# timed sequencing switch circuit design

#### RainbowVideo

Joined Apr 10, 2012
32
Apologies if this is not the correct forum to post this. I am looking for a schematic/parts list for a circuit that will switch on/off 30 outputs from a single input in order to output 1 through 30. Input would be 12vdc 1000ma, each output would connected to be a single 4 watt LED fixture. 'On' time would be adjustable 1 - 10 seconds (via dip switch) and any output could be excluded from the rotation (also via dip switch). I'm a decent builder but don't have the skills to design. This is for a small museum display. Let me know the cost for design.

#### Hymie

Joined Mar 30, 2018
721
What you want from the circuit could be made by daisy-chaining thirty 555 timer ICs.

I would recommend you construct a chain of three to see how it performs – making any adjustment to suit your requirements prior to building the finished product.

#### WBahn

Joined Mar 31, 2012
24,970
You've got a decent start at a set of specs. Let's see if we can flesh it out a bit.

When you say that any output could be excluded from the rotation, are you saying that you would exclude any one output and the other 29 would operate as if there were just 29 total. Or are you saying that you could exclude any combination of outputs and the remaining one would go in sequence just as if the others didn't exist?

When you say that the on-time would be adjustable, is that a single adjustment that applies to all of the outputs, or did you mean that each output has a separate adjustment?

Is the sequence free-running or triggered? Free running means that when it finishes the sequence it will automatically just start the sequence over. Triggered means that some action will cause the sequence to start running once and, once it finishes, it will stop until triggered again.

#### WBahn

Joined Mar 31, 2012
24,970
What you want from the circuit could be made by daisy-chaining thirty 555 timer ICs.

I would recommend you construct a chain of three to see how it performs – making any adjustment to suit your requirements prior to building the finished product.
I would NOT recommend using 30 555 timer circuits. That's especially the case if the timing for all of them are supposed to be the same. A quite simple MCU solution is the way to go.

#### RainbowVideo

Joined Apr 10, 2012
32
Great questions: exclude any combination of outputs. one time for all outputs free running. .

When you say that any output could be excluded from the rotation, are you saying that you would exclude any one output and the other 29 would operate as if there were just 29 total. Or are you saying that you could exclude any combination of outputs and the remaining one would go in sequence just as if the others didn't exist?

When you say that the on-time would be adjustable, is that a single adjustment that applies to all of the outputs, or did you mean that each output has a separate adjustment?

Is the sequence free-running or triggered? Free running means that when it finishes the sequence it will automatically just start the sequence over. Triggered means that some action will cause the sequence to start running once and, once it finishes, it will stop until triggered again.[/QUOTE]

#### WBahn

Joined Mar 31, 2012
24,970
Great questions: exclude any combination of outputs. one time for all outputs free running.
Okay. So next questions.

How many different time settings are you looking at? How accurate do they need to be? What's the smallest and largest time settings you need?

Does the next output always go on immediately when the prior output goes off?

Are DIP switches the only acceptable way of getting input?

#### RainbowVideo

Joined Apr 10, 2012
32
Okay. So next questions.

How many different time settings are you looking at? How accurate do they need to be? What's the smallest and largest time settings you need?

Does the next output always go on immediately when the prior output goes off?

Are DIP switches the only acceptable way of getting input?
Adjustable in 1 second increments from 3 seconds to 10 seconds. Accuracy not a factor. simultaneous switching would be desirable but not mandatory. DIP switches was just a thought of what might be convenient to enable/disable selected outputs and an easy way to change the timing, certainly open to other ideas.

#### WBahn

Joined Mar 31, 2012
24,970
There are a number of options available. For the output side, one way would be to use a shift register that ran a single 1 down it and whichever output it was at would be the one that would be on at a particular time. To skip over a light, you simply clock it again in rapid succession so that the light is turned on so briefly that no one would notice and it appears like the next enabled like came on right way. Just in my head I can see of possible way of doing it so that you can use a single 555 timer and no MCU, but there might be a hidden gotcha that's not coming to mind. With an MCU it is pretty trivial.

As soon as you have an MCU, you open up a lot of options for user I/O. For timing you could have just a pair of up/down buttons and you just adjusted it to the desired rate -- that would give you an effectively continuous range of adjustment (dictated by the resolution of the MCU clock, but you could run that fast enough that it would seem continuous). For light selection, I could imagine putting it into a mod where all of the LEDs are one (or seem that way) and you use the same up buttons to advance the focus to each light in turn (which blinks in response) and you then use the down button to toggle it's state between in use and not in use (probably indicated by a fast blink for on and a slow blink for off).

How often would the settings me changed? Is it acceptable to have the lights doing things as part of the setup process?

Joined Mar 10, 2018
3,682
This is a first look at a possibility. Basically using a single chip to develop
the external LED driver inputs. External driver IC or MOSFET for each
pin needed because of LED drive current needed (4W LED).

Basically a SW counter runs a demux automatically scanning from one to the next.
Code would be used to hold a table of time values/LED such that each LEDs on time
would be changed when going to next LED.

Also a PWM is used to control LED brightness. That also would be a code table
so that each LED would have its own brightness value.

Simple character LCD used along with 3 switches, one to select menu, another to
move thru menu up or down. Menu would be for selecting LED on time and bright-
ness.

There are consultants that can do this design for you.

Shown is tool for control chip, the components shown are all on one chip.
Just the power drivers (not shown) are off chip. Resources used were minimal.
For example could have used the onchip A/D to sense a photocell and control
the PWM thereby setting brightness based on ambient light level. Many possi-
bilities.

The offchip LED drivers could be an Octal driver, you would need 4 of them.

The tool, PSOC Creator, is free, the board < $20 (an evaluation of choice would have to be made to see if enough I/O is pinned out). https://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and Regards, Dana. Last edited: Thread Starter #### RainbowVideo Joined Apr 10, 2012 32 There are a number of options available. For the output side, one way would be to use a shift register that ran a single 1 down it and whichever output it was at would be the one that would be on at a particular time. To skip over a light, you simply clock it again in rapid succession so that the light is turned on so briefly that no one would notice and it appears like the next enabled like came on right way. Just in my head I can see of possible way of doing it so that you can use a single 555 timer and no MCU, but there might be a hidden gotcha that's not coming to mind. With an MCU it is pretty trivial. As soon as you have an MCU, you open up a lot of options for user I/O. For timing you could have just a pair of up/down buttons and you just adjusted it to the desired rate -- that would give you an effectively continuous range of adjustment (dictated by the resolution of the MCU clock, but you could run that fast enough that it would seem continuous). For light selection, I could imagine putting it into a mod where all of the LEDs are one (or seem that way) and you use the same up buttons to advance the focus to each light in turn (which blinks in response) and you then use the down button to toggle it's state between in use and not in use (probably indicated by a fast blink for on and a slow blink for off). How often would the settings me changed? Is it acceptable to have the lights doing things as part of the setup process? This will be a one and done on the installation and adjustment side of things. The museum display does not exist at this point, but they have requested the ability for up to 30 lights. When I go to set it up, I will take 30 fixtures, set up as many as needed, set the desired timing and walk away (in a perfect world, forever). This is a first look at a possibility. Basically using a single chip to develop the external LED driver inputs. External driver IC or MOSFET for each pin needed because of LED drive current needed (4W LED). Basically a SW counter runs a demux automatically scanning from one to the next. Code would be used to hold a table of time values/LED such that each LEDs on time would be changed when going to next LED. Also a PWM is used to control LED brightness. That also would be a code table so that each LED would have its own brightness value. Simple character LCD used along with 3 switches, one to select menu, another to move thru menu up or down. Menu would be for selecting LED on time and bright- ness. There are consultants that can do this design for you. View attachment 169192 Shown is tool for control chip, the components shown are all on one chip. Just the power drivers (not shown) are off chip. Resources used were minimal. For example could have used the onchip A/D to sense a photocell and control the PWM thereby setting brightness based on ambient light level. Many possi- bilities. The offchip LED drivers could be an Octal driver, you would need 4 of them. The tool, PSOC Creator, is free, the board <$20 (an evaluation of choice
would have to be made to see if enough I/O is pinned out).

https://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and

Regards, Dana.
Thanks, Dana. I'll follow up on this. I don't believe I'll need LED drivers as they integrated into the fixture. Currently the fixture of choice is the Gantom One although I'm certainly open to lower priced alternatives. So far this is the only one I've found that meets the fixture size and light output specs.

Last edited by a moderator:

#### WBahn

Joined Mar 31, 2012
24,970
This will be a one and done on the installation and adjustment side of things. The museum display does not exist at this point, but they have requested the ability for up to 30 lights. When I go to set it up, I will take 30 fixtures, set up as many as needed, set the desired timing and walk away (in a perfect world, forever).
That makes things a LOT simpler -- and it underscores the value is describing the problem you are trying to solve, not just the solution you think you need. You don't need the ability to remove lights from the display and skip over them. You just need to use a shift register that can handle at least 30 outputs (32 is what you'll end up with). When you set it up, you can just jumper the output of the last lamp you use back to the input. Use a 555 with a trim pot to set the timing. That's pretty much the minimal solution. The big problem here is that if your shift register gets upset you can have either multiple lights on at the same time chasing each other or no lights at all. You can use a second 555 (and the 556 has two of them in one IC for just about the same price) to make periodically launch the signal down the shift register. A few ways to do this depending on what's important.

Using a MCU still has some advantages. Probably the biggest is that it can be programmed to deal with the missing/multiple token situation very easily and cleanly. The cost of the MCU you need to do this is very minimal (but you need to be able to develop and implement the code -- so if you plan on doing things like this in the future, it's worth it. Otherwise, find someone to do it for you. You might also consider using something an (ugh) Arduino.

#### djsfantasi

Joined Apr 11, 2010
5,833
I agree with WBahn that a small micro might be the best solution.

I hope you’re comfortable coding.

If I were to do this, I’d write a small program for a micro connected to a long (30+bits) shift register (4 registers connected serially).

Then, since there are 30 lights (30 bits long), l would create a small table or array, each row consisting of two unsigned long values and with as many rows as needed to define all of the desired sequences. A sequence is which lights are on and for how long before a different set of lights is desired.

Each row in the array contains the time that this particular set of lights should remain unchanged. The second value is a bit mapped value of the lights status. As a simple example, consider the an 8 bit binary value of “11001101” or 205 decimal. This indicates that lights 8,7,4,3,1 are to be illuminated. Just extend this concept to 30 bits.

The program would read a row, shift in the 30 bits to the shift register(s) and then pause for the time specified in that row.

There are some minor considerations. Initialization. Starting over. Creating the table.

For the latter, what I’ve done is use a spreadsheet. The first column contains the time. You can use seconds, milliseconds or whatever is convenient. The next thirty columns should be labeled by a meaningful name for the light itself. Enters 1 if the light should be on; enter 0 if it should be off.

Then add one more column. Create a formula in this column, which converts the 30 previous values into one unsigned long value. You can use this spreadsheet to develop your desired lighting plot and export it to a text file which can be edited into code appropriate for your language. In fact, I would have added one more column which formats the two values into text that can be used directly in your IDE.

Last edited:

#### RainbowVideo

Joined Apr 10, 2012
32
That makes things a LOT simpler -- and it underscores the value is describing the problem you are trying to solve, not just the solution you think you need. You don't need the ability to remove lights from the display and skip over them. You just need to use a shift register that can handle at least 30 outputs (32 is what you'll end up with). When you set it up, you can just jumper the output of the last lamp you use back to the input. Use a 555 with a trim pot to set the timing. That's pretty much the minimal solution. The big problem here is that if your shift register gets upset you can have either multiple lights on at the same time chasing each other or no lights at all. You can use a second 555 (and the 556 has two of them in one IC for just about the same price) to make periodically launch the signal down the shift register. A few ways to do this depending on what's important.

Using a MCU still has some advantages. Probably the biggest is that it can be programmed to deal with the missing/multiple token situation very easily and cleanly. The cost of the MCU you need to do this is very minimal (but you need to be able to develop and implement the code -- so if you plan on doing things like this in the future, it's worth it. Otherwise, find someone to do it for you. You might also consider using something an (ugh) Arduino.
With your good advice, did a little more digging. could I do this with a single 555 and three 4017(s) connecting pin 15 of the first 4017 to pin 9 of the second 4017, pin 15 of the second 4017 to pin 9 of the third 4017 and pin 15 of the third 4017 to pin 9 of the first 4017, then to change the number of LEDs just change pin 15 of the third 4017 with the first unused output?
I'm stretching a bit here, I'm not an engineer but a builder.

Joined Mar 10, 2018
3,682
Another approach is to do this wireless, with a ESP8266 in a wireless network
approach. Each light would be a client on the network, and using one UP with
an ESP8266 as a host. That way you get rid of all the wiring if you are spanning
a lot of Cu over the display area.

Google "esp8266 mesh network", several videos on this.

The Gantom One shows it has its own constant current driver, and is dimmable, but
not clear if it has to be fed PWM signal (which I think is true) or has its own PWM.

Regards, Dana.

#### Bernard

Joined Aug 7, 2008
5,334
Cascading 4017's is a bit more complicated but doable. About 8 output pins available / IC so maybe 4 ICs.
Are you suggesting just total # of displays selected & not random elimination ?

#### RainbowVideo

Joined Apr 10, 2012
32
Cascading 4017's is a bit more complicated but doable. About 8 output pins available / IC so maybe 4 ICs.
Are you suggesting just total # of displays selected & not random elimination ?
Correct. The final number of displays would be determined when system is installed and the last #number of outputs would be eliminated via some sort of jumper.

Another approach is to do this wireless, with a ESP8266 in a wireless network
approach. Each light would be a client on the network, and using one UP with
an ESP8266 as a host. That way you get rid of all the wiring if you are spanning
a lot of Cu over the display area.

Google "esp8266 mesh network", several videos on this.

The Gantom One shows it has its own constant current driver, and is dimmable, but
not clear if it has to be fed PWM signal (which I think is true) or has its own PWM.

Regards, Dana.
A great solution, but probably not appropriate for a small town 'walk in in the morning, flip on the switch' museum. Too sophisticated. I wouldn't be using the dimming feature anyway. I'm cutting it close on the differential between ambient and projected light. But Thanks!

Last edited by a moderator:

#### WBahn

Joined Mar 31, 2012
24,970
With your good advice, did a little more digging. could I do this with a single 555 and three 4017(s) connecting pin 15 of the first 4017 to pin 9 of the second 4017, pin 15 of the second 4017 to pin 9 of the third 4017 and pin 15 of the third 4017 to pin 9 of the first 4017, then to change the number of LEDs just change pin 15 of the third 4017 with the first unused output?
I'm stretching a bit here, I'm not an engineer but a builder.
This is very close. The problem is that you need exactly one of the bits within the registers to be HI and all of the others to be LO. If they are all LO, then you are just cycling a bunch of zeroes around the shift register and no lights will ever come on. If you have more than one bit HI, then you will have more than one light on at the same time and they will be chasing each other around the loop. So you need some additional logic to start the process going and to monitor it to ensure that it doesn't get upset by some noise or a power glitch or a cosmic ray or whatever. That's a job that a little MCU can handle very easily.

Joined Mar 10, 2018
3,682
Are you going to run cable out to each light from controller or
use a single cable with taps for each light. The latter uses a
chip / light, addressable, to turn on/off, and brightness level.

You would have a simple host interface, a UP, sending out
address and data for each LED light.

This chip is used extensively in led lighting strips. 10M light
to light distance allowed. Programming of host to this serial
network fairly simple, libraries already exist for Arduino.

Note chip has RGB capability, but you could use it just to
turn on/off the light its connected to.

Just a thought.

Regards, Dana.

#### crutschow

Joined Mar 14, 2008
23,742
This is how to cascade the CD4017:

#### Bernard

Joined Aug 7, 2008
5,334
The AND gate might be CD4081BC.