CogniWake: Alarm Clock for Executive Dysfunction
by arnecoelus in Circuits > Raspberry Pi
57 Views, 1 Favorites, 0 Comments
CogniWake: Alarm Clock for Executive Dysfunction
Hello there! In this instructable I will be covering the assembly & inner workings of a school project I have decided to name CogniWake.
CogniWake
CogniWake is an alarm clock for people with executive dysfunction (or simply trouble getting up ;]) that requires mental and physical user activity to influence the alarm state.
Why did I build this?
I have ADHD and an extreme difficulty getting up in the morning.
I consistently turn off/disable alarms while half-asleep and go back to bed only to wake up hours later with no recollection of ever turning off the alarm.
With this project I intend to consistently get myself "booted" up enough to stay awake and begin my day.
What does it do?
Core functionality
- When an alarm is triggered, a math query is shown on the display.
- To turn off the alarm this query must be solved.

(Easy difficulty)
Snoozing
- Triggering the RCWL0516 radar sensor for 3 seconds will snooze the alarm.
- Snooze enable/length is configurable per alarm.
Temporary muting
- If the Accelerometer/gyroscope detects the device being lifted, the alarm will temporarily be muted for as long as the device is held.
Software & features
- The full explanation can be found in the section after Final Assembly.
Supplies
- Raspberry Pi 4B 1GB + min 16GB SD card
- Assembled T-piece cobbler
- Half-size breadboard
- Pi Touch Display 2 (5”)
- MPU6050 Gyroscope / Accelerometer
- RCWL0516 Microwave Motion Sensor
- SFM-27-I Piezo Buzzer
- Vibration motor module
- ULN2003 Darlington Array (for our buzzer)
- DS3231 RTC Module
- PLA (3D printer!)
- 8 x M2.5 Screws
- Soldering iron + tin
- 4 x Rubber foot pads
- 7 x Double-sided adhesive pads
- 3 twist ties
- 10 female headers
A more detailed bill of materials and price list can be found in this GitHub repository.
Flashing the Image
Requirements
- Image from this GitHub repository
- Raspberry Pi Imager or Balena Etcher
- SD card (16 GB Minimum)
1. Open Raspberry Pi Imager
- Select Raspberry Pi 4 Option

- Select custom Image


- Select storage device
- Flash

2. Insert SD card into Pi
Building the Breadboard
1. Connect the T piece cobbler to your pi's 40 pin header.
2. Place ULN2003 Darlington Array in breadboard.
3. Connect 5V to the + rail and GND to the - rail on the 5V side.
4. Connect 3.3V to the + rail and GND to the - rail on the 3.3V side.
5. Connect 5V to ULN2003 pin 9 and GND to ULN2003 pin 8. ULN Pin 1 to GPIO 20
6. Connect buzzer 5V to the + rail and buzzer GND to ULN2003 pin 16.

7. Connect vibration motor module 5V/GND to +/- rails and IN to GPIO 21.
>

8. Connect RCWL0516 Microwave Radar 5V/GND to +/- rails and OUT to GPIO 16.

- Note: This component does not come with headers. Soldering your own headers is necessary.
9. Connect MPU6050 VCC/GND to 3.3V +/-rails and SDA/SCL to SDA/SCL (Pi)

- connect AD0 to 3.3V to change the i2c address.
- This is required because the RTC shares the same default address.
10. Connect DS3231 RTC VCC/GND to 3.3V +/- rails and SDA/SCL to SDA/SCL (Pi)
11. Keypad
- Note: This component does not come with headers. Soldering your own headers is necessary.
- Leave the outer 2 NC pins unpopulated
- Pinout
- 1: C2 -> GPIO 25
- 2: R1 -> GPIO 17
- 3: C1 -> GPIO 24
- 4 R4 -> GPIO 23
- 5 C3 -> GPIO 5
- 6 R3 -> GPIO 22
- 7 R2 -> GPIO 27


Final Assembly
Get the 3D printable files from this GitHub Repository. The enclosure consists of 2 parts, the main body and the roof.
The roof slides into the slit behind the keypad and keeps both itself and the keypad in place. Adhesive pads can be added in case of tolerance mishaps.
Mounting the display
- Fit the display in the recess

- Attach the display using M2.5 screws.

Mounting the pi

Mounting the breadboard
- Peel off the adhesive strip on the underside of the breadboard and slot it in the tray.
Connecting the display
- Connect the DSI cable to the ribbon slot on the display

- Guide the DSI cable to the DISPLAY port on the Pi.

- Fit it with the metal contacts facing the inside of the Pi board.
- Connect a red and black wire to the 5v and ground rail and connect these to their counterparts on the display connector.
Sensor mounts
- Slide the keypad into the cutout
- Use adhesive pads to stick the other sensors to the enclosure.

Mount the roof
- Before attaching the roof, plug in the USB-C cable and test if the SD card boots. If the device reaches the kiosk screen you can continue the assembly.

- After confirming functionality, slide the roof mounting plate behind the keypad using the guide rails.
- Depending on the tolerance of your 3d printer the fit could be loose and might require extra adhesive pads to keep the roof from moving.

Software Features & Configuration
Image Information
hostname: cogniwake
user: cogniwake
password: cogniwake
AP password: c0gn!wake
Navigating the interface
Navigation/input is done through the keypad
- 1, 2, 3 = Switch view
- * = Next selectable element
- # = Confirm selection
- Input fields take all numbers.
Inside view
- Weather displayed in navigation bar
- Main clock view
- Current time

2. Alarms page view
- View alarms
- Add alarms
- Edit alarms
- Toggle alarms

3. Settings page view
- Toggle between network/self hosting + display web interface IP address
- Toggle between Network Time Protocol/Manual input
- Enable/Disable weather
- Power off
- Reboot
Outside view
- Available at the IP address shown on the settings page view
- Dashboard (index)
- Live time
- Weather information
- Statistics regarding math solving

2. Alarms
- View alarms
- Add alarms
- Edit alarms
- Toggle alarms

3. Settings
- Configurable
- Accent color
- Full network configuration
- View available networks
- View connection details
- Ability to pick a network & connect to it
- Ability to switch to access point mode
- Full time configuration
- Ability to pick between NTP and a manually set time.
- User name
- Full weather configuration
- Ability to enable/disable the weather functionality
- Input a city/country
- Data functions
- Clear math questions / answers
- Clear all alarms
- Clear logs
- Hardware functions
- MPU6050 test stream
- RCWL0516 test stream
- Keypad test stream
- Buzzer test stream
- Vibration motor test stream
- Power off
- Reboot

- Logs
- Shows logs






