I’m going to build my son a wooden race track for his toy car obsession and I’d like to add some extra pizazz just for the heck of it and to have a fun project to work on.
My idea is to embed a strip of neopixels in the middle of the track along with an array of sensors (I’m going to start with photoresistors) that will detect where along the track the car is. With that data I can light up the neopixels behind the car (where it’s been) to create a sort of Tron effect on the track.
I know I could connect 12, 24, 36 or any # of photoresistors to an Arduino Mega or similar, but that seems like a waste to manage that many individual sensors essentially using up all of my IO pins. Not to mention the wire management nightmare that would come with that.
In my short investigation so far, I’m looking at using an MCU with a ton of pins, an I2C I/O expander (this might help with wire management), multiplexing the photoresistors (still very fuzzy on this concept) or finding some kind of single wire photoresistor array device.
What I’d love to find is something like a NeoPixel strip but instead of an array of LED outputs it would be an array of photoresistor inputs. Does anybody know if a device like this exists? Ultimately, having an array of n# of sensors all connected through one wire.
If not, can anybody point me to multiplexing tutorials or offer a little bit more info on the idea?
My initial, high-level implementation thought on this project is the car will start at the top of the track, as it travels down the track, it will pass over a photoresistor reducing/increasing its resistance. I can measure this resistance difference to know what sensor the car is currently over. Knowing the car will always travel in a linear direction, I can light up all lights starting from the currently covered sensor to the start of the track. Eventually the car will pass over the last sensor and all lights on the NeoPixel strip will be lit up.
Accuracy doesn’t have to be amazing, just good enough to create the fun effect I’m going for.
Any advice would be very much appreciated.