Raspberry Pi and LED Strips [new python library]

Earlier today I published the first beta release of the LED Strip python library that we created at the LAB for the Raspberry Pi. This library was developed to be used with the Digital RGB LED strips from Adafruit - our favorite LED strip.

We have been playing with these for quite a while using Arduinos, and Adafruit’s Arduino library. With that in mind, we structured out library similar to the Arduino library from Adafruit. To help you get up and running quickly, we put together two examples scripts and a  readme file featuring an initial draft of the documentation.

One of the reasons that we are so excited about using the LED strips with Raspberry Pis is that they play really nicely with Spacebrew - the LAB’s dynamic routing tookit/service. This is especially true since Adam Mayer developed an awesome python Spacebrew library at our meet-up in January.

Here is a link to the Spacebrew python library repo. Make sure to go through the readme file because you’ll need to install several dependencies to get the Spacebrew library up and running on your device. I’ll post more information about this library sometime in the coming week or two.

Tags: , , , , , , , ,

8 Responses to “Raspberry Pi and LED Strips [new python library]”

  1. [...] Here’s a great new python library for the Adafruit Digital RGB LED Strips, shared by Julio Terra: [...]

  2. Ed says:

    Hi there, this may be a bit of a beginner question but can you indicate which pins you should connect the strip’s CLOCK IN and DATA IN wires to, on the Raspberry Pi?

    I understand you can use GPIO pins 8, 7, 10, 9 and 11 for SPI on the Raspberry Pi. Which should we connect to when using this script?

  3. Ed says:

    Never mind, I did some more reading and worked it out. You connect CLOCK IN (CI) on the strip to to SCLK on the Pi, and DATA IN (DI) on the strip to MOSI on the Pi. Of course you also connect 5V to 5V, and ground to ground.

    Thanks for creating this library!

  4. julioterra says:

    Edwin, happy that you were able to figure out the connections. One quick note, depending on the length of your LED strips you may need to connect the 5V to an external power source. The reason being the amperage from the Raspberry Pi pin may not be enough to drive a large number of LEDs. In such a case, you should make sure to connect the ground from the Rpi to the ground from the external power source.

  5. Ed says:

    Thank you, Julio! Yes, I am only driving a small number of LEDS (a 1 metre strand with only 32), that seems to work okay for that small number. I would love to ramp this up though, and create something like a low-res LED display by winding a long strip back along its own length — and then writing code to generate something like Space Invaders on it!
    In that case I would definitely connect additional power for the strand. :-) Thanks again for this library and your great blog — really inspiring.

  6. Henry says:

    Will this raspberry pi library work with the 12mm led dots?

  7. julioterra says:

    This library only works with the RGB LED strips listed here: http://www.adafruit.com/products/306

Leave a Reply