Arduino UNO-Based Battery-Powered IR Sensor Controlled Robot with L298N Motor Driver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit involves an Arduino UNO microcontroller, three IR sensors, an L298N DC motor driver, two hobby motors, and a 12V battery. The Arduino UNO is used to control the IR sensors and the motor driver, which in turn controls the two hobby motors. The IR sensors are used to detect obstacles, and the motor driver controls the direction and speed of the motors based on the input from the Arduino.
Component List
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
IR Sensor
- Description: Infrared sensor used for obstacle detection.
- Pins: out, gnd, vcc
L298N DC Motor Driver
- Description: Dual H-Bridge motor driver used to control 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 (Hobby)
- Description: Small DC motor with a gearbox for hobby projects.
- Pins: vcc, GND
Battery 12V
- Description: 12V battery used to power the motor driver and motors.
- Pins: +, -
Wiring Details
Arduino UNO
5V connected to:
- IR Sensor (vcc)
- IR Sensor (vcc)
- IR Sensor (vcc)
- L298N DC Motor Driver (5V)
GND connected to:
- IR Sensor (gnd)
- IR Sensor (gnd)
- IR Sensor (gnd)
- L298N DC Motor Driver (GND)
- Battery 12V (-)
D12 connected to:
- IR Sensor (out)
D11 connected to:
- IR Sensor (out)
D10 connected to:
- IR Sensor (out)
D7 connected to:
- L298N DC Motor Driver (IN4)
D6 connected to:
- L298N DC Motor Driver (ENB)
D5 connected to:
- L298N DC Motor Driver (ENA)
D4 connected to:
- L298N DC Motor Driver (IN3)
D3 connected to:
- L298N DC Motor Driver (IN2)
D2 connected to:
- L298N DC Motor Driver (IN1)
IR Sensor
vcc connected to:
- Arduino UNO (5V)
- L298N DC Motor Driver (5V)
gnd connected to:
- Arduino UNO (GND)
- Battery 12V (-)
out connected to:
- Arduino UNO (D12)
- Arduino UNO (D11)
- Arduino UNO (D10)
L298N DC Motor Driver
5V connected to:
- Arduino UNO (5V)
- IR Sensor (vcc)
GND connected to:
- Arduino UNO (GND)
- Battery 12V (-)
IN4 connected to:
- Arduino UNO (D7)
ENB connected to:
- Arduino UNO (D6)
ENA connected to:
- Arduino UNO (D5)
IN3 connected to:
- Arduino UNO (D4)
IN2 connected to:
- Arduino UNO (D3)
IN1 connected to:
- Arduino UNO (D2)
OUT1 connected to:
- Motor (Hobby) (GND)
OUT2 connected to:
- Motor (Hobby) (vcc)
OUT3 connected to:
- Motor (Hobby) (GND)
OUT4 connected to:
- Motor (Hobby) (vcc)
12V connected to:
- Battery 12V (+)
Motor (Hobby)
GND connected to:
- L298N DC Motor Driver (OUT1)
- L298N DC Motor Driver (OUT3)
vcc connected to:
- L298N DC Motor Driver (OUT2)
- L298N DC Motor Driver (OUT4)
Battery 12V
+ connected to:
- L298N DC Motor Driver (12V)
- connected to:
- Arduino UNO (GND)
- IR Sensor (gnd)
- L298N DC Motor Driver (GND)
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)