Arduino-Controlled Dual DC Motor Driver with IR Array and Power Switching
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit is designed to control two DC motors using an Arduino UNO microcontroller and an L298N DC motor driver. The motors' operation is influenced by inputs from a 5 channel IR array, which is powered by the Arduino UNO. A 7.4V battery provides power to the system, with a rocker switch to control the power flow. The Arduino UNO is programmed to manage the motor driver inputs, which in turn control the speed and direction of the DC motors.
Component List
Arduino UNO
- Microcontroller board based on the ATmega328P
- It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button.
DC Motor (x2)
- An electric motor that runs on direct current (DC) electricity.
- It has two pins for power and ground connections.
L298N DC Motor Driver
- A dual H-bridge motor driver that can drive two DC motors or one stepper motor.
- It has pins for motor outputs, power supply, and control inputs from the microcontroller.
7.4V Battery
- A power source for the circuit.
- It has a positive and a negative terminal.
5 Channel IR Array
- An array of infrared sensors used for line tracking or obstacle detection.
- It has output pins for each sensor and power supply pins.
Rocker Switch
- A switch to control the connection of the power supply to the circuit.
- It has two pins to open or close the electrical circuit.
Wiring Details
Arduino UNO
5Vconnected to 5 channel IR arrayVCCGNDconnected to 5 channel IR arrayGNDand L298N DC motor driverGNDVinconnected to L298N DC motor driver5V- Analog pins
A0toA5connected to 5 channel IR array pinsA1toA5 - Digital pins
D4toD7connected to L298N DC motor driver pinsIN3toIN1 - Digital pins
D10andD11connected to L298N DC motor driverENAandENB
DC Motor
pin 1andpin 2of the first DC Motor connected to L298N DC motor driverOUT3andOUT4pin 1andpin 2of the second DC Motor connected to L298N DC motor driverOUT1andOUT2
L298N DC Motor Driver
GNDconnected to Arduino UNOGNDand 7.4V battery-5Vconnected to Arduino UNOVin12Vconnected to Rocker Switch1ENA,ENB,IN1,IN2,IN3,IN4connected to Arduino UNO digital pinsD10,D11,D6,D7,D4,D5OUT1,OUT2,OUT3,OUT4connected to the respective pins of the two DC Motors
7.4V Battery
+connected to Rocker Switch2-connected to L298N DC motor driverGND
5 Channel IR Array
VCCconnected to Arduino UNO5VGNDconnected to Arduino UNOGNDA1toA5connected to Arduino UNO analog pinsA0toA5
Rocker Switch
1connected to L298N DC motor driver12V2connected to 7.4V battery+
Documented Code
sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
documentation.txt
No additional documentation provided for the code.