Can you not simply drive one of the LEDs from an inverter? That will ensure one of the LEDs is always on.It must be something pretty simple to do but i'm bit confused how.
I have green and red LED and i want the red one be turned on while GPIO is LOW and green turned on when i put GPIO HIGH.
What circuit should i make? : )
Here is an idea to reduce the quiescent current with LEDs off. Takes advantage of the required voltage drop across the LEDs for conduction. The 150 ohm can probably be larger but it shows the concept.This is how I've done it. It allows the LEDs to show red or green or be off, and if you use the right kind of component, with 2 LEDs in a 2-pin package, it can show a plausible yellow if you feed it a.c. I acknowledge that it draws power in every state, and more than an LED typically needs. You can improve this by replacing the resistors with an op-amp output set up as a 2.5V buffer, and then use a single 33 Ohm resistor in series with the LEDs. If you have many LEDs to drive the same way, add a transistor pair between the op-amp and the LEDs.
View attachment 196124
That may work but consumes a minimum of 20 mA even if the driving pin goes high impedance...This is how I've done it. It allows the LEDs to show red or green or be off, and if you use the right kind of component, with 2 LEDs in a 2-pin package, it can show a plausible yellow if you feed it a.c. I acknowledge that it draws power in every state, and more than an LED typically needs. You can improve this by replacing the resistors with an op-amp output set up as a 2.5V buffer, and then use a single 33 Ohm resistor in series with the LEDs. If you have many LEDs to drive the same way, add a transistor pair between the op-amp and the LEDs.
View attachment 196124
The quiescent current with both LEDs off is not the problem. This current is less than the designed LED current. So, this current does not increase the requirements on the power supply. The issue is the added current when one of the LEDs is on. This is the voltage drop of the LED divided by 120 ohms. The resistor shunts the LED voltage. This shunt current added to the LED current determines the max load on the power supply.That may work but consumes a minimum of 20 mA even if the driving pin goes high impedance...
I don't understand your point here which is probably a good one. Could you explain it more?In that application, it was also a great advantage to have one lead of each component be at the same voltage. In that case, the two-resistor design won't work anyway.
Sigh. OK, this is in the important field of model railroads. I found these bicolor LEDs, and thought they'd be a good way to make a device called a "searchlight signal". This has a single lens and light bulb (though there are often as many as 3 signal heads on a single mast) which has a movable filter that can make the displayed light red, green or amber. These LEDs can show all 3 colors, if you aren't too fussy about the actual hues that appear--there are actual standards for railroad signals, and the most common LEDs aren't right! What I wanted to do was to bend one lead of an LED into a hook which I'd solder around the mast, and that would provide a firm support and also an electric contact. The other lead would have a wire attached, which would bring the current to the signal, positive, negative or alternating.I don't understand your point here which is probably a good one. Could you explain it more?
More can be found here.Sigh. OK, this is in the important field of model railroads. I found these bicolor LEDs, and thought they'd be a good way to make a device called a "searchlight signal". This has a single lens and light bulb (though there are often as many as 3 signal heads on a single mast) which has a movable filter that can make the displayed light red, green or amber. These LEDs can show all 3 colors, if you aren't too fussy about the actual hues that appear--there are actual standards for railroad signals, and the most common LEDs aren't right! What I wanted to do was to bend one lead of an LED into a hook which I'd solder around the mast, and that would provide a firm support and also an electric contact. The other lead would have a wire attached, which would bring the current to the signal, positive, negative or alternating.
It should be clear that to make this work, all the LEDs on a particular mast must have a common lead. That could be ground, but then I'd need a negative supply, which I wanted to avoid, so I set up the pseudo-ground at 2.5V. I feed that to the signal mast, and apply 0V or 5V or an alternating voltage to each of the LEDs. There has to be a resistor in series with each line, but not a large one, because the voltage is only 2.5, from the pseudo-ground to either Vcc or ground. 33 Ohms seems to be about right. So here are a couple of pictures, showing the back of a signal and then the front. Aren't you glad you asked?View attachment 196153View attachment 196154
The BBC has blocked me from watching this. I am in the UK and I have a BBC TV licence. WTF?More can be found here.
How cThe BBC has blocked me from watching this. I am in the UK and I have a BBC TV licence. WTF?
Again, why not simply add an inverter? Feed the GPIO into a CMOS inverter then drive one LED from the GPIO and the other form the output of the inverter, each LED having a series resistor. Only one LED will every consume current at any one time and all of that current will be through the LED, nothing wasted.Ou, you have written more than i expected : ) I need some time to read all of this Thnx guys.