Author Options:

LED relay switch... maybe? Answered

first off thanks for looking and helping if you decide to. I have only been working with computer electronic in a DIY since for about a year. My question is, do I need a relay for what I am trying accomplish and if so what kind? What I am trying to accomplish is: I have two push buttons (momentary contract switches). And I want it so that when I press the first button (orange) the first LED turns on. And when I hit the second button (blue) the first LED turns off and the second one turns on. Kind of like a toggle but only with the LEDs. The buttons are also connected to a board that is connected to my computer via USB. Which is where the power is coming from for the LEDs. I can use another source if necessary. I drew a little picture to help describe what I am trying to describe.


I think with all that I've looked into I need to do a 556 circuit. I am still trying to understand it all but I am working on it. What I hope I can do, correct if I am wrong please. I will make the first push-to-make button connected to trigger A but also connected to reset B. And the second button to trigger B and reset A. So in my little head I believe that I can have the output A be triggered by the first switch and when you press the second switch it will reset A (to turn it off). And the trigger B and output B. Blah none of this makes since I am sure.

Sounds like you need dpdt latching relay.

Or you could get off with a spdt latching relay if they were the same voltage.

They are the same voltage. I will look into how they work. Thanks!

For the record, on that diagram the ground arrows are in fact returns to my already made chip. The main thing I need is for the orange switch to turn on the orange leds but still make the connection with the other chip (the HID chip). And the blue to do the same thing, but turn off the orange lights when the blue leds turn on. And then if you press the orange the blue turns off etc... etc..


Wow, I just tried to open a can of worms that I thought read easy open. Then I find myself with a chainsaw, confused and weird. :) I looked into the CMOS chip, but they are very involved. I guess this is why people go to school for this stuff. I'll keep reading and hope I figure this out. Thanks for all your help!

they actually are not. you can wire them as if they were relays without any extra components design something with relay and we'll show you how to wire a chip instead

It is true that a DPDT relay will be simpler to wire up, if it is a latching relay, then the Logic chips mentioned. But it will also consume a lot more power. The CMOS chips (many operate between 1.1 and 5 v), those that are flip-flops with a latching feature would be my own personal choice.

no need in relays use some CMOS (90xx / 94xx / 74HCxx) or TTL (74LSxx / 74Fxx) chips for the logic the TTLs and 74HC cmos can sure drive LEDs directly the other CMOS maybe not - use allmost any small transistor like C945 or 547 if using some leds (more load) then use small transistor

It'd be simpler for a beginner to make a relay circuit. I'd use a flip-flop, but a relay is really quite easy to do.

Could you point me to a page that explains how these work? So that I can see if they work with what I need. Thanks for the help.

this device is much like a relay - its a switch that is controlled by another input. but its electronic (silent and takes very small current) and for small currents only in each of the 4 units inside there are 2 wires coming from the sides. they act as 2 switch contacts the voltage on them is what you want and is allowed to change smoothly (between some min and max voltage). for example you give it a voltage rising smoothly from 0 to 5 V. you get the same on the output if the switch is closed and nothing (disconnect) when it is open. (note that nothing does not mean 0 V. it means it'll be anything you connect to it from elsewhere). if you give it sound signal you get it clear on the output too (unless you get into other trouble like clipping or frequency response issues) there is also wire coming from the top. this is the control. if you give it 'high' voltage the switch closes and if you give 'low' it opens there is also 'not enable' wire ('not' is stated by the line above the word 'enable'). if you give it high voltage it disables (not enables) the entire chip and opens all switches. use it when you need to switch off that part of the circuit (for example 'silence' or 'stand by' mode). connect it to VEE if you dont need this option the effects of the inputs and their combinations are written in short form in the 'truth table' in the doc the component can work only with 'high' (1) and 'low' (0) voltage. if you give it medium voltage (between high and low) it may consider it as high or low (random each time or constant for the component) or randomly 'flicker' between them or make other unknown stuff. (some components may get damaged from getting medium voltage for long time. most dont) the allways-on power supply for the component are VCC (the + - connect it to 5 V or what you need - check the document to see which voltages are accepted) and VEE (the - - you connect it to earth usually. sometimes its useful to connect it to negative voltage instead but thats not needed in most circuits). for the control inputs any voltage between VEE and VIL is considered low and between VIH and VCC is considered high do not give the component control voltages lower than the VEE or higher than the VCC you give it. you may damage the component otherwise even if the voltages are ok with the range in the docs. this kind of device is called digital. this means that the device can work only with 2 distinct levels of voltage - 'low' and 'high'. for example if you give this component a slow rising voltage from 0 to 5 V the switch is off at the beginning (when the control voltage is below VIL) then it gets erratic (may go 'flickering' in the output or output unknown voltage from the switch or malfunction otherwise) when the voltage is medium and then closes the switch ok when the voltage is between VIH and VCC. if you give such component a sound signal it will output mostly noise since it tries to switch as sharp as possible between 2 distinct levels and does not work with the exact shape of the signal pure digital components (like gates and flip flops) output only high or low voltage. so when you connect a circuit with compatible digital components only then the voltages are allways ok and you usually dont need to bother about that. compatible means that the voltage one outputs (VOH VOL) is acceptable for others (VCC VIH VIL VEE). its allways the case when using components of the same group (90 / 94 / 74HC . . . . ) and needs to be manually matched if you mix components of various groups the component in ur example is both digital and analog. it is analog when it comes to the switches and digital when it comes to the control inputs i hope now you can see the difference between digital and analog when your circuit uses only 2 levels of voltage for each point (like 'on' or 'off' for LED without medium options) use digital components only. go read on wikipedia on how logic gates work. find the docs for basic inverter / and / or / nand / nxor etc gates and see if you understand how to use them. find such components (from some electronic stuff) and try to see yourself how they work ask !

It's a very simple circuit, you have the switch which leads to the relay power and the LED, you may wish to put the LED in series with a resistor to keep it from damage, that should work just fine, what kind of voltage/amperage is the circuit using to do this.

The switch I just put up is a bit cleaner. I'm not sure if the is a SPDT or something different. The final goal is to have the LEDs stay on even if one of the buttons are not on. Thus having the LED power separated from the switches power.


So you want something that lights when the relay is on, even if the switch isn't being pressed? Well the switch would have to be on to keep the relay energized as in on, I don't understand the seperate power source for the leds, if you're powering the relays to turn on then it's separate from the rest of the circuit anyway...

connect like this, USB + -> LED -> push button -> USB -

oh, sorry, i thought he just wanted to turn the LEDs on one at a time...