I recently bought a X-Ring WS2812B RGB on AliExpress.com. There is no information about the wiring or the bus how the X-Ring is controlled. So I did a little reverse engineering and want to share the information:
At first: the X-Ring is driven by a One-Wire connection.
There is a switch on the top:
The wiring is the following:
When I ordered they had “ESP8266, Wemos d1 mini” in the title. The board also has a Wemos-Logo on it. But it is not compatible to Wemos D1 mini. The widths do not match!
But you can easily mount an Wemos D1 mini to the board. I decided to connect the wemos to the bottom left side because then you can connect the Wemos D1 mini easily with wires to the board (5V, GND). You can choose to connect the Wemos D1 mini to RXD or TXD then (doesn’t matter as long you switch the according pin on the DIP-switch). Basically all labels on the board are irrelevant for an Wemos D1 mini (except: 5V, GND) because it is not compatible.
The wiring on the pictures is as follows (how to read: on the left hand side the pin name on the ESP, right hand side the X-Ring):
GND->GND
5V->5V
D2->RXD(7)
Make sure to switch the pin “7” on the DIP-switch, located on the top of the X-Ring, to the right as shown in the images. This acts as a pin selector and effectively connects the One-Wire with the RXD(7) pin. Make sure to switch at most one pin to the right.
Then you can start programming the X-Ring
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #include <Adafruit_NeoPixel.h> // https://github.com/adafruit/Adafruit_NeoPixel #define PIN D2 #define STRIPSIZE 12 // Parameter 1 = number of pixels in strip // Parameter 2 = pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIPSIZE, PIN, NEO_GRB + NEO_KHZ800); void setup() { strip.begin(); strip.setBrightness(25); // Lower brightness and save eyeballs! strip.show(); // Initialize all pixels to 'off' } void loop() { // for each pixel set color to red. Wait 100ms between each individual pixel. for(uint16_t i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, strip.Color(64, 0, 0)); strip.show(); delay(100); } } |
And develop your own application using the X-Ring.
If you have found a spelling error, please, notify us by selecting that text and pressing Ctrl+Enter.
16 comments for “X-Ring missing documentation”