Arduino UNO and L298N Motor Driver Based Obstacle Avoiding Robot with Ultrasonic Sensors and IR Receiver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an L298N DC motor driver, two HC-SR04 ultrasonic sensors, an IR receiver, and a 12V battery. The circuit is designed to control motors and read sensor data for various applications.
Component List
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control of the speed and direction of two DC motors.
- 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
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, commonly used for prototyping and educational purposes.
- 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
HC-SR04 Ultrasonic Sensor (1)
- Description: A sensor used for measuring distance by using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
HC-SR04 Ultrasonic Sensor (2)
- Description: A sensor used for measuring distance by using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
IR Receiver
- Description: A device that receives infrared signals and converts them into electrical signals.
- Pins: DATA, VCC, GND
12V Battery
- Description: A power source providing 12V DC.
- Pins: -, +
Wiring Details
L298N DC Motor Driver
- 12V connected to + of the 12V Battery
- GND connected to - of the 12V Battery
- ENA connected to D6 of the Arduino UNO
- IN1 connected to D11 of the Arduino UNO
- IN2 connected to D10 of the Arduino UNO
- IN3 connected to D9 of the Arduino UNO
- IN4 connected to D8 of the Arduino UNO
- ENB connected to D5 of the Arduino UNO
Arduino UNO
- D6 connected to ENA of the L298N DC Motor Driver
- D11 connected to IN1 of the L298N DC Motor Driver
- D10 connected to IN2 of the L298N DC Motor Driver
- D9 connected to IN3 of the L298N DC Motor Driver
- D8 connected to IN4 of the L298N DC Motor Driver
- D5 connected to ENB of the L298N DC Motor Driver
- 5V connected to VCC of both HC-SR04 Ultrasonic Sensors and the IR Receiver
- GND connected to GND of both HC-SR04 Ultrasonic Sensors and the IR Receiver
- D13 connected to ECHO of the first HC-SR04 Ultrasonic Sensor
- D12 connected to TRIG of the first HC-SR04 Ultrasonic Sensor
- D7 connected to DATA of the IR Receiver
- D4 connected to ECHO of the second HC-SR04 Ultrasonic Sensor
- D3 connected to TRIG of the second HC-SR04 Ultrasonic Sensor
HC-SR04 Ultrasonic Sensor (1)
- VCC connected to 5V of the Arduino UNO
- GND connected to GND of the Arduino UNO
- ECHO connected to D13 of the Arduino UNO
- TRIG connected to D12 of the Arduino UNO
HC-SR04 Ultrasonic Sensor (2)
- VCC connected to 5V of the Arduino UNO
- GND connected to GND of the Arduino UNO
- ECHO connected to D4 of the Arduino UNO
- TRIG connected to D3 of the Arduino UNO
IR Receiver
- DATA connected to D7 of the Arduino UNO
- VCC connected to 5V of the Arduino UNO
- GND connected to GND of the Arduino UNO
12V Battery
- + connected to 12V of the L298N DC Motor Driver
- - connected to GND of the L298N DC Motor Driver
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Additional Documentation (documentation.txt)
This document provides a comprehensive overview of the circuit, including the components used, their connections, and the code running on the Arduino UNO.