timing crystal XTAL2 and super capacitor C5.
No programming is required.
4. BUTTON1 and BUTTON2 with their respective
input (R2 and R4) and pull-down (R3 and R5)
resistor networks are used for setup and
5. The output circuit that can be used to turn the
lights on and off contains output relay RY1. This
relay has 16A contacts rated at 120 VAC, so it
could directly control lighting circuits up to 1,500W
of connected load; anything larger requires a power
interface system. R7, Q1, and D2 act as the
interface between the 5 VDC output of the PIC
and the 24 VDC coil of the relay. Red LED1 via
R8A and R8B serve as an onboard status of the
output. When this LED is lit, the output is active
signalling that the lights
should be turned on.
6. U1 is an 18F2520 PIC
processor clocking at 20
MHz from resonator XTAL1.
R1 is the pull-up resistor for
the reset function. This is the
information and control
broker since it handles the
information exchange to
every other part of the
circuit. The code for the PIC
is also available at the article
link and is programmed in
before the chip is inserted
into the printed circuit board
(PCB). Two other PICs were
tried, but there were issues
with the program size and
the best fit turned out to be
7. A 24 VDC power supply
input goes into terminal strip
PS. FU1 provides overcurrent
protection and D1 provides
reverse polarity protection.
Power supply status is
indicated on the board with
green LED2 via resistors R6A
and R6B. The 24 VDC bus
supplies the power to the
output circuit and U4 which
is a switching power supply
module filtered by C1 and
C2. The 5 VDC output is
filtered with C3 and C4.
I am a huge proponent of
power supply filtering, and
additional tantalum filtering
capacitors are provided for U1, U2, and U3
with C8, C7, and C6, respectively. The end result
is a rock solid and stable power supply system on
All components are through hole and mount onto
one double-sided PCB measuring 7.87” long x 2. 82” wide.
Board layouts are provided with the downloads. The parts
list for the circuit is shown in Figure 3. Integrated circuit
(IC) sockets are used for U1, U2, and U3, but they could
be soldered in. The only tricky part is ensuring CABLE1 is
correctly installed on the PCB and on the LCD. Figures 4A
and 4B show the correct way of positioning this cable.
■ FIGURE 4A. Mounting CABLE1 on the PCB.
Note wiring colors called out on the board.
■ FIGURE 4B. Mounting CABLE1 on the LCD.
Note the white wire goes on the RX pin.
June 2013 43