Arduino Mega 2560 Based Autonomous Robot with RFID and Sensor Integration
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit designed to interface an Arduino Mega 2560 with various sensors, an RFID module, an LCD display, and a motor driver controlling four motors with wheels. The circuit is powered by a DC power source and utilizes the Arduino Mega 2560 as the central microcontroller to manage inputs and outputs, including sensor readings, RFID communication, and motor control.
Component List
Arduino Mega 2560
- Microcontroller board based on the ATmega2560
- It has 54 digital input/output pins (of which 15 can be used as PWM outputs), 16 analog inputs, 4 UARTs (hardware serial ports), a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button.
RFID-RC522
- A radio frequency identification (RFID) reader module that operates at 13.56 MHz.
- It is commonly used for access control, payment systems, and identification.
LCD I2C Display
- A liquid crystal display that uses the I2C communication protocol.
- It is used to display text and numbers to the user.
IR Sensor
- An infrared sensor capable of detecting obstacles and measuring distances.
- It is typically used in line-following robots and as an object detector.
HC-SR04 Ultrasonic Sensor
- An ultrasonic ranging module that provides 2cm to 400cm non-contact measurement function.
- The ranging accuracy can reach up to 3mm.
L298N DC Motor Driver
- A high-power motor driver module that can drive up to four DC motors.
- It has built-in diode protection and can drive motors with a voltage between 5V and 35V.
Motor and Wheels
- DC motors connected to wheels, allowing for the movement of the robot or vehicle.
- They are driven by the L298N motor driver.
DC Power Source
- A power supply unit that provides electrical energy to the circuit.
- It typically has a positive and a ground terminal to power the components.
Wiring Details
Arduino Mega 2560
3V3connected to RFID-RC522 VCC (3.3V)5Vconnected to HC-SR04 VCC, IR Sensors VCC, and LCD I2C Display VCCGNDconnected to IR Sensors GND, LCD I2C Display GND, HC-SR04 GND, RFID-RC522 GND, and L298N GNDD21/SCLconnected to LCD I2C Display SCLD20/SDAconnected to LCD I2C Display SDAD2 PWMconnected to IR Sensor OUTD3 PWMconnected to IR Sensor OUTD4 PWMto L298N IN4D5 PWMto L298N IN1D6 PWMto L298N IN2D7 PWMto L298N IN3D8 PWMto HC-SR04 ECHOD9 PWMto HC-SR04 TRIGD10 PWMto L298N ENAD11 PWMto L298N ENBD52to RFID-RC522 SCKD50to RFID-RC522 MISOD53to RFID-RC522 SDAD51to RFID-RC522 MOSID49to RFID-RC522 RST
RFID-RC522
VCC (3.3V)connected to Arduino Mega 2560 3V3RSTconnected to Arduino Mega 2560 D49GNDconnected to Arduino Mega 2560 GNDIRQnot connectedMISOconnected to Arduino Mega 2560 D50MOSIconnected to Arduino Mega 2560 D51SCKconnected to Arduino Mega 2560 D52SDAconnected to Arduino Mega 2560 D53
LCD I2C Display
GNDconnected to Arduino Mega 2560 GNDVCCconnected to Arduino Mega 2560 5VSDAconnected to Arduino Mega 2560 D20/SDASCLconnected to Arduino Mega 2560 D21/SCL
IR Sensors
outconnected to Arduino Mega 2560 D2 PWM and D3 PWM (two sensors)gndconnected to Arduino Mega 2560 GNDvccconnected to Arduino Mega 2560 5V
HC-SR04 Ultrasonic Sensor
VCCconnected to Arduino Mega 2560 5VTRIGconnected to Arduino Mega 2560 D9 PWMECHOconnected to Arduino Mega 2560 D8 PWMGNDconnected to Arduino Mega 2560 GND
L298N DC Motor Driver
OUT1andOUT2connected to two motors (motor and wheels)12Vconnected to DC Power Source PositiveGNDconnected to Arduino Mega 2560 GND5Vnot connected (if jumper is in place, it is powered by the board's 12V)OUT3andOUT4connected to two other motors (motor and wheels)ENAconnected to Arduino Mega 2560 D10 PWMIN1connected to Arduino Mega 2560 D5 PWMIN2connected to Arduino Mega 2560 D6 PWMIN3connected to Arduino Mega 2560 D7 PWMIN4connected to Arduino Mega 2560 D4 PWMENBconnected to Arduino Mega 2560 D11 PWM
Motor and Wheels
- Four motors connected to L298N OUT1, OUT2, OUT3, and OUT4
vccandGNDfrom motors connected to L298N corresponding outputs
DC Power Source
Groundconnected to Arduino Mega 2560 GND and L298N GNDPositiveconnected to L298N 12V
Documented Code
Arduino Mega 2560 - sketch.ino
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Arduino Mega 2560 - documentation.txt
(No additional documentation provided for the code)
This concludes the documentation for the given circuit. The code provided is a template and needs to be filled in with the logic to control the components based on the requirements of the application.