Welcome everyone to this week’s article on the Learn Robotics blog!
I’m going to be starting something completely new called the “Beginner Bots” tutorial series. In this series, I’m going to show you how to create an Arduino-based mobile robot start to finish. These weekly lessons are designed to walk you through the steps to creating a functional mobile robot, so if you’ve ever wanted to build a robot from scratch, then this tutorial series is for you!
We also have a dedicated Robotics eCourse that goes BEYOND these posts and gives you lessons in a digestible format. If you’re the kind of person who likes to be organized while learning, then the eCourse will be your best bet.
You’ll also gain access to additional robotics projects, quizzes, and a Course Certificate. Learn more about our Robotics eCourse here. Perfect way to showcase your skills on a Resume or College Application! Now, without further hesitation, let’s jump into Part 1!
How to Build a Mobile Robot using Arduino
Each week I will provide you with the objectives (goals of the lesson) and any materials you will need to complete the project.
Part 1 – Goals & Objectives
- Purchase materials to complete the Beginner Robotics Series
- Review each component of the mobile robot (part identification & purpose)
- Configure our computers with the correct software while our parts are on order.
- Time Duration: Approximately 1 hour
This tutorial series is based on the Elegoo Arduino Smart Robot Car kit. You can purchase the kit on Amazon for about $70. I recommend this kit because it provides a lot of value for the money and the components can be utilized in a number of robotic projects.
While you can follow along without purchasing the kit, it’s always more beneficial to be hands-on with a robot and try out the lessons for yourself. With that said, if you’re on a tight budget, I will be reviewing the components of the kit, below, so you can choose to purchase them separately.
- Multitool (I use a Leatherman Wingman)
- Household Tool Set
- Screwdriver Set
- Drill (Faster to construct everything)
- Computer with at least 1 USB port (any OS is fine)
Earn a Completion Certificate!
Join the Robotics eCourse and earn a Course Completion Certificate. It’s a great way to showcase your robotics projects and test your knowledge. Sign up here!
What is a Robot?
We’re building a mobile robot. But first, what’s a robot? A simple definition: a robot is an automated device that uses sensors and algorithms (software) to respond to and make decisions about its environment.
Think Software meets Mechanics meets Electronics.
There are 3 main components of our mobile robot:
- Control System: how our robot processes information. In most cases, the brain is also called a microcontroller. We’re using the Arduino Uno R3.
- Drive Train: how our robot moves. It includes a four-wheel, 4-wheel-drive (4WD) system.
- Sensor System: how our robot detects its environment. We will be starting off with Infrared (IR) and Ultrasonic sensors in the upcoming lessons. You can see an IR sensor attached to my robot now.
I’ve created a more detailed map of each component of the Elegoo kit, below.
The Parts of Our Robot
There are quite a few components necessary in order to build a mobile robot. As you can see from the list below, there are a lot of parts, which can be pricey when purchased separately. This is one of the reasons why I recommend picking up a kit.
However, as mentioned earlier, if you already have spare parts, or are on a budget, these are the things you will need to have in order to follow along with this series.
Check out the parts we’re using below:
- Arduino Uno R3: Microcontroller for this project. Similar to a brain, it does all the processing of information and calculations.
- Arduino Sensor Shield: Provides additional ports for sensors. This is similar to a USB hub (splits an existing port into multiple ports for use by multiple devices).
- L298N Motor Driver: Controls the motors of our robot
- Base Plate, 4X Wheels, 4X DC Motors: This is our car chassis. Holds all of the electronics and provides the structure to our robot.
- 2X Infrared (IR) Sensors
- 2X Ultrasonic Sensors
- Assorted Wires
- Battery Pack (6X AA battery holder + 6X AA batteries) or 7.2V Hobby Battery
- On/Off Switch
- DC Socket Plug
- USB A-male to B-male cable
After you gather and/or order the parts you need, you can continue on with configuring your computer with the programming software.
Get the Software Configured
You have two options when it comes to programming. You can program offline in an IDE (Integrated Development Environment) or you can use the online IDE on the Arduino website.
- Download a copy of the Arduino IDE. This is a great option if you’re not always connected to the internet, or do not want to worry about having internet to work on your robot.
- Create an account on arduino.cc for access to the online Arduino IDE. An internet connection is required for this option.
If you’ve chosen to download the software, once it’s finished downloading, follow the on-screen prompts to complete installation.
When you’re finished, launch the Arduino program and open a blank sketch. You’ll see a screen that looks like this:
All of your code for the robot will live inside of a sketch or a program. We’ll go in more detail with sketches after we assemble our robot in subsequent articles. But for now, all you need to know is that there are two required Methods in order for the program to compile.
setup(): configures your pins as Inputs or Outputs
loop(): code in this method is executed and runs forever.
Similar to the “main” method in classic C-programming.
In English: you need these two functions (setup and loop) or you’ll get an error. AKA, it won’t work. Therefore, you must include these, even if they’re empty.
Go beyond this Article with our eCourse
Enroll in our eCourse and build additional mobile robot projects, gain access to our quizzes, 1:1 office hours, and a Course Certificate. Click here to sign up!