Introduction: Developing a Smart Bus Boarding System Using RFID and Camera Integration
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:
- Raspberry Pi 4 - Main processing unit for the system.
- ESP32-CAM Module - Used for taking photos of passengers.
- Arduino Uno - Powers the ESP32-CAM and manages communication.
- RFID Reader Module - To scan RFID tags for fare validation.
- RFID Tags/Cards - Issued to passengers for fare payment.
- Jumper Wires - For making necessary connections between the components.
- Breadboard - Used for prototyping connections.
- Power Supply for Raspberry Pi & Arduino - To power the devices.
- MicroSD Card (for Raspberry Pi) - Used for OS and data storage.
- LEDs (optional) - For indicating status of the fare check.
- Buzzer (optional) - To alert passengers or the system operator on unauthorized boarding.
- USB Cable - For connecting the Raspberry Pi to power and for programming.
Software Requirements:
- Raspberry Pi OS - For operating system setup on the Raspberry Pi.
- Arduino IDE - For programming the Arduino Uno.
- ESP32 Libraries - To manage the ESP32-CAM module.
- Python - For running scripts on the Raspberry Pi (for image processing, data logging, etc.).
- OpenCV or any image processing library - For capturing and processing images from the ESP32-CAM.
- Firebase (optional) - For storing data such as images or fare statuses.
- 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.
Step 1: 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.
Step 2: Setting Up the Arduino Nano With RFID
Connect the RFID reader to the Arduino Nano:
- VCC to 3.3V on the Nano
- GND to ground
- SDA to a digital pin (e.g., D2)
- 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.
Step 3: Configuring the Raspberry Pi for Computing and Firebase
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.
Step 4: Setting Up and Programming the ESP32-CAM
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.
Step 5: Integrating Components for Full System Functionality
Ensure all parts are connected:
- Arduino Nano reads RFID tags and sends data to the Raspberry Pi.
- The Raspberry Pi triggers the ESP32-CAM using a request and uploads captured images to Firebase.
- Use Python scripts on the Raspberry Pi for handling logic, image requests, and data uploads.
Step 6: Testing and Troubleshooting
Test each step:
- Arduino Nano: Check if it reads RFID tags and sends data properly.
- ESP32-CAM: Confirm it captures images on request.
- Raspberry Pi: Ensure it handles data processing and Firebase uploads.
Common issues may include:
- Connection errors: Double-check wiring and serial connections.
- Camera response delays: Ensure the ESP32-CAM is in range of the Wi-Fi signal.
Step 7: 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.

