This past weekend (this post has been in the queue for a while…) there was the Ferndale Pig and Whiskey Festival. I spend a lot of time at i3Detroit and was convinced to help out at this event. We have a large device aptly named the moneysucker as it consists mostly of a water cooler bottle, a shop-vac and a long tube. That particular one is triggered by a non-contact mains switch and has a spiral of lights running up the tube. Over the years that has been made sturdier and nicer, but now it’s hard to move and impossible to shrink without essentially breaking it and rebuilding it after. The one I built is a sucker in name only; it is a water cooler jug, an arduino, a neopixel strip, and an IR presence sensor.
The first version I built used an arduino pro mini, but that died just as we were supposed to leave for the event. My best guess is the little SOT23-5 linear regulator on the chinese knock-off board was not up to the task of stepping 12 volts down to 5 (even though I was not powering anything but the ir sensor and arduino with it). The fix was to replace it with a full-size real-deal arduino, no expense was spared (although it wasn’t my expense). The IR sensor had the LEDs pointed straight out, and I decided that I’d rather have them mounted at a right angle to make the board mounting easier. That was a bit of a mistake. Those LEDs are very sensitive. All the sensor is is a comparator and a potentiometer to set the bias, so the level it triggers at can be set (theoretically a distance). When I unmounted the LEDs the alignment became somewhat of an issue. If I were to do it again I would convert the sensor to a beam break sensor, and heatshrink around the 5mm LED body to keep directionality. This would invert my signal, but the pin change interrupt does not care. The pin change interrupt is indifferent to your small mortal worries.
The code was a modified version of the adafruit strandtest.ino example expanded to the length of strip I was using. I chose a default state I liked (the rainbow and rainbowCycle subroutines) and one I liked for the instance of having money inserted (theaterChase, white) and pulled out the rest of the calls. The interrupt is triggered on a pin state change so no mater what I use for a sensor (reflective, beam break, etc…) it will trigger a blinking state. The theaterChase subroutine was also tweaked to be more intense and shorter. The delay passed in the subroutine call was shortened from 50 to 20, and the number of cycles was shortened to 3 instead of 10.
the code is here.
the rest of the pictures are here.