LED - Mega Clock

by Michalsky in Circuits > Arduino

31344 Views, 231 Favorites, 0 Comments

LED - Mega Clock

548f80329d29c9c41100008c.jpeg
Arduino Mega Clock

LED - Mega Clock

Bill of Material (All You Will Need)

LED-Mega-Clock.jpg

For the Housing

  • Three 300x300mm x 3mm thickness Acrylic glass (black)
  • One 300x300mm x 3mm thickness Acrylic glass (trasparent)
  • Acrylic glass adhesive and polish
  • Twenty 15mm spacers M3 thread
  • Twenty M3 screws + washers
  • One 300x300 picture frame

For the Electronic

  • 480 3mm LEDs (color of your choice)
  • Sixty 120 Ω resistors
  • One 4-Digit 7-Segment Display common anode
  • Eight 74HC595 Shift Registers
  • Eight BD139 NPN Transistors
  • One Arduino ATMEGA 2560 Board
  • One TLC5940
  • 1m RGB-LED-Strip
  • One LM317 voltage regulator
  • One 0.1μF capacitor
  • One 1μF capacitor
  • One 1 kΩ resistor
  • One 330 Ω resistor
  • One 2.5 mm DC Jack
  • Ribbon Cable
  • Header Strips
  • One I2C RTC DS1307 AT24C32 Real Time Clock Module For Arduino Mega2560
  • Lot of Copper Wire and tin solder
  • Eight 750 Ohm Resistors
  • Four circuit strip boards
  • One 12V 1A Powersupply or one 11,1 1000-2000mAh Lipo rechargeable battery

Building the Housing (Part1)

sketch_front_view_001_01.jpg
5472f209d535cf2dba0000db.jpeg
DSC_0386.jpg
Bild2.png
iso_003.jpg
DSC_0376.jpg

  1. Cut and drill the 3mm acrylic plates as shown in the sketch
  2. Glue front housing plate (black plate), bonding part (transparent plate) and LEDs slice plate (black plate) together

Building the Housing (Part2)

DSC_0008.jpg
DSC_0019.jpg
5472f85ad535cf7ee3000035.jpeg
5472f7ddd535cf3b940000df.jpeg
5472f95bd535cf3b940000e4.jpeg
5472f9acd535cf0128000036.jpeg
Side_view_no_plates.jpg
iso_005.jpg
  1. Glue one 300x300mm 3mm thickness acrylic plate to the back paperboard of the picture frame for more stability, if the picture frame has a glass you can take it out, we dont need it
  2. Screew four 15mm spacers to the acrylic plate like shown in the pictures
  3. Now you can glue the four spacers from one side of the picture frame to the front plate (tip scratch the plate first before gluing the spacers, they will fix better)
  4. Unscrew the glued four spacers for the next step

Inserting LEDs to the Front Plate

Bild3.jpg
Bild4.png
Bild5.png
DSC_0371.jpg
DSC_0374.jpg
  1. First insert the 3mm LEDs in the first row of the drilled plate (first 60 LEDs)
  2. Bend the anodes to the side and solder the cathodes arround the plate together with 0.8mm copper wire
  3. Repeat this for the other 7 rows
  4. Now solder anodes of the same column together
  5. You should have a matrix of 8 rows (cathodes) and 60 columns (anodes)

Soldering the Matrix Together

DSC_0369.jpg
DSC_0022.jpg
DSC_0023.jpg
DSC_0393.jpg
  1. Solder one 8-pol cable connector to the 8 rows (cathodes) of the matrix
  2. Solder eight 8-pol cable connectors to the 60 columns (anodes) of the matrix. I have used 8-pol connectors now I have 64 cables available but we only need 60, on the left four I put rubber tape. You can also do best and use seven 8-pol connectors an one 4-pol connector so you have exact 60 connections

Inserting the 4-Digit 7-Segment Display

DSC_0024.jpg
DSC_0025.jpg
DSC_0026.jpg
DSC_0027.jpg
  1. Cut the LEDs Slice plate at the center and glue the 4-Digit 7-Segment display (tip solder wires to the display before glueing the display)
  2. I had to scratch the back side of the plate and glued the spacers again, because it was not realy fixed like I mentioned before

Building the Electronic

DSC_0012.jpg
DSC_0396.jpg
DSC_0397.jpg
DSC_0398.jpg
DSC_0400.jpg
  1. Cut the circuit stripboards so the fit inside the picture frame
  2. You will need some connectors you can built your owns like I made

Building the Electronic and Code Explanation

LED-Mega-Clock.jpg
DSC_0001.jpg
DSC_0002.jpg
DSC_0003.jpg
DSC_0004.jpg
DSC_0005.jpg
DSC_0006.jpg

Here is the complete circuit and the code

I put also a 11,1V 1000mAh Lipo rechargeable battery so I can power the clock without external DC cable.

Code explanation:

After connecting all the electronic downloading the zip 3 zip-Files one is the code an the others are the libraries.
First you have to put both libraries folders for TLCs and RTC-Module into your arduino library folder otherwise you will get error when opening the code, or you can also download the libraries from the arduino site.

The code include 3 folders:

The SetTime Folder with SetTime.ino: use this file to set the time manually for your RTC-Module for the first time, for this you have to change the byte variables in the setDateTime() function with your local Time, then load this code to your arduino and the RTC-Module will store your local Time, you only have to do this the first time to set the time or if you change the battery of your RTC-Module. The TestTimeFolder with

TestTime.ino: use this only to check if the RTC-Module stored the correct time, load this code and open the serial monitor to check it.

The LED_Mega_Clock Folder: with 6 files, all this 6 files have to be in the same Folder, open only LED_Mega_Clock.ino and you'll get all 6 files in different Taps.

  • "LED_Mega_Clock Tap": here is the setup for the pins and definition of global variables and arrays for the registers and the loop() function. I have made 3 functions in the "programs Tab" with 3 different animations choose one of them and put it into the loop function.
  • "RTC Tab": here is the setup of the RTC you don't really need to edit this tab but for more information visit arduino site. Here I made the function checkTime() to begin transition between RTC-Module and arduino. I use this before each animation and also don't forget to read the time before the animation and convert this binary coded data to normal decimal with the byte bcdToDec() function I made. For example: int second = bcdToDec(Wire.read()); "RGB_LED_Strip Tap": here I made 2 functions one that change the whole color-spectrum from red to magenta very 20 min and one that change each color every second use PWM outputs of your arduino to do this. you can make your own functions.
  • "blue_LEDs Tap": here I made 3 functions using multiplexing one to set the blue LED-Matrix with second, minute, and hour indicator the other do the same but with a swinging point from right to left as second indicator. and the shift() function to shift data. You can make your own animations.

How to shift data: http://arduino.cc/en/tutorial/ShiftOut

  • digit_display Tap: here are 3 functions one to set the the digits (anodes or arduino pins defined in the CA [ ] array in the "LED_Mega_Clock Tap") one to set the segments (cathodes or TLC pins to sink the current to GND ) and one to reset the TLC That means you have 4 digits that you set high or low with your arduino pins and 7 segments in each digit that you set high or low with the TLC using Multiplexing. How to use the TLC library: http://arduino.cc/en/tutorial/ShiftOut

You can optimise the clock for example by connecting a Foto-Resistor in the circuit to automatically controll the lightness of the clock depending on the ambient light of your room, or you can use a 10k Potentiometer to control the brightness manually.

You can also insert a button to switch betteew different programs or put another LED Strip inside the clock to illuminate the transparent Plastic Part in the front panel.