# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/054/386/medium800/robotics___cnc_400px-NES-ROB.png?1527171758)

https://youtu.be/ffAuebA5WAo

After the [Video Game Crash of 1983](https://en.wikipedia.org/wiki/Video_game_crash_of_1983 "Video Game Crash of 1983"), console vendors were looking to market new gaming devices without using the word game (seriously). In 1985, Nintendo released their [Nintendo Entertainment System (NES)](https://en.wikipedia.org/wiki/Nintendo_Entertainment_System "Nintendo Entertainment System (NES)"), which proved to be a great hit and the start of a long string of beloved gaming gear.

As part of the first round of shipments, the console came with a light gun (NES Zapper) and a novel interactive robot they called the&nbsp;Robotic Operating Buddy, or R.O.B., which was part of a marketing plan to portray the NES's technology as being novel and sophisticated when compared to previous game consoles, and to portray the NES as being within reach of the better established toy market.&nbsp;

R.O.B. came with some gyro spinners and attachable claws. A lot of the peripherals were soon separated from their robotic friend.

![](https://cdn-learn.adafruit.com/assets/assets/000/054/387/medium800/robotics___cnc_nes-rob-d8-sm.jpg?1527171909 Picture from http://www.theoldrobots.com/Rob.html)

While R.O.B. was appealing, Nintendo only made a couple of games that used his capabilities.

Later NES packages dropped R.O.B., making the price more affordable. R.O.B.s were relegated to closets with many of his little gyro peripherals and his claws scattered and lost.

## Revival Efforts

R.O.B. relies on a series of precise flashes from a CRT [analog television](Analog%20television "CRT Television") to receive commands via a sensor in the robot's head. It had no connection to the NES itself.

Using an NES on a modern LCD TV does not allow R.O.B. to work as the images are not output in the same way analog signals were used. R.O.B. uses a detection chip in his head which relied on specific flash timing inherent in analog TV (in the US, [NTSC signals](https://en.wikipedia.org/wiki/NTSC "NTSC Television")).

Over the years, people have tried to recreate the R.O.B. controls without success. Some success has been achieved by Makers by hacking the motor control board in R.O.B.'s base (which will be shown later in this article).&nbsp;

Here at Adafruit, we took this as a challenge. With the aid of some NES emulation detective work on the [AtariAge forums](http://atariage.com/forums/topic/177286-any-interest-in-nes-rob-homebrews/ "AtariAge forums") along with Ladyada's NTSC-foo, we have recreated the light control sequence R.O.B. uses to move.

This tutorial will assist you in taking your dusty R.O.B. and making him a useful part of your life.

## R.O.B. Buying Guide

If you want to go and buy a R.O.B. here are some hints:

1. You don't need an NES console or game cartridge. R.O.B. works alone.
2. You don't need the spinners or other peripherals. The grey "claws" really are not required either.
3. You do want the battery cover for the bottom unless you plan to modify the power in some way.
4. You do want to ask the owner if R.O.B. works with the batteries in and if any gears may be stripped as this will affect the price you pay.
5. Gear issues can often be fixed, but it may be worth it to buy a R.O.B. that seems in working order.
6. You don't need to buy one of the pristine bundles with or without original packaging unless you are a collector and know what you're spending money on. For this tutorial, only the basic R.O.B unit is needed.

As it becomes known that R.O.B. can be controlled, the prices may fluctuate. Before publishing this tutorial, a basic R.O.B. may go for US $50 to $100 on eBay with higher prices for bundles of extra stuff. Do your homework before jumping in. You may have some better luck at thrift shops.

# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Hacking Optical Control

![](https://cdn-learn.adafruit.com/assets/assets/000/054/390/medium800/robotics___cnc_Pic4.jpg?1527175780 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](http://atariage.com/forums/topic/177286-any-interest-in-nes-rob-homebrews/ "atariage.com forum post")&nbsp;reverse engineered old game cartridges to gather R.O.B.s control codes!&nbsp;[Tursi](http://harmlesslion.com/ "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&nbsp; 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:

![](https://cdn-learn.adafruit.com/assets/assets/000/054/388/medium800/robotics___cnc_pulse.png?1527174943 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](../../../../adafruit-neopixel-uberguide/the-magic-of-neopixels "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.

Warning: 

Digikey offers a series resistor calculator for LEDs [here](https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-led-series-resistor "Digikey series resistor calculator for LEDs").

# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Control Hardware

Here we use an [Adafruit Circuit Playground Express](https://www.adafruit.com/product/3333 "Circuit Playground Express") (CPX) which has the following characteristics:

- Has a transmit IR LED with a wide field of view and good transmit power
- CPX shows up on your computer as a USB flash drive when connected via a power+data USB cable
- CPX is programmable via CircuitPython, a language that is easy to use and code that can be changed quickly without installing a toolchain (like Arduino) and changes do not require recompile, just copy a new code file onto CPX and it runs.

## Parts List
### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
![A Black woman's manicured hand holds a round microcontroller with lit up LEDs.](https://cdn-shop.adafruit.com/640x480/3333-05.jpg)

### Alkaline AA batteries (LR6) - 3 pack

[Alkaline AA batteries (LR6) - 3 pack](https://www.adafruit.com/product/3521)
Battery power for your portable project! These batteries are good quality at a good price, and work fantastic with any of the kits or projects in the shop that use AAs. This is a pack of **3 AA batteries**.  
  
These batteries are Alkaline (MnO2) chemistry, with a voltage...

In Stock
[Buy Now](https://www.adafruit.com/product/3521)
[Related Guides to the Product](https://learn.adafruit.com/products/3521/guides)
![Angled shot of 3 AA batteries.](https://cdn-shop.adafruit.com/640x480/3521-00.jpg)

### 3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip

[3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip](https://www.adafruit.com/product/3287)
This battery holder connects 3 AA batteries together in series for powering all kinds of projects. We spec'd these out because the box is compact, and 3 AA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries, plus it has&nbsp;a nifty&nbsp;on-off...

In Stock
[Buy Now](https://www.adafruit.com/product/3287)
[Related Guides to the Product](https://learn.adafruit.com/products/3287/guides)
![Angled shot of 3 x AA battery holder with on/off switch, JST, and belt clip.](https://cdn-shop.adafruit.com/640x480/3287-00.jpg)

### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)
![USB cable - USB A to Micro-B - 3 foot long](https://cdn-shop.adafruit.com/640x480/592-01.jpg)

## Build

Hook up the Circuit Playground Express as shown below. When using the USB cable, you don't need the battery pack connected.

![](https://cdn-learn.adafruit.com/assets/assets/000/054/392/medium800/robotics___cnc_ROB-CPX2.png?1527184214)

For programming and testing, you don't need the battery pack connected, the USB cable will power the Circuit Playground Express and allow for programming.&nbsp;

When programming is complete and you want a stand-alone controller, disconnect the USB cable and plug in the battery pack which has 3 AA cells in it. There is an on/off switch on the battery pack. Note the switch on the Circuit Playground Express is not a power switch.

# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Programming

The code is a relatively short CircuitPython program. You can learn about CircuitPython [at this link to the Adafruit Learning System](../../../../adafruit-circuit-playground-express/what-is-circuitpython "What is CircuitPython").

You can copy it from the page or download it from the GitHub link. Save it onto a drive on your local computer as **code.py**.

To load the code as-is, plug your Circuit Playground Board to your computer via the USB cable. You should see a new flash drive called **CIRCUITPY** in your list of available drives. If you don't see it, press the tiny Reset button on the Circuit Playground Express.

In the off-chance your board does not have CircuitPython preloaded (usually indicated by the board showing up as **CPLAYBOOT** and not **CIRCUITPY** ), [follow the instructions here](../../../../adafruit-circuit-playground-express/circuitpython-quickstart "Loading CircuitPython to a CPX") to load the latest version. Now press Reset and you should see a drive named **CIRCUITPY**.

Drag a copy of **code.py** or otherwise copy the file to the **CIRCUITPY** drive. The program should run immediately.

If you wish to modify and interact with the code, Adafruit suggests using the free Mu editor. You can download Mu and learn more by [following this guide](../../../../adafruit-circuit-playground-express/installing-mu-editor "Mu Editor"). Mu also includes an interactive REPL to show the code is working.

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/ROB_Control/code.py

## What the code is doing

The code loads libraries for using various functions on the Circuit Playground Express board. Then the definitions for the R.O.B. control bit codes are defined: the `Init` code all commands use and the 8 bit codes unique to various functions: `Up`, `Down`, `Left`, `Right`, `Close`, `Open`, and `Test` (LED).

The function `IR_Command` takes one of the commands above, appends the Init sequence, and turns on and off the IR LED on the Circuit Playground Express according to the timings discussed on page Light Hacking. If the bit is zero, the function delays 1/60 of a second. If the bit is a one, the LED is turned on for 1.5 milliseconds, turned off, and the program waits 15 milliseconds. 15 + 1.5 = 16.5, the other time is used by the code.

The `while True:` loop (exactly like a `loop()` function in Arduino) keeps polling the Circuit Playground Express inputs and outputs commands appropriately.

How each input is used will be explained in the next section.

# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Use

![](https://cdn-learn.adafruit.com/assets/assets/000/054/447/medium800/robotics___cnc_rob_x.jpg?1527194572)

Info: 

It is best to experiment close to your computer with the USB cable still connected to the Circuit Playground Express. If you are using Mu, you can click the REPL button and some debug information will show: stating R.O.B. has started and groups of 3 numbers read from the Circuit Playground Express accelerometer (x, y, and z values respectively).

Hold your Circuit Playground Express about 12 to 18 inches from R.O.B.'s head with the IR LED not blocked by your finger and aimed at R.O.B.'s left eye (on your right). Don't shake the Circuit Playground Express yet, hold it steady.

Now press the A button with a finger. R.O.B.'s arms should open wide (if closed). Press button B on the front of the Express and his arms should open. Hey, my robot works!!

The other controls are a bit trickier - some practice will help. If you turn the Circuit Playground Express board clockwise, R.O.B. should twist one way. Turn it counterclockwise and he should move the opposite way. It may take some practice as the the board is reading the changes in acceleration relative to the pull of the earth. Short, quick movements work best while keeping the IR LED aimed at R.O.B.'s head. Tricky but doable.

The final movement involves a quick up movement to have R.O.B. move his torso up. The silver USB connector should be moved up in a short quick movement (without twisting). R.O.B. should move the whole body/arm assembly up. A quick downward movement towards the ground should move the torso down. Again, keep the IR LED pointed at R.O.B.'s left eye. It may take some practice.

Once you have the basics down, you can unplug the USB cable and use the battery pack to make a portable solution. Go have fun with your robot!

## Alternative Controls

If you find the movements unsuited for continued use, there are options. You can change the code to increase or decrease the sensitivity of the movements. Use the values output by the Circuit Playground Express to the REPL to guide you on values which may work. Remember that the earth pulls down (in the y direction holding the CPX at R.O.B.) with a value of -9.8 meters/second. Movements add or subtract from that y value.

You can add additional push buttons to the Circuit Playground Express pads as a more advanced project. Pads A1 through A7 are capacitive touch switches which can be programmed to activate functions. This is used in the Youtube video on the Overview page.

You can read other buttons to trigger movements. Push buttons should be momentary closed. In that case you might consider some sort of holder/case so you are not juggling your fingers.&nbsp;

# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Hardware Hacking

Danger: 

The base of R.O.B. contains the other significant circuit board. To access, carefully remove the four screws on the bottom plate. This allows you to see the main circuit board (from the bottom).

![](https://cdn-learn.adafruit.com/assets/assets/000/054/393/medium800/robotics___cnc_Pic0.jpg?1527186589)

Going further, you can carefully remove the four screws holding on the circuit board to flip it over.

![](https://cdn-learn.adafruit.com/assets/assets/000/054/394/medium800/robotics___cnc_Pic3.jpg?1527186673)

The Sharp IR2C25 chips are undocumented motor control drivers. The RFC-CPU10 is a custom Nintendo microcontroller or programmable chip that is also undocumented. The 6 wire rainbow wiring harness goes to the midsection via a coiled cable. The 4 wire white harness leads to the head section. The slide switch disconnects the battery power from the rest of the circuitry when in the off position.

A partial schematic is shown below. Some of the passive components have been left off, most of them support the CPU chip.

Danger: 

![](https://cdn-learn.adafruit.com/assets/assets/000/054/395/medium800/robotics___cnc_ROB-Schematic.png?1527187264)

Warning: 

R.O.B. uses three motors to move: one in the base and two in the mid-section. Each motor is controlled by a Sharp IR2C25 driver chip. The CPU takes commands from the white wiring harness wire S connected to pin 1. Then the CPU will connect the appropriate output pin connected to A, B, C, D, E, F, or Z. If you take a wire connected to the positive battery terminal and connect it to one of those connection points noted in the diagram, you will get that function to activate. BUT BE CAREFUL, the limit switches are not communicating to you to stop the movement like the CPU controlling it. If you have a gear issue, you'll have to research the repair - [links are here](https://www.google.com/search?q=nintendo+rob+gear+issue&oq=nintendo+rob+gear+issue "Links to R.O.B. repair guides"), via Google.

An experienced tinkerer/Maker could use this to build controls to make R.O.B. move. It's not as elegant as using the control signals used earlier and it could damage R.O.B. if you are not careful or you do not take the limitations of movement into account.

# Controlling a Classic Nintendo R.O.B. Robot Using Circuit Playground Express

## Going Further

One of the main purposes Adafruit looked into getting a couple of R.O.B. units was to hack on them. With the control protocol unknown and tube TVs long since sent away, we thought we could take over the motor control.

The new [Adafruit Crickit control board and the Circuit Playground Express](https://www.adafruit.com/product/3093 "Crickit and Circuit Playground Express")&nbsp;could easily help in giving R.O.B. the smarts to bring him to today's standards. Crickit can provide functionality and CPX has all those sensors.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/054/420/medium800/robotics___cnc_3816_iso_demo_CP_ORIG_2018_05-568x437.jpg?1527190420 The new Adafruit Crickit robotics platform with a Circuit Playground Express mounted on top)

You could use a Crickit along with the existing motor control chips inside R.O.B. This would leave more control for a couple of motors to motorize the base so R.O.B. could move around a room.

If you wanted control besides the existing optical input, you could pair a Wi-Fi or other radio to send commands to Crickit via a receiver (or even use a phone as the controller).

We don't have designs for these or other functions. But there are many guides on the [Adafruit Learning System](../../../../ "Adafruit Learning System") on Crickit, [robotics](../../../../category/robotics "robotics guides"), programming, radios, and much more.


## Guide Products

### Circuit Playground Express

[Circuit Playground Express](https://www.adafruit.com/product/3333)
 **Circuit Playground Express** is the next step towards a perfect introduction to electronics and programming. We've taken the original Circuit Playground Classic and made it even better! Not only did we pack even more sensors in, we also made it even easier to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3333)
[Related Guides to the Product](https://learn.adafruit.com/products/3333/guides)
### Alkaline AA batteries (LR6) - 3 pack

[Alkaline AA batteries (LR6) - 3 pack](https://www.adafruit.com/product/3521)
Battery power for your portable project! These batteries are good quality at a good price, and work fantastic with any of the kits or projects in the shop that use AAs. This is a pack of **3 AA batteries**.  
  
These batteries are Alkaline (MnO2) chemistry, with a voltage...

In Stock
[Buy Now](https://www.adafruit.com/product/3521)
[Related Guides to the Product](https://learn.adafruit.com/products/3521/guides)
### 3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip

[3 x AA Battery Holder with On/Off Switch, JST, and Belt Clip](https://www.adafruit.com/product/3287)
This battery holder connects 3 AA batteries together in series for powering all kinds of projects. We spec'd these out because the box is compact, and 3 AA's add up to about 3.3-4.5V, a very similar range to Lithium Ion/polymer (Li-Ion) batteries, plus it has&nbsp;a nifty&nbsp;on-off...

In Stock
[Buy Now](https://www.adafruit.com/product/3287)
[Related Guides to the Product](https://learn.adafruit.com/products/3287/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)

## Related Guides

- [Adafruit Circuit Playground Express](https://learn.adafruit.com/adafruit-circuit-playground-express.md)
- [CLUE Custom CircuitPython Badge](https://learn.adafruit.com/clue-custom-circuit-python-badge.md)
- [Compost Friend!](https://learn.adafruit.com/compost-optimization-machine.md)
- [eInk / ePaper Weather Station](https://learn.adafruit.com/epaper-weather-station.md)
- [PyLeap CLUE Custom Conference Badge](https://learn.adafruit.com/pyleap-clue-custom-conference-badge.md)
- [PyPortal Philips Hue Lighting Controller](https://learn.adafruit.com/pyportal-philips-hue-lighting-controller.md)
- [Glowing Interactive Crystal Staff ](https://learn.adafruit.com/glowing-interactive-crystal-staff.md)
- [CLUE Rock, Paper, Scissors Game using Bluetooth](https://learn.adafruit.com/rock-paper-scissors-circuitpython.md)
- [How to Choose a Microcontroller](https://learn.adafruit.com/how-to-choose-a-microcontroller.md)
- [UFO Flying Saucer with Circuit Playground Express](https://learn.adafruit.com/ufo-circuit-playground-express.md)
- [PyPortal IoT Weather Station](https://learn.adafruit.com/pyportal-iot-weather-station.md)
- [Adabot Operation Game](https://learn.adafruit.com/adabot-operation-game.md)
- [Touch Tone for Circuit Playground Express](https://learn.adafruit.com/touch-tone-for-circuit-playground-express.md)
- [CLUE Text Telephone Transmitter](https://learn.adafruit.com/clue-teletype-transmitter.md)
- [Dancing Inflatables: Make your Holiday Display Move](https://learn.adafruit.com/dancing-inflatables-make-your-holiday-display-move.md)
- [Last-Minute Halloween Accoutrements with HalloWing](https://learn.adafruit.com/last-minute-halloween-accoutrements-with-hallowing.md)
