clock circuit diagram. There are 12 columns in the
LED matrix which are labelled N1 to N12, so hand
1 and hand 13 connect to N1, hand 2 and hand 14
connect to N2, and so on (see Figure 7).
Resistor Should I Use?
The LED cathodes are connected together for each
hand position, so all seven LED cathodes for hand 1 are
connected together. This then connects to N1 on the
clock circuit diagram. On hand 2, all seven LED cathodes
are connected together, then are connected to N2 on the
The PIC16F877 has a maximum current rating
of 200 mA over port C and D combined. Each I/O
pin is 25 mA. The maximum number of LEDs in one
column is 15 (N12 which contains the pivot LED).
This means we can supply each row of LEDs with
13 mA to stay within the limits of the
What LEDs Should
I used 700 mcd diffused 3 mm white LEDs
that I found on eBay. It’s important to use LEDs
with a high mcd rating to maintain the
brightness since the LEDs are multiplexed and
only really lit a fraction of the time.
The Power Supply
The PIC16F877 and DS1307 both need a
stable regulated power supply source of 5V DC.
This is best done with a 7805 voltage regulator
with a couple of capacitors. In addition to these,
I put 100 nF capacitors across the supply pins
(VDD and VSS) on the PIC16F877 and DS1307.
This removes spikes from the supply that could
upset the operation of the microcontroller.
This is a dedicated real time clock (RTC)
which keeps the time, date, and day of week. It
can operate in 12 or 24 hr clock mode and has
its own battery backup (a CR2032 3V watch
battery) which will keep the RTC running during
power failures. This has its own oscillator which
uses a 32.768 kHz quartz crystal (see Figure 9).
The RTC and PIC16F877 use an I2C bus to
communicate with each other. The I2C bus has
4.7K pull-up resistors for the clock and data lines.