Badge Scanner

Name: Alexia-Ioana Enache
Group: 331CA

Introduction

The Badge Scanner is an embedded system designed to control access to a fitness room using RFID badges. Upon scanning a badge, the system checks if the badge is authorized and grants or denies access. Additionally, it displays the name of the person who scanned the badge, as well as the current temperature and humidity inside the room on an LCD screen. This system ensures that only authorized individuals can access the fitness room, while also providing real-time environmental data to enhance the gym experience.

General Description

The Badge Scanner system is composed of hardware and software modules that work together to scan badges, process the information, and control access, while also displaying environmental data:

Hardware Modules:

  • ESP32 Microcontroller – the central unit responsible for handling input and output operations. ESP32 is used for its increased processing power and integrated Wi-Fi and Bluetooth capabilities.
  • RFID Reader (RC522) – scans RFID badges and transmits the data to the microcontroller.
  • Servo Motor or Solenoid Lock – controls the access mechanism (door lock).
  • LCD Display – shows the name of the person, temperature, and humidity.
  • Buzzer – provides audible feedback for access attempts.
  • LEDs – indicate the status of the access (green for granted, red for denied).
  • DHT11/DHT22 Sensor – measures the temperature and humidity in the fitness room.

Software Modules:

  • RFID Reader Logic – reads the RFID tag and checks it against a database of authorized badge IDs.
  • Access Control Logic – grants or denies access based on the validity of the scanned badge.
  • Feedback System – provides feedback through the buzzer, LEDs, and LCD.
  • Environmental Data Display – retrieves and displays the temperature and humidity readings from the DHT sensor.
  • Logging (Optional) – logs the access attempt with timestamp, badge ID, and environmental data.

Interaction Flow:

  • The RFID reader scans a badge when it is placed near the sensor.
  • The microcontroller checks if the badge ID matches any of the authorized IDs stored in memory.
  • If the badge is authorized, the servo motor or solenoid lock is activated to unlock the door, and a green LED is lit.
  • If the badge is not authorized, a red LED is lit, and the buzzer sounds an alert.
  • The LCD screen displays:
    1. The name of the person who scanned the badge.
    2. The current temperature and humidity in the room.

Hardware Design

List of Components:

  • 1x ESP32 Microcontroller
  • 1x RC522 RFID Reader
  • 1x LCD 16×2 (I2C) Display
  • 1x Buzzer
  • 2x LEDs (Green, Red)
  • 1x DHT11/DHT22 Sensor
  • Resistors
  • Connecting wires
  • Breadboard
  • Wires

Connection Overview:

  • The RFID reader connects to the ESP32 via SPI (Serial Peripheral Interface).
  • The servo motor or solenoid lock connects to a PWM pin on the ESP32.
  • The buzzer and LEDs are connected to digital output pins.
  • The LCD display is connected via I2C.
  • The DHT11/DHT22 sensor is connected to a digital pin for reading temperature and humidity.

Software Design

Development Environment:

The firmware was developed using the Arduino IDE (configured to work with ESP32) or PlatformIO. Both platforms support the ESP32 microcontroller and allow easy integration with libraries for various sensors and actuators.

Libraries and 3rd-Party Sources Used:

Library Name Purpose
————————————————————————————————-
MFRC522.h Handles RFID reader communication with the ESP32.
LiquidCrystal_I2C.h Controls the LCD display via I2C protocol.
DHT.h Interfaces with the DHT11/DHT22 sensor to read temperature and humidity.
EEPROM.h Used to store authorized badge IDs or logs (optional).

Algorithms and Planned Structures:

The firmware is structured into several key components:

  • 1. RFID Scanning
    1. The MFRC522 library is used to read RFID badge data.
    2. When a valid badge is detected, its ID is retrieved.
    3. The ID is compared to a pre-defined list of authorized IDs stored in memory.
  • 2. Access Control Logic
    1. If the badge ID matches an authorized ID:
      1. The servo motor or solenoid lock is activated to unlock the door.
      2. A green LED is lit, and an “Access Granted” message is displayed on the LCD.
    2. If the badge ID does not match:
      1. A red LED is lit, and the buzzer sounds.
      2. An “Access Denied” message is displayed on the LCD.
  • 3. Environmental Data Display
    1. The DHT sensor is used to read the temperature and humidity in the fitness room.
    2. The data is displayed on the LCD screen along with the name of the person who scanned the badge.
  • 4. Feedback System
    1. Feedback is given through the LCD, LEDs, and buzzer to indicate the success or failure of the access attempt.

Sources and Implemented Functions

Function / Module Description
———————–—————————————————————————–
scanRFID() Reads the RFID tag using the MFRC522 library.
compareBadgeID() Compares the scanned ID to the list of authorized badge IDs.
unlockDoor() Activates the servo motor or solenoid lock to grant access.
displayMessage() Shows messages on the LCD display (“Access Granted” or “Access Denied”).
displayEnvironment() Displays the temperature and humidity values on the LCD.
soundBuzzer() Sounds the buzzer in case of an access attempt, either for granting or denying access.
blinkLED() Controls the LEDs to indicate the status of the access attempt.

Conclusion

This Badge Scanner project provides a complete access control system for a fitness room, incorporating RFID scanning for user authentication and environmental monitoring through temperature and humidity readings. The system ensures that only authorized individuals can access the room while providing real-time information about the room's climate, enhancing the gym experience for the user.

Repository și Cod Sursă

Pentru accesarea codului sursă complet, documentației tehnice suplimentare și fișierelor proiectului, vizitați repository-ul oficial al proiectului pe GitHub:

[https://github.com/alexiaenache/BadgeScanner](https://github.com/alexiaenache/BadgeScanner)

pm/prj2025/eradu/alexia_ioana.enache.txt · Last modified: 2025/05/21 18:37 by alexia_ioana.enache
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0