Binary Clock With RTC Module

by slokster22 in Circuits > Arduino

429 Views, 3 Favorites, 0 Comments

Binary Clock With RTC Module

IMG_7802.jpg

Always needed a fun clock in the dorm, so I thought a colorful LED binary clock would do the job.

Supplies

elegoo mega.jpg
rtc.png
resistors.jpg
frosted-leds-red-green-blue-yellow-white-800x800.jpg
download.jpg
_c_a_cab-01-127-1.jpg
615H1lKSM4L._SL1200_.jpg
14e74fcc-98c0-492d-8291-65b934cd5292.b8558fd8d158e59302a7d37bee4c58cc.jpg

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

IMG_7786.jpg
  1. 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.

Box

IMG_7791.jpg
IMG_7793.jpg

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

67022440856__07E38396-3DCD-47B6-839A-1098DECC6767.jpg
IMG_7792.jpg

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.