Arduino Nano-Based Line Following Robot with IR Sensors and DC Motors
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino Nano, a 5-channel IR sensor, a 9V battery, an L298N DC motor driver, an LM2596 voltage regulator, and two DC Mini Metal Gear Motors. The circuit is designed to control the motors based on the input from the IR sensor, with power supplied by the batteries and regulated by the LM2596.
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
5-channel IR Sensor
- Description: An infrared sensor module with 5 channels for detecting obstacles or line tracking.
- Pins: VCC, GND, S1, S2, S3, S4, S5, CLP, Near
9V Battery
- Description: A standard 9V battery used to power the circuit.
- Pins: +, -
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
LM2596
- Description: A step-down voltage regulator module.
- Pins: IN, OUT
DC Mini Metal Gear Motor
- Description: A small DC motor with metal gears for increased durability and torque.
- Pins: IN1, IN2
Wiring Details
Arduino Nano
- D2 connected to L298N DC motor driver IN1
- D3 connected to L298N DC motor driver IN2
- D4 connected to L298N DC motor driver IN3
- D5 connected to L298N DC motor driver IN4
- D9 connected to L298N DC motor driver ENA
- D10 connected to L298N DC motor driver ENB
- GND connected to LM2596 OUT and 5-channel IR sensor GND
- 5V connected to LM2596 OUT and 5-channel IR sensor VCC
- A0 connected to 5-channel IR sensor S1
- A1 connected to 5-channel IR sensor S2
- A2 connected to 5-channel IR sensor S3
- A3 connected to 5-channel IR sensor S4
- A4 connected to 5-channel IR sensor S5
5-channel IR Sensor
- GND connected to LM2596 OUT and Arduino Nano GND
- VCC connected to LM2596 OUT and Arduino Nano 5V
- S1 connected to Arduino Nano A0
- S2 connected to Arduino Nano A1
- S3 connected to Arduino Nano A2
- S4 connected to Arduino Nano A3
- S5 connected to Arduino Nano A4
9V Battery
- - connected to LM2596 IN
- + connected to LM2596 IN
L298N DC Motor Driver
- IN1 connected to Arduino Nano D2
- IN2 connected to Arduino Nano D3
- IN3 connected to Arduino Nano D4
- IN4 connected to Arduino Nano D5
- ENA connected to Arduino Nano D9
- ENB connected to Arduino Nano D10
- OUT1 connected to DC Mini Metal Gear Motor IN1
- OUT2 connected to DC Mini Metal Gear Motor IN2
- OUT3 connected to DC Mini Metal Gear Motor IN1
- OUT4 connected to DC Mini Metal Gear Motor IN2
- 12V connected to battery 12V +
- GND connected to battery 12V -
LM2596
- IN connected to 9V Battery - and 9V Battery +
- OUT connected to 5-channel IR sensor GND, Arduino Nano GND, 5-channel IR sensor VCC, and Arduino Nano 5V
DC Mini Metal Gear Motor
- IN1 connected to L298N DC motor driver OUT1
- IN2 connected to L298N DC motor driver OUT2
- IN1 connected to L298N DC motor driver OUT3
- IN2 connected to L298N DC motor driver OUT4
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)
This document provides a comprehensive overview of the circuit, including the components used, their connections, and the code running on the Arduino Nano.