nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Connecting whilte LED strip to Pi

Mon Sep 09, 2019 1:29 am

Hi all,

I am trying to connect 4 x single color light strips to my Pi. The light strip I purchased was this one:

https://www.amazon.ca/gp/product/B005EH ... UTF8&psc=1

I am going to cut 4 x 8" strips from this roll. An 8" strip is like 11 individual LED's.

The light strip has only two wires (black and red) since it is a single color. I am just trying to make sure I do this correctly. From what I understand, I need to connect the black wire to a ground pin on the Pi. For the red wire, do I need to use a MOSFET like this one?

https://www.amazon.ca/Cylewet-RFP30N06L ... S9ZSQ7E38S

If so, I think I would need to use four of these MOSFETs each one connected to a light strip. The source pin of each MOSFET would go to the Pi Ground pin, the drain pin would go to a GPIO, and then the gate pin would go to the 12v power source. Does this sound about right?

But if there is an easier way to do this without the external power supply and MOSFET's then I would like to know.

Thank you!

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

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 9:20 am

nextguy wrote:
Mon Sep 09, 2019 1:29 am
If so, I think I would need to use four of these MOSFETs each one connected to a light strip. The source pin of each MOSFET would go to the Pi Ground pin, the drain pin would go to a GPIO, and then the gate pin would go to the 12v power source. Does this sound about right?
No, that sounds destructively wrong.

Put "Pi driving LED strip" in your favourite search engine, read two or three results, and ask again if you still don't understand (no shame in that).
Don't rely on any one website because there is some wrong information out there ... if you tell us what you find, someone will look over it for you and check.
Signature retired

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

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 9:37 am

Depending on how much current your LED's are going to draw look at the NPN transistor or FET examples on this web site

https://elinux.org/RPi_GPIO_Interface_Circuits
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 9:54 am

davidcoton wrote:
Mon Sep 09, 2019 9:20 am

No, that sounds destructively wrong.

Put "Pi driving LED strip" in your favourite search engine, read two or three results, and ask again if you still don't understand (no shame in that).
Don't rely on any one website because there is some wrong information out there ... if you tell us what you find, someone will look over it for you and check.
I did the search that you recommended and actually the first result is where I had gotten my setup idea:

https://dordnung.de/raspberrypi-ledstrip/

The author provided this diagram using MOSFET's:

Image

Unless I misunderstood the wiring, he has 3 MOSFET's because he is using an RGB light strip. I would use 4 MOSFET's since I am driving 4 single color LED strips.

The third pin (SOURCE) in each MOSFET in his diagram connects to Ground, the second (DRAIN) goes to the GPIO, and the first (GATE) goes to the external power source.

User avatar
Burngate
Posts: 6002
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 10:26 am

nextguy wrote:
Mon Sep 09, 2019 9:54 am
The third pin (SOURCE) in each MOSFET in his diagram connects to Ground, the second (DRAIN) goes to the GPIO, and the first (GATE) goes to the external power source.
Not quite!

He has (red, green, & blue) wires connecting the GPIOs to the gates.

His black wires connect the GND of the Pi, the sources of the FETs and the negative of the external power source.

The drains of the FETs go to the LED strip negatives, with their positives connected to external power source positive.

So for each LED strip you have a loop: power souce positive through LED strip (+ to -) through FET (drain to source) and back to power source negative
AND you have another loop controlling the first: Pi GPIO through FET (gate to source) and back to Pi GND

nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 11:36 am

Burngate wrote:
Mon Sep 09, 2019 10:26 am
Not quite!

He has (red, green, & blue) wires connecting the GPIOs to the gates.

His black wires connect the GND of the Pi, the sources of the FETs and the negative of the external power source.

The drains of the FETs go to the LED strip negatives, with their positives connected to external power source positive.

So for each LED strip you have a loop: power souce positive through LED strip (+ to -) through FET (drain to source) and back to power source negative
AND you have another loop controlling the first: Pi GPIO through FET (gate to source) and back to Pi GND
Oh boy yeah you are right... I am still learning a lot about reading schematics and had no practical knowledge with circuits before the last two weeks.

I will go ahead and give this diagram a try. Hopefully there will be no fires or electric shocks.

nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 12:34 pm

Sorry just another question. I came across this article:

https://www.instructables.com/id/Easies ... pberry-Pi/

It suggests to purchase an RGB Signal Amplifier instead of using transistors:

https://www.amazon.com/TSSS-Repeater-Si ... B00A46UAQO

From his pictures, it looks like the Pi 5v connects to V+ on the amplifier and then one GPIO to each of RGB.

On the output, V+ and RGB all plug into the appropriate pin on the LED strip. In my case, I would connect V+ to each of my 4 LED strips, and one of R, G, and B to V- on each of my 4 LED strips.

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

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 3:05 pm

For a short length, the MOSFET is more appropriate. You don't need the power handling capability of that amplifier.
And you must match your supply voltage to what the strip requires. Yours is a 12V strip, it will not work well from the Pi's 5V supply. You should calculate the maximum current required, but I don't think this will cause any problem.

Note: This strip can only be cut at 3-LED intervals, so you need to make each section 12 LEDs long, not 11.
Signature retired

nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 3:49 pm

davidcoton wrote:
Mon Sep 09, 2019 3:05 pm
For a short length, the MOSFET is more appropriate. You don't need the power handling capability of that amplifier.
And you must match your supply voltage to what the strip requires. Yours is a 12V strip, it will not work well from the Pi's 5V supply. You should calculate the maximum current required, but I don't think this will cause any problem.

Note: This strip can only be cut at 3-LED intervals, so you need to make each section 12 LEDs long, not 11.
Ok thank you. I am having a tough time finding the IRLZ34N in Canada. The amplifier is more readily available so I was hoping I could use that. With the MOSFET, those that I have found seem to have trouble opening at 3.3v. I will keep searching.

User avatar
Burngate
Posts: 6002
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 5:30 pm

That amplifier seems expensive to me, at $14, compared to the FETs at $2.3 each.
Still, it's your wallet.

You first mentioned RFP30N06, then 2N7000 was mentioned, now IRLZ34N.
What they all have in common is their gate threshold voltage of 1v - 2v, comfortably below the 3v3 that the Pi can provide on its GPIOs.
There are plenty more out there for you to choose from.

I, personally, like International Rectifier's offerings, in part because they invented the HexFet which I thought at the time was brilliant. My music system seems to like them, too, having worked like a dream for all these years.

But do some research* and see what's out there.

*These days Research is a synonym for Google.

nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 5:44 pm

Burngate wrote:
Mon Sep 09, 2019 5:30 pm
That amplifier seems expensive to me, at $14, compared to the FETs at $2.3 each.
I found an amplifier with 4 channels like this one:

https://www.amazon.ca/gp/product/B07F78 ... 9V8W2LW1AN

It is very cheap also at 9.26 Canadian Dollars. I believe I should be able to drive all 4 light strips with this one amplifier right? Each light strip would plug into 1 channel of the amplifier. So it looks like a very simple solution instead of purchasing and wiring 4 individual FET's.

The other thing I am not sure about is according to the original article I read:

https://www.instructables.com/id/Easies ... pberry-Pi/

I can't figure out if I actually need to plug in an external 12V 2A power supply to the amplifier. I looked around and found that I have lying around both a 12V and 5V LED single color light strip that I could use for this project.

User avatar
Burngate
Posts: 6002
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 6:03 pm

It's got to get its power from somewhere, and the Pi can't provide all that, so it needs another source.
It seems that "amplifier" wants 12v, but I would guess at rather more than 2A.

But give it a go - buy it, try it, see what happens!

User avatar
neilgl
Posts: 947
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 8:12 pm

Locking at a similar “amplifier” it has 3 mosfets inside...

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

Re: Connecting whilte LED strip to Pi

Mon Sep 09, 2019 10:28 pm

nextguy wrote:
Mon Sep 09, 2019 5:44 pm
I found an amplifier with 4 channels like this one:

https://www.amazon.ca/gp/product/B07F78 ... 9V8W2LW1AN

It is very cheap also at 9.26 Canadian Dollars. I believe I should be able to drive all 4 light strips with this one amplifier right? Each light strip would plug into 1 channel of the amplifier. So it looks like a very simple solution instead of purchasing and wiring 4 individual FET's.
You need to check whether the amplifier will work from the Pi's 3V3 GPIO, or whether it needs a 12V signal (it is intended to work from the end of one LED strip, to drive another).
nextguy wrote:
Mon Sep 09, 2019 5:44 pm
The other thing I am not sure about is according to the original article I read:

https://www.instructables.com/id/Easies ... pberry-Pi/

I can't figure out if I actually need to plug in an external 12V 2A power supply to the amplifier. I looked around and found that I have lying around both a 12V and 5V LED single color light strip that I could use for this project.
Start by working out the current requirement for the four LED strips, all on, for both 5V and 12V LED strip.
Then buy a suitable PSU. For your four short strips, your Pi supply may be enough for the 5V strip, if you have a good PSU (not a "charger") and not too many peripherals on the Pi. It also depends somewhat on which model Pi.
Signature retired

nextguy
Posts: 20
Joined: Sun Aug 11, 2019 10:38 am

Re: Connecting whilte LED strip to Pi

Tue Sep 10, 2019 11:54 pm

I decided to give the amplifier a try and amazingly (for me at least) everything works!

I am using the amplifier to drive 4 short strips. If I knew how to use fritzing I would upload the schematic. But basically, I made these connections from the Pi to the amplifier:

GPIO - Amplifier Input
4 - CH1
27 - CH2
21 - CH3
13 - CH4
5V - V+

Then from the amplifier outputs I made these connections:

CH1 - Light strip 1 (negative terminal)
CH2 - Light strip 2 (negative terminal)
CH3 - Light strip 3 (negative terminal)
CH4 - Light strip 4 (negative terminal)
V+ - Positive terminal of each light strip

Finally I plugged a power supply to the amp and my Pi can now control the light strips through pigpiod.

Thank you to everyone that helped!

Return to “Beginners”