Photoresistors are cheap, and the ATMega328 chip has spare analog pins, so why not use a dual sensor configuration for the GRISbot communications protocol?
Here’s what the sensor cowling looks like with two photoresistors (aka LDRs) inside:
Likewise the screen would flash separate signals to each sensor, like so:
(NOTE: In real life, the cowling would be pressed against the screen to avoid ambient light seepage.)
And this is an example of how the protocol would work:
The lines labeled ‘screen’ show the flashes on the screen with respect to time. The lines labeled ‘sensor’ show the voltage transients recorded by the chip in response (and note that they lag and are not instantaneous). The line labeled ‘data’ shows the data recorded by the microcontroller program.
Sensor A is the sensor that receives data, but data is recorded only when B is high. A’s value is then only read once, and then B has to go low in order to reset the trigger. Here’s the data diagram:
The advantage of this system is that it is completely non-time-dependent. Processing can slow the frame rate all it wants, and the microcontroller will still read the correct data.
Another reason to go with this system is that I may want two sensors anyway for triangulation purposes. More on that as it develops, if it does.