Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO-Based Obstacle Avoidance Robot with Ultrasonic Sensors and L298N Motor Driver

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Obstacle Avoidance Robot with Ultrasonic Sensors and L298N Motor Driver

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller, an L298N DC motor driver, three HC-SR04 ultrasonic sensors, two hobby motors, a 7.4V battery, and a rocker switch. The Arduino UNO is used to control the motor driver and read data from the ultrasonic sensors. The motor driver is used to control the two hobby motors. The ultrasonic sensors are used for distance measurement.

Component List

  1. Arduino UNO

    • Description: A microcontroller board based on the ATmega328P.
    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
  2. L298N DC Motor Driver

    • Description: A dual H-Bridge motor driver module.
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  3. HC-SR04 Ultrasonic Sensor

    • Description: An ultrasonic distance sensor.
    • Pins: VCC, TRIG, ECHO, GND
  4. Motor amarillo motorreductor hobby

    • Description: A small hobby motor with a gearbox.
    • Pins: vcc, GND
  5. 7.4V Battery

    • Description: A 7.4V rechargeable battery.
    • Pins: +, -
  6. Rocker Switch

    • Description: A simple on/off switch.
    • Pins: output, input

Wiring Details

Arduino UNO

L298N DC Motor Driver

HC-SR04 Ultrasonic Sensor 1

HC-SR04 Ultrasonic Sensor 2

HC-SR04 Ultrasonic Sensor 3

Motor amarillo motorreductor hobby 1

Motor amarillo motorreductor hobby 2

7.4V Battery

Rocker Switch

Code Documentation

Arduino UNO Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This code is a basic template for the Arduino UNO. The setup() function is used to initialize any settings or configurations, and the loop() function contains the main code that runs repeatedly.