Circuit Documentation
Summary
This circuit is designed to control two DC motors using an Arduino UNO microcontroller and an L298N DC motor driver. It includes two IR sensors for input and a rocker switch (SPST) to control the power supply from a 2 x AA battery mount. The Arduino UNO is responsible for processing the signals from the IR sensors and sending control signals to the L298N driver, which in turn drives the motors.
Component List
- Rocker Switch (SPST): A single-pole single-throw switch used to connect or disconnect the power supply to the circuit.
- 2 x AA Battery Mount: Provides the power source for the circuit with a nominal voltage of 3V.
- L298N DC Motor Driver: An integrated circuit used for controlling the speed and direction of two DC motors.
- IR Sensor: Detects infrared light from the environment and provides a digital output signal.
- Arduino UNO: A microcontroller board based on the ATmega328P, used for processing sensor inputs and controlling the motor driver.
- DC Motor: Converts electrical energy into mechanical motion.
Wiring Details
Rocker Switch (SPST)
- Pin 1: Connected to the positive terminal of the 2 x AA Battery Mount.
- Pin 2: Connected to the 12V input of the L298N DC motor driver.
2 x AA Battery Mount
- Positive (+): Connected to Pin 1 of the Rocker Switch (SPST).
- Negative (-): Common ground for the circuit.
L298N DC Motor Driver
- OUT1, OUT2: Connected to the terminals of one DC Motor.
- OUT3, OUT4: Connected to the terminals of the second DC Motor.
- 12V: Connected to Pin 2 of the Rocker Switch (SPST).
- GND: Common ground for the circuit.
- 5V: Provides 5V output to power the Arduino UNO and IR sensors.
- ENA, ENB: Connected to digital pins D6 and D5 of the Arduino UNO for enabling the motor outputs.
- IN1, IN2, IN3, IN4: Connected to digital pins D7, D8, D9, and D10 of the Arduino UNO for motor control signals.
IR Sensors
- VCC: Connected to the 5V output from the L298N DC motor driver.
- GND: Common ground for the circuit.
- OUT: One sensor's output connected to digital pin D11 and the other to D12 on the Arduino UNO.
Arduino UNO
- 5V, GND: Power supply connections for the board and connected components.
- D5, D6: Control signals for ENA and ENB on the L298N motor driver.
- D7, D8, D9, D10: Control signals for IN1, IN2, IN3, and IN4 on the L298N motor driver.
- D11, D12: Inputs from the IR sensors.
DC Motors
- One motor connected to OUT1 and OUT2 of the L298N motor driver.
- The other motor connected to OUT3 and OUT4 of the L298N motor driver.
Documented Code
Arduino UNO Code (sketch.ino)
void setup() {
}
void loop() {
}
This code is a template and does not contain any functional code. It needs to be populated with the logic for reading the IR sensor inputs and controlling the DC motors via the L298N motor driver.