Arduino Nano-Based Battery-Powered Line Following Robot with IR Sensors and L298N Motor Driver
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino Nano microcontroller, an L298N DC motor driver, two IR sensors, a 7.4V battery, and two motor and wheel assemblies. The circuit is designed to control the motors based on input from the IR sensors.
Component List
Arduino Nano
- Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
- Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
L298N DC Motor Driver
- Description: A dual H-Bridge motor driver that allows speed and direction 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 (Sensor 1)
- Description: An infrared sensor used for obstacle detection.
- Pins: out, gnd, vcc
IR Sensor (Sensor 2)
- Description: An infrared sensor used for obstacle detection.
- Pins: out, gnd, vcc
7.4V Battery
- Description: A power source for the circuit.
- Pins: +, -
Motor and Wheels (Motor 1)
- Description: A DC motor with attached wheels.
- Pins: vcc, GND
Motor and Wheels (Motor 2)
- Description: A DC motor with attached wheels.
- Pins: vcc, GND
Wiring Details
Arduino Nano
- D2: Connected to out of IR Sensor 1
- D3: Connected to out of IR Sensor 2
- D9: Connected to IN1 of L298N DC Motor Driver
- D10: Connected to IN2 of L298N DC Motor Driver
- D11/MOSI: Connected to IN3 of L298N DC Motor Driver
- D12/MISO: Connected to IN4 of L298N DC Motor Driver
- VIN: Connected to 5V of L298N DC Motor Driver
- GND: Connected to gnd of IR Sensor 1, GND of L298N DC Motor Driver, gnd of IR Sensor 2, and - of 7.4V Battery
- 5V: Connected to vcc of IR Sensor 1 and vcc of IR Sensor 2
L298N DC Motor Driver
- OUT1: Connected to GND of Motor 1
- OUT2: Connected to vcc of Motor 1
- OUT3: Connected to vcc of Motor 2
- OUT4: Connected to GND of Motor 2
- 12V: Connected to + of 7.4V Battery
- ENA: Connected to +5V-J1
- ENB: Connected to +5V-J2
IR Sensor 1
- out: Connected to D2 of Arduino Nano
- gnd: Connected to GND of Arduino Nano
- vcc: Connected to 5V of Arduino Nano
IR Sensor 2
- out: Connected to D3 of Arduino Nano
- gnd: Connected to GND of Arduino Nano
- vcc: Connected to 5V of Arduino Nano
7.4V Battery
- +: Connected to 12V of L298N DC Motor Driver
- -: Connected to GND of Arduino Nano
Motor and Wheels (Motor 1)
- GND: Connected to OUT1 of L298N DC Motor Driver
- vcc: Connected to OUT2 of L298N DC Motor Driver
Motor and Wheels (Motor 2)
- vcc: Connected to OUT3 of L298N DC Motor Driver
- GND: Connected to OUT4 of L298N DC Motor Driver
Documented Code
Arduino Nano 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)