Hacking Optical Control

Inside R.O.B.'s head: the "left eye" phototransistor to the left of the Sharp IR3T07 decoder chip

The theory is R.O.B. should be able to be controlled by flashing a light source in the correct manner. R.O.B. uses a phototransistor in his left "eye" connected to a Sharp IR3T07 decoder chip. The IR3T07 is undocumented. But some creative folks at AtariAge.com reverse engineered old game cartridges to gather R.O.B.s control codes! Tursi found each command to R.O.B. consisted of 13 bits. The first 5 bits are an initialization string and are always the same: 00010. The next 8 bits are the command, coded as follows:

UP:    10111011 - Raises the body up
DOWN:  11111011 - Lowers the body down
LEFT:  10111010 - Turns the body left
RIGHT: 11101010 - Turns the body right
CLOSE: 10111110 - Close the arms
OPEN:  11101110 - Open the arms
TEST:  11101011 - Turn the head LED on

In the forum, someone tried to recreate this in Arduino C  code but wasn't successful.

Ladyada suggested 60 hz pulses (1/60 = 16.67 milliseconds). No luck. Then she said to use only the blanking time within the 16.67 microseconds which is 1.5 milliseconds. So out of each 60th of a second, have the on/off bit active for 1.5 milliseconds, then off for the remaining 15.167 milliseconds. Also, you must account for some instruction execution time. I shaved the on pulse down time to 15 ms. So the timing is:

Not quite to scale. Pulse may be on (high) or off (low)

This code was tested with an Adafruit 32u4 Feather (Arduino Leonardo compatible) with a white LED. It worked! R.O.B responded to each of the commands!

The LED must be aimed at R.O.B.'s left eye (on the right as you look at him head on). The distance the LED must be to the head varies on what type of LED you are using. Brighter = farther away.

The color of the LED in testing was varied from white to green to infrared. The color did not matter at all! All those green flashes in the NES games - the green color was not the significant factor.

A NeoPixel smart RGB LED was tried in some early tests. A single NeoPixel could be used but not a ring (apparently a ring takes longer to set and clear the flash of light). A single NeoPixel also seemed to not work as far away as a single color LED and the angle of the light was more critical. So NeoPixels were found not to be ideal for controlling R.O.B.

The Circuit Playground Express can supply a maximum 18 milliamps per external pin with 7 ma recommended. If you decide to use an external LED to control your robot, use a series resistor and chose the value accordingly to avoid excessive current draw which might harm your Circuit Playground Express.

Digikey offers a series resistor calculator for LEDs here.

This guide was first published on May 24, 2018. It was last updated on May 24, 2018. This page (Hacking Optical Control) was last updated on May 24, 2018.