How to Control Christmas Lights - How to do almost anything with Christmas Displays.
  January 22, 2017 - Sunday |Id: Visitor|Login|Prefs|Register| 336 more shopping days until Christmas  
Home
About Us
Story
Forum
Forum Pro
How To
Photos
Videos
Classifieds
Community
Score Board

High Scorer
Hill Robertson
Featured Pics
Featured HowTo
Curtain Strobe Modification







HowTo: Build a 1024 Port Controller for $100  (Peter Olsen)


                              

Step 1 : Introduction

This How To describes how to build an infinitely scalable controller.

- It is based on boards containing 64 ports but it can be constructed in lots of anywhere from 8 ports up.

- Any number of boards can be connected together to make a controller of any desired size. A 1024 port system can be built for under $100.

- It is driven from the parallel port using a Basic program (or Blitzen if and when a suitable plug-in becomes available).

- It only requires 3 wires to connect each board together.

- The boards can be located near the computer or remotely.

- The design is intended to be interfaced to SSR's or Mosfets that would drive the lights.

Step 2 : Overview

The design is based on 74HC595 shift register chips. The data is sent out serially one bit at a time and shifted through the chips. Each chip has 8 outputs, which drive 8 SSR's or Mosfets etc.

In the case of a 64-port system 64 bits of data are shifted out one at a time for each update. A latching pulse then latches the new data into all chips.

The parallel port is used, but only one of the 8 data bits is needed. Two of the control port outputs are used for clock and latch functions.

A 486 PC driving a 1024 port system could update all outputs 88 times per second, so there are no practical speed limitations.

Step 3 : Program Code

A Basic program can be used to drive the system. An array of bytes would be used to store the port settings, where each byte represents 8 bits on one port.

- To turn on the second output on chip 3 you might execute the following Basic statement. (ie to set the data so it will get turned on when you do the shifting):

array(3) = array(3) or &B01000000

- To turn on outputs 1, 4 and 7 and turn off the others on chip 5 you might execute:

array(5) = &B10010010

- To shift the new data out to update all ports you would execute:

for i = 1 to 8 ' 8 bytes
bitpattern = array(i) ' get one byte
for j = 1 to 8 ' 8 bits per byte
out &H378,bitpattern and 1 'output rightmost bit
out &H37A,clockhi ' clock it through shift registers
out &h37A,clocklo
bitpattern = bitpattern / 2 ' shift bits right
next
next
out &H37A,latchhi ' latch new data into all outputs
out &h37A,latchlo



clockhi/lo and latchhi/lo are variables that contain the data to set the relevant pin hi/lo (see below).

A parallel port has 24 pins. A byte only has 8 bits. To allow you to access all necessary pins the computer splits up the parallel port into multiple logical "ports". Each port is simply an address in memory that you send data to. We are interested in the "data" port and the "control" port.

To send data to the data port you send a byte to address 378 hex. To send data to the control port you send a byte to address 37A hex.

The pins that the data port &H378 controls are as follows:
PINS 9 8 7 6 5 4 3 2 (ONLY 2 IS USED FOR THIS APPLICATION)
ie. if you execute: out &H378,5 (binary 00000101) then pins 4 and 2 change from 0v to 5v.

The pins that the control port (&H37A) controls are as follows:
PINS - - - - 17 16 14 1 (ONLY 1 AND 14 ARE USED FOR THIS)

Pin 14 is used for clock and pin 1 is used for strobe to latch the data. But note that those two pins are inverted. ie. you output a 0 to get 5v and vice versa.

When you toggle clock high/low you have to keep latch low. and when you toggle latch high/low you have to keep clock low.

So when you work it all out and invert the bits, you end up with the following variables:

CLOCKHI = 1 (Binary 00000001)
CLOCKLO = 3 (Binary 00000011)
LATCHHI = 2 (Binary 00000010)
LATCHLO = 3 (Binary 00000011)


Step 4 : Circuit Diagram and PCB

To download the circuit diagram for the controller in ExpressPCB format click here

To see the circuit diagram in GIF format click here

To see the artwork for a 64-port PCB click here. The artwork is reversed. ie. viewed from above. Note that it does not include the Mosfets and output connectors shown in the diagram below.

For the component overlay click here

To download the PCB in Autotrax / Traxmaker format click here


Step 5 : Completed Board


Here is a completed 64-port board, including Mosfets and output connectors. (Actually this one is missing the 8th chip). The mosfets are suitable for switching 24v and 35v lights in Australia. For direct 110v switching in the USA you would need to drive SSR's from the outputs.

Note that this board includes a PICAXE chip and realtime clock on the left. They would not be required for a PC driven system. It also includes an optional power supply.



                              
 

 
Designed, Hosted, and Coded by Hill Robertson
Computer Christmas - Copyright © 2001 Hill Robertson