Arduino UNO and L298N Motor Driver Based IR Sensor Controlled Dual DC Motor System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control two DC motors using an Arduino UNO and an L298N DC motor driver. An IR sensor is used to detect obstacles, and a rocker switch is used to control the power supply from a 12V battery.
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
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows control 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
IR Sensor
- Description: An infrared sensor used for obstacle detection.
- Pins: out, gnd, vcc
DC Motor (Motor 1)
- Description: A DC motor used for driving mechanical components.
- Pins: pin 1, pin 2
DC Motor (Motor 2)
- Description: A second DC motor used for driving mechanical components.
- Pins: pin 1, pin 2
Battery 12V
- Description: A 12V battery used as the power supply for the circuit.
- Pins: +, -
Rocker Switch
- Description: A switch used to control the power supply from the battery.
- Pins: 1, 2
Wiring Details
Arduino UNO
5V connected to:
- IR Sensor (vcc)
- L298N DC Motor Driver (5V)
GND connected to:
- IR Sensor (gnd)
- L298N DC Motor Driver (GND)
- Rocker Switch (pin 2)
D7 connected to:
- IR Sensor (out)
D5 connected to:
- L298N DC Motor Driver (IN4)
D4 connected to:
- L298N DC Motor Driver (IN3)
D3 connected to:
- L298N DC Motor Driver (IN2)
D2 connected to:
- L298N DC Motor Driver (IN1)
L298N DC Motor Driver
5V connected to:
- Arduino UNO (5V)
GND connected to:
- Arduino UNO (GND)
IN4 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:
- DC Motor 2 (pin 2)
OUT2 connected to:
- DC Motor 2 (pin 1)
OUT3 connected to:
- DC Motor 1 (pin 1)
OUT4 connected to:
- DC Motor 1 (pin 2)
12V connected to:
- Battery 12V (+)
IR Sensor
vcc connected to:
- Arduino UNO (5V)
gnd connected to:
- Arduino UNO (GND)
out connected to:
- Arduino UNO (D7)
DC Motor (Motor 1)
pin 1 connected to:
- L298N DC Motor Driver (OUT3)
pin 2 connected to:
- L298N DC Motor Driver (OUT4)
DC Motor (Motor 2)
pin 1 connected to:
- L298N DC Motor Driver (OUT2)
pin 2 connected to:
- L298N DC Motor Driver (OUT1)
Battery 12V
+ connected to:
- L298N DC Motor Driver (12V)
- connected to:
- Rocker Switch (pin 1)
Rocker Switch
pin 1 connected to:
- Battery 12V (-)
pin 2 connected to:
- Arduino UNO (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)