Hawaii Sunrise Alarm Clock
When I naturally wake up from sunlight streaming through my window at my home in Hawaii, I feel refreshed and relaxed. When I hear my iPhone alarm go off, I am immediately panicked, searching for my phone in the darkness, hoping to turn off that horrendous sound. So I built a Hawaii-influenced Sunrise Alarm Clock with an Arduino. When it’s time to wake up, my alarm clock, powered by a bright LED, will become brighter over time, mimicking a sunrise and allowing me to wake up more naturally. This clock will also enable me to wake up to the “sunrise” even if the sun isn’t rising at the time I want to wake up or if it’s a cloudy gloomy day. The key components include an Arduino UNO, a MOSFET, a real-time clock (RTC) module which keeps track of the time, a LCD display which displays the current time, a bright LED which provides the source of the light, and a tropical box design. This project is a great alternative to loud obnoxious alarm noises, cost-effective, and not too difficult to build.
Supplies
All of these products can easily be found on Amazon.
- 9V battery (and connector clip) ($5)
- Arduino UNO ($20)
- Solderless Breadboard ($6 for pack of 4)
- Wires ($7 for a pack)
- CR2032 Clock battery ($3 for pack of 4)
- DS3231 Real-time clock (RTC) module ($9)
- NTE2395 N-Channel Power MOSFET Transistor ($5)
- Bright 9V LED ($7)
- SSD1306 LCD display ($10)
- Material for box - cardboard, acrylic, wood ($5-10) Soldering materials
Total: ~ $80
Wire Up the Circuit
Wire up the Arduino to the computer via USB and the circuit as pictured, with the clock battery in the back of the RTC.
A list of what is connected, as pictured in the circuit diagram:
RTC
- SDA: Arduino SDA
- SCL: Arduino SCL
- VCC: Arduino 5V
- GND: Arduino GND
- All other ports not connected
- Insert CR2032 clock battery in the back
LCD
- GND: Arduino GND
- VCC: Arduino 3.3 V
- SCL: Arduino A5
- SDA: Arduino A4
MOSFET
- Drain pin (middle): Negative end of LED
- Gate pin (left): Arduino pin 9
- Source pin (right): Arduino GND
Battery
- Positive end: Positive end of LED
- Negative end: Arduino GND
How it works:
In summary, the circuit is set up such that the Arduino reads the time from the RTC and outputs it to the LCD display. When the time from the RTC changes to the set alarm time, the Arduino triggers the MOSFET to enable current to flow through and light up the LED gradually over the next minute. When the minute has passed, the Arduino stops the current flow through the MOSFET, thereby shutting off the LED. The clock battery in the back of the RTC powers the clock module to keep the time even when the Arduino is disconnected from the computer power source.
Download Arduino Code
Download the Arduino code from this Sunrise Code link. Open the .zip files of the DS3231 and ArducamSSD1306 libraries and save them to your Arduino documents folder.
Program the Arduino
a. Using sunrise_setTime.ino code, type in the current time (in 24 hr time) in the commented line. Run the code. Note: there is a slight delay when uploading code to the Arduino, so upload a time 10-15 seconds before the current time. Open the Serial Monitor and verify that the clock has the correct time.
b. Using sunrise.ino code, program the alarm time (the hour and minute you want the light to turn on) in the commented lines. Run the code.
c. Disconnect the Arduino from the computer and plug the USB port into a wall/another outlet near your bed. Verify the LCD time is still correct. Once done, you may remove the clock battery from the RTC. Note: keeping in the battery for a long period of time may drain the circuit and charge the battery.
How it works:
The sunrise_setTime code initially sets the time of the RTC, and the RTC starts counting each second afterward and keeps the current time. The sunrise code, after using some libraries for functionality and initializing the LCD display and RTC, displays the current time from the RTC, changing every second that passes. It then uses an “if statement” to determine whether the light should turn on or not. If the current time is the set alarm time, a “for loop” is activated where the LED’s brightness is mapped to an integer value, starting at 0 (LED off) and increasing by 4 until it reaches 255 (the maximum LED brightness). The time is still displayed while the LED gets brighter. Finally, the LED shuts off (brightness back to 0) after about a minute. Following my procedure outlined above, the software is easily programmable to change the current and alarm times.
Prototype the Box
I was fortunate to have access to materials (cardboard, wood, spray paint, etc.) and a laser cutter; thus, I was able to follow the procedure as stated below. If you do not have access to a laser cutter, a cardboard box which can hold your circuit and some diffuse material (i.e. acrylic paper) for one face of the box can make a nice alarm clock.
a. Create your design
The notches and outline of the box can be made via Box Designer. I then used Adobe Illustrator to create the floral design. I measured out a hole for my LCD display to fit, created my own design for the front of my box to remind me of a Hawaii sunrise, and made my own three-layer cover that can hold an acrylic piece.
b. Cardboard prototype
Using my Illustrator file, I cut out and taped together a cardboard prototype. The cardboard cut took about 10 minutes using a laser cutter. I noticed an error in one of my notches as it didn’t fit together so I physically corrected the error on the cardboard model using an Exacto Knife and then adjusted my design file. At this stage, I also placed my circuit into the box to ensure that it fit.
Make the Final Clock
I cut out my wood and acrylic pieces; using the laser cutter, all my cuts were done in about 30 minutes. I spray painted each wood piece to give the wood a nice finish. For the front of my alarm clock, I laser cut and spray painted the five additional layers (one for each color). Each layer took approximately 30 minutes to cut, paint, and allow to dry. Finally, I glued all my pieces together to make the box and fastened the LCD to the front.
Results + Conclusion
Results
The alarm in this video is set for 6:00 AM. As you will see, the white LED light becomes visible a few seconds after 6:00 AM, gets brighter, and then shuts off a little after 6:01 AM.
Conclusions
I successfully created a functional and beautiful Hawaii Sunrise Alarm Clock. When I am far away from my home, I can wake up to a Hawaii sunrise any day of the year. A persistent challenge was getting a “Low memory available, stability problems may occur” error message from the Arduino application when uploading my code to the device. So, an improvement in this project can include programming an Arduino with a bigger memory storage or using a Raspberry Pi. Another possible improvement can be to better block the red power light from the RTC module (emitted red light before the white LED light comes on). This would be a pretty easy fix by placing dark tape or some other material on top of the red light bulb. An extension to this project would be to use buttons to program both time and alarm time, rather than a temporary clock battery, in order to set the time after the circuit is unplugged from the computer. Experimenting with different LED colors or combinations of LEDs and acrylic or other materials that diffuse light to better mimic a sunrise would also be of interest. Lastly, incorporating a snooze button that could delay the “sunrise” by ten minutes could be a neat and useful feature. This project provided me with invaluable experiences coding with Arduino, building circuits, working with laser cutters, spray paint, and soldering, while becoming my new favorite way to wake up in the morning.
References + Acknowledgements
References & Acknowledgements
Thanks to Pomona College for funding my project and ‘Iolani School and Mr. Taylor Wong for allowing me to use the box materials and the laser cutter. Additionally, thank you to Dr. Scott Tan, Mr. Tony Grigsby, Mr. Aman Desai, Mr. Chae Park, and Mr. Dylan McCuskey for their help and support on this project.
Other links:
- Project inspired by: https://www.instructables.com/Sunrise-Alarm-Clock...
- Libraries for the LCD: https://www.instructables.com/Sunrise-Alarm-Clock...
- Libraries for the RTC: https://www.instructables.com/Sunrise-Alarm-Clock...