Arduino UNO and L298N Motor Driver Controlled Robotic Car with IR Sensors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to control multiple motors using an L298N DC motor driver and an Arduino UNO. The circuit also includes IR sensors for obstacle detection and is powered by a 12V 7Ah battery.
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
Motor with Reducer
- Description: A DC motor with a built-in gearbox to reduce speed and increase torque.
- Pins: 3 - 6 VCC, GND
IR Sensor
- Description: An infrared sensor used for obstacle detection.
- Pins: out, gnd, vcc
Arduino UNO
- Description: A microcontroller board based on the ATmega328P, used for controlling the circuit.
- 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
12V 7Ah Battery
- Description: A rechargeable battery used to power the circuit.
- Pins: 12v +, 12v -
Wiring Details
L298N DC Motor Driver
- OUT1 is connected to the 3 - 6 VCC pin of two motors.
- OUT2 is connected to the GND pin of two motors.
- 12V is connected to the 12v + pin of the battery.
- GND is connected to the 12v - pin of the battery and the GND pin of the Arduino UNO.
- OUT3 and OUT4 are connected to the 3 - 6 VCC pins of two other motors.
- ENA is connected to +5V-J1.
- IN1 is connected to the D11 pin of the Arduino UNO.
- IN2 is connected to the D10 pin of the Arduino UNO.
- IN3 is connected to the D9 pin of the Arduino UNO.
- IN4 is connected to the D8 pin of the Arduino UNO.
- ENB is connected to the D7 pin of the Arduino UNO.
Motor with Reducer
- 3 - 6 VCC of the first motor is connected to OUT1 of the L298N DC motor driver.
- GND of the first motor is connected to OUT2 of the L298N DC motor driver.
- 3 - 6 VCC of the second motor is connected to OUT1 of the L298N DC motor driver.
- GND of the second motor is connected to OUT2 of the L298N DC motor driver.
- 3 - 6 VCC of the third motor is connected to OUT3 of the L298N DC motor driver.
- GND of the third motor is connected to the GND pin of the fourth motor.
- 3 - 6 VCC of the fourth motor is connected to OUT4 of the L298N DC motor driver.
- GND of the fourth motor is connected to the GND pin of the third motor.
IR Sensor
- out of the first IR sensor is connected to the A1 pin of the Arduino UNO.
- gnd of the first IR sensor is connected to the GND pin of the Arduino UNO.
- vcc of the first IR sensor is connected to the 5V pin of the Arduino UNO.
- out of the second IR sensor is connected to the A0 pin of the Arduino UNO.
- gnd of the second IR sensor is connected to the GND pin of the Arduino UNO.
- vcc of the second IR sensor is connected to the 5V pin of the Arduino UNO.
Arduino UNO
- D11 is connected to IN1 of the L298N DC motor driver.
- D10 is connected to IN2 of the L298N DC motor driver.
- D9 is connected to IN3 of the L298N DC motor driver.
- D8 is connected to IN4 of the L298N DC motor driver.
- D7 is connected to ENB of the L298N DC motor driver.
- A1 is connected to the out pin of the first IR sensor.
- GND is connected to the gnd pin of the first IR sensor.
- 5V is connected to the vcc pin of the first IR sensor.
- A0 is connected to the out pin of the second IR sensor.
- GND is connected to the gnd pin of the second IR sensor.
- 5V is connected to the vcc pin of the second IR sensor.
- GND is connected to the 12v - pin of the battery.
12V 7Ah Battery
- 12v + is connected to the 12V pin of the L298N DC motor driver.
- 12v - is connected to the GND pin of the L298N DC motor driver and the GND pin of the Arduino UNO.
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 a summary, component list, wiring details, and documented code.