chebe: (Default)
chebe ([personal profile] chebe) wrote2019-10-15 11:41 pm

Adafruit NeoPixel Goggles Kit enhancement

Get yourself one of the Adafruit NeoPixel Goggle kits, and make it up following their excellent instructions.



Adafruit NeoPixel Goggle kit made up
Photo by [personal profile] chebe



The kit is great, but we want uniform and smooth looking solid colours. So peel off the hot glue and disassemble the kit. The kit comes with RGB NeoPixels, so grab a couple of RGB (not RGBW) NeoPixel Jewels (Adafruit / Pimoroni). Chain the Jewels onto the Rings; it'll be in the order: right-ring, left-ring, left-jewel, right-jewel, and more wires will be passed back across the bridge between the lenses. Use the wires and hot-glue to fix the Jewels in place.



Goggle kit with NeoPixel Jewels added, back of goggles
Photo by [personal profile] chebe



If trying to get the rings as aligned as possible is important to you, upload a sketch that just turns on the first NeoPixel of each ring, and the second NeoPixel of each jewel (the first is the centre one and won't help with alignment). Use this to align the NeoPixels before hot-gluing. It can also help to add leads to some of the Trinket pins; 5V power, GND, #1, #2. We'll be using them later.



Goggle kit with NeoPixel Jewels added, front of goggles, lenses removed
Photo by [personal profile] chebe



To control the goggles while wearing them without reprogramming we'll need a little circuit. A potentiometer to control brightness, a flip switch to change colours, and a tactile switch to turn the goggles on and off.



Quick sketch of goggles control circuit
Photo by [personal profile] chebe



Solder up the circuit board. This little 1" protoboard is plenty big enough (SparkFun / Proto-Pic).



Goggles control board, front
Photo by [personal profile] chebe



I made the mistake of not reading the product description carefully enough. I missed that the pins on these protoboards are connected together in groups of three. We need to use a blade to break the connections we don't want.



Goggles control board, back
Photo by [personal profile] chebe



I also found out that the colour/mode flip switch needs to be connected to Trinket pin #1, which can handle digital read/write on pin 1. And the potentiometer needs to be connected to pin #2, which can handle analog read on what is confusingly also referred to as pin #1. So the code looks a little like;

pinMode(PB1, INPUT);
pinMode(PB2, INPUT);

switchValue = digitalRead(1);
potVal = analogRead(1);


Upload the sketch for the behaviour you want. Use Sugru to cover the back of the the control circuit board and attach it to a hair clip big enough to fit the goggle band. Leave to cure.