An alarm clock with sunrise simulation features to prevent Seasonal Affective Disorder
Powered by an Arduino UNO and the Johnny-Five JavaScript Robotics & IOT Platform.
Just the stuff shown in the diagram above, namely:
- Arduino UNO, or another supported device with minor changes to the code
- LCD display with valid controller
- A potentiometer to control the display contrast
- Piezo to sound the alarm
- Breadboard
- A couple of LEDs
- A few basic resistors
- Several wires
- A steady hand and a little patience
Note that the Arduino simply acts as a 'thin client'; all the actual code is executed on a host machine running Node.js (e.g. your computer). To untether, you'll need a client that can itself run Node.js. Check the Johnny-Five platform support page to assess your options.
- Prep your board using the instructions here
- Clone this repo
- Install the necessary dependencies with
npm install
- Run it with
npm start
Note: there's a decent chance you'll have to change the port at new five.Board({ port: 'COM3' })
. Try calling it with no arguments first, but check here if that doesn't work.
Your alarm will automatically set the time and date based on the host device (i.e. your computer). If the time and/or date is wrong, try changing it there.
When you first turn on the machine, the next alarm time will be automatically set for one hour from the current time. This can be adjusted with the buttons as follows:
Button | Action | Alarm direction | Minutes |
---|---|---|---|
Up | Tap | Later | 1 |
Up | Hold | Later | 10 |
Down | Tap | Earlier | 1 |
Down | Hold | Earlier | 10 |
Press the mode button to set the alarm on or off. The info LED will be lit when an alarm is set, and off when it is not. Additionally, this is indicated on the display, along with the time of the upcoming alarm.
30 minutes before an alarm, the sunrise simulation will begin to get brighter. The sunlight will then fade out automatically until 30 minutes after the alarm has been dismissed.
When an alarm is sounding, you can perform the following actions:
- Tap the mode button to turn off the currently playing alarm.
- Hold the mode button to toggle the upcoming alarm on/off.
- Tap the up button to snooze the alarm for 1 minutes.
- Hold the up button to snooze the alarm for 10 minutes.