Friday, March 25, 2016

Daisy Chained NeoPixel Ring Flower Garden

I've had this recessed frame kicking around for a long time and finally came across a good use for it. Inspired by the story of a student's flower garden Logo program in Teaching With Logo by Molly and Daniel Watt, I picked up some NeoPixel rings at my local go to hobby store, Tinkersphere, and set about learning how to daisy chain them into one circuit.

Lynn's flower garden

I set about by downloading the Adafruit NeoPixel library and connecting up one ring to an Arduino Duemilanove (my first Arduino!) and lighting it up with the "simple" example included in the library. Some of the NeoPixel rings I got have through holes to connect up the wires and others have solder pads. I prepared the rings by soldering on like-colored wires for the 5V, GND, Data In, and Data Out connections.

NeoPixel wiring connections

Once one ring is lit up, it's a simple matter to add more. The Data Out wire on the first connects directly to the Data In of the second. To add the second to the code, add the total NeoPixels up and put them in the NUMPIXELS definition:#define NUMPIXELS 80 The for loop that lights them up inside loop() runs for the numbers of pixels you define, so all the pixels along the chain should light up:

I tested the chain lighting up all the same color using a breadboard to make sure the circuit worked.I connected each ring's 5V wire to the + rail and it's GND wire to the - rail. The Arduino 5V pin goes to the + rail and the GND pin goes to the - rail. And the data pin (I used 13) connects to the Data In wire on the first ring. I added a 330 ohm resistor on this wire as Adafruit recommends. The very last ring in the series gets its Data In from the second-to-last ring's Data Out, but its Data Out does not need to connect to anything.

Then I tested the circuit on different power sources to make sure a battery power source would be enough in the final setup. There are lots of forum posts about people having problems getting all of their NeoPixels to light up properly once they move a circuit from testing to installation. Surprisingly, a 6V (4 AA) battery pack powering the Arduino, and that in turn supplying 5V to the parallel power circuit of 7 rings, 88 NeoPixels, was enough to make them all nice and bright. You'll see I set the maximum brightness at 30, which is plenty nice.Transferring the circuit to the frame backing just required a lot of soldering, hot glueing the rings down, and adding wire segments. The GND and 5V rails go around the outside. Then the battery pack is glued on the side. It includes a handy switch to power off.