Introduction

My Keepon, a simple and low-cost version of
Keepon robot and the commercial robot, is a black box with two buttons. For
human-robot interaction studies, it needs to be controlled by a PC. The goal of
this tutorial is to hack the robot so the movements and sounds of My Keepon
robot can be controlled independently over a PC Serial communication (UART).

*** If you don’t need to know how My Keepon is
hacked, skip 3-Hacking principle and go to 4.

Hacking principle

My Keepon uses two microprocessors to control
the movements and the sounds, which talk to each other via I2C protocol.

The PS232 (address 0x52) deals with sounds and
encoders and is the slave node on the I2C bus.

The PS234 (address 0x55) handles driving the H-bridges, main processing (including handling button presses), and is the master node on the I2C bus. At the bottom-right corner of the PCB , there are 4 pads (V, CI, DA and G) of I2C communication. Those pads are connected to A0, A5, A4 and GND of Arduino Uno respectively with a logic voltage converter (5V to 3.3V).

In order to control the My Keepon, the master
microprocessor must be changed to be a slave. This step is done by pulling the
two I2C lines to the ground for one second after the robot powers up. (For the
powering up detection, the V line is connected to Analog pin A0 of Arduino).
Therefore it is important first to power up the Arduino and then the robot as
will be stated in the start-up procedure.

In order to connect the I2C connection with
the USB port of the PC an Arduino will be used with dedicated shield as shown
in Fig 2. The shield has simple electronics to do the logic conversion between
5V and 3.3V.

Start hacking!!

STEP 1: Opening My Keepon

To open My Keepon, use a screwdriver for the 4
screws in the back casing of My Keepon. Be careful when opening My Keepon, take
care of the position of the different parts, so you are able to reassemble them
again later. With a drill make a hole
above the power connector in order to let the four wires enter the casing.

How to open My Keepon casing.

STEP 2: Connect My Keepon hardware to Arduino
shield

Attach with some tape the four wires along the
black flat cable. Under a transparent plastic cover is the PCB of My Keepon
(located in the red rounded rectangle). Solder the four wires in the correct
order, solder the other ends to the shield. Check if V of My Keepon is
connected with V of Arduino shield, same for CI, DA and G.

Where to solder the wires

STEP 3: Re-assembly

Re-assemble the robot carefully and tighten
the back cover with the 4 screws. Power up My Keepon. Without power for Arduino,
My Keepon should work as it did at purchase. So My Keepon can still be used as
you did when it was purchased.

STEP 4: Connect the hardware to your computer

Plug the Arduino shield to Arduino Uno with
the corresponding pins. Then, connect the board to your computer by a USB
cable.

Hardware connection

STEP 5: Install the firmware

Open the Arduino IDE and upload the software
with .ino extension in the Arduino. This should only be done once. In Control
Panel under Devices check the port number to which the Arduino is connected.

Normally My Keepon is now hacked and ready for
its first use.

How to use the hacked My Keepon

Important is always to follow this bullet
list.

1) Connect the Arduino to My Keepon.

2) Connect the Arduino to a PC using a USB cable.

3) Launch ViKeepon.exe

4) Power up My Keepon.

(It is important to first power Arduino (by
the USB cable) and then power up My Keepon as such the Arduino takes over the
control. Normally My Keepon should not
move. When you turn on My Keepon, if it starts moving the Arduino has no
control. Then, you need to redo the 4 steps in the bullet list.)

When opening the .exe file of ViKeepon, the
user interface will open.

Select the correct port (as found in Control
Device).

Press the button “Open Port”.

ViKeepon User interface

Press the button “Jump”. If My Keepon jumps,
jump as well of joy. You just hacked My Keepon and you have control over him by
the ViKeepon User Interface.

The different items of the user interface are
as follows. Try the different possibilities to get familiar with the different
possibilities of My Keepon.

Basically My Keepon reacts to commands that
are sent to and received from the robot over the UART protocol using hex
values. Persons interested in this can see in appendix the communication
protocol. We have a program that uses these commands, persons interested in
this can contact the organizers of this workshop.

To make these commands more understandable,
the following commands have been offered by BeatBots.

Turn on your My Keepon. You should receive a "My Keepon
detected" message.

AUDIO ENVELOPE [0...127] (near instantaneous log of the audio amplitude;
commented out in code for reduction of data transfer)

AUDIO BPM [VAL] (estimated beat interval in multiples of 5msec)

The easiest would be to see the code for the
different buttons and compare it with the command structure given above.

The first exercise is to make a motion and
sound sequence for the button “Harlem Shake”. Search for the string “//ADD
HARLEM SHAKE SEQUENCE HERE”. You can add here your code using the allowable
commands for the robot.

The second exercise is to modify the reaction
of My Keepon when one of the robot’s buttons is pressed.

Search for this string in the software code:
“//ADD HERE CODE TO MODIFY MOTION AND SOUNDS OF BUTTON TOP OF HEAD”.

The third exercise is now up to you! We are
curious which behaviours you will give to My Keepon. Good luck!!!

Appendix:Communication protocol

Data package structure

1st byte

2nd byte

3rd byte

4th byte to (n+3)th byte

Device Address

Write/Read

Length of data (n)

Data

Device Address:

0x52 - PS232: Sounds controller

0x55 - PS234: Movement controller

0x50: Button states

Write/Read:

0x00 – Write

0x01 – Read

Length of data: numbers of bytes that will be
written/read to/from the device