Electronics > Beginners
Please help me understand this circuit
Moriambar:
Hi.
I was searching for a circuit to be able to slowly turn up an LED (increasing the current) by pressing a pushbutton. I wanted to opt out microcontrollers since it seems kind of overkill for this simple project. Nevertheless I stumbled upon the circuit in black in the picture below. It works perfectly. Then I thought of adding a second LED and added basically the green part. The funny thing is that now only one of the two LEDs work, still displaying the correct behaviour.
So I think that I kinda do not understand what's going on, and cannot figure it out. Why is the second led off? Does this hide some deep hole in my knowledge which I'm not aware about?
Also as a bonus: when I power the circuit off, a residual voltage/charge stays on the cap and it's enough to make the LED bright for a long time. How can I safely (if possible) discharge the cap when the switch is open?
Cheers
JackJones:
Different coloured leds have different forward voltages. Red leds have the lowest, usually about 1.8ish volts, while green and blue are closer to 2.5v. So if you have for example a red led in parallel with a green one, the voltage across both the leds will be the forward voltage of the red led, 1.8v. Too low to turn the green on.
If both the leds had the same forward voltage, both of them would light up. If you want both of the different colours to light up, you should use a separate resistor for both of them
IanB:
In general you cannot put two LEDs in parallel unless they are completely identical. If there is any imbalance in the properties of the diodes then one diode will take more current than the other and they will not share current equally. You could fix this problem by having two resistors, one per LED.
To discharge the capacitor when the switch is open I think you need a second transistor. You could put a PNP transistor across the capacitor to discharge it (with a current limiting resistor). When the switch is pressed you would pull up the PNP base through a base resistor, which would turn the PNP off and let the capacitor charge up. When you release the switch the PNP would turn on through a base pull down resistor and discharge the capacitor.
Moriambar:
--- Quote from: IanB on January 26, 2019, 05:08:47 pm ---In general you cannot put two LEDs in parallel unless they are completely identical. If there is any imbalance in the properties of the diodes then one diode will take more current than the other and they will not share current equally. You could fix this problem by having two resistors, one per LED.
To discharge the capacitor when the switch is open I think you need a second transistor. You could put a PNP transistor across the capacitor to discharge it (with a current limiting resistor). When the switch is pressed you would pull up the PNP base through a base resistor, which would turn the PNP off and let the capacitor charge up. When you release the switch the PNP would turn on through a base pull down resistor and discharge the capacitor.
--- End quote ---
Thanks. So the led being a bit different do not exhibit the same behaviour and current prefers one. Indeed the two-resistor solution works.
Regarding the pnp discharging solution: The pull-up has to be stronger than the pull-down, right?
Cheers
Moriambar:
--- Quote from: JackJones on January 26, 2019, 05:02:42 pm ---Different coloured leds have different forward voltages. Red leds have the lowest, usually about 1.8ish volts, while green and blue are closer to 2.5v. So if you have for example a red led in parallel with a green one, the voltage across both the leds will be the forward voltage of the red led, 1.8v. Too low to turn the green on.
If both the leds had the same forward voltage, both of them would light up. If you want both of the different colours to light up, you should use a separate resistor for both of them
--- End quote ---
They are both red LEDs. I think they're not from the same batch though or have small differences that make them not light up together.
Cheers
Navigation
[0] Message Index
[#] Next page
Go to full version