Build an OTTO DIY robot with Arduino

FunduinoPublished on

Vom Bausatz zum tanzenden Roboter mit Ultraschall-Augen

Der OTTO ist ein kleiner, süßer Roboter. Vier Miniaturservos treiben ihn an, sodass er seine beiden Beine und Füße getrennt bewegen kann. Die Programmierung mit der Arduino-Software ist sehr einfach: Genau wie in unseren anderen Anleitungen programmierst du die einzelnen Module nach und nach.

Mit etwas Ausdauer und Geschick beim Programmieren bewegt sich der Roboter wie ein Tänzer und pfeift seine eigene Melodie. Auch Gegenstände erkennt er problemlos – dafür sorgt der eingebaute Ultraschall-Abstandssensor.

Den OTTO gibt es auch als Komplettset.

Assembled OTTO DIY robot with an ultrasonic sensor as eyes
The Funduino OTTO
All components of the OTTO kit laid out side by side
The components at a glance
1 / 2

You need this

Microswitch - miniature push button, normally open, various sizes Microswitch - miniature push button, normally open, various sizes — 7 * 7mm 0,63 € *Item no. F23106890About the product — Microswitch - miniature push button, normally open, various sizes — 7 * 7mm
Otto robot - DIY experiment kit, Arduino-controlled Otto robot - DIY experiment kit, Arduino-controlled — with enclosure 39,90 € *Item no. F23105681About the product — Otto robot - DIY experiment kit, Arduino-controlled — with enclosure
Funduino SG90 servo motor - 9 g, 180°, 3.5-6 V Funduino SG90 servo motor - 9 g, 180°, 3.5-6 V 2,33 € *Item no. F23107201About the product — Funduino SG90 servo motor - 9 g, 180°, 3.5-6 V
V3.0 expansion board for Arduino Nano - 37 digital, 8 analog pins V3.0 expansion board for Arduino Nano - 37 digital, 8 analog pins 2,43 € *Item no. F23107461About the product — V3.0 expansion board for Arduino Nano - 37 digital, 8 analog pins
HC-SR04 Ultrasonic Sensor - distance measurement 2-400 cm, 5 V HC-SR04 Ultrasonic Sensor - distance measurement 2-400 cm, 5 V 2,26 € *Item no. FUN-1010564About the product — HC-SR04 Ultrasonic Sensor - distance measurement 2-400 cm, 5 V
Passive buzzer - 5 V speaker, PWM control Passive buzzer - 5 V speaker, PWM control 0,90 € *Item no. F23106769About the product — Passive buzzer - 5 V speaker, PWM control
Funduino Nano R3 Microcontroller - ATmega328P, CH340, Soldered Funduino Nano R3 Microcontroller - ATmega328P, CH340, Soldered 9,18 € *Item no. FUN-1010562About the product — Funduino Nano R3 Microcontroller - ATmega328P, CH340, Soldered
Breadboard cables female-female - 40 pieces, 20 cm Breadboard cables female-female - 40 pieces, 20 cm 1,67 € *Item no. FUN-1010559About the product — Breadboard cables female-female - 40 pieces, 20 cm
9 V battery clip - 5.5 x 2.1 mm DC barrel plug, 15 cm cable 9 V battery clip - 5.5 x 2.1 mm DC barrel plug, 15 cm cable 0,96 € *Item no. F23106613About the product — 9 V battery clip - 5.5 x 2.1 mm DC barrel plug, 15 cm cable
DC Barrel Jack Adapter 5.5 x 2.1 mm - male, screw terminal, up to 24 V DC Barrel Jack Adapter 5.5 x 2.1 mm - male, screw terminal, up to 24 V 0,96 € *Item no. F23106646About the product — DC Barrel Jack Adapter 5.5 x 2.1 mm - male, screw terminal, up to 24 V

All 10 parts together 61,22 € *Ready to ship immediately · Delivery time: 1-3 business days

* All prices include statutory VAT, plus shipping costs.

Funduino OTTO or OTTO DIY?

OTTO DIY has a very large community. You can find all the information in the OTTO DIY GitHub repository. If you have a 3D printer, you can also print the parts yourself. There are now many versions of the robot available to download from Thingiverse —some have only been modified cosmetically, while others offer additional features.

Funduino has created its own design. This doesn’t change the programming—only the assembly differs in three ways:

  • The NANO ProtoShield, the board with the connected modules, is attached to the back wall of the robot’s lower body instead of underneath the head. Advantage: When you need to work on the electronics, removing the head won’t cause most of the electronics to fall out.
  • With the ProtoShield standing upright, the power connection is on top of the head and accessible through an opening. Advantage: During programming, you can briefly connect an external power source without removing the head.
  • Because the connection is on the outside, you no longer need an on/off switch: To start, simply plug in the connector at the top of the head. This saves you from having to solder the switch, and the standardized connector on the ProtoShield gives you a lot of flexibility when it comes to the power supply.

You can get the Funduino OTTO kit with or without a printed enclosure from the Funduino shop: Order OTTO here.

Self-printed enclosure parts for the OTTO robot
Enclosure parts from the 3D printer

Set two servos to 90°

First set two of the servos to 90°. To do this, attach the fitting and turn the servo to 90°.

The SG90 servo motor with the attachment fitted is turned to 90 degrees.
Set the servo with the attachment fitted to 90°

Insert the servos into the torso

Insert the servos into OTTO’s body and screw them in place.

Two servomotors inserted and screwed into the lower part of OTTO
The servos in OTTO’s belly

Insert clips into the legs

Insert the cut-to-size clips into OTTO’s legs.

A trimmed clip is inserted into one leg of the OTTO.
Insert clips into the legs
OTTO leg with clip inserted
The clip is in the leg.
1 / 2

Screw the legs onto the belly

Now screw the legs onto OTTO’s body.

The legs of OTTO are screwed onto the base.
The legs are screwed onto the belly.
OTTO with both legs attached
Both legs installed
1 / 2

Insert clips into the feet

Then insert a short, trimmed clip into each foot and screw it in place.

Install the servos in the feet

Align the two remaining servos to 90° as before, insert them into the feet, and screw them in place.

A servo set to 90 degrees is inserted into one of OTTO’s feet.
Install servos in the feet
Servo screwed into the foot of OTTO
The servos in the feet are screwed in.
1 / 2

Route the servo cables and clamp the feet in place

Route the servo cables through the legs into the inside of OTTO’s body. Then clamp the feet in place and screw in the servos.

Plug in the NANO and connect the servos.

Insert the NANO microcontroller into the expansion board and connect the servo cables as follows:

  • Left leg – Pin 2
  • Right leg – Pin 3
  • Left foot – Pin 4
  • Right foot – Pin 5

Then insert the expansion board into the holder in the torso.

Use the ultrasonic sensor

Now insert the ultrasonic sensor into the eye opening.

The HC-SR04 ultrasonic sensor is inserted into the eye opening of the OTTO.
The ultrasonic sensor goes into the eye opening
OTTO head with ultrasonic sensor installed
The sensor is in the head.
1 / 2

Wire up the ultrasonic sensor

Take four jumper wires and connect them to the ultrasonic sensor. Connect the other ends to pins 8 and 9. You may have already noticed the G, V, and S labels on the expansion board - they’re important now:

  • Trig – Pin 8, row S
  • Echo – Pin 9, row S
  • Vcc – Pin 9, row V
  • GND – Pin 8, row G

Connect the speaker

Connect two more jumper wires to the speaker and connect them to pin 13 on the Expansion Board. Connect the positive side to S and the negative side to G.

Connect the battery - fully assembled

Now is a good time to connect the battery clip to the battery and feed it through the opening.

Done! Well… almost. You still need to program OTTO.

Fully assembled OTTO robot before programming
The fully assembled OTTO

Include the library and assign the pins

For this, you need the Arduino IDE and have to upload a program to OTTO. The easiest way is to search for OttoDIYLib in the IDE - this library makes programming your OTTO much easier.

Always add this block at the beginning of your code so you can access the library:

Include the library and assign the pins
#include <Otto.h>
Otto Otto;
#define LeftLeg 2   // Left leg pin
#define RightLeg 3  // Right leg pin
#define LeftFoot 4  // Left foot pin
#define RightFoot 5 // Right foot pin
#define Buzzer 13   // Speaker pin

The setup part

The following must also be included in the setup:

The setup part
void setup() {
  Otto.init(LeftLeg, RightLeg, LeftFoot, RightFoot, true, Buzzer);
  Otto.home();
}

Movements

You can now access various functions that OTTO can perform. The parameters mean:

  • steps – how many times the movement is repeated without you having to write additional lines of code
  • time (shown below as T) – the execution time in milliseconds. A higher value slows down the movement. Try values between 500 and 3000: 3000 = very slow, 2000 = slow, 1000 = normal, 500 = fast.
  • direction – when walking: 1 = forward, -1 = backward. When turning and bending: 1 = left, -1 = right.

Otto.jump() has no direction parameter – that would be pointless when jumping. OTTO can’t actually jump properly, but at least it tries.

Movements at a glance
// Gehen: richtung 1 = vorwärts, -1 = rückwärts
Otto.walk(schritte, zeit, richtung);
Otto.walk(2, 1000, 1); // Beispiel: zwei Schritte vorwärts in 1000 ms

// Drehen: richtung 1 = links, -1 = rechts
Otto.turn(schritte, T, richtung);

// Beugen: richtung 1 = links, -1 = rechts
Otto.bend(schritte, T, richtung);

// Bein schütteln
Otto.shakeLeg(schritte, T, richtung);

// Springen: hier gibt es keinen Richtungsparameter
Otto.jump(schritte, T);

Dances

There is another parameter for the dances: h describes the size of the movements. This makes the dances more interesting. The useful value ranges are listed as comments after each command.

Dances at a Glance
// h beschreibt die Größe der Bewegungen

Otto.moonwalker(schritte, T, h, richtung); // 1 = links, -1 = rechts; h zwischen 15 und 40
Otto.crusaito(schritte, T, h, richtung);   // 1 = links, -1 = rechts; h zwischen 20 und 50
Otto.flapping(schritte, T, h, richtung);   // 1 = vorne, -1 = hinten; h zwischen 10 und 30
Otto.swing(schritte, T, h);                // h zwischen 0 und 50
Otto.tiptoeSwing(schritte, T, h);          // h zwischen 0 und 50
Otto.jitter(schritte, T, h);               // h zwischen 5 und 25
Otto.updown(schritte, T, h);               // h zwischen 0 und 90
Otto.ascendingTurn(schritte, T, h);        // h zwischen 5 und 50

Sounds and gestures

OTTO can produce different sounds and sing songs. By changing the contents of the parentheses, you can easily play different melodies. To repeat a melody, simply call the function again.

Available melodies: S_connection, S_disconnection, S_buttonPushed, S_mode1, S_mode2, S_mode3, S_surprise, S_OhOoh, S_OhOoh2, S_cuddly, S_sleeping, S_happy, S_superHappy, S_happy_short, S_sad, S_confused, S_fart1, S_fart2, S_fart3.

The best part comes last: By combining movements and sounds, OTTO expresses different gestures and emotions using the Otto.playGesture() function. As you can see, it's actually pretty simple - but it looks pretty advanced.

Sounds
// Melodie abspielen – songName aus der Liste unten einsetzen
Otto.sing(songName);

// Einzelnen Ton abspielen (Notenfrequenz, Abspielzeit, Pause danach)
Otto._tone(10, 3, 1);

// Tonübergang (Ausgangsfrequenz, Schlussfrequenz, Zusatz, Abspielzeit, Pause danach)
Otto.bendTones(100, 200, 1.04, 10, 10);
Gestures
Otto.playGesture(OttoHappy);
Otto.playGesture(OttoSuperHappy);
Otto.playGesture(OttoSad);
Otto.playGesture(OttoVictory);
Otto.playGesture(OttoAngry);
Otto.playGesture(OttoSleeping);
Otto.playGesture(OttoFretful);
Otto.playGesture(OttoLove);
Otto.playGesture(OttoConfused);
Otto.playGesture(OttoFart);
Otto.playGesture(OttoWave);
Otto.playGesture(OttoMagic);
Otto.playGesture(OttoFail);
Rate the instructions

Comments

Ask a question or share an experience

Contact us if something doesn’t work. Please include your board and the error message.

We review every comment before publication. Your email address remains with us.