camjones1708
Posts: 6
Joined: Tue Feb 11, 2014 6:06 pm

Raspberry Pi control LEDs

Wed Feb 19, 2014 2:23 am

I had some 5050 LEDs off ebay (yeah they're crappy I know, but they get the job done.) and I was wondering what I would need to control them (the leads are +12v, r,g,b). I know I would need 3 transistors and a breadboard which I have. This is the tutorial I am using is http://mitchtech.net/raspberry-pi-pwm-rgb-led-strip/ . Would they be controllable individually like the ones off adafruit? I think I could manage the software between youtube and github having so many guides but the hardware is throwing me off. If the 5050's I have aren't individually controllable what would be a good solution for some that are? Adafruits are expensive for $25 a meter.

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Raspberry Pi control LEDs

Wed Feb 19, 2014 7:22 am

In the PCA9685 data sheet, there is a little section showing a schematic to drive heavy LED loads. I have used scheme to drive some heavy loads with that chip. It couldn't be easier.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

camjones1708
Posts: 6
Joined: Tue Feb 11, 2014 6:06 pm

Re: Raspberry Pi control LEDs

Wed Feb 19, 2014 3:34 pm

What page of that are you finding the schematic?

User avatar
Richard-TX
Posts: 1549
Joined: Tue May 28, 2013 3:24 pm
Location: North Texas

Re: Raspberry Pi control LEDs

Thu Feb 20, 2014 3:40 am

The bottom of page 28.
Richard
Doing Unix since 1985.
The 9-25-2013 image of Wheezy can be found at:
http://downloads.raspberrypi.org/raspbian/images/raspbian-2013-09-27/2013-09-25-wheezy-raspbian.zip

camjones1708
Posts: 6
Joined: Tue Feb 11, 2014 6:06 pm

Re: Raspberry Pi control LEDs

Thu Feb 20, 2014 7:53 pm

I'm sorry that schematic doesn't exactly mean much to me, how do you even know that's the schematic for my LED strip?

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: Raspberry Pi control LEDs

Thu Feb 20, 2014 8:49 pm

It's just general instructions for lighting up a load more LEDs from a chip not designed for it - like what you're trying to do with your raspi and the 5050 strip... Though I must admit, I don't really understand those diagrams either.

Firstly the LEDs are not individually addressable, though the strips are easily chopped up into shorter lengths, and you /could/ individually address those, if you had enough pins. For example, you could have a load of strips arranged like the spokes of an umbrella, and have nice circling animations, or you could just keep it all as one long strip, controlled with only 3 PWM pins. You could get a load of ws2803 chips, and have tens of RGB strips (one WS2803 controls 18 PWM pins nicely, so you divide that by 3 for the R,G, and B, and you get 6 RGB strips per WS2803. they're chainable - I've got enough to drive 48 strips - pretty sweet :) )

Nothing I've mentioned so far can actually power your 12v strip though - you'll need some transistors or mosfets. You'd control the transistor/mosfet with the Raspi's gpio pin, or the WS2803's pin, to use it as a valve to let 12v through from another power supply. If you've got a 5m strip, your power supply should be about 12v at 6 amps to power everything at 100% safely. Those strips will also light up at 9volts, but won't be as good, obviously.

I hear that mosfets are the best, though I forget why. One problem is, though, that you'll need 'logic level' mosfets in order to work properly from the raspi's relatively weak 3.3v output. All the logic level mosfets I found were surface-mount, though luckily apparently they're not too scary, as their pins just so happen to be a niceish fit to solder onto perfboard/prototyping PCB. For running large lengths (3m plus) of 5050 strip, you'll need some proper mosfets - which probably won't swich on properly at 3.3v, so will need to be fully activated themselves with another, smaller transistor. phew! All this is why I've had 10 metres of that stuff sitting in my 'awesome components' box for at least a year now.

Long story short - you'll need at least transistors and a decent 12v power supply, possibly some mosfets (logic-level or big and beefy), and possibly some nice PWM chips like the WS2803. It depends on how long lengths you want to drive, and how many of them.

I've got a couple bags of s8550 and s8050 transistors that I picked up for my project - They seem to be good general-purpose for stuff like this, and can be picked up relatively cheaply in relatively large amounts (50-100 or so).

Good luck!
note: I may or may not know what I'm talking about...

Return to “Beginners”