Developing a Smart Bus Boarding System Using RFID and Camera Integration

by tiya in Circuits > Arduino

27 Views, 0 Favorites, 0 Comments

Developing a Smart Bus Boarding System Using RFID and Camera Integration

Screenshot 2024-11-11 171012.png

This project involves creating a smart bus boarding system that uses RFID to check if passengers have paid their fare. If a passenger hasn't paid or skips the check, a camera takes a photo for identification. The system uses an Arduino and an ESP32-CAM module to capture images, and data is processed via a Raspberry Pi for monitoring and tracking. The goal is to improve bus fare collection efficiency and security by automating the boarding process and recording unauthorized actions.

Supplies

Hardware Supplies:

  1. Raspberry Pi 4 - Main processing unit for the system.
  2. ESP32-CAM Module - Used for taking photos of passengers.
  3. Arduino Uno - Powers the ESP32-CAM and manages communication.
  4. RFID Reader Module - To scan RFID tags for fare validation.
  5. RFID Tags/Cards - Issued to passengers for fare payment.
  6. Jumper Wires - For making necessary connections between the components.
  7. Breadboard - Used for prototyping connections.
  8. Power Supply for Raspberry Pi & Arduino - To power the devices.
  9. MicroSD Card (for Raspberry Pi) - Used for OS and data storage.
  10. LEDs (optional) - For indicating status of the fare check.
  11. Buzzer (optional) - To alert passengers or the system operator on unauthorized boarding.
  12. USB Cable - For connecting the Raspberry Pi to power and for programming.

Software Requirements:

  1. Raspberry Pi OS - For operating system setup on the Raspberry Pi.
  2. Arduino IDE - For programming the Arduino Uno.
  3. ESP32 Libraries - To manage the ESP32-CAM module.
  4. Python - For running scripts on the Raspberry Pi (for image processing, data logging, etc.).
  5. OpenCV or any image processing library - For capturing and processing images from the ESP32-CAM.
  6. Firebase (optional) - For storing data such as images or fare statuses.
  7. Software for RFID Reader - A library to interface with the RFID reader (e.g., MFRC522).

These supplies will allow you to prototype and test the core functionalities of your smart bus boarding system.

Setting Up the Raspberry Pi

Start by setting up the Raspberry Pi. Install Raspberry Pi OS on the microSD card and connect the Pi to a network. Access it via SSH or VNC for ease of programming. Update the system packages and install necessary Python libraries like RPi.GPIO for GPIO control.

Setting Up the Arduino Nano With RFID

Screenshot 2024-11-11 165249.png

Connect the RFID reader to the Arduino Nano:

  1. VCC to 3.3V on the Nano
  2. GND to ground
  3. SDA to a digital pin (e.g., D2)
  4. SCK, MOSI, and MISO to SPI pins

Upload code to the Arduino that reads RFID tags and sends data to the Raspberry Pi through serial communication.

Configuring the Raspberry Pi for Computing and Firebase

Screenshot 2024-11-11 165431.png

Set up the Raspberry Pi with Raspberry Pi OS, connect it to your network, and install necessary Python libraries (firebase_admin, RPi.GPIO, etc.). The Pi will handle logic processing, trigger the ESP32-CAM, and upload images to Firebase.

Setting Up and Programming the ESP32-CAM

Screenshot 2024-11-11 170110.png
Screenshot 2024-11-11 170131.png

The ESP32-CAM will take pictures when prompted by the Raspberry Pi. Connect the ESP32-CAM to power and flash it with a sketch that allows remote image capture via an HTTP request.

Integrating Components for Full System Functionality

Screenshot 2024-11-11 170430.png

Ensure all parts are connected:

  1. Arduino Nano reads RFID tags and sends data to the Raspberry Pi.
  2. The Raspberry Pi triggers the ESP32-CAM using a request and uploads captured images to Firebase.
  3. Use Python scripts on the Raspberry Pi for handling logic, image requests, and data uploads.


Testing and Troubleshooting

Test each step:

  1. Arduino Nano: Check if it reads RFID tags and sends data properly.
  2. ESP32-CAM: Confirm it captures images on request.
  3. Raspberry Pi: Ensure it handles data processing and Firebase uploads.

Common issues may include:

  1. Connection errors: Double-check wiring and serial connections.
  2. Camera response delays: Ensure the ESP32-CAM is in range of the Wi-Fi signal.


Acknowledgement

Note: This article is part of an assignment submitted to Deakin University partnered with Chitkara university, School of IT, Unit SIT210 - Embedded Systems Development.