1

I need some advise on this -- driving 12 RGB leds individually. I was thinking of this model: LL-509RGBC2E-006. If I use these "plain" RGB LEDs with 4 pins, so that would mean I need to set 12 x 3 = 36 GPIO pins, which I guess means that I can't do this with a single Pi 3B (26 output pins available?). Also I'm weary of the total current (typical spec is 20 mA per colour, so 20 * 3 * 12 = 720 mA, and also it's written somewhere that you shouldn't put more than 16 mA per GPIO pin.

So... I guess I need some additional logic. Here are the questions:

  • what kind of output board would I need to drive these with variable voltages? (I think voltage ranges are from 1.7V to 3.9V depending on the colour.)
  • it is a problem if the cable between controller and LED is up to 20 metres? Should I use a particular cable (e.g. larger diametre, shielding, ...)?
  • could I possibly use a cheap audio interface as DAC that doesn't remove DC offset?
  • or would it be easier to use "addressable" LEDs? Only, I would need to cut the strip apart, as all 12 LEDs will have a distance of around 2.5 metres from each other.

If I can get it to work with two network'ed Pi 3B, that would also be ok for me. But if I lose too much current on the 20m cable, perhaps this is still too heavy for the Pi alone.


Edit: How about daisy chaining three Adafruit 16 channel PWM boards?

5
  • Have you looked at LED strips? If they fit your application they will be much simpler to use. I see you have, Use LED strips.
    – joan
    Jun 18, 2018 at 14:06
  • @joan but if I need to space 12 LEDs 2.5m apart from each other, can I do with by simply cutting up and resoldering the strip with the spacing cable inbetween?
    – 0__
    Jun 18, 2018 at 14:10
  • I have no idea. However you would have similar problems with individual LEDs. I suspect your question will be a better fit on an electronics site.
    – joan
    Jun 18, 2018 at 14:22
  • With that sort of distance, I might think about using individual addressable LEDs. Use something like 24 V to send power to them, and a small buck converter to reduce the voltage at the LED. The higher voltage for the long stretches means a lower current, which means lower losses. Jun 18, 2018 at 15:13
  • It would be much easier to use addressable LEDs, such as the APA102 ones. You can get individual addressable LEDs and use your own cables using thicker wire for less resistance. But Joan is right, you should ask your question on an electronics site.
    – NomadMaker
    Jun 18, 2018 at 15:15

2 Answers 2

1

Using a Raspberry Pi to control many RGB LED's at a distance is challenging. For example, if you have 12 RGB LED's, you also potentially have 4x12=48 connections to worry about. If your LEDs are spaced out over 20 metres, you might suddenly find yourself trapped in a 48-strand copper web. To reduce wiring complexity it's better to introduce LED drivers and controllers. For example, the AdaFruit NeoPixel architecture drastically simplifies wiring considerations with its addressable LED design. The simplification of wiring will introduce software complexity, but overall you end up with a robust design (i.e., 48 trip wires is hair-pulling). Adressable LEDs are your friend.

Addressable LED's do have their own constraints. In particular, control signal timing is better suited to the Arduino hardware, which is a real-time MCU. The Raspberry Pi does a lot, but real-time signalling with strict timing is not one of its strengths. The Raspberry Pi does support protocols such as serial, I2C, SPI and 1-Wire, which can be used to control some addressable LED products (you'll need to shop around). For example, the APA102 adddressable LED strips can be controlled with a standard SPI interface.

If you can't find an addressable LED product that uses one of the Raspberry Pi protocols, consider adding Arduino's to your design and controlling them from the Raspberry Pi. For example, I've controlled a NeoPixel device from an Arduino connected with a 20' serial cable to my Raspberry Pi.

Unfortunately, distance itself creates issues for the control signals requried by addressable LEDs. At 20 meters you definitely need to take voltage drops over wire into account using triple the current (for the ground return wire). And a 20 meter length of wire is most definitely an antenna, so you will have signaling issues. Fortunately, there are a lot of wireless solutions at hand (e.g., wifi internet). With wireless control, the only copper you really need should be for power. And that will give you all the flexibility you need.

Your design will emerge organically on its own to suit your own requirements. Do consider addressable LEDs. Do consider introducing Arduinos. Do consider wireless control. Also reach out to SE Electronics once you narrow down your questions to specific things they can help with (e.g., "What wire gauge should I use to power my devices at 20 meters?")

4
  • "And a 20 meter length of wire is most definitely an antenna, so you will have signaling issues" -- this is why I thought using the controller next to the Pi and really going just with the output voltages to "dumb" LEDs might be less error prone here, albeit of course it means much more cables.
    – 0__
    Jun 18, 2018 at 17:53
  • With your voltage-drop link, I get a negligable drop though at 20 metres and 1.5mm copper wire for DC 6V, 20 mA.
    – 0__
    Jun 18, 2018 at 18:02
  • 1
    Glad you're already thinking of using thicker wire. Note that the ground return wire carries 3x the current (i.e. for R+G+B combined). Edited answer
    – OyaMist
    Jun 18, 2018 at 18:15
  • 1
    As already suggested use APA102 NOT Adafruit WS2801. APA102 are far easier to use with the Pi as they do not have timing constraints.
    – joan
    Jun 19, 2018 at 4:21
1

You can mitigate some of the issues by multiplexing the RGB LEDs you mentioned. If you wire all the Red pins of each LED together, then the Green pins of each LED together and then the Blue pins together but a separate wire to each common pin, you can control 12 LEDs with 15 pins. In operation you would turn set all the ground GPIO pins high and the RGB GPIO pins low. Then for the first LED, set the RGB pins as desired and pulse the first LED common pin low then high, then repeat for the remaining LEDs. If you do this fast enough you won't see any flicker. Without going too deep into the electrical characteristics, the pulses result in lower average current requirements too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.