Author Topic: Please help me understand this circuit  (Read 2847 times)

0 Members and 1 Guest are viewing this topic.

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Please help me understand this circuit
« on: January 26, 2019, 04:56:07 pm »
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
 

Offline JackJones

  • Regular Contributor
  • *
  • Posts: 229
  • Country: fi
Re: Please help me understand this circuit
« Reply #1 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
« Last Edit: January 26, 2019, 05:05:55 pm by JackJones »
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11892
  • Country: us
Re: Please help me understand this circuit
« Reply #2 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.
 
The following users thanked this post: Moriambar

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Please help me understand this circuit
« Reply #3 on: January 26, 2019, 05:25:38 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.

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
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Please help me understand this circuit
« Reply #4 on: January 26, 2019, 05:28:21 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

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
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Please help me understand this circuit
« Reply #5 on: January 26, 2019, 05:40:06 pm »
Identical performance even in two LEDs from the same batch would be rather surprising because of slight differences that are normal in mass production.  Ideally, each LED should have a current-limiting resistor with a value selected for the desired behavior.  Hard-wiring LEDs in parallel is essentially the "worst-case" for powering multiple LEDs. 

Do you have enough supply voltage to connect the LEDs in series instead of parallel?  That would at least ensure that the same current was going through each LED.  That is a very common scheme used for LED replacement gadgets that operate on high voltages (like LED light bulbs that operate on mains voltage, etc.)

Changing the current through an LED is not a popular way of controlling light output. Again, because of slight differences between LEDs, it is difficult to get consistent results.  That is why PWM is commonly used for controlling LED brightness.
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Please help me understand this circuit
« Reply #6 on: January 26, 2019, 05:59:32 pm »
You can put the LEDs in series... and reduce 720R.
The further a society drifts from truth, the more it will hate those who speak it.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: Please help me understand this circuit
« Reply #7 on: January 26, 2019, 06:08:10 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

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
They might have slightly different wavelengths which will cause them to have different forward voltages. Try powering them up, each with its own series resistor to do a side by side comparison. Are they exactly the same colour and brightness? If not, it's even more likely you have totally different parts. Even if they look the same, there can still be enough difference in the semiconductor junctions to make only one of them light, when connected in parallel.

Another issue with that circuit is the sharp turn on of the BJT. Try this which will ramp up more slowly.

And please don't post monster image files. Spend the time to do a little image processing to get the size down. I made the attached schematic from your file by converting it to monochrome and scaling it down to a sensible size.
 
The following users thanked this post: Moriambar

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11892
  • Country: us
Re: Please help me understand this circuit
« Reply #8 on: January 26, 2019, 06:15:58 pm »
Regarding the pnp discharging solution: The pull-up has to be stronger than the pull-down, right?

Yes. The pull down resistor has to be a small enough value to turn the PNP on when the switch is open. The pull up resistor has to be smaller than the pull down resistor so that it pulls the base high and turns the PNP off.
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Please help me understand this circuit
« Reply #9 on: January 26, 2019, 06:25:31 pm »
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?

Reduce C by some orders of magnitude :-)

The further a society drifts from truth, the more it will hate those who speak it.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Please help me understand this circuit
« Reply #10 on: January 26, 2019, 06:34:45 pm »
Thanks to all.

I understand what you say about the LED differences. I will try Zero999's circuit tomorrow and then try to tweak values etc.

Sorry for the monster image file.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Please help me understand this circuit
« Reply #11 on: January 26, 2019, 06:37:10 pm »

Changing the current through an LED is not a popular way of controlling light output. Again, because of slight differences between LEDs, it is difficult to get consistent results.  That is why PWM is commonly used for controlling LED brightness.

Pardon my noobeness, but if the slight differences are what prevent us to get consistent results, then how does PWM give consistency?
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Please help me understand this circuit
« Reply #12 on: January 26, 2019, 07:17:00 pm »
if the slight differences are what prevent us to get consistent results, then how does PWM give consistency?

The LEDs are driven to a consistent point in their operating range, and then "chopped" in time which is very consistent and repeatable.

If you had a reliable way of measuring brightness, you could experiment by drawing voltage/current vs. brightness curves for various LED examples.
 
The following users thanked this post: Moriambar

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: Please help me understand this circuit
« Reply #13 on: January 27, 2019, 07:32:08 am »
If you use a SPDT switch, you can control both the turn on time (via R1) and the turn off time (via R2).
Maybe start with R1=10K, R2=1K and C1=100nF.

   OR

Just add a resistor in parallel with the capacitor in your original circuit. 
You would need to keep in mind the series current when the switch is on if you do this.

   
« Last Edit: January 27, 2019, 07:39:42 am by MarkF »
 
The following users thanked this post: Richard Crowley, Moriambar

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3365
  • Country: nl
Re: Please help me understand this circuit
« Reply #14 on: January 27, 2019, 08:13:52 am »
I've added an PNP transistor and a resistor to drain the 1mF capacitor when the switch opens.
I've also attached the project in KiCad format.
So instead of everybody re-drawing the whole thing you can take this project, modify it a bit and post a screenshot :)

KiCad is fully Free and Open Source Software. No hidden agenda's, no misty stealing of your intellectual property, no artificial limits on for example board size or number of pins. No limited time edition.

And it is being improved significantly every year. Do not believe a 2 year old review :)
« Last Edit: January 27, 2019, 08:16:55 am by Doctorandus_P »
 
The following users thanked this post: Moriambar

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19528
  • Country: gb
  • 0999
Re: Please help me understand this circuit
« Reply #15 on: January 27, 2019, 10:10:08 am »
I've added an PNP transistor and a resistor to drain the 1mF capacitor when the switch opens.
I've also attached the project in KiCad format.
So instead of everybody re-drawing the whole thing you can take this project, modify it a bit and post a screenshot :)

KiCad is fully Free and Open Source Software. No hidden agenda's, no misty stealing of your intellectual property, no artificial limits on for example board size or number of pins. No limited time edition.

And it is being improved significantly every year. Do not believe a 2 year old review :)
I haven't used KiCAD for a couple of years. The last time was a total fail. I tried to open a project posted by someone else here and it mangled it badly because the libraries on my install were different to theirs.

Original

https://www.eevblog.com/forum/beginners/best-way-to-amplify-a-sine-wave-without-distorsion/msg1125940/#msg1125940

What it looked like when I opened it.

https://www.eevblog.com/forum/beginners/best-way-to-amplify-a-sine-wave-without-distorsion/msg1126604/#msg1126604

I don't have KiCAD installed on this machine and will try opening your attachments later.
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Please help me understand this circuit
« Reply #16 on: January 27, 2019, 11:47:18 am »
If you use a SPDT switch, you can control both the turn on time (via R1) and the turn off time (via R2).
Maybe start with R1=10K, R2=1K and C1=100nF.

   OR

Just add a resistor in parallel with the capacitor in your original circuit. 
You would need to keep in mind the series current when the switch is on if you do this.


thanks, the spdt switch was actually one of the original ideas, but I was trying to build it without it, something more "automatic" in order to have a temporary pushbutton instead of a proper switch.

Nice idea though
« Last Edit: January 27, 2019, 11:49:29 am by Moriambar »
 

Offline MoriambarTopic starter

  • Supporter
  • ****
  • Posts: 490
  • Country: it
Re: Please help me understand this circuit
« Reply #17 on: January 27, 2019, 11:49:56 am »
I've added an PNP transistor and a resistor to drain the 1mF capacitor when the switch opens.
I've also attached the project in KiCad format.
So instead of everybody re-drawing the whole thing you can take this project, modify it a bit and post a screenshot :)

KiCad is fully Free and Open Source Software. No hidden agenda's, no misty stealing of your intellectual property, no artificial limits on for example board size or number of pins. No limited time edition.

And it is being improved significantly every year. Do not believe a 2 year old review :)

thanks, I'll try this as soon as I can
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3365
  • Country: nl
Re: Please help me understand this circuit
« Reply #18 on: January 27, 2019, 12:45:27 pm »
I haven't used KiCAD for a couple of years. The last time was a total fail. I tried to open a project posted by someone else here and it mangled it badly because the libraries on my install were different to theirs.

I don't have KiCAD installed on this machine and will try opening your attachments later.

KiCad has had it's share of bumps but inconsistencies are getting less.
KiCad has now reached V5 late last year which was a very big improvement, but as a consequence incompatibilities with some hardware have turned up, wich is why it's been bumped to V5.0.2 pretty fast after V5.0.

The little project above is made with only standard symbols from the library (which has expanded enourmously in the last few years, Even DigiKey is making libraries for KiCad).
https://www.digikey.com/en/resources/design-tools/kicad

In the zipped file there is a [projectname]-cache.lib in which the symbols which are used in the schematic are cached. So as long as you distribute this file with your project, the mess you showed should not happen anymore.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: Please help me understand this circuit
« Reply #19 on: January 27, 2019, 03:45:59 pm »
Just a note to forgo any confusion.
I use: 
   mF == milliF == 10-3
   uF == microF == 10-6
   nF == nanoF  == 10-9
   pF == picoF  == 10-12

 
The following users thanked this post: tooki

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: Please help me understand this circuit
« Reply #20 on: January 27, 2019, 03:54:36 pm »
If you use a SPDT switch, you can control both the turn on time (via R1) and the turn off time (via R2).
Maybe start with R1=10K, R2=1K and C1=100nF.

   OR

Just add a resistor in parallel with the capacitor in your original circuit. 
You would need to keep in mind the series current when the switch is on if you do this.


thanks, the spdt switch was actually one of the original ideas, but I was trying to build it without it, something more "automatic" in order to have a temporary pushbutton instead of a proper switch.

Nice idea though

You do know they make momentary SPDT switches?
Example:
   https://www.mouser.com/ProductDetail/E-Switch/FS5700SPMT2B2M1QEH?qs=sGAEpiMZZMvxtGF7dlGNpp%252bW2sLS6zO28qxKefzNuxg%3d
 

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Please help me understand this circuit
« Reply #21 on: January 27, 2019, 08:10:52 pm »
   uF == microF == 10-6
     µF == microF == 10-6
The further a society drifts from truth, the more it will hate those who speak it.
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2550
  • Country: us
Re: Please help me understand this circuit
« Reply #22 on: January 27, 2019, 08:27:01 pm »
   uF == microF == 10-6
     µF == microF == 10-6
Yes. But, trying not to use special characters.
 

Offline Audioguru

  • Super Contributor
  • ***
  • Posts: 1507
  • Country: ca
Re: Please help me understand this circuit
« Reply #23 on: January 27, 2019, 08:39:28 pm »
All the cheap Chinese LED flashlights that use 24 white LEDs have all the LEDs in parallel and they all look to be at the same brightness. Do they hire somebody to test them all and sort them into matched piles?
 

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: Please help me understand this circuit
« Reply #24 on: January 27, 2019, 08:47:12 pm »
All the cheap Chinese LED flashlights that use 24 white LEDs have all the LEDs in parallel and they all look to be at the same brightness. Do they hire somebody to test them all and sort them into matched piles?

1) Machines on the assembly line sort the dice into brightness "bins".  All semiconductors go through extensive testing on the line. LEDs are no exception.

2) Those dice only appear to be"matched" at the beginning of their brief life-span.  Watch a few videos from BigClive to see how well they fare over the longer term.
« Last Edit: January 27, 2019, 08:50:03 pm by Richard Crowley »
 
The following users thanked this post: tooki


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf