c1223
Posts: 9
Joined: Wed Oct 24, 2012 10:56 pm

Controlling RGB LEDs

Thu May 30, 2013 12:12 pm

I know there are a few topics on the subject already but I have quite a few questions and didn't want to hijack the other threads.

I want to be able to control LED strings (something like this). Now I understand that this will be a lot of learning for me and a rather big project, but I'm happy to take that on.

First things first: I have a AC/DC power supply that can supply 6A at 12V no problem. I know how to code C (and C++).

My questions are:

1) Where do I start? Can the RPi do this? Obviously the power that the LEDs require cannot be supplied by the RPi hence the external PSU, but how would I go about connecting it all up? I want the RPi to be able to dim the LEDs from 0% - 100% (I know that the LEDs dimming curve isn't great but I'll live with it).

(I'm thinking that V+ goes to the cathode, while the anodes of the LEDs are connected to the GPIO pins of the RPi, but not sure if I've got the right idea).

2) Is there something I should read that'll give me more clues?

3) Anything else?

Thanks

User avatar
theoriginalxbrav
Posts: 41
Joined: Sun May 12, 2013 7:16 pm

Re: Controlling RGB LEDs

Fri May 31, 2013 1:09 am

I ended up doing this with a bunch of MOSFETs and a PWM control. I wish I had a schematic to share, but I got bored of my colours pretty fast!
Projects:
Raspberry Pi Weather Camera and weeWX: http://reboot.us.com/local-weather/
Daily Timelapses: https://www.youtube.com/playlist?list=PLi1er5S-VzV8d2t21zT0U_aBInl1_Ojkf

User avatar
Tage
Posts: 287
Joined: Fri May 24, 2013 2:29 am
Location: St Thomas, Ontario Canada

Re: Controlling RGB LEDs

Fri May 31, 2013 2:53 am

see my response to Driving LEDs from GPIO pins. use PWM to adjust the colors.

c1223
Posts: 9
Joined: Wed Oct 24, 2012 10:56 pm

Re: Controlling RGB LEDs

Fri May 31, 2013 6:58 am

Thanks Tage. I ended up finding this: https://github.com/smithje/RGB_LED_Driv ... rip_bb.png

Probably the easiest way to do it for these high power LED strips.

Raspberry wino
Posts: 49
Joined: Mon Mar 05, 2012 11:48 am

Re: Controlling RGB LEDs

Fri May 31, 2013 9:32 am

I've got a couple of rolls of those 12V LED strings and plan to do things with them. The only thing I achieved so far was to make a 'Christmas Star' which twinkles nicely. No Raspberry Pis were involved, it's controlled by an 8051 (running on 5V) the outputs of which feed a ULN2803 which can drive 500mA on each output at up to 50V. Presumably I could drive the ULN2803 from the RPi.

I'd love to be able to control individual LEDs in these strings for snazzy effects but it's not possible. The minimum they can be cut into is a group of three (or 5cm) but I'm sure it's possible to make something fairly impressive, including mixing different colours. I haven't tried PWM yet but I assume the control circuitry is the same, so it's just a matter of understanding the (RPi or 8051) processor's PWM circuitry.

My problem in using the RPi generally is what to use for level shifting from the 3v3 GPIO to 5V for general purpose output pins.

User avatar
theoriginalxbrav
Posts: 41
Joined: Sun May 12, 2013 7:16 pm

Re: Controlling RGB LEDs

Fri May 31, 2013 7:57 pm

Raspberry wino wrote:I've got a couple of rolls of those 12V LED strings and plan to do things with them. The only thing I achieved so far was to make a 'Christmas Star' which twinkles nicely. No Raspberry Pis were involved, it's controlled by an 8051 (running on 5V) the outputs of which feed a ULN2803 which can drive 500mA on each output at up to 50V. Presumably I could drive the ULN2803 from the RPi.

I'd love to be able to control individual LEDs in these strings for snazzy effects but it's not possible. The minimum they can be cut into is a group of three (or 5cm) but I'm sure it's possible to make something fairly impressive, including mixing different colours. I haven't tried PWM yet but I assume the control circuitry is the same, so it's just a matter of understanding the (RPi or 8051) processor's PWM circuitry.

My problem in using the RPi generally is what to use for level shifting from the 3v3 GPIO to 5V for general purpose output pins.
Again, TTL-level MOSFETs to the rescue. I believe I used these guys in my last project:

http://www.adafruit.com/products/355

I used N-Channel as those LED strips are common anode. I threw in a 100kOhm resistor between the gate and drain to provide a small current flow from the GPIO. I drove 5m of the 600 count LEDs, and the MOSFETs were cool to the touch.
Projects:
Raspberry Pi Weather Camera and weeWX: http://reboot.us.com/local-weather/
Daily Timelapses: https://www.youtube.com/playlist?list=PLi1er5S-VzV8d2t21zT0U_aBInl1_Ojkf

Return to “Interfacing (DSI, CSI, I2C, etc.)”