Obstacle Avoidance Robot
The Obstacle Avoidance Robot project demonstrates an autonomous mobile robot capable of detecting and avoiding obstacles in its environment. Built on a differential drive platform and powered by Acrome’s Motion Kit, this robot uses an ultrasonic distance sensor mounted on a pan-tilt servo mechanism to scan the environment in multiple directions. By integrating sensory feedback with real-time motion decisions, the robot intelligently navigates through dynamic or cluttered spaces without external control.
About Tools and Materials:
3x SMD Red (Purchase Here)
SMD USB Gateway (Purchase Here)
Arduino Gateway Module (Purchase Here)
2x BDC Motor (Purchase Here)
2x Servo Module (Purchase Here)
Ultrasonic Distance Sensor (Purchase Here)
Step 1: Hardware & Software Overview
Project Key Components
SMD Red Used to control the left motor, right motor, and the pan-tilt + ultrasonic sensor unit.
BDC Motors Drive the differential base for forward, backward, and turning motion.
Pan-Tilt Servo Module Allows the ultrasonic sensor to scan the environment horizontally and vertically.
Ultrasonic Distance Sensor Detects obstacles by measuring distance and provides real-time feedback.
Gateway Module (USB or Arduino) Connects the SMD network to a computer or controller for command transmission.
Key Features:
Autonomous Navigation The robot moves independently by detecting and avoiding obstacles in real time.
Pan-Tilt Environmental Scanning The ultrasonic sensor is mounted on a pan-tilt servo system, enabling multi-directional scanning for enhanced obstacle detection.
Modular and Expandable Architecture Built entirely using Acrome’s Motion Kit, the system is easy to expand with additional modules.
Multiple Programming Interfaces Supports both Python and Blockly, allowing users to implement logic visually or through code.
Real-Time Feedback and Decision Making The system continuously analyzes distance data and makes path decisions accordingly.
Educational and Practical Ideal for learning about autonomous systems, sensor fusion, servo control, and reactive robotics.
Step 2: Assemble
Connect the SMD Red to your PC or Arduino using either the USB Gateway Module or Arduino Gateway Module to establish communication.
Attach the 100 RPM brushed DC motors with encoders to the motor output ports of the left and right SMD Red modules using RJ-45 cables.
Connect the pan-tilt servo modules and ultrasonic distance sensor to the third SMD Red module. Ensure that the pan servo (horizontal) and tilt servo (vertical) are connected to the correct module IDs, and the ultrasonic sensor is attached via the appropriate port.
Secure all components to the robot chassis, including the motors, servos, and sensor. Make sure the ultrasonic sensor is positioned at the front of the robot with a clear field of view.
Power the SMD modules using a compatible external power supply or battery pack. Confirm that all indicator LEDs are active and that the wiring is neat, tight, and correctly placed.
Project Wiring diagram
Step 3: Run & Test
Software Execution and Behavior Testing
Once all hardware connections are complete, proceed with testing the system using either Blockly or Python.
Option 1: Blockly Interface
Open the Acrome Blockly platform and load the obstacle avoidance project blocks.
Use logic blocks to scan using the pan-tilt servo and read distance from the ultrasonic sensor.
Add movement commands to turn or stop the robot based on sensor data.
Upload the code and run it. The robot should begin autonomous navigation, avoiding obstacles by turning left, right, or stopping when necessary.
Option 2: Python API
Open your development environment and run the provided Python script or write your own using Acrome’s Python SDK.
Use the
get_ultrasonic()
function to read distance values from the sensor.Move the pan-tilt servos using
set_position()
to scan the environment.Based on distance readings, control the motors with
set_duty_cycle()
to avoid obstacles.Run the script and observe how the robot scans, decides, and reacts in real-time.
What to Expect During Testing:
The robot will continuously scan left, center, and right using the pan-tilt mechanism.
If an obstacle is detected within a predefined distance, the robot will stop or change direction.
Smooth and reactive motion indicates successful configuration and programming.
Codes
Last updated