DESHBOT Shield – Beginner's Obstacle Avoiding Robot

by devkrishnavhora in Circuits > Arduino

35 Views, 0 Favorites, 0 Comments

DESHBOT Shield – Beginner's Obstacle Avoiding Robot

fd.jpeg

Introduction

In this project, we will build a simple obstacle-avoiding robot using the DESHBOT Shield.

The robot uses an Arduino Nano as its controller. An HC-SR04 ultrasonic sensor measures the distance in front of the robot. When there is enough space, the robot moves forward. When it detects an obstacle, it stops, moves backward, turns right, and then checks the distance again.

The DESHBOT Shield makes the wiring easier because the motor connections and other connections are available directly on the shield.

This tutorial is written for beginners, so we will build the robot step by step.

Supplies

WhatsApp Image 2026-08-17 at 2.47.32 PM.jpeg

Component Name List

  1. DESHBOT SHIELD
  2. Arduino Nano with cable
  3. 0.96" OLED Display (SSD1306, I²C)
  4. HC-SR04 Ultrasonic Distance Sensor
  5. DC Gear Motor ×2
  6. Robot Wheels ×2
  7. Li-ion Battery Pack
  8. Robot Chassis / Body
  9. Motor Driver — integrated/on the DESHBOT board;
  10. Castor wheel
  11. double tape

Understand the DESHBOT Shield

1.jpeg


The DESHBOT Shield is the main board of our robot.

The Arduino Nano sits on the shield and controls the robot.

The shield provides connections for:

  1. Motors
  2. Power
  3. Sensors
  4. Display
  5. Other Arduino connections

Before connecting anything, look carefully at the labels printed on your shield.

Insert the Arduino Nano

uno.jpeg


Place the Arduino Nano onto the Nano headers on the DESHBOT Shield.

Make sure the pins are correctly aligned before pressing the Nano into the headers.

Do not force the board if the pins are not aligned.


After installing it, the USB connector of the Nano should remain accessible so that we can program the robot.



Connect the Two Motors

m1.jpeg

Our robot has two motors.

We will call them:

  1. Motor 1 – M1
  2. Motor 2 – M2

According to the program:

Motor 1

  1. M1A → Arduino D9
  2. M1B → Arduino D8

Motor 2

  1. M2A → Arduino D6
  2. M2B → Arduino D7

Connect the first motor to the M1 motor terminals and the second motor to the M2 motor terminals on the DESHBOT Shield.

Connect the HC-SR04 Ultrasonic Sensor

ultra.jpeg


The ultrasonic sensor is used to detect obstacles.

It has four pins:

  1. VCC
  2. TRIG
  3. ECHO
  4. GND

Our program uses:

HC-SR04Arduino

VCC

5V

TRIG

A0

ECHO

D13

GND

GND

Connect the OLED Display

oled.jpeg


The OLED is used to show what the robot is doing.

For example, it can display:

  1. START
  2. FORWARD
  3. BACKWARD
  4. RIGHT
  5. STOP

The OLED uses the I²C communication interface.

Connect it as follows:

OLED

Arduino

VCC

5V

GND

GND

SDA

A4

SCL

A5

Connect the WS2812B LED


The RGB LED gives the robot a simple status indicator and already intregrated with Deshbot robotic shield .

The program uses:

Arduino D11 → LED Data IN

The LED also needs:

  1. 5V
  2. GND

The robot uses:

  1. 🟢 Green → robot is moving
  2. 🔴 Red → robot is stopped

Connect the Battery


The battery provides power to the robot.

Connect the battery to the power input of the DESHBOT Shield, matching the positive (+) and negative (–) connections.


⚠️ Safety: Check the battery voltage and polarity before switching on the robot.

Check All Connections


Before turning on the robot, check all the connections one more time.

  1. M1 motor → M1 terminals
  2. M2 motor → M2 terminals
  3. Ultrasonic sensor → VCC, TRIG, ECHO, GND
  4. OLED display → VCC, GND, SDA, SCL
  5. WS2812B LED → Data, 5V, GND
  6. Battery → Power input
  7. Make sure there are no loose wires or short circuits
⚠️ Important: Do not power the robot until you have checked the positive and negative connections.

: Install the Arduino IDE


Download and install the Arduino IDE on your computer.

Connect the Arduino Nano to your computer using a USB cable.

Then select:

  1. Board: Arduino Nano
  2. Processor: ATmega328P
  3. Port: The COM port connected to your Nano

Once everything is selected, the robot is ready for the program to be uploaded.

Install the Required Libraries


Open the Arduino IDE and go to Library Manager.

Search for and install these libraries:

  1. Adafruit NeoPixel
  2. Adafruit GFX Library
  3. Adafruit SSD1306

The Wire library is already included with the Arduino IDE, so you do not need to install it separately.

Upload the Program

Screenshot (4).png


Connect the Arduino Nano to your computer using the USB cable.

Open the obstacle-avoiding robot code in the Arduino IDE.

Make sure the correct Board and COM Port are selected, then click the Upload button.

After the upload is complete, the OLED should display “START”, and the robot will be ready to run.

How the Robot Works


Now that the program is uploaded, the robot can start detecting obstacles.

The HC-SR04 ultrasonic sensor measures the distance in front of the robot.

  1. If the distance is 30 cm or more, the robot moves forward.
  2. If the distance is less than 30 cm, the robot:
  3. Stops
  4. Moves backward for 2 seconds
  5. Turns right
  6. Waits for 4 seconds
  7. Checks the distance again

The OLED shows the current action, while the RGB LED shows the robot's status.

Assemble the Robot

fd.jpeg


Now that all the connections and programming are complete, it is time to assemble the robot.

Mount the components securely on the chassis:

  1. DESHBOT Shield with Arduino Nano
  2. Two DC motors and wheels
  3. HC-SR04 ultrasonic sensor
  4. OLED display
  5. Battery
  6. WS2812B LED

Make sure the ultrasonic sensor faces forward and that all wires are secure.


Test the Robot


Now it is time to test your DESHBOT robot.

  1. Place the robot on a flat surface.
  2. Make sure there is enough open space around it.
  3. Turn on the power.
  4. The robot should start moving forward.
  5. Place an object in front of the robot.
  6. When the object is closer than 30 cm, the robot should stop, move backward, turn right, and wait.

Check the OLED display while testing. It should show the robot's current action, such as FORWARD, STOP, BACKWARD, or RIGHT.


Final Result


Congratulations! 🎉 Your DESHBOT Shield obstacle-avoiding robot is now complete.

Power on the robot and place it on a flat surface. The robot should move forward, detect obstacles using the ultrasonic sensor, and automatically reverse and turn when an obstacle is too close.

You can now use the DESHBOT Shield as a base for building more advanced robotics and IoT projects.

Future Improvements

Ideas

Once the basic robot is working, you can add more features such as:

  1. Bluetooth control
  2. Wi-Fi control
  3. Remote control from a phone
  4. Servo-mounted ultrasonic sensor
  5. Multiple ultrasonic sensors
  6. Line-following sensors
  7. Battery voltage monitoring
  8. Buzzer
  9. More RGB LEDs
  10. ESP32-based AI features
  11. Automatic path planning


Conclusion

This project is a simple way for beginners to learn how a microcontroller, motor driver, ultrasonic sensor and display can work together.

The DESHBOT Shield makes the project easier to assemble while leaving plenty of room for future robotics and IoT experiments.