Multiple Output, One Input

Thread Starter

Tunafish389

Joined Nov 14, 2022
11
Hi, so I am looking for something like a demultiplexer but instead of having a high/low control the outputs. I am looking for a single switch to switch what channel the output sends it to (either in order or randomly). For example I press the switch output one turns on then off, I press the same switch and then output 2 turns on then off. When I press the switch again it moves to output 3 and so on... Is there something out there like that? Thanks.
 

crutschow

Joined Mar 14, 2008
34,280
turns on then off
For how long?
For the same time as the button is depressed?

For logic level signals (3-15V) you could use a CD4017 decade counter with 10 outputs, that advances to the next output at each clock pulse.
The pulse could be generated by a CD4081, quad package, two input AND gate connected at each output, with the second input connected to the input pulse (or to whatever generates the desired pulse width).
 
Last edited:

dl324

Joined Mar 30, 2015
16,839
Welcome to AAC!
For example I press the switch output one turns on then off, I press the same switch and then output 2 turns on then off. When I press the switch again it moves to output 3 and so on... Is there something out there like that?
This is easily accomplished with a shift register.

Random things are best left to microcontrollers where it's straightforward to generate randomness.
 

Thread Starter

Tunafish389

Joined Nov 14, 2022
11
Thanks for the info so far, the decade counter could work but I guess some more information would be needed.

So I want a ground input and ground output. The signal time would be same as the the length of the button pressed. So press button, it sends ground to output pin 0 then on release it stops ground to pin 0. Next button press it sends ground to pin 1 then on release stops ground. Next button press to pin 3 and so forth.

The release after button pressed is not mandatory but ideal. The ground output is important but I could use the decade counter with maybe some relays to loop the ground but I would rather not if possible. Thanks for the ideas so far!

The application is controlling some voice recordings playback. I could do about 8 recordings and they will playback with there own switch by completing a ground circuit (goes low). For example I have eight switches and I press switch one, it will play that recording but none of the others. I am trying to get one button to switch thru each of the recordings.
 
Last edited:

crutschow

Joined Mar 14, 2008
34,280
Is it okay if the output goes high (to the supply voltage) when the outputs are off?

Can the button go to a high instead of ground when pressed?

Is the button mechanical?
 
Last edited:

Irving

Joined Jan 30, 2016
3,843
This is a good example of where a small 16-pin MCU is a better solution than discrete logic. Want a random selection? No problem! Want selection to be a 150mS pulse rather than just a 'low'? No problem!
 

Thread Starter

Tunafish389

Joined Nov 14, 2022
11
The circuits that senses what recording are normally high. So they can be high without issue, it triggers the selected file by going low.

A microcontroller is not out of the question but think that can be left for another thread.

I am thinking the decade counter to some 555 timers (so it doesn't keep signal being sent from counter). This should put out about 5v which could trigger some npn transistors for the low input to the playback device. Seems complicated and maybe there's an easier way to go about it...
 

crutschow

Joined Mar 14, 2008
34,280
I am thinking the decade counter to some 555 timers (so it doesn't keep signal being sent from counter)
Don't understand what the 555 timers are for?
The signal from the counter gates will just go low once per complete cycle.

Can the signal stay low, until the next signal goes low?
 

Irving

Joined Jan 30, 2016
3,843
Put the 555 on the demux input, then only 1 required. Low going clock to counter triggers 555 and selects output. 555 times out, demux output goes high till next selection.

If you know how to program or want to learn how.
Agreed, or ask someone else to do it for you... There are many on AAC who could oblige...
 

Thread Starter

Tunafish389

Joined Nov 14, 2022
11
The 555 timer is stop it from being high until the next cycle. Simulating a press, instead of a hold. A press will play a file once, a hold will continue to repeat that file in a loop. The idea is to only play once.
 

Irving

Joined Jan 30, 2016
3,843
What demux?
Ah, i was thinking about a counter driving a 1:n demux, as per TS original post, so a zero input to the demux propagates across it's outputs.

Mind you, a CD4017 propagates a 1 not a 0 so you'd need an inverting buffer on the output, so you'd apply the 555 to the buffer's output enable line.

But then a 3-bit counter and 1:8 demux is a better solution as you have 10 less solder joints to make! IMHO!
 
Last edited:

crutschow

Joined Mar 14, 2008
34,280
The 555 timer is stop it from being high until the next cycle. Simulating a press, instead of a hold
So there is no button?
i was thinking about a counter driving a 1:n demux, as per TS original post, so a zero input to the demux propagates across it's outputs.
That does sound like a good way to go.
The demux input could be a short negative pulse from a 555 with the rising edge clocking the counter to the next mux channel..
 

Thread Starter

Tunafish389

Joined Nov 14, 2022
11
There is a button but that will be used to play the next audio file. So the button would be used to control the decade counter, which will send signal to a different channel at each press.

The idea with the 555 was that it would stop that signal from counter from consistently being active. This wasn't the case after testing. The 555 would keep the output while it has signal, it wouldn't start the timer until the signal was released which won't work for.

So back to relays, I think. The counter sends 5v to the relays that will be setup with capacitor to time the switching of the relay. Not sure what effects this will have on the counter though...
 

crutschow

Joined Mar 14, 2008
34,280
So the button would be used to control the decade counter, which will send signal to a different channel at each press.
So could the length of the button-press to be the low time to the audio modules?
So back to relays, I think.
I see no reason to use relays and I don't understand why you think you do(?).
The low time could be generated by a 555 timer if the button press-time is not sufficient for that purpose.

The demux/counter circuit proposed by Irving should do want you want.
A low input to the demux will give a low at the selected output for the duration of the low at the input.
 
Last edited:

Thread Starter

Tunafish389

Joined Nov 14, 2022
11
Ok here is a ruff draft of the circuit after the decade counter. This is to take the counters consistent 5V and turn it into a half second low signal.

The ground input is where the c1000uf and r1 just connects to each other. There will be a 5V source between d1 and r700 which will always be on. The output from 4017 will trigger the low signal coming to d2. This will always be high but go low for a half a second once 4017 sends its 5V. Each output on the 4017 will have its own circuit in the schematic.

To go low the circuit pulls 7mA which I think the 4017 can handle. When high it is pretty much idle. Just hope that half a second low is long enough to trigger the audio player. I don't have any 4017 and am waiting for the audio play so just have to wait now.
 

Attachments

crutschow

Joined Mar 14, 2008
34,280
Here's a diagram of a CD4051 8-channel analog mux/demux whose address would be controlled by the 4-bit binary counter.
A low (from either a 555 or the button) at the demux COMMON OUT/IN will appear at the CHANNEL IN/OUT pin, as determined by the counter address, to trigger the audio module.
The counter address is advanced by a CLOCK pulse generated by each push of the button.
The circuit doesn't require a transistor on each output.

1668529273038.png
 
Top