Binary Clock With RTC Module
Always needed a fun clock in the dorm, so I thought a colorful LED binary clock would do the job.
Supplies
1x Arduino Mega 2560, or Elegoo Mega 2560
1x DS1307 RTC Module
17x 100Ω resistors
17x LEDs (you can color coordinate with hours(5), minutes(6), seconds(6))
38x Female to Male Jumper Wires
3x Male to Male Jumper Wires
1 Wooden Box (size should fit all wires and components, mine was 10x10x3 inches)
1 Breadboard
1 Push Button
Super Glue
Hot Glue
Wire Up the Board
- Attach leds legs to the bread board.
- have a ground wire connect to the negative outer section
- connect a resistor that touches this negative ground strip and one that connect to the positive (longer) end of the LED
- then connect the shorter end of the LED to a digital pin on the arduino.
- connect the RTM module by placing the connecting the pins on the module to the corresponding pins on the Arduino
- SDA to SDA
- SCL to SCL
- GND to GND
- VCC to 5V
The Code
The only part of the code that you need to change is the corresponding pins of your seconds, minutes, hours and the pin attached to your button.
Essentially, the code runs and checks if the button state is on or off.
If it is on, then the RTC module gets the time and passes it to functions that turn on the corresponding lights.
If it is off, then the code turns all the LEDs off.
After confirming that your code works, you can move on to making the box for the clock.
Downloads
Box
I personally used Makercase to make a box for this project. Initially I had a 10x3x3 box, but I realized the cables of this project were personally hard to keep track of, so I made the box bigger.
Once you have your box made, export it into Adobe Illustrator and customize to display the lights however you want. Then lasercut the box and assemble.
As you can see from pictures, I tried to do this with an Arduino Uno, but I ran into issues using all the pins and the SCL and SDA pins at the same time. Be aware, that there are some digital pins that cannot be used along with SCL and SDL pins because they are connected in the board.
Assemble
Place everything inside the box and run the code and the clock should be running. You can buy a battery connector for the Arduino if you want to have the clock run without a usb. I also drilled a hole after the fact because a button was added to the project, but you could include that in your first box design for convenience.