## connecting a very bright white LED to raspberry pi

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### connecting a very bright white LED to raspberry pi

Hi guys.
I was able to connect 5 white LEDS to my raspberry pi.
viewtopic.php?f=91&t=200701
But then they short out and I was back again to where I had started.

I found this very bright LED from a china made torch.
Can anybody tell me what components would I need to carefully light it with my Rpi with GPIO pins.

Code: Select all

``````2N2222 transistor
470 ohm resistor
47 ohm 1 watt resistor``````
This the the big bright LED.

I am not an Electronic Guy but still I checked with a multimeter.
Observations when Led is lit:

Code: Select all

``````2.92 V
Screen Shot 2018-02-25 at 7.56.44 PM.jpg (43.14 KiB) Viewed 3255 times

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

### Re: connecting a very bright white LED to raspberry pi

standard "formula" for calculating the voltage limiting resistor for any led powered from any voltage is:
subtract the forward voltage over the led from the voltage you are using to power the led, this gives you the theoretical voltage over the resistor.
now apply ohm's law R=U/I (or instead of U many nations use the letter V so R=V/I, where V = Voltage, R = resistance in ohm, and I = current in Ampere).

In your case the supply voltage must be significantly (a few volts at least) larger than the forward voltage of the LED, so a 2.92V LED cannot be reliable powered from 3.3V, and you should use 5V.

The series resistance should then be (if you really want to feed the LED 160mA (0.16A), which is a bit much, but possible) ;
5.00-2.92 = 2.08 V and I = 0.16A so R would be 2.08 / 0.16 = 13 Ohm

the 13 ohm resistor has to be able to handle a heat dissipation of I * V = 0.16 x 2.08 = 0.3328 Watt so this will be quite a large resistor to cope with 1/3th of a Watt. I would recommend a resistor of at least half a watt.

also you will need a transistor to switch the current on/off, and that transistor must be able to switch 0.16A, and be controlled by a control voltage that can deliver 3.3V, and a maximum of say 10mA (a guesstimate, i think the maximum for a single GPIO is 16mA).
is's series (gate resistor) can be calculated as 3.3V minus the base-emmitter diode forward voltage (0.7V typically), so the base resistor should be 3.3 - 0.7 = 2.6V an R = V/I = 2.6 / 0.01 = 2600 Ohm, or 2K6 (nearest equal or higher normal E48 range value will be 2K7).

oops, not 2600 Ohm, but 260 Ohm, I made a small error 2.6/0.01 = 260, so yes 470 Ohm would be okay!

pcmanbob
Posts: 10502
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

### Re: connecting a very bright white LED to raspberry pi

So using some of what you already have.

Now when you connect this circuit up, you need to remove the batteries and connect the supply side of your circuit to the terminal that had the positive of the battery connected to it , and the transistor side of the circuit to the terminal that had the negative of the battery connect to it.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

Thanks for all the knowledge friend.
I was overwhelmed.

So to summarise I would need these components:

Code: Select all

``````13Ω 0.5 W resistor connected in series with +tive side
Base resistor of 2K6Ω
A Transitor (A 2N2222 ll work?)
``````
Thanks.

mod edit, no not 2K6, but 260 Ohm, so 470 Ohm is good too

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

Ohh I got it from the diagram.
Thanks:)

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

Hi,
I found one more LED which changes its color after every 1 second.
Apart from that it has different patterns like dimming and fast slow lighting.
It has RGB colors + white also.

Code: Select all

``Its voltage is 4.23 V``

Can this be used with pi?
That LED is a bit strange though.

pcmanbob
Posts: 10502
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

### Re: connecting a very bright white LED to raspberry pi

Guneshs wrote:
Sun Feb 25, 2018 3:58 pm
Hi,
I found one more LED which changes its color after every 1 second.
Apart from that it has different patterns like dimming and fast slow lighting.
It has RGB colors + white also.

Code: Select all

``Its voltage is 4.23 V``

Can this be used with pi?
That LED is a bit strange though.
If you know what current its drawing yes if you power it from 5v.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

No, strangely though It was showing 1 mA in multimeter.

pcmanbob
Posts: 10502
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

### Re: connecting a very bright white LED to raspberry pi

Guneshs wrote:
Sun Feb 25, 2018 4:18 pm
No, strangely though It was showing 1 mA in multimeter.
That is an unlikely reading ! it suggests that this LED has a more complex circuit driving it and there is more than one power connection to what ever is supplying it.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

So what should one do if they want to use such an LED, Sir.

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

pcmanbob
Posts: 10502
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

### Re: connecting a very bright white LED to raspberry pi

Guneshs wrote:
Sun Feb 25, 2018 4:30 pm
So what should one do if they want to use such an LED, Sir.
Is this just a single component or some device you have ?

For component try and find data sheet for it.
if its a device then you can take it apart and workout how it works or again try and find a data sheet for it, but that's unlikely if its a commercial product
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

I found it Sir,
It uses

Code: Select all

``````5 V
220Ω resistor``````
https://www.amazon.com/Chanzon-100pcs-c ... vse_lbvc_0
A video explaining it.

pcmanbob
Posts: 10502
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

### Re: connecting a very bright white LED to raspberry pi

So now you know you can use the same transistor with the 470 ohm resistor on the base and the LED and 220 ohm resistor between 5v and transistor.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

I think Your last statement should be rewritten as
use the same transistor with the 470Ω resistor in between the base and and the GPIO pin.
220Ω resistor between 5V and the positive LED terminal
Is this correct?

pcmanbob
Posts: 10502
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

### Re: connecting a very bright white LED to raspberry pi

We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Guneshs
Posts: 48
Joined: Sun Jun 25, 2017 4:18 pm

### Re: connecting a very bright white LED to raspberry pi

Ya correct.Thanks:)

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

### Re: connecting a very bright white LED to raspberry pi

Led's with built in IC's like these normally have a built in current source, (current limiter) one for each of the in-built RGB lights, so they don't need a current limiting resistor at all, normally they work directly on 5V, or some even on a 3V battery, they are an exception to the rule that LED's need a current limiting resistor.