Using the WS2812

Hey Guys,

I know this isn’t related to the Spark directly, but I am looking to use the WS2812 in one of my projects and just wanting to confirm the wiring on the modules before purchasing them and to make sure they will work with the Particle (when it arrives)

Basically the above module has 6 pins IN, OUT, VCC, GND, VCC and GND

My question comes into the IN and OUT pins, basically I want to know if there is any difference between IN and OUT? eg. can I link 6 of these modules and share a common cable going to the IN (eg. not daisy chaining)


@semaja2, these modules are designed to be daisy chained. While power and ground can be connected from module to module, the IN on the first module in the chain would go to the Photon. Then the OUT of that module goes to the IN of the next and so on to your last module. I have driven a 60-LED string of WS2812 (Neopixel) LEDs directly from a pin on the Core/Photon but you may want to use a level shifter to boost the 3.3v output to 5v for the modules. Also, remember that turning on all the LED on a WS2812 at full brightness will take about 60ma so 7 x 6 modules x 60ma = 2.5Amps! Make sure you have enough power for you anticipated use :smile:

1 Like

@peekey123 so it wouldn’t be possible to run them direct and not daisy chained? eg. 6 cables come out of D0 on the Photon and each cable goes to the IN pin on the WS2812?

As for power I will most likely use a 5V 2A power supply for both the Photon and the power rail to the LEDs, hopefully this will be enough amperage for my setup (as long as I never take them all to full brightness…)

I think that’s possible but the signal might get corrupted when too many of them are “parallel” getting data from one same pin.

I’m doing something similar, where I need to feed the Photon 5v 2a through VIN. I have a level shifter to boost the 3.3v output to 5v, but when reading the datasheet under “power” for the photon, it says:

Likewise, the power source should be sufficient enough to source 1A of current to be on the safe side.


Noob question, but will the lights still receive 2A? Will this not be too much for the Photon based on this description?

Also, what are your clock and data pins connected to on the Photon?

@njonas I ended up putting a 5V 2A power supply direct to the VIN pin on the Spark Core and then connected my strip of WS2812b to the VIN pin.

My understanding of electronics would say this bypasses the Spark Core/Photon for the most part and thus you don’t need to worry about overloading the Core/Photon (Originally I was going to supply 5V 2A through the USB port but this would overload the Core)

Of course the Core/Photon will still use some power so out of the 2A you would only have about 1.7A? left for the lights etc

I will upload a instructable on my project I completed :slight_smile:

thanks @semaja2! So is a level shifter really necessary then?

Also, which pins on the Photon are you connecting to clock and data?

I never used a level shifter with a Particle device driving WS2812B strip though. :wink:

@kennethlimcp - good to know, what could be the downsides of that? Which pins on the Photon are you connecting to clock and data?

@njonas, do you have a link of the RGB strip that you are working with? the WS2812B only requires a data pin and i used A5 with the Neopixel library :wink:

@kennethlimcp I’m using the Adafruit DotStars:

So Dotstar is supported - Adafruit DotStar SPI LED Strip Library [Ported]

What issues are you facing?

@kennethlimcp Good to see there’s a supported library! I was just simply wondering what pins on the Photon I connect the clock and data line from the RGB lights to?

Look here at the example:

It is using D4 and D5 but you are redefine them

cool thanks, will try it out!

1 Like

Is there a working libarary for dotstar which works on the photon ?.

I can`t compile it without 12 error saying , Struct GPIO _Typedef has no member BRR or BSRR.