0% found this document useful (0 votes)
72 views2 pages

LAB TASK 2 Obstacle Avoiding Car

lecture

Uploaded by

darwinvargas2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views2 pages

LAB TASK 2 Obstacle Avoiding Car

lecture

Uploaded by

darwinvargas2011
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

LABORATORY 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:

• Arduino board (e.g., Arduino Uno)


• Motor driver module (L298N or similar)
• DC motors (2)
• Wheels (2)
• Chassis or platform for the car
• Ultrasonic sensor (HC-SR04)
• Jumper wires
• Power source (battery pack or power bank)
• Optional: Castor wheel or ball caster for stability

Steps:

Assemble the Car:

• 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.

Connect the Ultrasonic Sensor:

• 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 Code:

• 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.

Upload the Code:

• 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.

Test the Car:

• Power up the car using the battery pack or power source.


• Place obstacles in front of the car and observe its behavior.
• The car should move forward until it detects an obstacle within 20cm, at which
point it should turn right to avoid it.

Adjustments and Expansion:

• 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.

You might also like