First project - LPD6803 Chainable LED

Hi all,

I’ve recently bought a Photon and this is my first go at anything like this. I’ve played around with making a little program to flash the onboard LED but my main aim is to connect and control this set of chainable RGB LEDs http://www.pakronics.com.au/products/chainable-rgb-led-40-leds-unit-ss104990028 that I have bought.

I’m currently trying to work out how to wire this up to the photon on the breadboard, but where I’m running into confusion is that all the examples I can see online (including the picture on the product page above) seem to show the LEDs as having 4 wires interconnecting each unit. But as you can see in the pictures below, mine only have 3 and so I’m not sure if I’ve been sent the wrong set or if it’s just going above my head. I tried to look at the data sheet on that product page, but that was pretty beyond me.

(There’s also one red wire coming off the last LED in the chain. I’m not sure what this is either)

If nothing seems wrong with the LEDs then I’d really appreciate some guidance as to how I should be wiring up the LEDs to the Photon. Presumably one of these is power, but given there is only one other I don’t know if it’s data, clock or both? Or if these are just totally different to other examples I’ve seen. FWIW, I tried wiring up the LEDs with red running to 3v3 and white running to D0 and was able to get them to turn on, but I couldn’t seem to get any other colour than blue (trying to use the Adafruit_NeoPixel library).

Any help would be really appreciated!

Cheers

Ok, I think I may have worked out where I’m going wrong. No doubt this would be pretty obvious for someone who’s done anything like this before :smile:

So after doing some more reading and testing. I think maybe red is power, white is ground, and then I need to jumper from the green/white connector which would be the clock and data wires. I don’t have any jumper cables so I’ll run out and get some later and see how that goes!

I’ll report back with results.

Your LEDs are definitely not the same ones as those on that web page. In your case, there are only three wires connecting consecutive LEDs (right?) and the chip inside is definitely not an LPD6803, as it has the wrong pin count.
Probably you have a strand of WS2811-based (or compatible) LEDs, which are controlled with only one wire. Since a red cable comes out the end, I would guess that red is the data line, so you can daisy chain those together. Probably white is ground and green VCC then, but you should verify this, and figure out the correct voltage to apply, before you connect them to a power supply or you might damage the LEDs.

There are plenty of libraries available for WS2811 and friends, such as the Neopixel library.

Thanks for your reply Stef.

I’ve asked the store about them and am waiting to hear back from them with some more details. They’ve suggested that I might need to use I2C which I’m not familiar with so I’ve been looking into that while I wait to hear back from their technical team.

I’ve been able to read through the plastic that red is 5V, green is D0 (or DO?) and white is ground according to the text next to each solder point which has helped clarify that.

At this stage I can wire them up to the photon with Red going to the 3v3 atm, Green going to D0 and white going to ground and they they all light up correctly. But I’m yet to work out how to control them in my code.

So, using the Adafruit_NeoPixel library, I’ve been able to get a little bit of control over the LEDs.

They are currently wired like so:
Red (5V) -> VIN
White (GND) -> GND
Green (D0) -> D0 pin on the Photon.

I haven’t got any resistors in the mix at the moment either.

However, I’m experiencing something quite weird. After I initially set colours (which works as expected), any further updates to colours (even if they are the same) seem to randomly change the colours emitted from the LEDs.

Here is my current test code:

#include "neopixel/neopixel.h"
#define PIXEL_PIN D0
#define PIXEL_COUNT 40
#define PIXEL_TYPE WS2812B

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, WS2812B);

void setup() {
    strip.begin();
    strip.show(); // Initialize all pixels to 'off'
    
    
}

void loop() {
    
   for(int i=0; i<strip.numPixels(); i+=3) {
        strip.setPixelColor(i, strip.Color(0, 255, 0)); // Red
        strip.setPixelColor(i+1, strip.Color(0, 0, 255)); // Blue
        strip.setPixelColor(i+2, strip.Color(255, 0, 0)); // Green
   }
    
   strip.show();
   delay(5000);
}

The first time the colours are set (alternating red, blue, green) they look fine. However, after the 5 second delay, when the loop runs again, they change seemingly randomly. Some don’t change, others become a more pinky colour, etc. And when it loops again, the random changes happen again.

I’m super confused at this point so any help again would be much appreciated.