Introduction: LED Binary Clock
This is the second revision of my PIC based LED binary clock. The original version was the first PIC project I attempted, it used a PIC16F84A to do both the timekeeping and control the display matrix, unfortunately it didn't keep good enough time and gained about a minute every week.
This second version is based around a PIC16F628A running at 4MHz to control the display, it also uses a DS1307 realtime clock chip to do the timekeeping. Every second the DS1307 sends a pulse to the PIC chip, the PIC then reads the internal time from the DS1307 over the I2C bus and then displays the time in binary on the LED display.
The bottom row of LEDs display the seconds, the middle rows shows the minutes and the top row is for hours. The time displayed in the picture is 01100:010011:011011 or in decimal 12:19:27. The time is in 24 hour format so goes up to 10111:111011:111011 or 23:59:59
The PCB could be made double sided, or as I have done here single sided with 7 wire links soldered in place instead of the top copper layer. It has a 5 volt regulator so could be powered from any 9 - 15 volt DC power supply.
Step 1: Parts / Tools
As well as basic PCB making and soldering equipment you will need the following components:
1x PIC16F628A & programmer
1x DS1307 realtime clock chip
1x 32.768kHz watch crystal
3x BC548 (or similar) transistor
2x PTM pushbuttons
1x 78L05 regulator
2x 220uF electrolytic capacitors
17x Surface mount LEDs
1x DC power jack socket
5x 4.7K surface mount resistors
8x 100 ohm surface mount resistors
1x 2k surface mount resistor
12x zero ohm links (Or 11 zero ohm links and CR2016 backup battery)
1x 100nF surface mount capacitor
50cm single stranded bell wire
1x 9v - 15v DC power supply with DC jack
Step 2: Make PCBs & Program PIC
The first step is to make the PCBs, the PCB layout and schematics for the main clock and the display board are provided in Eagle format. The clock PCB is double sided, but the top layer consists simply of 7 links, this means that the PCB could also be made as a single layer with 7 wire links instead, this is the way I chose to make it as I cannot make double sided boards.
The display PCB uses exclusively surface mount devices while the main clock PCB uses a mixture of surface mount and through-hole components.
It is important to program the PIC chip with the hex file prior to soldering into the circuit as there are no ICSP connections on the board.
Step 3: Solder Bottom Components
Solder the 8 resistors, 1 capacitor and the zero ohm link / backup battery as shown to the bottom side of the main clock PCB.
Step 4: Solder Top Components
Next solder the through hole components ensuring to orientate the 2 chips, the 2 capacitors and the regulator correctly.
Step 5: Solder Display
For the display you need 17 surface mount LEDs, 6 100 ohm surface mount resistors, 11 zero ohm links and 9 2cm lengths of bell wire. Solder them to the PCB as per the diagram below, ensureing you solder the LEDs in the correct orientation.
The display board shown here is a newer version than is used in the rest of the photos in this instructable, it has fewer resistors so is easier and cheaper to make.
Care must be taken when mounting the zero ohm links (resistors with zero resistance) as there are tracks on the PCB running between the 2 solder pads, the links must be positioned so that neither of the metal terminals touch the PCB track between the pads.
Step 6: Finish
Solder the display PCB to the main clock PCB then all that is left is to connect the power.
The PSU needs to be at least 9v DC and need only be rated at about 200mA or so, the centre connector of the DC jack needs to be positive and the outer should be 0v.
Once the power is connected the clock should display 22:03:00 and immediately start counting the seconds. Then all that is left is to set the time, one of the buttons is used to set the minutes and the other sets the hours, as soon as either button is pressed it sets the seconds to 0 and increments the corresponding display by 1.
52 Comments
6 years ago
What kind of jack power connector is that ? 2.1 x 5.5 or 2.5 x 5.5 ?
6 years ago
What did you used to program this gadget ? And how did you program it ? Im newbie into this. What kind of Surface leds I can use ? or which are those you used ?
8 years ago on Introduction
Hi, I experienced an annoying problem, https://www.youtube.com/watch?v=584bDUsjb7s the video goes to see that the clock is not running as they should and do not know what to do about it. Do not know what could be wrong? Please help.
Reply 8 years ago on Introduction
It's difficult to see form your video, but I assume the blue module is one of these:
http://forum.arduino.cc/index.php?topic=177297.0
Do you have the SQ pin connected to pin 4 on the PIC?
According to the link above it's not uncommon for the modules to be defective though.
Also are you sure the wiring on your transistors is correct and that you've not got any bridges solder connections on your wires running to the LEDs?
Reply 8 years ago on Introduction
I'm sure that I got the diagram and correctly, SQ got connected to PIC as it should be, so I do not know what is wrong ..
8 years ago on Introduction
Sorry ! I have a problem with connection to Internet
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
Have code this project ?
8 years ago on Introduction
10 years ago on Introduction
Hello Eleven I suppose its a very old thread bu I liked your clock.
I am working on my own version in light of your clock. Can you shed some light on how your Hrs and Mins setting buttons work. How have you wrote the code. Just some clarification of the concept would help.
Thanx