06-07-2005, 11:05 PM | #1 (permalink) |
Upright
|
LED Switch
I wanted to create a circuit out of a keyswitch. When the key is in position 1, the green light is on. When the key is turned to position 2, the green light turns off, and a red light turns on. I drew up a mock up of how this is supposed to work. The lower left would be the power supply.
But I don't know how to turn off the green light when the key is in position 2. Does anyone know how? |
06-08-2005, 12:04 AM | #2 (permalink) |
zomgomgomgomgomgomg
Location: Fauxenix, Azerona
|
Well, two things. First of all, do you have the proper resistors in series with the LEDs? Otherwise they'll burn out pretty quickly.
Second, if you just connect a wire from the positive terminal of your power supply to the LED, and the negative terminal of the LED to position 2 on the switch, it should work fine...I'll sketch a circuit for you and see if I can find a spot to upload it. Edit: There ya go...make sense? Your just switching which LED gets to see the complete circuit.
__________________
twisted no more Last edited by telekinetic; 06-08-2005 at 12:12 AM.. |
06-08-2005, 01:28 AM | #3 (permalink) |
Upright
|
That's really ingenious, but the keyswitch doesn't quite work like that.
Here's what it looks like... Basically all the keyswitch does is complete the circuit between the two nodes, not switch which node gets active. Do you think it's still possible? Last edited by reddog418; 06-08-2005 at 01:33 AM.. |
06-08-2005, 08:19 AM | #4 (permalink) |
Psycho
Location: North America
|
This is what you want, excuse the poorly drawn resistors
http://img19.imagevenue.com/img.php?..._schematic.JPG Last edited by catback; 06-08-2005 at 08:22 AM.. |
06-08-2005, 11:21 PM | #6 (permalink) |
Junkie
Location: San Francisco
|
nevermind for now, perhaps will post later
__________________
"Prohibition will work great injury to the cause of temperance. It is a species of intemperance within itself, for it goes beyond the bounds of reason in that it attempts to control a man's appetite by legislation, and makes a crime out of things that are not crimes. A Prohibition law strikes a blow at the very principles upon which our government was founded." --Abraham Lincoln Last edited by n0nsensical; 06-09-2005 at 12:04 AM.. |
06-09-2005, 02:01 AM | #7 (permalink) |
Very Insignificant Pawn
Location: Amsterdam, NL
|
catback's circuit should work if you get the resistor values right. It might work better if the LED with two resistors in the path has a diode added in series.
Idea is when the LED with one resistor is on (the LED with the switch in the path) the current is high enough to cause a voltage drop large enough to not allow the other LED to light. Adding a diode in series with this leg of the circuit might allow the two LEDs to have a similar brightness by not requiring the first resistor to be so large. |
06-14-2005, 07:13 PM | #8 (permalink) |
Insane
Location: Austin, TX
|
Utilizing pull-down/pull-up resistors like this can be very tricky. You might be better off using a TTL or CMOS inverter. The circuit would be pretty simple:
Click for big version The basic idea is that when the switch is in position 1 (and presumably closed), the inverter gets a high signal, so it outputs "0", and the red light goes off. At the same time, the green light is getting a signal, so it turns on. When the switch is in position 2 (and presumably open), the inverter is getting a low signal, so it outputs "1", and the red light turns on. At the same time, the green light is getting no signal, so it turns off. 3.3V TTL inverters are pretty cheap (you can get them on www.digikey.com for under a dollar, and probably from Radio Shack for under 5.) Power the circuit with two AA batteries and use some 240 ohm resistors to prevent the LEDs from burning out. If you can only find CMOS (5V) inverters, then power the circuit with three AA batteries (4.5V) and use 470 ohm resistors. The resistor values are approximations based on what I've acutally built before...I could be way off so be careful. Last edited by skaven; 06-14-2005 at 07:18 PM.. |
06-15-2005, 05:36 AM | #9 (permalink) |
Very Insignificant Pawn
Location: Amsterdam, NL
|
Nice one Skaven!
This may not be as good but might be something to play with. Values are not critical. R3 should be as large as possible but still allow Q1 to saturate. Untested! If anyone wants the circuit explained, I'd be happy to tell my version. Last edited by flat5; 08-08-2005 at 03:27 AM.. |
06-22-2005, 04:00 PM | #10 (permalink) |
Psycho
Location: North America
|
Honestly they are all great ways to accomplish the basic task but the best way would be to use a SPDT relay. Of course if this switch controls something electronic or something with high impedance one of our ways would be quieter. But if the switch controls something that needs a good amount of current a simple SPDT relay would be easiest. To each his own, the possibilities are endless.
|
06-23-2005, 01:59 AM | #11 (permalink) |
Very Insignificant Pawn
Location: Amsterdam, NL
|
Diplomacy aside:
The problem as stated is to switch between two LEDs. 20ma or less is typical. I happen to think (at this time) that my circuit is best because it will work off of a single supply voltage of 3 to 24 volts by changing the resistors (at the extreme voltage ends), and not requiring any extra current, to drive a relay, for example. For switching AC or dirty voltages and/or high current loads, yes, a relay is a very good choice. If you have a small low current relay handy and this is an automotive application then a relay is a good solution to the problem. Last edited by flat5; 06-27-2005 at 05:00 AM.. |
06-23-2005, 07:36 PM | #12 (permalink) |
Insane
Location: Austin, TX
|
I agree with flat5; a low-voltage, low-current circuit will be needed to drive the LEDs anyway...why not use a simple resistor/transistor network or a CMOS/TTL inverter to make the LEDs all part of one circuit with one input voltage requirement.
|
07-06-2005, 12:18 PM | #13 (permalink) | |
Psycho
Location: North America
|
Quote:
|
|
07-06-2005, 03:11 PM | #14 (permalink) |
Very Insignificant Pawn
Location: Amsterdam, NL
|
You're right, why just switch LEDs? But that was the stated problem.
You suggested two resistors. Which is very tricky to get right. (have you tried it) :-) I added one transistor but was unsure if it would work so added another resistor. |
07-06-2005, 06:18 PM | #15 (permalink) | |
Psycho
Location: North America
|
Quote:
|
|
07-09-2005, 03:23 PM | #18 (permalink) |
Very Insignificant Pawn
Location: Amsterdam, NL
|
Just Google on "circuits".
Or be more specific. Here was the first hit. http://www.aaroncake.net/circuits/index.asp another good site: http://users.pandora.be/educypedia/e...icaopening.htm Last edited by flat5; 07-10-2005 at 05:54 AM.. |
Tags |
led, switch |
|
|