Rainbow Strip by ianmb1967 3d model
3dmdb logo
Thingiverse
Rainbow Strip by ianmb1967

Rainbow Strip by ianmb1967

by Thingiverse
Last crawled date: 3 years ago
The idea of this project is to create a wearable, water resistant, animated rainbow light strip to be shamelessly be exploited for money during pride festivities. Based on an Adafruit Neopixel strip, an Arduino nano and any standard 5v mobile power bank, this silly device can keep the proud individual dancing for hours on end.
The core of this project is the Arduino sketch that creates a rainbow corresponding to the number of LEDs in your WS2011b (or similar) light strip. The main feature is the algorithm that uses trigonometry to create a colour wheel where the circumference is equal to the number of LEDs in the strip. It isn't 100 percent exact, simply because the relationship between PWM level and brightness of an LED is not anywhere near linear. That said, you don't get the smoothest blend between the colours, but the major colours show through clearly. In brief, the formula for creating the colour wheel is essentially:
x = 2 Pi / (LED# +1) (where LED# is address of the current LED in the strip).
Red=cos(x) Maximum_Power_Level
Green=cos(x + 2Pi/3) Maximum_Power_Level
Blue=cos(x + 4Pi/3) Maximum_Power_Level.
In other words, the Red, Green and Blue values are offset from each other by 120 degrees.
The other second algorithm in the sketch simply shifts whatever is on the strip to the next pixel.
This sketch relies on the NeoPixel library. Kudos to Adafruit for the amazing hardware, libraries and community support.
For what its worth, I used Microsoft 3D paint to create a hollow cylinder to contain the Arduino nano and the wires and capacitor. It isn't the most ergonomic model and the holes could be a little bit larger to fit all the wires. I'm more than happy to hear recommendations for a more suitable enclosure.
Finally, the wiring diagram is exactly the same as what Adafruit recommends for connection of its NeoPixel strip. i.e. 100uF capacitor and a 230 Ohm resistor.

Tags