In the ‘light above’ mode, when a flashlight is brought close enough to exceed user-specified light intensity (a), the robot will turn in place. When the flashlight is brought close enough to exceed user-specified light intensity (b), the robot will move forward in whatever direction it is pointing. Withdrawing the flashlight beam will cause the robot to stop and wait for new commands.
The upward-aimed photocell is plugged into the ATMega328’s analog input corresponding to A2 on the Arduino. I previously made a photocell ‘assembly‘ consisting of a photocell, resistor, and branching lead. However, when I tested it out, I discovered that the shadows of the servo leads would fall on the photocell and cause the robot to move in fits!
Here’s how the installed photocell assembly looked at that time:
To preclude shadowing, I needed to elevate the photocell above the servo wires. Hence, I did some solder surgery to lengthen the photocell assembly leads, like so:
With lengthened leads on the photocell assembly, the robot looks like this now:
And so without further ado, this is how the ‘light above’ mode works: