Introduction: Yogy - the Arduino Powered Robot Made for Kids

Picture of Yogy - the Arduino Powered Robot Made for Kids

In this Instructable I will show you how to make a cute and kid friendly Obstacle Avoiding Robot I like to call Yogy.

Yogy gets his name from the Yoghurt tub body he is made from. I am a sucker for seeing the best in trash and this Yoghurt tub looked too good to be thrown away. I salvaged it and decided to give it a new life, a better life, a life as a robot!

You can follow through with me and make Yogy by following the written steps or pictures, which are pretty self explanatory.

Or if you don't feel like reading through and clicking with your mouse, you can check out the videos of the build with commentary!

Step 1: Parts List

Electrical Parts:
• Arduino Uno
• Prototyping Shield + Mini Breadboard
• 2 * Continous Rotation Servos + 2 * Wheel Servo Horns
• HC-SR04
• 8 Ohm Speaker
• Male and Female Breadboarding Jumper Cables
• 4 * AA Batteries + Pack
• 9V Battery
• Power Switch

Construction Parts:
• Yoghurt Tub
• Acrylic or a CD (or any other material you can make a base from)
• Small Square Bracket
• Small Screws
• Coke Bottle Lids

• Coping Saw
• Screwdriver
• Stanley Knife
• Hot Glue Gun + Glue Sticks
• Wire Cutters
• Wire Strippers
• Double Sided Foam Tape

Optional Extras:
• 2 * APC220 RF modules
• Soldering Iron + Solder
• Scrap Pieces of Cardboard
• Electrical Tape

Step 2: Marking the Layout

Picture of Marking the Layout

First you will need to trace the outline of your yoghurt tub onto the material that you wish to use as the base of the robot. This particular tub is 12.5 cm in diameter and 10 cm tall.  If you can’t find something similar in size go larger, as any smaller and all the components won’t fit.

Next you will want to place your continuous rotation servos onto the template and arrange them so that the output splines are in the centre of the circle. This is important as it keeps the centre of rotation in the centre of the robot, meaning the robot can turn around on a point. Once you have them where you would like trace around the servos with a marker.

Next grab the circular servo horns and mark around them. You do this because we will have to cut holes in the base to allow the wheels to poke through. Make sure you have sufficient room and mark the holes you need to cut out.

Step 3: Preparing the Drivetrain

Picture of Preparing the Drivetrain

One method to cut out the wheel holes is to drill two holes either end of the wheel hole with a drill bit the same diameter as that of the width of the hole. Using a Coping Saw connect the two holes together. Once this is done double check to make sure there is enough clearance between your wheel and the hole as you don’t want the two to rub against each other.

Once you are happy that your two servos and wheels are going to fit nicely you can peel the protective sheet off the acrylic.

Attach a strip of Double Sided Foam Tape to the side of the servo, this will be used to attach it to the base.

Attach another strip of Double Sided Foam Tape to the bottom of the servo, this will be used to join the two servos together.

Step 4: Attaching Drivetrain and Power

Picture of Attaching Drivetrain and Power

Peel the protective sheet off the bottom strip of tape and join the two servos together. Press them together quite firmly and hold for a few seconds to ensure the bond is adequate.

Then peel the protective sheets of the two sides of tape and press them against the base. Again it is important to press and hold to make sure they are really well stuck together. The next stage is to mount the batteries. In my case I am using a 4.8V rechargeable battery pack so first I need to see if it can fit.

Placing the battery pack at the back of the servos and placing the yoghurt tub over them all makes it clear that it will all fit together nicely. You can then begin to attach Double Sided Foam Tape to the back of the battery pack.

Peel the protective sheet off the tape and attach it to the two servos.

Step 5: Attaching Arduino

Picture of Attaching Arduino

Next attach another bit of Double Sided Foam Tape to one servo and attach the Arduino Uno to it on the flat section of the underside. (The bit where the Arduino logo is)

After doing this, your robot should look a little something like this.

Step 6: Sensor Mounting and Wiring

Picture of Sensor Mounting and Wiring

Next grab a scrap bit of cardboard and create a template for the Ultrasonic Sensor. Cut out the template and the holes for where the ‘eyes’ will go.

Tape the template to the yoghurt tub where you would like the sensor to go and trace around the ‘eye’ holes with a marker. You can then cut or drill out these holes and insert your sensor into it. Using a combination of Female and Male Breadboarding Jumper Cables connect the Trigger of the sensor up to Digital pin 6 of the Arduino. Connect the Echo to Digital pin 7. Connect the Vcc up to the 5V and connect the GND up to the Ground of the Arduino. Next you will need to connect your two continuous rotation servos shown in the included diagram.

Step 7: Checkpoint

Picture of Checkpoint

Now your robot should be looking something a little like this.

Step 8: Giving the Arduino Power

Picture of Giving the Arduino Power

Next we will need to give power to the Arduino, we will be doing this with a 9V battery. The 9V battery will be placed underneath the Arduino and in-between the two mounting brackets on the Continous Rotation Servos. We will need a power switch as so we don’t need to keep pulling the robots lid off to turn it on and off, so we need to mount it on the body. Measure the travel distance of your switch.

Mark an appropriately sized hole on the body large enough for the travel distance of your switch and cut it out. Test your switch to make sure it has enough room to move.

Step 9: Mounting Switch and Battery

Picture of Mounting Switch and Battery

Now attach the the switch to the body using some small screws. You can use a metal scewer to poke holes in the yoghurt tub to allow the screws to go through. Next measure up the Aluminium Square Bracket along the 9V battery to see how much you will need to hold it in place.

Mark on the body where it will go and mark on the bracket how much you will need. Cut it to shape using a Coping Saw and attach it to the body using Hot Glue. There should only be just enough room to allow your 9V battery to slide in as you want it to be a tight fit to hold it in place. Connect the 9V battery up to the switch and connect the positive end of the switch to the Vin pin of the Arduino and the ground to the GND pin on the Arduino.

Step 10: Attaching Wheels and Castors

Picture of Attaching Wheels and Castors

Now you will want to attach your wheels to your servos using the screws that come with your servos. Next grab two coke bottle lids and place them alongside your robot, these will act as castors to prevent your robot from wobbling too much.

Mark how much you need to cut off with a marker and cut it with wire cutters.

Grab the two smooth ends of the coke bottle lids and hot glue them to the underside of your robot.

Now you can drill some small holes around the perimeter of your bot and screw the body in place.

Step 11: Coding

Now I have attached two code files here. One is for basic obstacle avoidance use and is heavily commented. The other code is for more advanced users and offers a lot of cool features with no commenting. 

The more Advanced code uses some speaker functions and some serial control.

Basic Code:

Advanced Code:

Step 12: Finished!

Now one of the main points of this bot is to completely customize it how you want. I've added a speaker, LED and an RF module onto mine to turn it into a really cool little toy for kids. You can watch the videos below to see how he goes. All the fancy things he does are included in the Advanced code but just the plain and simple Obstacle Avoidance is in the basic. You will also see in the videos I have created a wireless SNES controller to control him. The SNES controller is great for kids as it has basic controls and the buttons are colour coded. I will show you how to make your own controller soon :)

Have fun!


jluyt123 (author)2016-09-29

The links are broken and I can not get the code. Tried this link too, which is ALSO down.

Can anyone help we to get the code?

Bazcreations (author)jluyt1232016-10-15

#include <NewPing.h>

#include <Servo.h> //Inclue Servo Library

Servo leftServo; //Create Left Servo object

Servo rightServo; //Create Right Servo object

#define TRIGGER_PIN 6 //Trigger pin of Ultrasonic sensor connected to pin 6

#define ECHO_PIN 7 //Echo pin of Ultrasonic sensor connected to pin 7

#define MAX_DISTANCE 100 //The maximum distance we want the sensor to look for is 1m

NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); //Create Ultrasonic sensor object

unsigned int time; //Variable to store how long it takes for the ultrasonic wave to come back

int distance; //Variable to store the distance calculated from the sensor

int triggerDistance = 30; //The distance we want the robot to look for a new path

int fDistance; //Variable to store the distance in front of the robot

int lDistance; //Variable to store the distance on the left side of the robot

int rDistance; //Variable to store the distance on the right side of the robot

void setup()


leftServo.attach(9); //Left servo connected to pin 9

leftServo.write(90); //Write the neutral position to that servo

rightServo.attach(8); //Right servo connected to pin 8

rightServo.write(90); //Write the neutral position to that servo


void loop()


scan(); //Get the distance retrieved

fDistance = distance; //Set that distance to the front distance

if (fDistance < triggerDistance) { //If there is something closer than 30cm in front of us

moveBackward(); //Move Backward for a second


moveRight(); //Turn Right for half a second


moveStop(); //Stop

scan(); //Take a reading

rDistance = distance; //Store that to the distance on the right side


delay(1000); //Turn left for a second

moveStop(); //Stop

scan(); //Take a reading

lDistance = distance; //Store that to the distance on the left side

if (lDistance < rDistance) { //If the distance on the left is smaller than that of the right

moveRight(); //Move right for a second


moveForward(); //Then move forward


else {

moveForward(); //If the left side is larger than the right side move forward



else {

moveForward(); //If there is nothing infront of the robot move forward



void scan() {

time =; //Send out a ping and store the time it took for it to come back in the time variable

distance = time / US_ROUNDTRIP_CM; //Convert that time into a distance

if (distance == 0) { //If no ping was recieved

distance = 100; //Set the distance to max




void moveBackward() {




void moveForward() {




void moveRight() {




void moveLeft() {




void moveStop() {




thats the basic code you need to install the newping library as well also im havin an isssue where yogi only moves backwards can anyone help

907_JesseJones (author)2015-12-02

I'm in the process of building a Yogi for my son's birthday. The problem I'm running into is that it won't roll straight. Instead, it drifts right which causes issues with obstacle avoidance. I've tried pulling up the servos and re-aligning them but they are probably 15-degrees left angle now and it still drifts right! I believe that the servos are rotating faster one direction than the other and I'd like to adjust the speed of one to compensate, but I don't see if/where that can be done in this code. Any thoughts?

907_JesseJones made it! (author)907_JesseJones2015-12-18

I resolved the issue with a better set of servos. Here is the final product. And my son loves it! :)

spike02 (author)2015-02-27

Is there a way that I could control its movements via a smartphone or tablet?

Miztlinette (author)spike022015-07-24

Sure! You need a Bluetooth Module and there's an app for Android named BlueTerm.
Let me show you some links:

I love Yogy, btw :3

sblondron (author)2015-03-18

the links are down... so i have the robot but no code..

spike02 (author)sblondron2015-03-24

Go to and the code download link is near the bottom

Ethereo (author)2014-04-01

I had problems with the library so, i add it

and the connection diagram of the HC-SR04 is missing, I know is obvious but is missing.

Thanks for the proyect t!!!

techbrarian (author)2013-11-15

hi there, i'm having a blast building the yogy. when i try to compile the code, i get a series of error messages revolving around a "redefinition of 'Servo leftServo'. ideas?

nardisk (author)2013-10-05

I get an error on "NewPing sonar (TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); / / Create Ultrasonic sensor object" what exactly should I enter?...

chickenparmi (author)nardisk2013-10-15

Have you installed the newping library?

adrianalexander (author)2013-10-11

Same issue here. The Ping))) sensor combines trigger and echo pins into 1 "Signal" pin. Can't figure out how to adjust the code in a such a way to read both signals from the 1 pin. Ideas...?

rpinto9 (author)2013-08-12

I was wondering if i can turn this onto a dog's possible?

chickenparmi (author)rpinto92013-08-12

Of course it's possible, anything is possible. First you would need to waterproof the body, so the dog could take it outside. It might be a good idea to add cushions or something similar around the outside to give the dog something to grab onto. You could even have a small servo inside the bot that lets out dog treats. Good luck!

makesomeso (author)2013-08-07

another great creation of yours.

makesomeso (author)makesomeso2013-08-07

like it very much

chickenparmi (author)makesomeso2013-08-07

Thank you very much! Glad you liked it!

looserboy (author)2013-08-06

Hi, very nice project.
I've made many robots like yours by the past but due to a huge lack of time, i've stopped.
When i see a so cute robot like this one, it make me to think about finding some spare time to restart this activity.

profpat (author)2013-08-05

very good instructables!

chickenparmi (author)profpat2013-08-05

Thank you very much, glad you liked it!

ynze (author)2013-08-05

Nice project! Did you do this with kids already, or is it a prototype?

chickenparmi (author)ynze2013-08-05

Already done with the kids :) I have a 3yo sister so she was the first candidate to play with it. Its nice because the tub encapsulates and protects it all, so little hands can't pull out cables. If you add a SNES wireless controller, which I will make an Instructable for later, it makes it really easy for them to control too.

monkeynuts (author)2013-08-05


About This Instructable




Bio: Robot fanatic.YouTuber. Robotics teacher.
More by chickenparmi:Making an Arduino Powered Curtain AutomationArduino Powered Jack-O'-lanternToilet Paper Roll Spooky Eyes
Add instructable to: