Grove Pixel RGBW Stick Drivers Released

Grove Pixel RGBW Stick Drivers Released

We are pleased to release all our drivers for the Chainable Grove Pixel RGBW Sticks from SwitchDoc Labs.   We have released drivers for the Raspberry Pi, ESP32, ESP8266 and Arduino.   The Grove Pixel RGBW Stick is now available at the SwitchDoc Labs Store.

 

What is a Pixel?

This is SwitchDoc Labs 8 Pixel Programmable RGBW Strip.  This is a small chainable board with eight 5050 SK6812RGBW RGBW LEDs. The SK6812s are each individually addressable as the driver chip is located inside the LED. Each Stick has ~18mA constant current drive so the color will be very consistent even if the voltage varies, and requires near 5V.   This stick is NeoPixel compatible.

[callout size=”col-12″ title=”Grove 8 Pixel RGBW Stick” button_title=”See Store Page” button_link=”https://shop.switchdoc.com/products/8-pixel-neopixel-strip-with-grove-connectors”  button_size=”normal” button_rounded=”true” button_color=”red”]

And a 5 Pack of Grove 8 Pixel RGBW Sticks:

[callout size=”col-12″ title=”5 Pack – Grove 8 Pixel RGBW Stick” button_title=”See Store Page” button_link=”https://shop.switchdoc.com/products/5-pack-8-pixel-rgbw-chainable-stick-with-grove-connectors”  button_size=”normal” button_rounded=”true” button_color=”red”]

Plus we have singlePixels that we will be releasing soon.

This stick is based on the SK6812RGBW LEDs.   RGBW means that you have the usual R, G and B LEDs, but you also have a seperate White LED.  This allows you to have a very clear and pure white out of the stick, instead of just having the R,G and B mixed together to provide White.

Each stick is carefully sized so you can build evenly spaced larger displays out of these sticks.

This stick is NeoPixel compatible.

Each 8 Pixel stick has two Grove connectors.  One for input and then one for output.   To chain the sticks you connect the output of one stick to the input of another stick and then so on.  No soldering required!

The Grove Pixel RGBW Stick

The Software

Each of these computer architectures and operating system (or lack thereof in the case of Arduinos) make producing the tight timing required by the serial data streams for these Pixels a challenge.   Bit-banging will work with the Arduino, but is iffy on any of the other processors because of various operating functions in the operating system that require interrupts, thus disrupting the serial data stream timing.

Raspberry Pi Drivers

The Raspberry Pi has a complex, multi-faceted operating system based on Linux.  It is a multi-tasking pre-emptive operating system, which means virtually any task (and all user tasks) can be interrupted (read stopped) and thus our serial stream to the Pixel LEDs stopped and corrupted to some degree.

This library solves the real-time control problem by using the PWM and DMA hardware on the Raspberry Pi’s processor.  The PWM (pulse-width modulation) module can generate a signal with a specific duty cycle, for example to drive a servo or dim an LED.  The DMA (direct memory access) module can transfer bytes of memory between parts of the processor without using the CPU.  By using DMA to send a specific sequence of bytes to the PWM module, the Pixel data signal can be generated without being interrupted by the Raspberry Pi’s operating system.

Raspberry Pi Driver

ESP8266

The ESP8266 can be programmed via the Arduino IDE, but because of the WiFi interface, it still has a bunch of things going on in the background.  The Adafruit library used in this driver disables interrupts before the bit stream is transmitted, so the Pixels get set appropriately.   There are some rare bugs reported on this library regarding losing UDP packets from the WiFi interface but there are no systemic problems with these drivers known on the ESP8266.   The library used, the Adafruit NeoPixel library, is the same one used by the Arduino.  The picture to the right shows the OurWeather board (based on an ESP8266) driving a Pixel stick.

ESP8266 Driver

ESP32

The ESP32 has the most elegant solution to the Pixel serial data stream problem.  The ESP32 has two CPUs and allows you to specify which CPU (0 or 1) you want a given task to run.   Unfortunately, while you can use freeRTOS tasks on a given CPU, (for example putting the Pixels on CPU0 and all other tasks on CPU1), there is no way to force the background operating system (specifically the WiFi, bluetooth, housekeeping, TCP/IP stack, etc.) so you get the “Pixel 19” or the “Pixel 26” problem.  These problems show up as a specific LED not working correctly and it is linked to the 1ms background interrupt driving all of those communication processes.   Not good!

BC24 – Big Circle 24 RGBW Pixels with ESP32 – Kickstarter prototype

The solution?   The RMT (Remote Control) module on the ESP32, primarily used for Infrared controls, can be used to drive the Pixel data stream.   Furthermore, it is a “fire and forget” module that uses DMA (Direct Memory Access) to send the serial stream out all the while using none of the CPU resources and hence the 1msec problem goes away.   The RMT module driver can be used to send and receive infrared remote control signals. Due to flexibility of the RMT module, the driver can also be used to generate many other types of signals.   We shall do more in the future with this module.

ESP32 Driver

Arduino

The Arduino has no operating system to speak of, so you have excellent control of the timing of the GPIOs so you can use bit-banging to get the signals to the Pixel serial data stream in just the right timing.   The Adafruit library uses some assembly language to get things just write, but there are other examples of Arduino drivers that work fine without the assembly language.

Arduino Driver

 

What’s Next?

SwitchDoc Labs is launching a kickstarter shortly on an ESP32 powered Pixel string, the BC24.   Stay tuned.  Picture of the prototype is below.   We are making a couple of changes to the production model, which will be sent out during the Kickstarter.

 

How Do Pixels Work?

The Grove 8 Pixel RGBW is based on 8 of the SK6812RGBW integrated assembly (otherwise known as NeoPixels).

The SK6812RGBW is a smart LED control circuit and light emitting circuit in one controlled LED source, which has the shape of a 5050 LED SMD package. Each lighting element is a pixel, and the intensities of the pixels are contained within the intelligent digital interface input. The output is driven by PWM (Pulse Width Modulation) technology, which helps guarantees high consistency of the color of the pixels. The control circuit consists of a signal shaping amplification circuit, a built-in constant current circuit, and a high precision RC oscillator.

The serial data protocol being used is unipolar NRZ (Non Return to Zero) communication mode. The 32-bit data (8 bits for R,G,B,W) is transmitted from the controller to DIN of the first element, and if it is accepted it is propagated pixel to pixel. After an internal data latch in the device, the remaining data is passed through the internal amplification circuit and sent out on the DO port to the remaining pixels. The pixel is reset after the end of DIN. Using automatic shaping forwarding technology makes the number of cascaded pixels only limited by signal transmission speed.

The LED has a low driving voltage, high brightness, broad scattering angle, good consistency, low power, and long life. The control circuit is integrated in the SK6812RGBW package.

Grove Pixel RGBW Stick

Grove Connectors On The Grove 8 Pixel RGBW Stick

There are two Grove Connectors on the Grove 8 Pixel Stick, both of which are Grove Digital connectors.

J1 – Grove Input – Digital

This Connector can be used to connect up to a processor such as the Raspberry PI, Arduino or ESP32.

J1 –  Grove Input Digital
Pin 1 DIN Digital Serial Input
Pin 2 N/C No Connect
Pin 3 VDD Power for Grove Module
Pin 4 GND Ground

J2 – Grove Output – Digital

The Grove Output can be connected to an Input of additional 8 Pixel Sticks to build bigger displays.

 

J1 –  Grove Output Digital
Pin 1 DOUT Digital Serial Output for Chaining
Pin 2 N/C No Connect
Pin 3 VDD Power for Grove Module
Pin 4 GND Ground

 

Download Specifications

You can use any NeoPixel driver on your computer as long as it supports the SK6812RGBW data format.

8 Pixel Stick Specification

SK6812RGBW Specification