How to Control Christmas Lights - How to do almost anything with Christmas Displays.
  February 20, 2017 - Monday |Id: Visitor|Login|Prefs|Register| 307 more shopping days until Christmas  
About Us
Forum Pro
How To
Score Board

High Scorer
Hill Robertson
Featured Pics
Featured HowTo
Curtain Strobe Modification

HowTo: Dimming the Olsen 595  (Ernie Horning)


Step 1 : Introduction

This How To describes how to build an infinitely scalable controller with 256 step dimming.

It is based on a design by (Peter Olsen) and discribed in a ‘How To’ entitled ‘Build a 1024 Port Controller for $100’ also known as ‘The Olsen 595' controller.

As in ‘The Olsen 595’ controller:

  • Any number of boards can be connected together to make a controller of any desired size.

  • It is driven from the parallel port using the same method as ‘The Olsen 595’ except that each dimmed output will use 8 outputs from the original design.

  • It only requires 3 wires to connect each board together plus power and ground.

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

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

Step 2 : Overview

The input circuit is based on the 74HC595 shift register chip. The data is shifted into the chip serially one bit at a time with a positive pulse on the shift clock pin. The shift register is then sent to the outputs with a positive pulse on the latch clock pin. Each chip has 8 outputs and all eight are connected to a dimming circuit.

The dimming circuit consists of a zero crossing circuit, a high frequency oscillator and a counter. The counter; a 74HC40103 consists of an 8-bit synchronous down counter with a single output which is active when the internal count is zero. In normal operation, the counter is decremented by one count on each positive-going transition of the clock. The output goes LOW when the count reaches zero. The output would then connect to an SSR or MosFET that would drive the lights.

In my area of the world, line power is 120 volts at 60 cycles per second (CPS). At this frequency there will be 120 zero crossing each second. If we want 256 levels of dimming we would divide 120 by 256 time slices. This would give us 32.5µS slices or an equivalent oscillator frequency of 32720Hz. Because the LED in the opto coupler cannot turn on with zero volts on it, there will be a slight delay in the output pulse coming out of it. This delay, though it limits the full on time slightly, doesn't seem to have any visible effect. It does mean that the counter won't reach 256 counts before the zero cross restarts the counter, which also means that the lights can only be dimmed to about Ľ of full brightness. This can be easily remedied by increasing the oscillator speed so that the counter can run faster. I have found that a frequency of 41 KHz is about right. If you look closely in the dark, the lights are actually slightly on. This can be adjusted if you need to by changing the resistor connected to the LM555 and going to ground.

To select 1 of 256 possible levels, just as in 'The Olsen 595' design, the bit values are shifted into the '595 IC except that we always need to shift 8 bits (the dimming value) at a time. This then drives 1 SSR or MosFET, etc.

Peter once said that he wrote to 4096 channels 22 times in one second. This makes 512 dimmed channels that can be written in 45 milliseconds, using all 8 data bits on a parallel port that would be 32768 channels in 45 milliseconds. I don't know if 45 milliseconds plus another 16 milliseconds it takes for a light bulb to turn on is noticeable when compared to music.

Step 3 : Program Code

Programming a dimming design is just as it is in 'The Olsen 595' design, except that we need to shift 8 bits (the dimming value) at a time.

This is the same Basic program that you'll find in Peter's example with clarification pertaining to dimming.
for i = 1 to 8    ' 8 bytes 

bitpattern = array(i) ' get one byte <--- array(i) would contain the dimming value.
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
out &H37A,latchhi ' latch new data into all outputs
out &h37A,latchlo

Programming is described by (Peter Olsen) in a ‘How To’ entitled ‘Build a 1024 Port Controller for $100’.

Step 4 : Circuit Diagram

To see the circuit diagram in PDF format Click Here.

Step 5 : Completed Board

I'll post a picture here when the board is completed.


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