simple switch led thingie..

I'm completely at a loss of words!

I want to build a circuit that has 1 button/connecting element and two LEDs.

No connection: LED1 On | LED2 Off Conection: LED1 Off | LED2 On

I would google for it but I don't know how this is called! All I managed so far was using two transistors (pnp & npn) to build a circuit that when connected to gnd does led 1 and when connected to +V does led 2, but no connection, no light.

Its all for a door switch in the sense of door open = red light, door closed = green light.

Best regards, Jazzar

An SPDT switch will switch between two 'on' states.

Or you could use any switch connected to an arduino, and have the arduino turn the leds on and off.

its a starting point, you should be able to figure it out from there


I was having the same problem but now seems to be solved.

The parallel 10kohm connection doesnt work in many cases, and the analog pins still fluctuate when the signal is off. This can be bad when you need not only a 1 but also a steady 0.

Heres what I did: If you are using a breadboard, connect the two main ground lines of the bread board(blue lines) together. (one of them is connected to your arduino ground, right?) Then, hook up the "other" ground line to the "second" ground port of your (hopefully new) arduino. This way your "analog in" will remain steady at NOT zero, but at a constant value..which you can at least convert to a "zero" in your program.

But theres a soltn to that too...use the digital in of Arduino and you should get a 0 and 1 with no more fluctuations, provided you are running your breadboard the way I described above.

Hope this helps you. :D