This post may contain affiliate links. See the Affiliate Disclosure for more information.
Use of information on this site is at your own risk. View the Terms of Service.

AD: This post was reviewed by Grammarly, the Best Automated Proofreader.

Have you ever wanted to host a robotics class for your school, club, or kids? Well, look no further! In this tutorial, I’m going to show you how to make a DIY robot.

This project is great for kids and also affordable for community groups such as Girl Scouts and Boy Scouts. Earn the robotics badges when you complete this project!

Robotics kits can set you back hundreds of dollars per kit or more. However, this article will show how to create cheap robots for less than $30 per kit.

DIY robot tutorial with Arduino
  • Facebook
  • Twitter
  • Pinterest

For about $300, you can create a custom classroom set of robots that will teach hands-on concepts in mechanical design, electronics, and programming.

Not too shabby right?

Plus, students will have a great time designing and decorating their custom chassis. That means no two robots will look alike!

This article is very comprehensive, so I recommend adding it to your bookmarks so that you can find it later!

Let’s get started!

Cheap DIY Robots Materials List

The DIY robotics materials list will create ten robots. Feel free to scale the materials list to best suit the number of robots you want to build.

If you’re working in a group, you can have students work in pairs to maximize your resources.

Furthermore, I wouldn’t recommend having more than two students work together because then one person won’t be as engaged as the other two.

Without further ado, here’s the shopping list for do-it-yourself robots.

Item# per robotQuantity to BuyUnit PriceTotalLink to Buy
Continuous Servo Wheels 2 pack210$13.99$139.90Check Price on Amazon
Arduino Nano 3 pack w/ USB cords14$13.99$55.96Check Price on Amazon
Arduino Nano Shield 5 pack12$15.59$31.18Check Price on Amazon
9V battery connectors 10 pack11$5.55$5.55Check Price on Amazon
IR Sensors 10 pack*22$9.98$19.96Check Price on Amazon
9V batteries 10 pack11$10.99$10.99Check Price on Amazon
Assorted Ribbon Cable*41$5.99$5.99Check Price on Amazon
Caster Wheels11$12.99$12.99Check Price on Amazon
Grand Total$282.52
Cost per robot$28.25
*Optional Items if you want to add sensors to your robot.

You can purchase these kits directly through Learn Robotics & receive 20X LR Patches plus the DIY Activity Guide with printable worksheets!

Lastly, you will need to get a couple of cardboard boxes to make your chassis. If you’re looking for cardboard, check with your local grocery store.

You can also buy some foam board. It’s better to break down the boxes and cut them into pieces before your class. That way students can spend time designing their chassis, rather than fighting over who gets a box.

I also have kits for this project pre-packaged to make your event easier. This is great for groups of 10-20 students! Buy the parts through Learn Robotics and receive 20X Learn Robotics Patches for your group!

Required Tools to Build the Simple Robot

To assemble your robot, you will need the following tools on hand. The quantities given below are the recommended amounts. You can always purchase extra if you feel you need more hot-gluing stations or tools available.

ItemQuantity to BuyUnit PriceTotalLink to Buy
Hot Glue Gun w/ Glue Sticks2$8.99$17.98Buy on Amazon
Mini Screwdriver set2$4.55$9.10Buy on Amazon
Double-sided tape1$4.82$4.82Buy on Amazon
Electrical tape1$5.35$5.35Buy on Amazon
Exacto Knife1$5.71$5.71Buy on Amazon
Scissors2$7.99$15.98Buy on Amazon
Grand Total$58.94
Note: Some of these tools may require help from an adult. Be sure to handle tools properly as they can cause cuts and burns.

If you still haven’t gotten on the Prime bandwagon, you can get Free 2-day shipping for 30-days on Amazon.

Get Organized by Creating Individual “Kits”

Once the parts arrive, make sure you have everything on the list. You don’t want to get started building and realize you’re missing components.

If you’re teaching this project to a group, I recommend creating your own “kits.” Sort the parts so that each kit has enough components to make a single robot. The quantities of parts per robot are listed below.

If you’re short on time or not really up for the task of putting together all these parts, you can buy a group set already pre-packed and ready to go for your next class!

Item# per robot
Continuous Servo w/ Wheels2
Arduino Nano w/ USB cords1
Arduino Nano Shield1
9V battery connectors1
IR Sensors2
9V battery1
Assorted Ribbon Cables4
Caster Wheel1

Build your robotics kit for kids by dividing the bulk components into kits. You can put the components in paper or plastic lunch bags or storage containers to keep them together. Then, distribute a kit to each student or pair when you’re ready to teach the lesson.

Now that we have the components and the kits, it’s time to assemble our robots.

How to Assemble a Robot

This section will guide you through the process of building a simple robot with do-it-yourself components.

Create the Chassis

First, create your chassis with the cardboard sheets. This will be the structure that the components are mounted to. The minimum dimensions required for this robot are 4 inches by 6 inches to fit the controller, motors, and battery.

Here’s the basic rectangular design. Feel free to use your imagination and create other shapes and cutouts for your robot chassis. You can also spend time decorating your robot so that it has your flare! Stickers and markers are good for adding customizations.

rectangular chassis for diy robot
  • Facebook
  • Twitter
  • Pinterest

Another idea is to have students design their chassis. You can tie this project into other classes such as Geometry, Computer Science, or other math classes.

Attach the Motors and Wheels to the Chassis

Once you have your chassis cut, it’s time to add the components from the kit you made earlier.

Secondly, attach the servos using a hot glue gun. You must use hot glue for this because the servos are heavy and will not stay attached using double-sided tape.

attach servos to build a robot
  • Facebook
  • Twitter
  • Pinterest

Ensure the edges of the servos are lined up with the edges of the chassis. This will prevent unnecessary friction between the wheel and the frame.

Next, connect the wheels to the servo horns. Make sure the wires are leading towards the center of the robot (not towards the ends).

attach the wheels to servo motors for your robot
  • Facebook
  • Twitter
  • Pinterest

Thirdly, flip the robot over and hot glue the caster wheel to the back of the frame. Make sure the caster wheel is centered horizontally and about 1 inch from the back of the chassis.

attach caster wheel to bottom of robot diagram
  • Facebook
  • Twitter
  • Pinterest

Our simple robot is now looking like, well, a robot! It’s time to add some electronics to our bot.

Mount the Arduino Nano to the Robot

Rotate the robot back to the upright position. Connect the Arduino Nano to the Arduino Nano Shield. Ensure that the pins are lined up and the USB connector is in line with the DC Barrel Jack. Refer to the diagrams below.

connect Arduino Nano to a shield step by step diagram
  • Facebook
  • Twitter
  • Pinterest

Then place a bead of hot glue on the back of the Nano Sensor Shield. Affix it to the Top of the Chassis. I mounted mine between the two servo motors. You can attach it anywhere it will rest flat towards the front of the robot.

mount Arduino nano to mobile robot
  • Facebook
  • Twitter
  • Pinterest

Finally, plug the battery connector into the 9V battery connector. Hot glue the 9V battery onto the back of the chassis (preferably over the caster wheel).

mount the battery to your robot
  • Facebook
  • Twitter
  • Pinterest

Do not plug the battery into the Arduino Nano Shield. This will turn on the Arduino, which is what we don’t want while we’re plugging in electronics!

That’s it for building a basic robot! Now it’s time to wire up the electronics!

Wiring Electronics for an Arduino Robot

If you’ve never built a robot with Arduino before, this will be an exciting experience for you. The Arduino Nano is a microcontroller that we will program to move the robot around autonomously. You can think of it similarly to the brain of a person.

In this section, I’m going to give a very abbreviated version of how to wire the Arduino Nano. If you’re completely new to Arduino, I recommend checking out these resources to get you on-boarded fast:

Arduino Nano Pinout Diagram

The Arduino Nano has pins that we will connect our motors and sensors to. Here’s the pinout diagram for the Arduino Nano.

Arduino Nano Pinout
  • Facebook
  • Twitter
  • Pinterest

You don’t have to worry about understanding the diagram 100% to complete this project. However, I want you to pay attention to the two sets of pins on the controller.

On the left side, you can see a group of pins labeled A0, A1… through A7. These pins are Analog Input pins. They provide a 10-bit reading from sensors. If you read a sensor on any of these pins, the data will come in the range of 0-1023.

We won’t be covering analog signals in this tutorial, but if you’re interested in learning more about how Arduino works, check out my Beginner Arduino Course. It’s designed to get you up to speed with building and wiring sensors for rapid prototyping.

Furthermore, on the right side, you’ll notice a group of pins labeled 0, 1, 2… through 12. (13 is on the left.) These pins are Digitial Input and Output pins. Digital signals provide an input or output value of a 1 or 0 (1-bit).

Lastly, find the pins labeled 5V (red) and GND (black). These are your power pins. You’ll use them to power the servos and sensors added to the robot.

Note: The Arduino Nano is connected to the Nano Shield so the pins from the controller share the same signals with the shield.

Now that you have a brief overview of the controller, let’s start wiring our components.

There are only two components that you’ll need to wire into the Arduino Nano Sensor shield. (Three if you choose to install the IR sensors.)

Servo Motors Wiring to Arduino Nano

Most servos have limited degrees of rotation (typically 270-degrees); however, these servos are Continuous Rotation Servos, which means they rotate the full 360-degrees.

Servo Motors have 3 wires: Ground, Power, and Signal. Connect them to the controller as shown in the diagram below. The right servo will be controlled on Digital Pin 6. The left servo will be controlled on Digital Pin 3.

diy robot wiring fritzing
  • Facebook
  • Twitter
  • Pinterest

Now that the robot is wired, it’s time to program the servos to get our robot moving!

Program a Simple DIY Robot

The moment you’ve been waiting for is here! Finally, we can program our simple robots!

If this is your first time using Arduino, I recommend reading my article, Four Steps to writing any Arduino Program, before getting started.

Preparation Checklist: (You must do these before beginning the projects.)

Tip: Prop your robot up on a book so that it doesn’t fly off the table when you program it.

The Servos can be controlled using the Servo Library from Arduino.

The write() the method can be used to control how the servos turn. On a continuous rotation servo, we can provide an input parameter to control speed and direction.

It works like a sliding scale. Think of 90 as the center of a line. 0 is full-speed back and 180 is full-speed forward. Any numbers in between are a fraction of the speed in that direction.

code-continuous-servo-motors
  • Facebook
  • Twitter
  • Pinterest

We will use this information to create solutions to the example projects. Because we have motors mounted in opposing directions, we’ll have to modify the Input Parameter Value for the right side by flipping our timeline. For example, 180 will be full-speed backward and 0 will be full-speed forward.

Project #1 – Learn how to move the robot

It’s important to know how the motors work on our robot. This example will teach you how to set the speed and direction of the servo motors for various challenges.

I recommend propping the robot up on a book so that it doesn’t roll off the table for this activity. Keep the battery unplugged from the robot until you’ve uploaded the sketch.

First, include the Servo library. In the Arduino IDE Go to Sketch > Include Library > Servo.

Now, let’s create some Servo instances.

#include
/*
* Simple Robot Sample Code
* by Liz Miller
*
*/
Servo left;
Servo right;
int go = 1; //initialize the main loop

Next, assign a pin to the servo instances. This will be the PIN the servo is connected to on the Arduino Nano. (The Arduino Nano and the Arduino Nano Shield share the same pin connections.)

void setup() {  
  // put your setup code here, to run once:  
  left.attach(3); //left servo on D3  
  right.attach(6); //right servo on D6
}

It’s a good idea to initialize the servo speed to zero to prevent unnecessary motion during startup. See below.

void setup() {  
  // put your setup code here, to run once:  
  left.attach(3); //left servo on D3  
  right.attach(6); //right servo on D6
  left.write(90);
  right.write(90);
}  

Remember the sliding scale we talked about earlier. If 90 is the center at full-stop, then 0 is full-speed backward and 180 is full-speed forward.

All the numbers in between are fractional speeds in that direction. Let’s look at how the robot moves when we control the left servo motor.

void loop() {  
  // put your main code here, to run repeatedly:  
  left.write(180);  //run the left servo full speed forward 
}  

Notice the direction that the servo moves in. Next, let’s move both motors.

void loop() {  
// put your main code here, to run repeatedly:
  while(go==1){  
    left.write(180);  //run the left servo full speed forward 
    right.write(180); //run the right servo full speed forward
    delay(2000);
    left.write(90);
    right.write(90);
    go=0;
   }
}

You’ll notice that the robot spins because the right motor is mounted in the opposite direction. Update the right motor value from 180 to 0. Then, rerun the code. You should see your robot move forward for 2 seconds and then stop.

Need help? Download the full example code below!

If you’re looking for additional projects to make, you can purchase our pre-packaged kit that includes an activity guide with printable worksheets!

Connect the Battery to the Arduino Nano

Finally, when you’re ready to run the robot untethered from your computer, disconnect the USB cable and connect the 9V battery to the Arduino Nano shield barrel plug. The robot should turn on and start moving!

9v to Arduino nano
  • Facebook
  • Twitter
  • Pinterest

Tip: To prevent the robot from running unexpectedly, you can add a Power Switch to your robot by wiring the switch in Series with the Red Cable.

Add Sensors to the Simple Robot

This guide was meant to be a starting point for robotics. I want to briefly touch on how to take the next step and add sensors to your robot. In this section, I will show you how to install and wire IR sensors for your robot.

Mount IR Sensors to the Robot

If you decided to purchase a few packs of IR Sensors, follow these mounting instructions.

First, cut a 1” tall strip of cardboard and hot glue the base to the front of the robot.

attach IR sensors to robot
  • Facebook
  • Twitter
  • Pinterest

Next, affix the IR sensors in the vertical position on the front of the cardboard using a couple of dots of hot glue. Make sure that the bottoms of the LEDs are close to the ground, but not touching the ground. Place the IR sensors about ½” to 1” away from each other.

mount IR sensors
  • Facebook
  • Twitter
  • Pinterest

Now that the robot is built, we will move on to wiring up the components.

completed simple robot diy exploded view
  • Facebook
  • Twitter
  • Pinterest

Wire an IR Sensor to Arduino Nano

The IR Sensors can be wired as Digital or Analog sensors depending on how you want to read data from the environment.

IR Sensors have 3 pins: Ground (GND), Power (Vcc), and Signal (Out). Peel off a section of 3 cables to connect the IR sensor to the Arduino Nano Shield. Repeat this process for IR sensor 2.

  • Facebook
  • Twitter
  • Pinterest

The Signal Wire will be connected depending on if you want to read the sensors digitally or using analog pins. Analog readings are more accurate but also more challenging to program.

Digital Wiring: Connect the Signal Pins to D4 and D5 for 1-bit Digital readings (0 or 1).
Analog Wiring: Attach the Signal Pins to A0 and A1 for 10-bit Analog readings (0-1023).

For a detailed guide on how to wire and program an IR sensor, check out this tutorial.

How to Program an IR Sensor with Arduino

To program an IR sensor with Arduino, you’ll want to use some if-statements to check the readings from the IR sensors. Because we have two IR sensors, we can capture readings from both sides and turn ourselves closer to the line. This gives the perception of “line following.”

  • Facebook
  • Twitter
  • Pinterest

Now let’s translate this to code. If the sensor is on the line, keep going, otherwise, rotate towards the center of the robot. We’ll use an if-statement and the reading from each IR sensor. Here’s an example:

  • Facebook
  • Twitter
  • Pinterest

You’ll have to capture readings from your sensors before writing the conditional statements. That way you’ll be comparing the current condition against your desired condition (i.e. on the line).

This is beyond the basics for beginners, so don’t worry if you don’t fully understand this step. I recommend checking out this guide. If you need additional help, try our Beginner Arduino course and learn the specifics for reading sensors and making decisions.

Contribute to this Project

This project was designed as a starting point for groups and organizations looking to get into the robotics space without spending thousands of dollars.

No part of this project may be copied, reproduced, or sold. It is designed for Educational Use only. This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Support Future Updates & Improvements

It’s important to me that this project is free and available to everyone, but any contributions that can help with all that has gone into it would be hugely appreciated. Click here to Support this Project.

Purchase Group Robotics Set

I also have kits for this project pre-packaged to make your class or event easier. This is great for groups of 10-20 students! Buy the parts through Learn Robotics and receive 20X Learn Robotics Patches for your group! You’ll also get Learn Robotics Certificates, DIY Robotics eBook, Excel Spreadsheet, and Additional Example Projects! Click Here to Purchase Your Group Robotics Set

Did you make this project? Tag me in your photos on Facebook and Instagram (@learnrobotics).

Like my work? Keep me caffeinated.

global robotics competition online

Get Notified of the Next Competition

 

Be the first to know when we launch our next online robotics competition. Plus gain FREE robotics tips to your inbox.

You have Successfully Subscribed!

liz miller learn robotics


GIVE ME 1 WEEK IN YOUR INBOX

Gain Access to FREE robotics projects.

You have Successfully Subscribed!

GET YOUR FREE COPY

Enter your email below!

Get ready to build a tiny robot! Check your email for the download!

Gain Arduino Skills, FAST!

Take our online Arduino for Beginners Course, and learn to build projects using Arduino.

Enter your email to receive more information about the course.

learn to prototype with Arduino online course

You're in! Check your email for some awesome updates!

Pin It on Pinterest