■ I/O SCHEMATIC 2
bracket — made from readily available,
one-inch aluminum angle — which serves
as the mounting and heatsink. For most
applications, a heatsink is not needed
because the triacs dissipate approximately one watt each for a one amp load. The
same bracket design is used for the controller card, which has a 5V linear regulator mounted on the PCB and bracket.
The cards were installed and wired
together, using either ribbon cables (5V
DC and I2C) or short lengths of stranded
14 AWG wire (culled from the extension
cord used for the AC input). Note
that not all of the terminals are used,
but were added for flexibility in other
projects using these cards.
When the cabinet is installed outdoors and wired to the lights (mini-trees
in my case), each cable is routed through
a raintight Heyco bushing and to the
screw terminals on the I/O cards. This is
a bit of a knuckle buster; patience is
required, but the end result is reliable and
cost effective. (I could not find affordable
outdoor connectors with four circuits to
make this chore a snap). After all, this
CONTROLLER CIRCUIT DESCRIPTION
The controller PCB contains the power Programming of the AVR can be done
supply and µC, user controls, along with the in-circuit with the AVR ISP, and this
RTC circuit and the EEPROM. AC power is connects to CN6. Notice that the older style
applied at CN2 and distributed to the I/O 10 pin arrangement is used; after this
cards via CN1 and CN3, and also to the trans- project was completed, the AVR ISP mkII
former, T1, via fuse F1. The output from the (USB format) was released and I have
transformer is rectified by BR1 and feeds C1 upgraded to the current model that only
via diode D1. The anode of D1 has a 120 Hz uses a six pin header. A simple 10 pin to six
half-wave voltage that is used by the uC for pin cable can be used to connect the newer
sync, and that signal is developed by R23 six pin ISP pod.
and R24. Five volts for the remaining circuits Inputs to the system come from an
are regulated by IC1, and decoupled by C2. encoder with a switch, S1, and a second
IC4, the AVR Mega8, is connected to all switch, S2, that can reboot the AVR by low-the other circuits and runs from its internal ering the Reset line. R16 keeps the reset
8 MHz clock; accuracy is not needed as the line high when inactive. The encoder has
RTC has crystal control and the triac timing two quadrature phase outputs: A and B.
is derived from the 120 Hz sync just Firmware determines the direction and
described. The RTC, IC2, is self-contained amount of movement on the encoder shaft.
and uses a 32 kHz watch crystal, X1, and An external LCD module can be added
a battery, B1, to keep time if the AC to the system; power and data for it are
power fails. RTC data is transferred over sent out from CN7, on a data bus that is
the I2C bus which is also shared with the shared with the LED display segments.
EEPROM, IC3, and the I/O cards connected Finally, the dual LED display anodes
by ribbon cables. are driven by two transistors. This greatly
I2C was originally applied in consumer reduces the amount of hardware! Because
electronics (such as VCRs and TV sets) for the LCD and LED are multiplexed, care is
PCB to PCB data flow, and care was taken taken in the firmware to address each one
here to reliably extend the bus over ribbon separately. The LED is a dual digit compo-cables to the I/O cards. Resistors R9 and nent that is also MUX’d internally, so two
R10 were added to isolate the external bus, select signals (SEL_L and SEL_R) are used
and resistors R11, R12, R14, and R15 follow with high side driver transistors Q1 and Q2,
the recommended I2C bus terminations. respectively, to select the correct LED digit.
November 2007 53