I bought an Arduino Micro for a project a little while ago, found it easy to develop with and wondered where else I could use one. There are two Robosapiens in our house, so one of them went under the knife for a brain transplant. I chose an Adafruit Bluefruit LE Micro this time, so I could disconnect the USB cable and control the Robosapien over Bluetooth.
The Robosapien’s getting on in years and resources explaining what’s inside it are disappearing from the WWW. Markcra’s Robosapien pages are an invaluable starting point, though I never did find a complete list of pinouts for the U2 controller IC. Here’s the list I used while adding the wire extensions for the prototyping board:
|U2 pin||Connected to|
|P11||Finger/toe/heel switches left|
|P12||Grip switch left|
|P13||Shoulder switch left|
|P14||Finger/toe/heel switches right|
|P15||Grip switch right|
|P16||Shoulder switch right|
|P30||Grip motor open left|
|P31||Grip motor close left|
|P32||Shoulder motor left|
|P33||Shoulder motor leftexpecting to be able to|
|P34||Grip motor open right|
|P35||Grip motor open right|
|P36||Shoulder motor right|
|P37||Shoulder motor right|
|P42||Leg motor left|
|P43||Leg motor left|
|P44||Leg motor right|
|P45||Leg motor right|
“Left” and “right” are from the Robosapien’s point of view. With 31 lines of I/O before any enhancements might be considered, I had to add some extra I/O in the form of 2 MCP23S17 SPI I/O Expanders. The Bluefruit LE Micro uses SPI to communicate with its Bluetooth module, so adding the MCP23S17s was straightforward. I failed to get a single CS (Chip Select) line to work with HAEN (Hardware Address ENable) set on the MCP23S17s, but one CS pin on the master per MCP23S17 works a treat.
The Arduino code is very simple – it reads a character from either the USB serial port or the Bluetooth UART into a command buffer. ‘Commands’ on the modified Robosapien are trivial – motors and LEDs can be turned on and off, delays of 0-999ms can be inserted and triggers for low/high on the switches can be waited for. For example, “s+” is “left shoulder up”, “S-” (lower/upper case for left/right!) is “right shoulder down”, “w0” is “waist motor off”. “L=” is right leg motor ‘brake’ (high signal to both sides of motor driver, though the brake effect is very weak). “e000” is all LEDs on. “e255” is all LEDs off. There are 8 LEDs. “W500” inserts a delay of 500ms before the next command is executed. “tb1” is “trigger when left button signal is high”. “q” turns off all motors.
|Behaviour||Send text string|
|Turn in place||w+l+L-W075l-L+W075w-W075l+L-W150l-L+W075w+W075l+L-W150l-L+W075w-W075l+L-W150l-L+W075w+W075l+L-W150l-L+W075w-W075l+L-W150l-L+W075w+W075l+L-W150l-L+W075w-W075l+L-W150l-L+W075w+W075l+L-W150l-L+W075q|
Source code for Arduino IDE is here: robosapienarduino.tar.gz
While the brain transplant is a success, losing the behavioural repertoire and vocalisations means there’s plenty still to do to return the Robosapien to full health. It being an old (nearly ten years?) toy, I’m wary of physically modding it further – such as adding contact sensors to its feet – and using it more in case I break its mechanisms.
The Robosapien has lived up to its claims of “made to be hackable”, but PCB-hacking is fraught with dangers. I’d like to see “made-to-hack” toys have their toy-behaviour controllers on pluggable daughter boards, exposing well-documented headers for owners who want to try their hand at brain surgery.
Having successfully operated on one patient, I’m looking forward to using the Adafruit Bluefruit LE Micro on new candidates… and there’s an unloved, apparently-hard-of-hearing Zoomer in the toy cupboard downstairs. “Zoomer! Here boy! Whassis? Screwdriver! Roll over!”