LAB TASK 2 Obstacle Avoiding Car
LAB TASK 2 Obstacle Avoiding Car
Creating an obstacle-avoiding car with Arduino is a popular and exciting project that
combines robotics, sensors, and programming. Here's an exercise outline to build an
obstacle-avoiding car using Arduino:
Objective:
Build a small car that autonomously moves around while avoiding obstacles in its path
using an ultrasonic sensor.
Materials Needed:
Steps:
• Attach the wheels to the motors and mount them on the chassis or platform.
• Connect the motors to the motor driver module according to its pinout.
• If using a castor wheel or ball caster, attach it to the front or rear of the chassis for
stability.
• Mount the ultrasonic sensor on the front of the car, facing forward.
• Connect the VCC and GND pins of the ultrasonic sensor to the 5V and GND pins on
the Arduino, respectively.
• Connect the trigger (TRIG) and echo (ECHO) pins of the ultrasonic sensor to two
digital pins on the Arduino.
LABORATORY TASK 2: OBSTACLE AVOIDING CAR
• Write the Arduino code to control the motors and read data from the ultrasonic
sensor.
• Use the data from the sensor to detect obstacles and adjust the car's movement to
avoid collisions.
• Connect your Arduino board to your computer using the USB cable.
• Open the Arduino IDE on your computer.
• Copy and paste the code into the Arduino IDE.
• Select the correct board and port in the Arduino IDE.
• Click the "Upload" button to upload the code to the Arduino board.
• Experiment with different obstacle detection thresholds and adjust the code
accordingly.
• Customize the car's behavior by implementing additional avoidance maneuvers or
integrating more sensors for better detection accuracy.
• Enhance the car's functionality by adding features such as remote control or
autonomous navigation algorithms.