4

Anyone has managed to get raspberry pi connected to WS2801 RGB Led Strip? enter image description here

I have followed the connections here at adafruit: and tried to test the LED with pixelpi.py.

enter image description here

The pixelpi.py runs without error but there is no effect on the LED when I use the fade or chase mode. Right now only the first and the 10th LED lights up when I supply power to the strip.

I have installed the Occidentals v0.2 and have checked that /dev/spidev0.0 is available.

I am driving the Raspberry Pi using a 5V 2.3A source and the LED with a 5V 1.5A source and pulling both ground together. I have shorted the MOSI and the MISO pins together to make sure that signal is being sent and received correctly.

What am I be missing here ?

  • 2
    can you post a photo or draw a schematic how things are connected. Again this is more electronics stack related. – Piotr Kula Sep 17 '13 at 15:10
  • 2
    Also why did you short the MOSI and MISO? Is that supposed to enable all the LED's or what? – Piotr Kula Sep 17 '13 at 16:18
  • @ppumkin I followed the schematics exactly as above. The shorting of MISO and MOSI was a separate exercise just to test that there was no problems with the SPI. I followed the instructions here to test the SPI. – Chen Zhenhao Sep 18 '13 at 1:33
3

The datasheet for the WS2801 near the bottom of page 2 specifies that a high logic level should be 0.8*VDD

enter image description here

If VDD is 5V, then the output of the RPi GPIO(3.3V) will fall short of that spec.

I'm not sure what frequency the SPI is running at, but generally higher frequencies will reduce the maximum length of cable you can get away with, so make sure the cable is not too long.

I guess it's also possible that your module is broken.

  • "High logic level", what page is that on? It seems this thing can be powered from 3.3v up to 6v and control it using I2C (Named as two wire in the doc) If you mean the logic signal is relational to the Voltage then powering the WS2901 on 3.3v should solve the problem then? – Piotr Kula Sep 18 '13 at 11:54
  • 1
    It's near the bottom of page2 (Vᵢₕ). If VDD was 3.3V, then there is no problem. The "datasheet" for the strip doesn't show how the WS2801 is connected, but it's likely that VDD is 5V – John La Rooy Sep 18 '13 at 13:07
  • Yea that makes sense then. This does seem like it is the problem the OP is experiencing! :) – Piotr Kula Sep 18 '13 at 13:30
  • Yes, the VDD is 5V. I had the impression that if you powered the Raspberry Pi with 5V via pin 2, the GPIO would output 5V as well. So I suppose I need to use something like 74LVC245 to boost the logic level for both the CLK and MOSI so that it can be recognized by the WS2801 ? Thanks for the pointer @gnibbler. I will try to work on that – Chen Zhenhao Sep 19 '13 at 14:29
1

You should use a levelshifter as already suggested earlier in this thread.
I offer a kit for the RaspberryPi that you can buy at my webshop.
The design is open and schematics and source code is available.

Look here: http://www.hackerspaceshop.com/raspberrypi-things/raspberrypi-ws2801.html

0

For whatever it's worth, I've managed to get the Raspberry Pi (B+) to drive a short (1M) WS2801 LED strip using just the power from the PI (and only lighting a couple LEDs to keep the load light). I did it in C using this library to drive the SPI port: http://www.airspayce.com/mikem/bcm2835/index.html.

I tried it both using the +5V and +3.3V source from the Pi. I had a bunch of troubles at first, but after iterating for a while I found I had the wiring wrong, once I fixed it (per the diagram above) it started working.

Here's the settings:

if (!bcm2835_init())
{
    printf("Failure to initialize the bcm2835 library\n");
    return 1;
}
printf("Initializing Interface\n");
bcm2835_spi_begin();  // see http://www.airspayce.com/mikem/bcm2835/group__spi.html
bcm2835_spi_setBitOrder(BCM2835_SPI_BIT_ORDER_MSBFIRST);    // The default    
bcm2835_spi_setDataMode(BCM2835_SPI_MODE0);                 // The default    
bcm2835_spi_setClockDivider(BCM2835_SPI_CLOCK_DIVIDER_64);  // 64 = 256ns = 3.90625MHz  (under 25MHZ)
bcm2835_spi_chipSelect(BCM2835_SPI_CS_NONE);                // Not selecting a specific chip
bcm2835_spi_setChipSelectPolarity(BCM2835_SPI_CS0, LOW);      // the default    

Other than that, you fill an array with all the bytes to send down, then use this to send it:

    int nBytes = nLEDs * 3;
    char * strip = calloc(nBytes, sizeof(char));
    ... fill the array here ...
    bcm2835_spi_writenb(strip, nBytes); // write out the colors

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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