RGB Colour-Mixing Hat
2019-Jan-16, Wednesday 10:00 pmA long time ago I acquired a hat. Some time after that, still a long time ago, I added a blue LED strip to the band. Later again I replaced the silver ribbon with a black ribbon, removed the original hat band (cutting the glue off the hat), hot-glued a felt pocket to the inside to hold the battery, and cut a slit so the wires could pass through.
But single colour LEDs? Running off a 9 volt battery? Not good enough nowadays. Enamoured with potentiometers of late, I got the idea of doing a red-green-blue plus brightness mixing board. (Bonus points for not using radio, meaning it would remain functional at maker/hacker meetups where radio frequencies are often saturated.) I found myself in Makevember so I did up a quick breadboard prototype.
I settled on a layout, ordered some parts, and started watching youtube videos on using perfboards.
I'd used permanent protoboards before, but never started from scratch with a basic perfboard. So I tried to figure out a circuit, fit it onto a small perfboard (it would need to perch precariously on the hat brim, so the smaller the better), and started putting it all together. I marked various traces on the perfboard with markers, and cut it with a scissors.
I added four potentiometers (for red, green, blue, brightness), and a push button for the option of cycling through modes. I soldered header pins to the perfboard, so I could use jump leads to connect and disconnect the circuit board easily.
This is the mess of the underside. You will notice that I have power and ground rails. Made of solder. Turns out I'd wanted stripboard, but actually ordered was padboard. I made it work.
To match the circuit board I soldered header pins to the Flora pins as well. It's a bit stabby, but I actually like how easy it is to work with this way so I might do this more often in future.
I stitched the Flora to the aforementioned battery pocket hot-glued to the inside of the hat. I put the circuit board on the outside, perching on the brim. Connected together with many jump leads, through the slit in the hat.
This was also my first time using a Neopixel strip that comes in rubber sheathing. I ended up using 34 Neopixels of a 60/m length. Well, initially 35, but after I realised the connector leads were on the out-side of the strip, I soldered wires to the in-side, but they pulled the connectors right off, so I had to trim one off and try again. Second time around I used silicon coated wire, another first. I then soldered the silicon wires to half jump leads, for easy connection. It worked, which made me happy. But the rubber is frustrating to use. None of my glues would stick to it. To keep it in place I resorted to stitching with thread, through the rubber (in from the edges so it wouldn't tear too quickly). It worked, but I'll have to get a glue that will stick to it for future use.
Here is the rear view, with the circuit visible (and accessible). The potentiometers do what you'd expect, adding more or less of their assigned colours, with the brightness one just acting as a dimmer switch.
But once I had that done I wanted to add extra modes, controllable by pressing the push button a number of times. The first one I added was Rainbow Cycle (I'm using the Adafruit Neopixel library rather than FastLED here).
Then I made parts of it variables that can be controlled by the potentiometers;
- The Red pot controls the rainbow speed; how fast it completes a cycle.
- The Green pot controls direction; whether it goes clockwise or anti-clockwise.
- The Blue pot controls pixel density; so full is all pixels on, then every second pixel, then every third, widening the gap between pixels until only one is lit.
- The Brightness pot still controls brightness.
Here is a video clip of the Rainbow mode with the pixel density lowered to every second pixel, and the speed turned up high.
Then I added a Cylon mode. The colour is set in Colour-mixing mode, then you press the button into Cyclon mode;
- The Red pot controls the speed; how fast it completes a cycle.
- The Green pot does nothing, because the pattern goes back and forth anyway, and I couldn't think of anything else to control.
- The Blue pot controls window width; so low is only one pixel going back and forth, increasing to two, three, up to something like nine LEDs.
- The Brightness pot still, and always will, control the brightness.
Here is a video clip of the Cylon mode with the pixel window set to three, and the speed turned down.
Parts;
Hat
Adafruit Mini Skinny NeoPixel Digital RGB LED Strip, 60 LED/m
Adafruit Flora
Bakelite Perfboard
Potentiometers
10K ohm resistor
Momentary push button
Headers
Various jump leads
LiPo battery
But single colour LEDs? Running off a 9 volt battery? Not good enough nowadays. Enamoured with potentiometers of late, I got the idea of doing a red-green-blue plus brightness mixing board. (Bonus points for not using radio, meaning it would remain functional at maker/hacker meetups where radio frequencies are often saturated.) I found myself in Makevember so I did up a quick breadboard prototype.
Breadboard prototype
Photo by
chebe
I settled on a layout, ordered some parts, and started watching youtube videos on using perfboards.
Colour-mixing circuit
Photo by
chebe
I'd used permanent protoboards before, but never started from scratch with a basic perfboard. So I tried to figure out a circuit, fit it onto a small perfboard (it would need to perch precariously on the hat brim, so the smaller the better), and started putting it all together. I marked various traces on the perfboard with markers, and cut it with a scissors.
Prepare perfboard
Photo by
chebe
I added four potentiometers (for red, green, blue, brightness), and a push button for the option of cycling through modes. I soldered header pins to the perfboard, so I could use jump leads to connect and disconnect the circuit board easily.
Solder circuit
Photo by
chebe
This is the mess of the underside. You will notice that I have power and ground rails. Made of solder. Turns out I'd wanted stripboard, but actually ordered was padboard. I made it work.
Perfboard, underside
Photo by
chebe
To match the circuit board I soldered header pins to the Flora pins as well. It's a bit stabby, but I actually like how easy it is to work with this way so I might do this more often in future.
Solder headers to Flora pins
Photo by
chebe
I stitched the Flora to the aforementioned battery pocket hot-glued to the inside of the hat. I put the circuit board on the outside, perching on the brim. Connected together with many jump leads, through the slit in the hat.
Place Flora and wire up
Photo by
chebe
This was also my first time using a Neopixel strip that comes in rubber sheathing. I ended up using 34 Neopixels of a 60/m length. Well, initially 35, but after I realised the connector leads were on the out-side of the strip, I soldered wires to the in-side, but they pulled the connectors right off, so I had to trim one off and try again. Second time around I used silicon coated wire, another first. I then soldered the silicon wires to half jump leads, for easy connection. It worked, which made me happy. But the rubber is frustrating to use. None of my glues would stick to it. To keep it in place I resorted to stitching with thread, through the rubber (in from the edges so it wouldn't tear too quickly). It worked, but I'll have to get a glue that will stick to it for future use.
Here is the rear view, with the circuit visible (and accessible). The potentiometers do what you'd expect, adding more or less of their assigned colours, with the brightness one just acting as a dimmer switch.
Colour mixing mode, and rear view
Photo by
chebe
But once I had that done I wanted to add extra modes, controllable by pressing the push button a number of times. The first one I added was Rainbow Cycle (I'm using the Adafruit Neopixel library rather than FastLED here).
Rainbow pattern
Photo by
chebe
Then I made parts of it variables that can be controlled by the potentiometers;
- The Red pot controls the rainbow speed; how fast it completes a cycle.
- The Green pot controls direction; whether it goes clockwise or anti-clockwise.
- The Blue pot controls pixel density; so full is all pixels on, then every second pixel, then every third, widening the gap between pixels until only one is lit.
- The Brightness pot still controls brightness.
Here is a video clip of the Rainbow mode with the pixel density lowered to every second pixel, and the speed turned up high.
Then I added a Cylon mode. The colour is set in Colour-mixing mode, then you press the button into Cyclon mode;
- The Red pot controls the speed; how fast it completes a cycle.
- The Green pot does nothing, because the pattern goes back and forth anyway, and I couldn't think of anything else to control.
- The Blue pot controls window width; so low is only one pixel going back and forth, increasing to two, three, up to something like nine LEDs.
- The Brightness pot still, and always will, control the brightness.
Here is a video clip of the Cylon mode with the pixel window set to three, and the speed turned down.
Parts;
Hat
Adafruit Mini Skinny NeoPixel Digital RGB LED Strip, 60 LED/m
Adafruit Flora
Bakelite Perfboard
Potentiometers
10K ohm resistor
Momentary push button
Headers
Various jump leads
LiPo battery