How to build an Arduino Obstacle Avoiding Robot using Cardboard

Arduino Obstacle Avoiding Robot

Arduino Obstacle Avoiding Robot

Back again with another Arduino Bluetooth RC Car tutorial but with an advanced feature that makes your car autonomous by adding ultrasonic sensors to the RC Car you have made before!. Yeah, I know that you may have seen other tutorials using ultrasonic to make the car/robot avoid obstacles ahead, but I am going to make more precise obstacle avoiding car that uses 3 ultrasonic sensors which limits the car-obstacle hit to almost zero percent. In addition to a facial detection feature with your phone’s camera .. yeah! Just follow me up …

How it works

In a previous tutorial, I have made a simple Arduino Bluetooth RC Car from cardboard which allows you to control it with the 1Sheeld App within 3 different ways; Gamepad, Accelerometer, and Voice-recognition. At the end of that tutorial, I have promised you to make it autonomous and here’s it .. but not a traditional ultrasonic-based obstacle avoiding robot!


There are 2 new approaches here I did to make the car smarter in terms of “autonomous”:

  • Firstly, adding 3 ultrasonic in different front angles to cover all obstacles ahead .. a wider angle of ultrasonic preview means precise obstacles avoiding.

  • Then, using the phone’s camera with the help of the Face Detection Shield to detect human faces and avoid them.

Moreover, you can return back to the manual control mode anytime. Thanks to the amazing GLCD Shield which enables you to create radio buttons on your phone’s screen via coding their names, places on the screen and triggering the selection of each so that your car know when to go manually or autonomously.

Let’s go ahead and see how you can build your own Arduino Obstacle Avoiding Robot…

Before you start …

If you are just getting your 1Sheeld out of the box then go ahead with this 1Sheeld getting started tutorial or simply check the 1Sheeld User’s Manual.

And if you didn’t experience the previous tutorial about making the RC Car, then please check it here as you will need it in this tutorial.

So, let’s make it and see what hardware components you will need…

Gather Components


Build the Arduino Obstacle Avoiding Robot

You will need cardboard to make just 2 parts these will be added to your previous car;

  • Servo holder
  • Phone holder

To make it easy for you, I have designed the 2 parts with the exact dimensions …

Here’s it:


Caution: these are the dimensions in cm so you need to draw them, not to print and stick it to the sheet! They are not in real size. it’s just a guide!


Hardware Connections

In addition to the connections you already have inside your car, connect the servo and ultrasonic as follows:

  • Trigger pin of right ultrasonic sensor with       >>       pin 30 of Arduino Mega
  • Echo pin of right ultrasonic sensor with           >>       pin 31 of Arduino Mega
  • Vcc pin of right ultrasonic sensor with              >>       5v pin of the Regulator
  • GND pin of right ultrasonic sensor with           >>       GND of the circuit


  • Trigger pin of Middle ultrasonic sensor with       >>       pin 32 of Arduino Mega
  • Echo pin of Middle ultrasonic sensor with           >>       pin 33 of Arduino Mega
  • Vcc pin of Middle ultrasonic sensor with              >>       5v pin of the Regulator
  • GND pin of Middle ultrasonic sensor with           >>       GND of the circuit


  • Trigger pin of  left ultrasonic sensor with      >>       pin 34 of Arduino Mega
  • Echo pin of left ultrasonic sensor with           >>       pin 35 of Arduino Mega
  • Vcc pin of left ultrasonic sensor with              >>       5v pin of the Regulator
  • GND pin of left ultrasonic sensor with           >>       GND of the circuit


  • Signal pin of servo motor with           >>       pin 21 of Arduino Mega
  • Vcc pin of servo motor with                >>       5v pin of the Regulator
  • GND pin of servo motor with             >>       GND of the circuit



Here’s the full code you are going to upload to the Arduino Mega inside your Arduino Obstacle Avoiding Robot:


Code uploading

  • Connect the Arduino Mega via your PC.
  • Then, switch the 1Sheeld power to operate on 5v (Not the 3.3v):
  • 1Sheeld has 2 modes: Uploading mode and Operating mode. You can switch between them using the switch close to the Digital pins and is called “SERIAL SWITCH”.

As you will use Serial pins RX3 & TX3, you don’t have to move the switch to the Uploading mode at any time! Yeah, just keep it on the Operating mode always during the code upload and while you are playing with the car.

Finally, upload the code …

Run the Arduino Obstacle Avoiding Robot …

After that, open the 1Sheeld App, select these 5 shields:

  • Gamepad
  • Accelerometer
  • Voice Recognizer
  • Slider
  • GLCD
  • Face Detection
  • Buzzer

Then reset the Arduino Mega, cover your car and select the Auto mode from the GLCD Shield screen and release your monster Arduino Obstacle Avoiding Robot!

Note: if the Face Detection Shield didn’t open the preview then try another Android phone with an older Android version. like Android 5 or 6.

More …

So far, we have made 2 projects; RC Car & Arduino Obstacle Avoiding Robot .. both are still parts from the RC Car series which will be extended for more features to be added to the car like making the robot detect a line so you can use it as a line follower robot too .. More things it can do = More fun!

So, again, please play with your Arduino Obstacle Avoiding Robot carefully as you are going to need it for the next project 😉

Finally, if have any questions please let me know in the comments below .. and stay tuned for the upcoming tutorials ^_^

Related Blogs

Arduino Robotics

Arduino Robotics Series, from a car to a robot arm

Arduino keeps standing out from the crowd of all-around development boards due too its ease of use and budget price. As a result, this has enabled almost anyone to get his own idea into life no matter how crazy or even useless to the whole world it was, except for its maker! Also, it has …

Arduino Robot Arm

How to build an Arduino Robot Arm placed on RC Car

Arduino robots are always funny and definitely more enjoyable when combined with robotic arm! And today, I will walk you through the making of a simple Arduino Robot Arm that’s made of cardboard and how you can attach it over your Arduino Bluetooth RC Car / Robot that you have made so far through this series. …

Arduino Line Following Robot

How to build an Arduino Line Following Robot using Cardboard

Arduino Line Following Robot is one of the easiest and most well-known projects that anyone can make to learn the basics of programming, electronics, and mechanics all in one project. It’s known that this project is common for most of the makers and tech students and today I am going to give it a revisit …

Arduino Bluetooth RC car

How to make an Arduino Bluetooth RC Car using Cardboard

  Cardboard crafts are one of the most popular and easy to make DIY stuff. Mixing this with the unmatchable enjoyment of RC Cars and the ease of using Arduino, I am going to show you how to make a Cardboard Arduino Bluetooth RC car that you can control via Bluetooth from your smartphone.  …

Arduino Security Camera

Arduino Security Camera System (Arduino Home Hacks #4)

Arduino Security Camera Have you ever wanted to check your home in real time? Afraid that maybe someone has stormed in, don’t remember if you shut the door or not or maybe wanna check if your Hyper-energetic dog has broken any of your dishes AGAIN!! 🙂 Then this is the perfect place for you cause today …

Arduino IoT

Arduino IoT Shield Functions Explainer

Arduino makers …. you can connect your Arduino to MQTT brokers(servers) and launch your IoT with Arduino IoT Shield! It’s the 1Sheeld IoT shield that will do the job for you. It’s one of the most important but recent Arduino shields in 1Sheeld. Simply, it turns your Arduino into MQTT client where you can publish and …