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
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
Component Name List
- DESHBOT SHIELD
- Arduino Nano with cable
- 0.96" OLED Display (SSD1306, I²C)
- HC-SR04 Ultrasonic Distance Sensor
- DC Gear Motor ×2
- Robot Wheels ×2
- Li-ion Battery Pack
- Robot Chassis / Body
- Motor Driver — integrated/on the DESHBOT board;
- Castor wheel
- double tape
Understand the DESHBOT Shield
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:
- Motors
- Power
- Sensors
- Display
- Other Arduino connections
Before connecting anything, look carefully at the labels printed on your shield.
Insert the Arduino Nano
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
Our robot has two motors.
We will call them:
- Motor 1 – M1
- Motor 2 – M2
According to the program:
Motor 1
- M1A → Arduino D9
- M1B → Arduino D8
Motor 2
- M2A → Arduino D6
- 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
The ultrasonic sensor is used to detect obstacles.
It has four pins:
- VCC
- TRIG
- ECHO
- GND
Our program uses:
HC-SR04Arduino
VCC
5V
TRIG
A0
ECHO
D13
GND
GND
Connect the OLED Display
The OLED is used to show what the robot is doing.
For example, it can display:
- START
- FORWARD
- BACKWARD
- RIGHT
- 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:
- 5V
- GND
The robot uses:
- 🟢 Green → robot is moving
- 🔴 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.
- M1 motor → M1 terminals
- M2 motor → M2 terminals
- Ultrasonic sensor → VCC, TRIG, ECHO, GND
- OLED display → VCC, GND, SDA, SCL
- WS2812B LED → Data, 5V, GND
- Battery → Power input
- 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:
- Board: Arduino Nano
- Processor: ATmega328P
- 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:
- Adafruit NeoPixel
- Adafruit GFX Library
- Adafruit SSD1306
The Wire library is already included with the Arduino IDE, so you do not need to install it separately.
Upload the Program
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.
Downloads
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.
- If the distance is 30 cm or more, the robot moves forward.
- If the distance is less than 30 cm, the robot:
- Stops
- Moves backward for 2 seconds
- Turns right
- Waits for 4 seconds
- Checks the distance again
The OLED shows the current action, while the RGB LED shows the robot's status.
Assemble the Robot
Now that all the connections and programming are complete, it is time to assemble the robot.
Mount the components securely on the chassis:
- DESHBOT Shield with Arduino Nano
- Two DC motors and wheels
- HC-SR04 ultrasonic sensor
- OLED display
- Battery
- 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.
- Place the robot on a flat surface.
- Make sure there is enough open space around it.
- Turn on the power.
- The robot should start moving forward.
- Place an object in front of the robot.
- 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:
- Bluetooth control
- Wi-Fi control
- Remote control from a phone
- Servo-mounted ultrasonic sensor
- Multiple ultrasonic sensors
- Line-following sensors
- Battery voltage monitoring
- Buzzer
- More RGB LEDs
- ESP32-based AI features
- 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.