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

LEDs?

Tue Jul 27, 2021 10:06 am

Hi,
Hoping someone can help here please...
I am needing to use a 3.3v GPIO to power a pair of LEDs in series (because I need the specific shape).

I'm using a Pi 3b 1.2 with official power supply.

Basically one pair will be a power LED and the other will be an activity LED.

Based on the attached datasheets (I've had to zip them to be able to attach)
Datasheets.zip
LED datasheets
(150.57 KiB) Downloaded 13 times
, can you please advise if 2x L-153GDT in series on a gpio and then 2x L-153YDT in series on another gpio will work? Do i need any resistors or other components?
My electronics knowledge isn't the greatest...

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

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

Re: LEDs?

Tue Jul 27, 2021 10:30 am

No, you cannot use two of these LEDS in series with a 3V3 GPIO. The LED forward voltage is too high.

Depending on the brightness required, you may be able to use two in parallel, each with their own resistor. IIRC the maximum total GPIO current is 16mA, the LEDs might drop 2V at the relevant current, leaving 1V3 to drop across the resistor. A maximum current of 4mA per LED means an absolute minimum resistor value of 330R for each LED. This is not a precise calculation because the data is incomplete, particularly for the yellow LEDs.

If you need more brightness, you will need a transistor (or MOSFET) to drive each pair from the 5V supply, with appropriate resistors for each LED.
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?

Tue Jul 27, 2021 10:40 am

Ok thanks, so if I connected them as below
parallel.jpg
parallel.jpg (21.61 KiB) Viewed 884 times

with say 450R resistors (only have 330R and 120R, no 470R) in place, would that be a good place to start?

Just found the proper Yellow datasheet:
L-153YDT.zip
(69.21 KiB) Downloaded 9 times
Craggus2000
"If it ain't broke, break it and make it better"

User avatar
Imperf3kt
Posts: 4643
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia
Contact: Twitter

Re: LEDs?

Tue Jul 27, 2021 11:12 am

With that arrangement, how do you plan to use one led as a power on led and one as an activity indicator?
55:55:44:44:4C
52:4C:52:42:41

Rose tinted glasses are difficult to see through.

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

Re: LEDs?

Tue Jul 27, 2021 11:13 am

No, I need 2 LEDs for each, so that circuit I've drawn will be duplicated on another GPIO, one for power, one for activity.
Craggus2000
"If it ain't broke, break it and make it better"

dbrion06
Posts: 644
Joined: Tue May 28, 2019 11:57 am

Re: LEDs?

Tue Jul 27, 2021 12:11 pm

would that be a good place to start?
yes
(if both LEDs are shortcircuited, each branch will draw 3.1/0.45 = 7 mA; 14 mA is < 16ma; as eyes have log sensitiviy, you will see something)

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

Re: LEDs?

Tue Jul 27, 2021 2:06 pm

Craggus2000 wrote:
Tue Jul 27, 2021 10:40 am
Ok thanks, so if I connected them as below
parallel.jpg


with say 450R resistors (only have 330R and 120R, no 470R) in place, would that be a good place to start?

Just found the proper Yellow datasheet: L-153YDT.zip
Yes, good start. Yellow and Green versions appear well matched.
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?

Tue Jul 27, 2021 3:16 pm

Thanks all for your replies.

As another approach -
I've been asking a similar question on another forum, but relating to some LEDs that are already in situ (we don't know the specs of them, which I why I was thinking of replacing them).
See the diagram and response on that forum below. The blue box is the circuit that is already in place. Would this circuit also work, if I wanted to use the existing LEDs, based on the details below?

(If it makes any difference, or if anyone actually knows the details of the old LEDS, they are from an Amiga 500 keyboard.)


"You can power them using a 5V pin from the Pi, but you still need a transistor (or other switching element) to drive them. Something like the schematic below - the stuff in the box is the existing keyboard circuit, so you just connect its GND pin to ground and PWR or ACT to the circuit shown to light a LED. Unfortunately, the LEDs are high-side switched, so you need two transistors to control them from the 3.3V GPIO pin."
leds.png
leds.png (36.77 KiB) Viewed 791 times
Craggus2000
"If it ain't broke, break it and make it better"

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

Re: LEDs?

Tue Jul 27, 2021 3:56 pm

Craggus2000 wrote:
Tue Jul 27, 2021 3:16 pm
Thanks all for your replies.

As another approach -
I've been asking a similar question on another forum, but relating to some LEDs that are already in situ (we don't know the specs of them, which I why I was thinking of replacing them).
See the diagram and response on that forum below. The blue box is the circuit that is already in place. Would this circuit also work, if I wanted to use the existing LEDs, based on the details below?

(If it makes any difference, or if anyone actually knows the details of the old LEDS, they are from an Amiga 500 keyboard.)


"You can power them using a 5V pin from the Pi, but you still need a transistor (or other switching element) to drive them. Something like the schematic below - the stuff in the box is the existing keyboard circuit, so you just connect its GND pin to ground and PWR or ACT to the circuit shown to light a LED. Unfortunately, the LEDs are high-side switched, so you need two transistors to control them from the 3.3V GPIO pin."
leds.png
That is unnecessarily complicated, though it might work. The LEDs in series may have a voltage drop of anywhere from 4V to 5V, so selecting the correct series resistor is very tricky. If you can break the existing GND connection to the LEDs, you only need a single transistor, but to use the more consistent parallel arrangement you will need more radical surgery anyway.
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?

Tue Jul 27, 2021 4:14 pm

davidcoton wrote:
Tue Jul 27, 2021 3:56 pm
to use the more consistent parallel arrangement you will need more radical surgery anyway.
If I use the new LEDs, I was just going to remove the old LEDs from the keyboard and put on a piece of prototyping board, so not so radical....
Craggus2000
"If it ain't broke, break it and make it better"

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

Re: LEDs?

Tue Jul 27, 2021 10:07 pm

davidcoton wrote:
Tue Jul 27, 2021 3:56 pm
If you can break the existing GND connection to the LEDs, you only need a single transistor,
Could you elaborate please?
Craggus2000
"If it ain't broke, break it and make it better"

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

Re: LEDs?

Tue Jul 27, 2021 11:41 pm

Use the first part of your circuit, but with a lower base resistor (1K). Connect the collector of the BC547 transistor to the negative ends of the two LEDs. Connect the positive end of each LED to a resistor, the other ends of both resistors to 5V. Use resistors in the range 150R (very bright) to around 1K5.

Can't do a diagram tonight -- shout if you need one, and I will do one tomorrow if pcmanbob doesn't get here first.
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?

Wed Jul 28, 2021 6:18 am

davidcoton wrote:
Tue Jul 27, 2021 11:41 pm
Can't do a diagram tonight -- shout if you need one, and I will do one tomorrow if pcmanbob doesn't get here first.
Yes please!
Craggus2000
"If it ain't broke, break it and make it better"

User avatar
rpdom
Posts: 19040
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: LEDs?

Wed Jul 28, 2021 8:22 am

I can help with a diagram. I believe this is what is required.
LEDs.png
LEDs.png (5.45 KiB) Viewed 653 times
Unreadable squiggle

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

Re: LEDs?

Wed Jul 28, 2021 8:40 am

Just to check, will I have any problems with power/current, if I use the USB ports as well for things like game controllers? One USB port will definitely be connected to an Arduino Leonardo for the keyboard.

Apart from these two sets of LEDs, I'm only planning on using other GPIOs for buttons/joysticks.
Craggus2000
"If it ain't broke, break it and make it better"

User avatar
rpdom
Posts: 19040
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: LEDs?

Wed Jul 28, 2021 8:49 am

The amount of power those LEDs will take shouldn't be enough to cause any problems. You'll still have 1200mA total available for the USB ports.
Unreadable squiggle

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

Re: LEDs?

Wed Jul 28, 2021 10:42 am

rpdom wrote:
Wed Jul 28, 2021 8:22 am
I can help with a diagram. I believe this is what is required.
LEDs.png
Or those LEDs could be in series, with one dropper resistor.

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

Re: LEDs?

Wed Jul 28, 2021 10:45 am

If I use the existing LEDs, series would be preferable, as would mean I don't need to mess with the existing circuit board.
Craggus2000
"If it ain't broke, break it and make it better"

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

Re: LEDs?

Wed Jul 28, 2021 1:41 pm

What would the series-style circuit look like, if this is possible please?
Craggus2000
"If it ain't broke, break it and make it better"

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

Re: LEDs?

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. that is too high for reliable operation in series with a 5V supply.
Last edited by davidcoton on Wed Jul 28, 2021 5:06 pm, edited 2 times in total.
Location: 345th cell on the right of the 210th row of L2 cache

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

Re: LEDs?

Wed Jul 28, 2021 5:05 pm

rpdom wrote:
Wed Jul 28, 2021 8:22 am
I can help with a diagram. I believe this is what is required.
LEDs.png
Thanks for proving that my text description works! :D
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 Jul 29, 2021 9:43 pm

Craggus2000 wrote:
Tue Jul 27, 2021 3:16 pm
leds.png
leds.png (36.77 KiB) Viewed 466 times
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?
Craggus2000
"If it ain't broke, break it and make it better"

pidd
Posts: 2510
Joined: Fri May 29, 2020 8:29 pm
Location: Wirral, UK
Contact: Website

Re: LEDs?

Thu Jul 29, 2021 9:52 pm

Does it stay dim when you disconnect the input signal?

Check you have the transistors wired the correct way round.
I've tried increasing the resistance between 5v and the transistor,

The circuit hasn't got a resistor connected to 5V, are you sure you have wired this correctly?

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

Re: LEDs?

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.

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

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?
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.
ame wrote:
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.
It's the difference between making a circuit work once and making it production ready. In this case once is enough, though. ;)
Location: 345th cell on the right of the 210th row of L2 cache

Return to “Beginners”