# Switching Circuit Using 4017

I am working on triggering LEDs from a camera for a unique exposure process. Each exposure is roughly 15ms. Essentially, I get a high signal from the camera for the duration of the exposure, and during this time I need to have the LED on to light the target. The confusing part for me is that I need to turn on 4 different LEDs in succession. Let's call them A,B,C, and D. My initial thought was to use a decade counter (4017) and just have four outputs correspond to LEDs A,B,C, and D. The problem with that is the exposure signal goes high for each exposure, rather than one for the duration of all four LEDs. I then thought to use the exposure signal as an enable for the 4017, but I figured it would also be problematic.

I made a crude diagram of how it works.

I am leaning towards using an Arduino to handle the switching, but is there a circuit that can switch outputs given my situation?

• Does your diagram indicate what you actually need? Commented Feb 15, 2016 at 22:53

15ms is pretty slow in microcontroller-land, so an arduino would be a perfectly-acceptable solution. Certainly the easiest to adjust and extend.

If you want to do it in discrete logic though, I would suggest that the important part you want is a 4-bit serial-in/parallel-out shift register, and not a counter.

Something a bit like this:

simulate this circuit – Schematic created using CircuitLab

Edit: I've just noticed what a 4017 is. It would work with the AND array, but you need a separate RESET input so that its sequence goes back to output A after 4 pulses, otherwise you will have 6 no-output pulses between D and A. The NOR arrangement in my schematic means that you will always have exactly one active output and it will cycle through A-D.

This may not be an answer yet but I need a diagram and can't post one in the comments ...

simulate this circuit – Schematic created using CircuitLab

Figure 1. Normal 4017 operation.

If you use four sequential outputs from the 4017 you get the signal pattern shown in Figure 1.

If you want the pattern shown in the question you could AND each output with the clock.

simulate this circuit

Figure 2. As per question.

Your timing diagram, if it is of the output of 4017, its look incorrect. The outputs of 4017 for a,b,c and d will be consecutive without blanks between them, unless if you take the four outputs alternately, I.e a, c, e and f.

I'm not sure what exactly the timing you need for your camera flashes. But I think 4017 should be helping you.