ame
Posts: 3519
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: LEDs?

Thu Jul 29, 2021 10:10 pm

Craggus2000 wrote:
Thu Jul 29, 2021 9:43 pm
Craggus2000 wrote:
Tue Jul 27, 2021 3:16 pm
leds.png
So I made the circuit above, due to not wanting to mess with the original circuit as my first preference, and it works!

However... the after the Pi has shutdown the power led stays on extremely dim.

I've tried increasing the resistance between 5v and the transistor, and also between the transistor and the LEDs, but all it does is make the LEDs dimmer when operating. The dimness is still there after shutdown.

Any ideas?
You need a pull-up resistor on the base of the PNP transistor to hold it high when the NPN circuit is off. Try a 1k resistor or similar from the base of the PNP transistor to 5V.

User avatar
davidcoton
Posts: 6500
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LEDs?

Thu Jul 29, 2021 10:14 pm

ame wrote:
Thu Jul 29, 2021 10:10 pm
Craggus2000 wrote:
Thu Jul 29, 2021 9:43 pm
Craggus2000 wrote:
Tue Jul 27, 2021 3:16 pm
leds.png
So I made the circuit above, due to not wanting to mess with the original circuit as my first preference, and it works!

However... the after the Pi has shutdown the power led stays on extremely dim.

I've tried increasing the resistance between 5v and the transistor, and also between the transistor and the LEDs, but all it does is make the LEDs dimmer when operating. The dimness is still there after shutdown.

Any ideas?
You need a pull-up resistor on the base of the PNP transistor to hold it high when the NPN circuit is off. Try a 1k resistor or similar from the base of the PNP transistor to 5V.
That will be marginal for switch-on (the voltage divider will only put <0.5V across the BC557 Emitter-base junction).
See my two post above. (BTW, if you said 10K not 1K, it would work reliably.)
Location: 345th cell on the right of the 210th row of L2 cache

ame
Posts: 3519
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: LEDs?

Thu Jul 29, 2021 10:23 pm

davidcoton wrote:
Thu Jul 29, 2021 10:14 pm
ame wrote:
Thu Jul 29, 2021 10:10 pm
Craggus2000 wrote:
Thu Jul 29, 2021 9:43 pm


So I made the circuit above, due to not wanting to mess with the original circuit as my first preference, and it works!

However... the after the Pi has shutdown the power led stays on extremely dim.

I've tried increasing the resistance between 5v and the transistor, and also between the transistor and the LEDs, but all it does is make the LEDs dimmer when operating. The dimness is still there after shutdown.

Any ideas?
You need a pull-up resistor on the base of the PNP transistor to hold it high when the NPN circuit is off. Try a 1k resistor or similar from the base of the PNP transistor to 5V.
That will be marginal for switch-on (the voltage divider will only put <0.5V across the BC557 Emitter-base junction).
See my two post above. (BTW, if you said 10K not 1K, it would work reliably.)
Marginal and reliable are highly dependent on what's in my junk pile, and a 10k resistor matches my description of "1k or similar". For a while everything was 4k7 because I had a lot of them lying around. For a switching circuit like this there is no need for finesse.

User avatar
Craggus2000
Posts: 21
Joined: Wed Jan 15, 2014 8:25 pm
Location: Essex, UK

Re: LEDs?

Fri Jul 30, 2021 7:19 am

davidcoton wrote:
Thu Jul 29, 2021 10:10 pm
Try a 10K resistor from the BC547 collector to 5V. The idea is to hold the BC557 off when there is (nominally) no signal to the BC547 base.
You mean like this?
leds2.jpg
leds2.jpg (128.65 KiB) Viewed 483 times
Craggus2000
"If it ain't broke, break it and make it better"

User avatar
davidcoton
Posts: 6500
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LEDs?

Fri Jul 30, 2021 8:37 am

Craggus2000 wrote:
Fri Jul 30, 2021 7:19 am
davidcoton wrote:
Thu Jul 29, 2021 10:10 pm
Try a 10K resistor from the BC547 collector to 5V. The idea is to hold the BC557 off when there is (nominally) no signal to the BC547 base.
You mean like this?

leds2.jpg
Yes
Location: 345th cell on the right of the 210th row of L2 cache

User avatar
davidcoton
Posts: 6500
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LEDs?

Fri Jul 30, 2021 8:43 am

ame wrote:
Thu Jul 29, 2021 10:23 pm
Marginal and reliable are highly dependent on what's in my junk pile, and a 10k resistor matches my description of "1k or similar". For a while everything was 4k7 because I had a lot of them lying around. For a switching circuit like this there is no need for finesse.
By that logic you would also put 100R as "1k or similar". That would certainly NOT work.

You are now demonstrating the difference between experimental bodging and electronic design. :lol: :roll: I have nothing against designing using what is in stock or the junk box, but it's a good idea to make sure that what you recommend to others has the best chance of working first time.
Location: 345th cell on the right of the 210th row of L2 cache

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14123
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: LEDs?

Fri Jul 30, 2021 10:33 am

ame wrote:
Thu Jul 29, 2021 10:02 pm
davidcoton wrote:
Wed Jul 28, 2021 5:04 pm
ame wrote:
Wed Jul 28, 2021 10:42 am
Or those LEDs could be in series, with one dropper resistor.
No, they couldn't. The Vf of these LEDs can be 2V5. hat is too high for reliable operation in series with a 5V supply.
Oh? Yes they could.
No, they could not, unless my calculator is broken 2.5 + 2.5 = 5V leaving exactly ZERO volt over the series resistor, so no current will flow.
Obviously theory and practice are two different things, so at very low currents the V-forward of the LED's might well be lower than 2.5V, and so can leave some voltage over the series resistor.

I would just try if two of these LEDs in series with a very low series resistor, say 100 ohm powered with 5V will give enough light.
Note that with very little or no voltage over the series resistor each tiny variance over the actual 5V supply will result in large brightness variants.

I would try to use LED's with a somewhat lower forward voltage, say 2.0 Volt.@ 10mA.

ame
Posts: 3519
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: LEDs?

Fri Jul 30, 2021 10:55 am

mahjongg wrote:
Fri Jul 30, 2021 10:33 am
ame wrote:
Thu Jul 29, 2021 10:02 pm
davidcoton wrote:
Wed Jul 28, 2021 5:04 pm


No, they couldn't. The Vf of these LEDs can be 2V5. hat is too high for reliable operation in series with a 5V supply.
Oh? Yes they could.
No, they could not, unless my calculator is broken 2.5 + 2.5 = 5V leaving exactly ZERO volt over the series resistor, so no current will flow.
Obviously theory and practice are two different things, so at very low currents the V-forward of the LED's might well be lower than 2.5V, and so can leave some voltage over the series resistor.

I would just try if two of these LEDs in series with a very low series resistor, say 100 ohm powered with 5V will give enough light.
Note that with very little or no voltage over the series resistor each tiny variance over the actual 5V supply will result in large brightness variants.

I would try to use LED's with a somewhat lower forward voltage, say 2.0 Volt.@ 10mA.
Oh? You claim they could not, and yet the OP has built it and it works.

According to the datasheet for these LEDs, typical Vf for yellow is 2.1V, and green is 2.2V. Not much headroom, I agree, but it ought to work, and, unsurprisingly, it does.

User avatar
Craggus2000
Posts: 21
Joined: Wed Jan 15, 2014 8:25 pm
Location: Essex, UK

Re: LEDs?

Fri Jul 30, 2021 3:36 pm

davidcoton wrote:
Fri Jul 30, 2021 8:37 am
Craggus2000 wrote:
Fri Jul 30, 2021 7:19 am
davidcoton wrote:
Thu Jul 29, 2021 10:10 pm
Try a 10K resistor from the BC547 collector to 5V. The idea is to hold the BC557 off when there is (nominally) no signal to the BC547 base.
You mean like this?

leds2.jpg
Yes
Thank you it works! Oddly it wasn't needed on the ACT led, just the Power led.

Next thing - I've noticed there's a really almost unnoticeable blink on the act led, almost every second, so faint that you can't see it from the top, only the side. Is this something I should be worried about trying to remedy? When fully assembled you'll only be able to see the leds from the top.

I've added resistance (47R) to the 5V line, which decreases it but doesn't erradicate it completely. Adding any more makes the LEDs too dim, and even makes the Power leds dim whenever the Act leds light.
Craggus2000
"If it ain't broke, break it and make it better"

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 14123
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: LEDs?

Sat Jul 31, 2021 10:26 pm

ame wrote:
mahjongg wrote:
Fri Jul 30, 2021 10:33 am
Oh? You claim they could not, and yet the OP has built it and it works.
theoretically two 2.5V LED's in series CAN NOT work when powered from 5V because 5V - 2.5V -2.5V = 0V (for the current limiting resistor) THAT IS A FACT, but then as I said what can't work in theory sometimes works in practice. It's the reason for the saying "ignorance can be bliss".

ame
Posts: 3519
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: LEDs?

Sat Jul 31, 2021 10:39 pm

mahjongg wrote:
Sat Jul 31, 2021 10:26 pm
ame wrote:
Oh? You claim they could not, and yet the OP has built it and it works.
theoretically two 2.5V LED's in series CAN NOT work when powered from 5V because 5V - 2.5V -2.5V = 0V (for the current limiting resistor) THAT IS A FACT, but then as I said what can't work in theory sometimes works in practice. It's the reason for the saying "ignorance can be bliss".
You must have missed this bit that I wrote:

According to the datasheet for these LEDs, typical Vf for yellow is 2.1V, and green is 2.2V. Not much headroom, I agree, but it ought to work, and, unsurprisingly, it does.

User avatar
davidcoton
Posts: 6500
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LEDs?

Sat Jul 31, 2021 11:26 pm

ame wrote:
Sat Jul 31, 2021 10:39 pm
mahjongg wrote:
Sat Jul 31, 2021 10:26 pm
ame wrote:
Oh? You claim they could not, and yet the OP has built it and it works.
theoretically two 2.5V LED's in series CAN NOT work when powered from 5V because 5V - 2.5V -2.5V = 0V (for the current limiting resistor) THAT IS A FACT, but then as I said what can't work in theory sometimes works in practice. It's the reason for the saying "ignorance can be bliss".
You must have missed this bit that I wrote:

According to the datasheet for these LEDs, typical Vf for yellow is 2.1V, and green is 2.2V. Not much headroom, I agree, but it ought to work, and, unsurprisingly, it does.
You must have missed the bit in Electronics 101 when they taught you to design for the worst case, not typical. It's fine for one-offs, when you can play around to make it work each time, but for production engineering it will get you into trouble (and possibly out of work) fast. It's worth learning the proper way to do it -- and if you want to help others, don't teach shortcuts without all the caveats about why they can cause trouble.
Location: 345th cell on the right of the 210th row of L2 cache

User avatar
Craggus2000
Posts: 21
Joined: Wed Jan 15, 2014 8:25 pm
Location: Essex, UK

Re: LEDs?

Thu Aug 19, 2021 11:43 am

Craggus2000 wrote:
Fri Jul 30, 2021 3:36 pm
davidcoton wrote:
Fri Jul 30, 2021 8:37 am
Craggus2000 wrote:
Fri Jul 30, 2021 7:19 am


You mean like this?

leds2.jpg
Yes
Thank you it works! Oddly it wasn't needed on the ACT led, just the Power led.

Next thing - I've noticed there's a really almost unnoticeable blink on the act led, almost every second, so faint that you can't see it from the top, only the side. Is this something I should be worried about trying to remedy? When fully assembled you'll only be able to see the leds from the top.

I've added resistance (47R) to the 5V line, which decreases it but doesn't erradicate it completely. Adding any more makes the LEDs too dim, and even makes the Power leds dim whenever the Act leds light.
bump?
Craggus2000
"If it ain't broke, break it and make it better"

ame
Posts: 3519
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: LEDs?

Thu Aug 19, 2021 9:17 pm

Craggus2000 wrote:
Thu Aug 19, 2021 11:43 am
bump?
Sorry, I have to defer to Mahjongg and davidcoton, since my suggestions, which work, can't work. And apparently I can't read a datasheet.

But, that aside, isn't the ACT LED showing activity? Wouldn't you expect it to blink from time to time? What is driving it? Is it the on-board ACT led, or one of the GPIO pins?

If you can't see the blink from the top and the LED will be installed so it's only visible from the top then I wouldn't worry. But, it's up to you.

User avatar
davidcoton
Posts: 6500
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LEDs?

Thu Aug 19, 2021 9:29 pm

Craggus2000 wrote:
Fri Jul 30, 2021 3:36 pm

Thank you it works! Oddly it wasn't needed on the ACT led, just the Power led.

Next thing - I've noticed there's a really almost unnoticeable blink on the act led, almost every second, so faint that you can't see it from the top, only the side. Is this something I should be worried about trying to remedy? When fully assembled you'll only be able to see the leds from the top.

I've added resistance (47R) to the 5V line, which decreases it but doesn't erradicate it completely. Adding any more makes the LEDs too dim, and even makes the Power leds dim whenever the Act leds light.
So, what are you using to drive the ACT LED? Do you get the same misbehaviour if you use the same circuit on the ACT LED as on the PWR LED?

What are you hoping to achieve with the 47R resistor? The observed behaviour is roughly what I would expect. It will dim the LEDs, thus making the rogue flash less noticeable, and it will introduce some coupling between the two LED strings.
Location: 345th cell on the right of the 210th row of L2 cache

User avatar
Craggus2000
Posts: 21
Joined: Wed Jan 15, 2014 8:25 pm
Location: Essex, UK

Re: LEDs?

Mon Aug 23, 2021 11:09 am

davidcoton wrote:
Thu Aug 19, 2021 9:29 pm
So, what are you using to drive the ACT LED? Do you get the same misbehaviour if you use the same circuit on the ACT LED as on the PWR LED?

What are you hoping to achieve with the 47R resistor? The observed behaviour is roughly what I would expect. It will dim the LEDs, thus making the rogue flash less noticeable, and it will introduce some coupling between the two LED strings.
I'm just redirecting the Pi's act led to the GPIO pin.
Yes get the same thing if I use the same pwr led circuit.

I was just playing around with the resistor to see if it stopped/masked the regular blink.
If the regular blink is expected and won't cause a problem I'm happy to leave as is, just wasn't sure.

Thanks
Craggus2000
"If it ain't broke, break it and make it better"

User avatar
davidcoton
Posts: 6500
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: LEDs?

Mon Aug 23, 2021 3:35 pm

A resistor will not stop the blinking, whatever causes it. Do you get the same blink on the on-board LED?
Are you booting the OS from an SDCard or some form of USB storage?
Location: 345th cell on the right of the 210th row of L2 cache

Return to “Beginners”