1. Wiring - KPRoche/BLE-Beetle-Pixels GitHub Wiki
Notes:
- You will need to be able to some very basic soldering for these projects
- This project will work with any brand of the WS2812B addressable LEDs. NeoPixel is one brand name for those LEDs. For the sake of clarity, I will simply refer to them as pixels going forward.
- If you have not worked with pixels before, I recommend purchasing them through adafruit.com or sparkfun.com because of their rigorous quality control and good customer support.
- Different versions of pixels may have the connections in different order. Always double-check what goes where.
- This code is written for RGB pixels. There are newer RGBW (red-green-blue-white) pixels that would require modifications to the arduino code.
- I mention JST-PH and JST connector "pigtails" in the instructions; you can find those at Adafruit and SparkFun as well as at Amazon, or electronics suppliers like digikey. If you are going to do lots of these sorts of projects, I suggest you get a bag with a bunch of them from Amazon.
Wiring the Beetle
The program presumes the pixel data connection will be connected to pin D5 on the BLE Beetle. I like to use the 3-pin JST connectors for pixels, so the controller can be disconnected from the lighting harness for reprogrammng. If you are using one of the strip, bar or ring pixel products, you will frequently find they have JST connectors already attached. You just need the matching connector. You can buy bags of the 3 pin connectors with wire "pigtail" leads already installed. Just trim the pigtail to an appropriate length before stripping the ends and soldering to the board. You'll note that one of my boards (for the belt) uses a long pigtail so the wires can be threaded out of the buckle to the pixels on the belt, while the one for the collar has much shorter wires so it will be more compact when assembled. Note: It is important to match up the pins on your 3-pin connector properly to those on the pixel strip. Make sure that +V and 0V go to the correct place, and the data line goes to Data In on the first of your pixels.
While rated for 5V (easily provided by a USB power bank), the BLE Beetle can also happily run on the 3.7 VDC provided by a LiPo (lithium-polymer) battery. Most pixels will also happily run at this voltage, which makes powering small wearables like the collar version of this project easier. The connector on most LiPo batteries is a JST PH plug; you can purchase matching sockets on pigtail leads just like the 3-pin connectors.
The plus and minus terminals on the Beetle are easy to find as their holes are in the shape of a + and a -. Here are some photos showing examples of wiring for USB- and LiPo-powered use.
Figure (click to expand) | Description |
---|---|
Two BLE Beetles wired with 3-pin JST connectors to mate with the pixel harness. The one with the long tail is intended to be powered via the micro-USB connector on the board. The Beetle with the short wire also has a mating pigtail for the special two-pin JST PH plug used on most LiPo batteries. | |
A closer view of the two BLE Beetles with the attached connector "pigtails," showing the other side of the boards. | |
A closeup of the Beetle with the pixel harness wired to D5, +V and -V terminals, with a JST PH connector for LiPo batteries also wired into the +V and -V connections. | |
This Beetle will be powered via the USB connector, so only has the connector for the pixel harness. |
After testing, I recommend covering the board with large heat-shrink tubing or (less-optimal) electrical tape.
Wiring the pixels
As mentioned above, be sure to match the signals on the pixel side of the connector to those on the board side. If you are using pixels wired in a strip, they often have one of the 3-pin JST connectors already attached. I have found products from Adafruit usually have +V on the red wire on one side, Data In on the green wire in the middle, and 0V on a white or black whire on the other side. **Do double-check which signals are which, because crossing the signals will at best keep your pixels from lighting, and at worst can damage the pixels, the Beetle, or your power source.
If you are wiring individual pixels, you will see there are 4 connections on each pixel: +V, 0V, Data In and Data Out. The +V and 0V are fairly obvious. Data In and Data Out are used to talk to the pixels, which should be "daisy-chained" together. The wire from the controller end goes to the Data In to the first pixel, then the Data Out from that pixel is wired to Data In on the next pixel, etc. If you are buying a strip or ring of pixels, the connections between the pixels are all pre-wired for you.
For wearable projects (in clothing, etc), it is possible to make the pixel-to-pixel connections by sewing with conductive thread, but I have found that the thread oxidizes and becomes undependable after a while. For longer-lasting projects it is better to use fine-gauge wire, solder the connections, and gently stitch or capture the wire inside the project so it doesn't move too much and break.
Figure: Wiring the pixels