Introduction: Light Up Clock for Kids - Green Means Go! Red, Stay in BED!!!
We were going crazy without enough sleep!!! Our 2-year-old could not understand how to "wait for the 7" on the clock before coming out of his room morning after morning. He'd wake up early (I mean like 5:27am - "there's a 7!!!" he'd say) and just assume time to get up, come out of his room, and be awake for the day. Since ages 2-4 have a very difficult time reading clocks, this simple light up clock was a HUGE solution to our problem!!!
GREEN MEANS GO!!! RED, STAY IN BED!!! This simple, inexpensive Arduino real time clock can be set to light up LEDs at whatever time necessary. For us that means at 6:00am it turns RED, STAY IN BED. Then 10 minutes before 7:00am it turns YELLOW giving the indication it is almost time to come out and to play in your room. Then at 7:00am... "The light is GREEN!!!", he says, as he bursts into our room each morning no earlier than 7:00am. What a lifesaver!!!
Step 1: Gather the Materials
Parts
- 1 x Arduino Nano ($2.70 on AliExpress)
- 1 x DS1307 Real Time Clock ($0.60 on AliExpress)
- 1 x Double-sided Prototype Board ($1.45 for 5 on AliExpress)
- 1 each Green, Red, Yellow 5mm LED ($0.94 for 100 on AliExpress)
- 1 each 270 Ohm, 680 Ohm, 1K Ohm Resistors ($2.35 for 600 assorted on AliExpress)
- White Fluted Stadium Cup ($1 Walmart or Dollar store)
- Push Light or 3-4 AA battery holder ($1 Dollar Store or $0.50 on AliExpress)
Tools
- Soldering Iron and Solder
- Solderless Breadboard
- Wire and Jumper Wires
- Glue Gun
Step 2: Setting the Clock
The DS1307 RTC is like a watch and uses a battery to operate and keep time even when the Arduino loses power or resets. The RTC uses the I2C interface to communicate with the Arduino. SCL (clock) is attached to A5 and SDA (data) is attached to A4. The RTC does best with 5V for VCC but I found it ran fine down at 3.3V.
- Using a breadboard, hook up the Real Time Clock to the Arduino according to the schematic.
- Next, download the DS1307RTC Library on github here or in the attachments.
- If you've never downloaded a library, click "Clone or Download" and choose "Download ZIP" option.
- Import the library into the Arduino Editor by choosing "Import" and selecting the ZIP.
- Next, download the attached Program_Clock_RTC.ino sketch and import similarly into the editor.
- Set the current date/time in the sketch and run the program to set the clock.
- Verify the correct time is returning.
Congratulations!! You now have a working clock!!
Step 3: Adding the LEDs and Programming
LED Test
Now, hook up the LEDs and resistors according to the schematic.
Download the Light_Up_Clock_for_Kids.ino sketch and upload. In the loop you will see commented out the "setLEDs(tm.Hour, tm.Minute);" function and uncommented just below a "testLEDs();" function that cycles through each LED for 8 seconds.
Verify cycling through the LEDs works and uncomment the serial.print lines if you need to validate the RTC is still outputting the correct time.
Programming the Times
Once you verify everything is working, uncomment the setLEDs() function and comment out the testLEDs() function. In the setLEDs() body of the function set the times you want to display the various colors following the examples.
NOTE: You will probably have to play around with the resistor values to get the right brightness for your LEDs (and also the power draw you want). I found the following works well for my 5mm LEDS since Green has the highest forward voltage and is the brightest naturally, then dimmer for the other colors:
- Green: 1K Ohm
- Yellow: 680 Ohm
- Red: 270 Ohm
Attachments
Step 4: Building a Lamp Enclosure
Options
In order to diffuse the light the LEDs emit I tried a few different mediums to enclose the lights. With varying levels of effectiveness I tried a Push Button (LEDs end up too close to diffuse well), Mason Jar with parchment paper or glitter glue painted inside, and the white stadium cup. You need something to diffuse the light and reduce the harshness of the LEDs to give a soft, even glow.
Best Option
I found the basic white stadium cup ($1 for 3) with wax paper taped just inside (as shown) gave off a good even light. Without the wax paper the LEDs shine directly at the top of the cup creating uneven light patches. Since I plan to use this long term, I even grabbed a silicone nursery lamp I will be re-purposing and adding the Arduino to in the future ($10 on AliExpress).
Step 5: Low-power and Batteries
I wanted to make this more permanent and use batteries to operate. This next part is optional as you can just stick a cup on top and power with a wall plug or portable USB charger.
Low Power and Removing Built-in LEDs
The code already includes putting the Arduino in Low-Power sleep for 8 seconds, waking to check the time, then going back to sleep. For more power-saving and to not have the Power LED displaying at all times, you can get rid of the built-in LED on the Arduino Nano (and since I used pin D13 also decided to get rid of the built-in LED on that pin).
Use a soldering iron to heat the sides of the built-in LEDs labeled POW and L, then pull or cut to remove them. There are many other power-saving options you can try by googling, but this lasts multiple months on batteries and works great for now!
Prototype Board and Battery Case
Soldering all of the parts to a prototype board reduces the size and allows it to fit easily on top of the battery pack inside the cup.
Use a 3 or 4 AA battery case and solder the positive (+) to Vin on the Arduino and negative (-) to GND.
I didn't have any battery cases, but did have a $1 push light already taken apart that had a 4 AA battery case perfectly ready for my needs. I placed the white cup over the battery case and marked the black plastic, then cut with a utility knife.
Hot glue the board to the battery pack base, then hot glue the white cup over top of it. You can easily cut the hot glue when needed to open it up and reprogram the LED light up times.
This sits on the top of the kids' dresser next to the door and now no more early-morning disturbers!!!

Participated in the
Colors of the Rainbow Contest
18 Comments
5 years ago
Couple of thoughts...first, from what I read, the DS1307 is pretty inaccurate, probably better to use a DS3231, which I believe is interchangeable and would not require code changes. Second, how about using an ESP8266 ESP-01...quite cheap, and just let it do a time sync occasionally, then the time is always accurate. Might have to go back to just red and green without the yellow, but that should be sufficient...you could even just go to a single green LED, that's how the clock we had for our kids a few years back worked. Take a look at "OK to Wake" alarm clock and light. Same concept, but with a clock display and in a pre-made format...which of course isn't as cool or fun! With the ESP-01, you could also drive an I2C ht16k33 and have a plethora of LED's. I have a prototype binary clock with just such a setup...need to finish that project some day!
Reply 5 years ago
Hmm... I really should look into the ESP and check out capabilities, power consumption, etc. I've never used an ESP, but how hard would it be to have the ESP controlled over WIFI from your phone and be able to override the light times or light them manually? :)
Reply 4 years ago
Hey Jonathon, really nice instructable! My daughter is still in a cot for the moment, but moving to a bigger bed is pretty soon and I think we'll need something like this!
I'm a huge fan of the ESP8266, it would be a great choice for a project like this. I recommend going for something like the Wemos d1 mini, you can get them from Aliexpress for about $3 delivered, they have a built in USB to serial converter and have 9 digital GPIO pins.
You wouldn't even need an RTC anymore if you didn't want it as you can get the time from an NTP server
I have a WIP project of an alarm clock using an esp8266 if you wanted to check it out. It fetches the time from the internet, automatically looks after DST and you can set the alarm from a web interface (really basic). Hopefully some of it is useful to you!
https://github.com/witnessmenow/arduino-alarm-cloc...
There isn't any detail in the github link, but if you have any questions let me know. I also worked on it mostly on live streams, but I don't know if its worth going back over them!
https://www.youtube.com/playlist?list=PLbd5_U5QzQgYuUgvO5uwiekRx3ljlP8Jg
Reply 4 years ago
Awesome comment! I am definitely looking into this and ordering one. I really appreciate your expertise here. Looking at your own instructables there is a lot you have done that someday I may try! Thanks
Reply 5 years ago
I appreciate the insights! I looked up the "OK to Wake" clock - great project!
I agree with the DS3231 although it is slightly more expensive. I've found after 2 months the DS1307 is off by just less than a minute. I definitely was aiming for simple, lowest cost (otherwise I could have just bought something!), and low power consumption. Without a display and the ability to program the time with buttons I assume I'll have to plug in every couple months to re-program the times anyway to adjust for daylight savings and summer schedules and will just reset the time then. (NOTE: I do plan to add a 4-digit display for the time and buttons and logic to set the clock as well as the light times - whenever I finally get the display from China! haha).
Reply 5 years ago
The programming that I have done on the ESP was using the Arduino IDE, and as I recall, it has a good bit more program space than the normal Atmega chips, so it should be possible to do some fancy stuff via wifi and a web browser, though I have not worked with it.
Does the DS1307/3231 have DST capabilities built in? It keeps the full date, so I would think even if it doesn't, you could potentially code the logic to adjust for the change.
Not sure what the power consumption is...not a lot, though likely more than the plain Arduino and DS clock chip. It also runs on 3.3v, which is a touch more challenging than a 5v Arduino...though a regulator should take care of it.
Tip 4 years ago
Hey! Great work man... Just a note. The DS1307RTC Library have this example sketch called SetTime that automatically sets the current time and date to your RTC based from your computer's time and date. Just make sure that the set time and date of your computer is updated.
5 years ago
Great idea, nice work! Thanks for sharing.
Reply 5 years ago
Thank you for the feedback!
5 years ago
A great solution to a real problem. Fortunately our kids both learned quickly how to read an analog clock. They didn't know what the numbers meant, but they understood the picture that 6:00 made with the big and little hands. However, I think this is something I will have to keep in mind when wanting to do a simple light system in the future.
Reply 5 years ago
Thanks for the feedback!
5 years ago
This is a really great project, and something we need in my house! Well done, thank you for the ideas. I think rainbow contest is a good choice, personally! :)
Reply 5 years ago
Thanks!
5 years ago on Introduction
When our girls were that age, we had to tell them if it was dark out then it was too early to get up! Unfortunately, this really only worked on weekends in the fall and winter though. Love the stop light colors idea. Probably makes a great nightlight too!
Reply 5 years ago
Exactly! With the season changes and daylight savings we are always getting thrown off. It does make a nice nightlight with the subtle red glow at night when they are in bed. And turns off by itself at whatever time I program!
5 years ago
it is good for both but I( would say colors.
Question 5 years ago
So I am pretty new to writing Instructables and just saw the change to only be able to submit a project to a single contest. I wrote this over the weekend hoping to submit to both the Microcontroller and Colors of the Rainbow contests only to find out the rule change. Is there any official way to get notifications or updates for contest rules in the future?
Answer 5 years ago
This was a pretty drastic rule change, and it's not a very common thing to see. I don't suspect there will be anything like this again in the near future, but when they happen you might see a post over in the community/forum area, like this: https://www.instructables.com/topics/Important-Changes-to-Contests-May-1st/