Lightbar Project - Circuits 101

[TODO] Replace the junky lines with images.

So I had this great idea on how to make a control circuit for my lightbar. I wanted to use some basic timers, to create a basic signal and then manipulate each of those signals to get the desired result. On paper the idea was amazing, here it is:

__ __ __| |__| |__

This is the basic signal I could get out of the 555 Timer. (The high part of the signal means that the light will be on.

__ __ __ | |__| |__| |

By inverting this signal, I could end up with two signals that will cause one light to be on while the other was off, and then they’d switch.

Ok great so I was half way there, but now I needed 2 segments to switch part way through a signal change. That was much harder. For those who understand signal waves, I needed to shift the signal so that it was halfway out of phase. The goal result was for signals that look like:

__ __ __ |__| |__| |__| | Signal for segment 1

__ __ _ _| |__| |__| Signal for segment 2

__ __ __ | |__| |__| |__ Signal for segment 3

_ __ __ |__| |__| |_ Signal for segment 4

Going back and looking at the segment arrangement we can see that these 4 signals get us our desired result.

[ 1 2 ] [ 4 3 ]

It will start with 1 and 4 on, then 4 will go out and 2 will come on, then 1 will go out and 3 will come on, then 2 will go out and 4 will come on, then 3 will go out and 1 will come on, then 4 will go out and 2 will come on and around and around we will go.

This was perfect! Except how do I get those offset signals? Well, I asked an Electrical Engineering professor and he mentioned that if you run a clock twice as fast as you want, and put it throuh a counter, you can get a signal out of the counter that is half the speed, or in this case the speed you actually want. Because the counter would count on the falling edges of the clock, it would shift the resulting signal.

_ _ _ _ _| |_| |_| |_| | Signal that is twice as fast

__ __ __ __| |__| |__| Counter output

__ __ __| |__| |__

Compared to our original 555 timer signal we can see that this is shifted exactly how much we need to make our signals.

So the sources of our 4 signals are as follows:

Signal 1 - the 555 timer

Signal 2 - the output from the counter

Signal 3 - the inverse of the 555 timer

Signal 4 - the inverse of the output from the counter

I needed 2 timers, one to run at the base frequency of 2Hz and the other to run at twice that, 4Hz, which would be sent to the counter to get my 2Hz half out of phase signal.

It didn’t work. Basically, this looks great on paper, but each digital component uses thresholds of analog signal change to set values for high and low logic. Each piece I used varied slightly and the signals propagated through the circuit in unexpected ways.

I may have been able to sit down with an oscilloscope and figure out a better way, or spend more on more quality parts, but I basically decided there had to be a better way. So I thought about it and designed a digital logic circuit that used flip-flops to keep track of state and then change the state as a timer counted. This way I would not be manipulating the timer signal directly, just using it to drive some basic digital logic with a bit of memory. More on this in the next page.