This project uses ESP32 and Arduino Uno to automate toll collection by detecting and validating vehicles with RFID tags. RFID readers identify registered vehicles, control a servo motor-operated gate, and record data in Google Sheets for real-time monitoring.
- Overview
- Features
- Components Required
- Wiring and Hardware Setup
- How It Works
- Installation and Setup
- Code Overview
- Photos and Videos
- Future Enhancements
This IoT-based toll collection system is designed to simplify toll management by automating vehicle recognition and payment deduction. With RFID technology, the system identifies registered vehicles, opens the toll gate, deducts the toll amount, and logs transaction data in Google Sheets via ESP32.
- Automated Vehicle Detection: RFID reader authenticates vehicle RFID tags.
- Automated Gate Control: Servo motor controls gate opening and closing.
- Data Logging: ESP32 logs all transactions in Google Sheets.
- Security Checks: Ensures that only authorized RFID tags are allowed.
- Customizable Buzzer Alerts: Alerts for valid and invalid entries.
- ESP32
- Arduino Uno
- RFID Module (MFRC522)
- Servo Motor
- Buzzer
- Liquid Crystal Display (LCD) with I2C
- Wires and Breadboard
- Power Supply
- ESP32 to Arduino Uno Communication: Connect ESP32's RX/TX pins to Arduino's TX/RX.
- RFID Module to Arduino Uno: Use SPI interface pins for communication.
- Servo Motor and Buzzer: Connect to Arduino Uno's digital pins.
- LCD Screen: Connect LCD to Arduino Uno through I2C.
Note: Refer to the wiring diagram below for exact pin connections.
- Card Detection: When a vehicle’s RFID card is scanned, the system checks if it matches any registered card.
- Authentication: If the card matches, the system displays the vehicle ID on the LCD, opens the gate, and sends data to ESP32.
- Data Logging: ESP32 logs the transaction in Google Sheets, including date, time, and vehicle UID.
- Transaction Logging: Each transaction is recorded in a Google Sheet, maintaining a record of all toll activity.
- Upload Arduino Uno Code to the Arduino Uno:
- Make sure to install
Wire.h
,LiquidCrystal_I2C.h
,Servo.h
,MFRC522.h
,SPI.h
, andSoftwareSerial.h
libraries.
- Make sure to install
- Upload ESP32 Code to the ESP32:
- Ensure
WiFi.h
,HTTPClient.h
, andTimeLib.h
libraries are installed.
- Ensure
- Create a Google Sheet and deploy a Google Apps Script as a web app. Set permissions to allow anyone to log data.
- Replace the
serverName
URL inESP32
code with your Google Apps Script web app URL.
- Connect all components and power on the system.
- Test by scanning an authorized RFID tag; observe the gate operation, LCD message, and data logging in Google Sheets.
This code handles:
- RFID Scanning: Reads and validates RFID cards.
- Gate Control: Operates the gate servo motor for authorized vehicles.
- LCD Display: Displays vehicle information and status messages.
- Buzzer Alerts: Provides audible feedback based on vehicle status.
This code handles:
- WiFi Connection: Connects to WiFi for Google Sheets communication.
- RFID UID Validation: Receives UID from Arduino, validates length.
- Data Logging: Sends JSON data to Google Sheets API for record-keeping.
Demo.Video.mp4
- Multiple Payment Options: Integrate with online payment gateways.
- Vehicle Data Analytics: Provide insights on toll collection data.