Simple input selector, but still don't get it? - Page 1
Forum section: electronics / beginners

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 07, 2020, 01:49:23 pm
content: I found this push button input selector, but can't find out where the input sources go or get out.https://320volt.com/en/3-channel-push-button-selector-circuit/Will you please try to explain it to me in dummies level? :-)

author: The Soulman
author_rank: Super Contributor
timestamp: August 07, 2020, 01:57:21 pm
content: Nowhere, it has no switching capability, only lighting up leds.If you want you could replace the led's with transistors or optocouplers, or....<----

author: LateLesley
author_rank: Frequent Contributor
timestamp: August 07, 2020, 02:11:12 pm
content: As @Soulman said, it's not switching inputs and outputs, the only input is the pusbuttons, and the output is an LED, latched to show which button has been pressed.I think what you are looking for, is that circuit could be used with an analog switch/multiplexer, and this circuit, instead of driving LEDs, could drive the multiplexer address pins, allowing you to choose the input.An example chip would be something like the 74HC4051D.https://www.nexperia.com/products/analog-logic-ics/i-o-expansion-logic/analog-switches/74HC4051D.html

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 07, 2020, 07:30:49 pm
content: I do really like both of your replies, but the idea of just adding a mosfet to each LED. The circuit has already an LED to show what channel is selected, has a latching soft push button "switcher" so the only thing missing is a power switch, that can be done by the mosfet. While second solution, demands me to "think" and try to get that to work. :-)Is that a wise decision or?

author: Gyro
author_rank: Super Contributor
timestamp: August 07, 2020, 08:03:58 pm
content: It can be done simpler by the way. This circuit provides 4 buttons, but for 3 buttons you can use a triple 3 input NOR and squeeze it into a single IC package (active High outputs)....Alternatively you can do the same with NAND gates with pullup resistors and the buttons connected to GND (Active Low outputs).

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 07, 2020, 08:24:47 pm
content: My try on making a 4 button, done before your logic gate example.But would it work?

author: gcewing
author_rank: Regular Contributor
timestamp: August 08, 2020, 10:53:03 am
content: Quote from: FriedMule on August 07, 2020, 08:24:47 pmUsing a single mosfet to switch an analog signal like that is a bit tricky -- it will only work if the voltage at the source remains sufficiently close to ground, so that the gate-source voltage is large enough to keep the mosfet turned on. Also the body diode inside the mosfet can mess things up.It would be better to use something like a 4066 quad analog switch, which is designed for doing just this kind of thing.Also, your LEDs won't light connected in series with the mosfet gates like that. You would need to leave the LEDs and their resistors connected as in the original circuit, and connect the mosfet gates (or 4066 control inputs) directly to the outputs of the flip flops.

author: jonovid
author_rank: Super Contributor
timestamp: August 08, 2020, 11:31:35 am
content: Quotetrue I have used 4066's on a lot of this type of IMO look at debouncing & power filteringyou maybe trying to toggle on & off at the same time? with your switch busdisconnect the reset and see, try one channel at a time with all others disconnected.

author: Zero999
author_rank: Super Contributor
timestamp: August 08, 2020, 12:26:27 pm
content: Quote from: Gyro on August 07, 2020, 08:03:58 pmLike this.By the way, you can use the same technique with 3-input gates.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 09, 2020, 10:01:36 am
content: Thanks for helping, I have tried to read about the 4066 and tried to understand the original circuit, I have based "my" circuit on.As I understand from this site:http://www.learningaboutelectronics.com/Articles/4066-quad-bilateral-switch-circuit.phpA signal do only go trough a channel if a voltage is applied to the channels "gate". For the chip to switch on would, as I again understand it, you have to make some sort of latching circuit. My idea is to make latching push buttons that unlatch if any other push button is pressed.It does also look like to implementing any "channel LED", I have to add a circuit for that.About "my" circuit: It should handle the switching, if anyone pushes button is activated? The LED should change at the same time?I am hoping to use a 12V CC power supply for maintaining constant light on the LEDs and 6V-7V on the mosfet source.I do understand from you both that my circuit is not going to function as I hope it should?NEW SCHEMATIC:

author: Zero999
author_rank: Super Contributor
timestamp: August 09, 2020, 03:07:26 pm
content: What are you trying to do?An analogue switch such as the CD4066 is no good for driving LEDs.What do you want to do? Just switch on an LED when a button is pressed and turn off the others? How much current do the LEDs require?There are much simpler ways to do this.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 09, 2020, 06:49:46 pm
content: Thanks for your question! My goal is to make a Voltage ridirector. You push one of 4 soft latching push buttons, a LED, lights up, showing what button is currently pushed. The output that correspond with the number is now letting power go trough to the circuit who are on that number position.In short, if you push button 3, LED 3 lights up and output 3 is delivering power.Max CC would properly be about 750mA.

author: Zero999
author_rank: Super Contributor
timestamp: August 10, 2020, 11:15:50 am
content: Look at the circuit I posted earlier, with the NOR gates.Look at how each gate has two inputs, going to the outputs of the other gates. To design the same circuit, but with four switches, use three input NAND gates, again with each input going to the output of the other gates.Here's a discrete version, showing it can be done without ICs. It works on the same principle, but using discrete NOR gates. Rather than shorting the output to +V to force the output high, the switch shorts the base to 0V. Put C1 across the switch you want it to default to, when the power is first applied.It's possible to build a simlar circuit using NAND gates, made with Darlington pairs/MOSFETs, which can drive the loads directly, but it's only suitable for high supply voltages.EDIT:It's easy. Rather than just resistors, use diodes, as well as resistors, to make AND gates before the MOSFETs. If the switches can take the 700mA, required by the LEDs, then the 1k resistors can be eliminated (replaced with a short) and the switches put in parallel with the MOSFETs (drain to source). If the LEDs glowing dimly and associated voltage drop, when they're off isn't an issue, the 10k resistors can be eliminated (replaced with an open circuit)This circuit will run directly from the constant current source, as long as the forward voltage of the LEDs is high enough MOSFETs on enough. Note, the N=2 next to LED, means that each LED on the schematic represents two models in series, giving a voltage drop of about 7V. Again C1 is in parallel with the switch, which the circuit defaults to, when power is first applied.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 10, 2020, 10:25:05 pm
content: I do really like your discrete component solution, and have some noob questions.The switches, is that "on/of" contacts, not push buttons?Do channels change when flipping / pushing a corresponding button?Output of Voltage, what are they cable of delivering (mA)?

author: gcewing
author_rank: Regular Contributor
timestamp: August 11, 2020, 03:41:02 pm
content: Quote from: FriedMule on August 09, 2020, 06:49:46 pmMy reply was based on the assumption that you were wanting to switch analog signals going into an amplifier or something like that, which is what your use of the term "input selector" suggested.However, if you want to switch power on and off to various loads, that's a different story. Mosfets are fine for that.But in your circuit you seem to be using n-channel mosfets to switch the positive side of the supply. That won't work well. You need to use p-channel mosfets with the source connected to the positive supply, and drive them from the Q-bar outputs of the flip flops (because the gate of a p-channel needs to be taken negative with respect to the source to turn it on).

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 12, 2020, 12:51:58 am
content: The problem is about definition, it's an input selector but the part where the audio is going into and out of, is separated from everything else. To control the input selector, do I have to redirect power from power input to a 4 ch output redirect or and into the input selector, or in total am I making an input selector.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2020, 08:49:28 pm
content: Quote from: FriedMule on August 10, 2020, 10:25:05 pmThey are push buttons.The one with the MOSFETs can switch high currents, up to the rating of the MOSFETs. The schematic shows it switching LEDs which drop 7V and are driven at 700mA.The one with BJTs, is only for driving larger transistors, such as MOSFETs.Quote from: FriedMule on August 12, 2020, 12:51:58 amThat doesn't make much sense.Is this to switch LEDs, audio, or both? It's possible to make the same circuit with relays.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 13, 2020, 11:55:00 pm
content: I have chosen draw the input selector and the Volume / Balance control circuit, to make it easier to see what I am trying to do.The audio is only going trough the opto couplers, the rest is to control and power the opto couplers.I hope that it's somewhat understandable.

author: Zero999
author_rank: Super Contributor
timestamp: August 15, 2020, 12:38:28 pm
content: Quote from: FriedMule on August 13, 2020, 11:55:00 pmDid you remove the schematic, has the forum lost it? I hope you don't mind me reposting it. If you want me to delete it, message me, or ask a moderator to remove it.Please try to use the correct symbols. The NE3085 is an FET opto-isolator, not an opto-TRIAC. This is important becauser a FET opto-isolator is good for audio, but a TRIAC would produce a lot of distortion.The solid state relays won't latch, with the selector, but be momentary: is this what you want?What's going on with Set0?

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 21, 2020, 11:07:26 am
content: Hi Zero999Sorry for my very late answer!Thank you for making the schematic visible again, do not know what had happened.You write about a NTE3085 opto-isolator, I'll try to correct my drawing, thanks for your pointing that out! (see below)About latching relays, it was my hope to be able to push a push button that then switched the privies selected off. Let's say channel 4 was selected and now do I press button 3, that turns off button 4 and redirect power to output 3. Ch3 will now have a steady supply of power, while the other channels are off, until another channel is selected.Sel0 is just the return-power to the constant current supply.About the LEDs I am hoping to use one LED as indicator for what channel is selected but your circuit is using two LEDs per channel, is there a way to eliminate one of them, maybe by reducing the input Voltage?I have tried to simulate the circuit on falstad but I have done something wrong:http://tinyurl.com/y244yxar

author: Zero999
author_rank: Super Contributor
timestamp: August 23, 2020, 12:52:11 pm
content: You won't get 700mA, using those JFET current sinks, more like 700µA.If you can get relays with four contacts, then you could use those as part of the selector circuit.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 25, 2020, 03:57:14 am
content: Thanks to your great drawings, has I finally managed to make the following circuit:http://tinyurl.com/y5epns6bThere are some problems about the right amount of power and a few questions about if the resistor, has to be there?I have also not yet found a way to add LED's to indicate the active channel.Is it possible to use solid state instead of mechanical relay?Note: it says that there are bad connections, but it's simply due to me, ignoring if a line crossed a point in the relay.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 25, 2020, 04:40:20 pm
content: How do I make a chip 3PST solid state relay, can't seem to find any chips?

author: Zero999
author_rank: Super Contributor
timestamp: August 26, 2020, 06:56:42 pm
content: Is there any reason why you want to use solid state relays?I doubt you'll be able to get a 3PST solid state relay.If you must use solid state relays, use the circuit I posted previously, with the MOSFETs. Put the LED side of the solid state relay, with a suitable series resistor, in parallel with the LED.

author: BrianHG
author_rank: Super Contributor
timestamp: August 26, 2020, 07:54:25 pm
content: Here is a cheap AC/DC output optocoupler which can sustain 2 amps, 6 amp pulsed:TLP241A(F -https://www.mouser.com/ProductDetail/Toshiba/TLP241AF?utm_term=TLP241A&qs=bUPhaerQQeE1lWx5mm8O0Q%3D%3D&utm_campaign=TLP241AF&utm_medium=aggregator&utm_source=findchips&utm_content=Toshiba0.100 Ohm output resistance when on. 40v maximum output voltage between pins when off.

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 26, 2020, 07:55:42 pm
content: No there is no reason for using solid state relays at all, can's just find out on how to make bjt / mosfet's, replace the solid states.My problem is that I think I do not understand your drawings, how to combine them to a functioning single drawing, so I have done many things and, yes end up with something less ideal.

author: Zero999
author_rank: Super Contributor
timestamp: August 29, 2020, 10:24:34 pm
content: Quote from: FriedMule on August 26, 2020, 07:55:42 pmWell you haven't exactly stated what you're trying to achieve.Go back to the logic gate solution, using the NOR gates, with output resistors enabling their outputs to be safely forced high by switches. It's possible to omit the resistors, but shorting the output of logic gates to +V, causes large current spikes to be drawn from the power supply. Figure out how it works using the truth table for the NOR gate. Now consider the same circuit with NAND gates, but the outputs are inverted, so have to be forced to 0V, by switches. The other schematics I've posted work on the same principle, except they use transistors/relays.https://en.wikipedia.org/wiki/NOR_gate

author: FriedMule
author_rank: Frequent Contributor
timestamp: August 31, 2020, 12:07:40 am
content: I like your solution, it does not take up much space but I have to add the LED's and a bit.You talk about transistor/relay solution, may I please here more about that?I was hoping on being able to just add "relays" if I need more channels or an extra on/off indicator.

author: Zero999
author_rank: Super Contributor
timestamp: September 01, 2020, 09:45:52 am
content: Quote from: FriedMule on August 31, 2020, 12:07:40 amIt's easy to connect relays to the outputs of logic gates, using transistors.I've already posted transistors/relay solutions which work on the same principle as thecircuit I posted previously. They're all just logic gates, NAND/NOR, made from relays, transistors and/or diodes. For example, theone with the BJTsis just four, three input NOR gates. The only subtle difference from the circuit above is the switches force the outputs low, by shorting the base to 0V, rather than connecting the output to +V, via a resistor.Theone with the MOSFETsconsists of diode AND gates, followed by MOSFET NOT gates, forming NAND gates. Because the LEDs are connected between the output and +V, they're on, when the output is low. The switch forces the output low, by connecting the gate to +V.https://en.wikipedia.org/wiki/Diode_logic#AND_logic_gatehttps://d2vlcm61l7u1fs.cloudfront.net/media%2F989%2F98947c65-7a7b-460d-ac91-a564a9f62f6e%2FphpshF46T.pngExtra outputs/inputs can be added by using additional gates, with more inputs.

author: FriedMule
author_rank: Frequent Contributor
timestamp: September 03, 2020, 07:44:09 pm
content: I have now tried to modify your great circuit a bit. I have done that to try to make power lached to the selected output and to avoid any limitation on the current on the push-switch. It may not be a great solution, but I have done my best. :-)I have changed the DPST push button to a simple SPST and replaced one of the LED's in series with an optocoupler.Top half of the circuit is for powering the input selector and the top 4 LEDs are just loads for the moment.I do not understand why you choose to put two LEDs in series to make a 7V voltage drop?Please take a look and understand that I am in no way saying that your circuit was flawed or anything, I am just trying to make my brain understand it and fit it to what I, maybe wrongly, think it does not do from your original drawing.I have lost a great amount of data on hard drive, so I can only present a simulation for the moment:http://tinyurl.com/yyo7grhk

author: Zero999
author_rank: Super Contributor
timestamp: September 03, 2020, 08:52:18 pm
content: Yuck, that schematic is quite difficult to follow. Doesn't that simulator support labels? It makes it much easier to read.What's the point of the opto-couplers? Nothing seems to be isolated. Why not drive the LEDs directly from the transistors?I thought your LEDs used 700mA. If so, why use J-FET current sinks which only supply 8mA?All of the circuits I've posted use SPST push button switches. None of them have DPDT push button switches. I think you're confused with the relay contacts, or someone else's circuit.I put two LEDs in series, because I thoughtyour LEDs have a voltage drop of 6V to 7V, in which case they would really be two LEDs in series, inside the same package. Perhaps I misunderstood, but it doesn't matter, the principle behind the circuit is the same.The most important thing is: do you now understand how it works?

author: FriedMule
author_rank: Frequent Contributor
timestamp: September 04, 2020, 12:34:06 am
content: Quote from: Zero999 on September 03, 2020, 08:52:18 pmYes it's a mess! And yes, just found out you can make notes, sorry!Quote from: Zero999 on September 03, 2020, 08:52:18 pmThe isolation is not my goal here I was thinking of the control of the current on the input chips, but yes forget that, was just not thinking. Blame lack of routine in electronic for that! :-)Quote from: Zero999 on September 03, 2020, 08:52:18 pmAt max does my input selector use 700mA but that's an old calculation where a LED was included to indicate selected input."My" choice for using J-Fets is not mine but simply a copy of a circuit that should be able to deliver a "dimmable" constant current, I have chosen that because I do not know better. All I need is a super simple discrete constant current, that do not get influenced by Voltage ripple over i.e. 5VQuote from: Zero999 on September 03, 2020, 08:52:18 pmI did mistakenly read your SW S1, S2 and so on as a Push button switch with 4 pins or DPST, I thought your separate power was switched on a separate on in the button.Quote from: Zero999 on September 03, 2020, 08:52:18 pmYes I do now think so. But do I understand correctly that I easily can maintain one of your LEDs and put my load in series?I am so happy that you spend all that time to help and teach!! :-)

author: Zero999
author_rank: Super Contributor
timestamp: September 07, 2020, 09:38:45 pm
content: You won't get a 700mA constant current source, using a J-FET, like that.My advice is to use the MOSFET design, but with relays. Replace R3, R6, R9 & R12 and the LEDs with relay coils and flyback diodes and power the circuit of whatever, voltage the relay coils require. Assuming the relays don't use much current, say under 200mA, the old 2N7000 could be used for M1 to M4.The relays can then be used to switch whatever you want from audio signals, to LEDs.

author: Zero999
author_rank: Super Contributor
timestamp: September 27, 2023, 07:59:54 am
content: I thought about this again for a project at work. It won't be used, since a more simpler solution which didn't involve switching has been selected.The problem with all of the transistor/relay-diode and logic gate circuits posted is, the number of inputs or diodes/resistors doubles for each channel added. The flip-flop solution doesn't, assuming it works, I haven't looked at it for long enough to determine that.This circuit doesn't have that problem. It just uses relays. The downside is, it probably won't work, with free-wheeling diodes in parallel with the relay coils, since it will delay the turn-off for too long. To reduce arcing and prolong contact life, add an RC snubber, with a resistor several times the voltage rating of the coil resistance and a capacitor, which will store enough of the energy in the coil, without being subject to over voltage, can be added across the contacts all connected in series.

author: Benta
author_rank: Super Contributor
timestamp: September 27, 2023, 07:39:21 pm
content: Here's a different idea (used it myself in a different application).By encoding to binary and decoding again, it's 100% certain that two buttons (or inputs) cannot be active at the same time. And latching is much simpler.For 4 buttons, remove U3A and replace the 4051 with a 4052. This will give you stereo capability from the start.Very nice is that you don't need extra debouncing, U5 will do that for you.SWx inputs will need pull-down resistors.More comments in the schematic.If you don't need bipolar signal capability, connect VEE to GND.

author: Zero999
author_rank: Super Contributor
timestamp: September 27, 2023, 09:53:45 pm
content: Is there any need for debouncing this circuit? Once the switch is pressed, the appropriate output will latch high on the first pulse. It wouldn't matter if the switch bounced.Yes, I could do it that way, but the requirement was for relays, which are isolated. I'd just use a microcontroller, if I wanted to use analogue switches.Preventing more than one on being at a time wasn't a requirement, but I can see how it would be for some applications. It might be possible to implement that with this circuit, by adding resistors and capacitors.This is a bit of a cludge but could be made to work.R1 should limit the current so only one relay can latch on at a time.R2 only needs to charge C1 and shouldn't provide enough current to latch a relay. C1 just needs to store enough energy to activate one relay.An MCU might be a better idea.

author: Benta
author_rank: Super Contributor
timestamp: September 27, 2023, 11:08:28 pm
content: Groan...And here's the four-button version, just for fun.The output demux can be anything, also a LED or relay driver or whatever.The point is, it fulfils the basic "radio button" functionality in a simple, cheap and understandable way.Your isolation requirement I found nowhere in this thread, but OK, it's late I may have missed it.Happy "clackety-clack" (expensive, BTW, both in parts and in power).Just for fun, here's the four-button version:

author: RJSV
author_rank: Super Contributor
timestamp: September 28, 2023, 05:04:11 am
content: Ok, OK, OK; Sanity check here, folks....whew! At about the 40rh iteration and people reading still don't have a good overview, of problem / question / goals.Then, suddenly, oh, its for audio. FORGET THE COMPLEX ELECTRONICS, for one second: (unless you wish to learn, that's ok). Bouncing from one partially stated 'function', to another, incomplete and complex solution._________________________________________________________________________________________________________________Is that switch-set with one down, and stays like that, until some other push button is pressed ?I mean, like your '67 Chevy vintage car radio has ?And, where did that switch come from, salvaged out of ?Sounds like you want a multiple selector, for audio, but then you imply audio / constant current, using non-existing symbol 'CC'.I know of a rotary, 6 position switch, that likely can handle 750 mA, and even better has TWO decks, so has DP6T, That's double pole, six throw. And has nice 'chicken head' style knob.

author: Zero999
author_rank: Super Contributor
timestamp: September 28, 2023, 07:16:03 am
content: Quote from: Benta on September 27, 2023, 11:08:28 pmYou didn't miss it, just the fact it was designed for a different application where I work, which I mentioned in the post. The idea was to use it for switching between different strain gauge signals. Connecting more than one simultaniously wouldn't have done any harm, even though the reading would have been invaid. I decided to post it here, as it's not needed, but I thought someone else might find it useful.Quote from: RJSV on September 28, 2023, 05:04:11 amThat's pretty much it. A switch like the one on an old radio. There's some level of ambiguity. It's not clear whether it's for LEDs, running off a constant current supply, or audio.