Smart Access and Environment Monitoring System
Overview:
This project combines light sensing, RFID communication, and user input to build a smart access and environment monitoring system. The system adapts LED brightness to ambient light, identifies users via RFID, and toggles modes using a push button.
Objectives:
- Identify users via RFID and display their status in the serial monitor.
- Adjust LED brightness dynamically based on ambient light levels.
- Use Red Pitaya to analyze I²C signals, light flicker, and button inputs.
Components:
Component | Purpose |
Arduino Uno | Microcontroller for system integration. |
Red Pitaya STEMlab 125-14 | Signal analysis of I²C, light signals, and button inputs. |
Seeed Studio Grove NFC Module v1.1 | RFID communication and user identification. |
Photodiode (BPW34) | Measures ambient light intensity. |
Push Button | Toggles modes between manual and automatic. |
220 Ω Resistor | Current limiting for the LED. |
LED (Red) | Visual output for mode status. |
Breadboard and Jumper Wires | For circuit connections. |
Steps:
1. Circuit Assembly:
- Connect the Photodiode:
- Anode to Arduino analog input (e.g., A0) with a 10 kΩ pull-up resistor.
- Cathode to GND.
- Connect the RFID Module:
- VCC to Arduino 5V.
- GND to Arduino GND.
- SDA to Arduino A4.
- SCL to Arduino A5.
- Connect the Push Button:
- One terminal to Arduino digital pin (e.g., pin 2) with a 10 kΩ pull-down resistor.
- The other terminal to 5V.
- Connect the LED:
- One terminal to Arduino PWM pin (e.g., pin 9) through a 220 Ω resistor.
- The other terminal to GND.
2. Arduino Programming:
- Write a program to integrate all functionalities:
#include <Adafruit_PN532.h>const int photoPin = A0; const int buttonPin = 2; const int ledPin = 9; Adafruit_PN532 nfc(A4, A5); void setup() { pinMode(buttonPin, INPUT); pinMode(ledPin, OUTPUT); Serial.begin(9600); nfc.begin(); } void loop() { // RFID Identification uint8_t uid[7]; uint8_t uidLength; if (nfc.readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, &uidLength)) { Serial.print("UID: "); for (uint8_t i = 0; i < uidLength; i++) { Serial.print(uid[i], HEX); Serial.print(" "); } Serial.println(); } // Light Sensing int lightLevel = analogRead(photoPin); int brightness = map(lightLevel, 0, 1023, 0, 255); analogWrite(ledPin, brightness); // Button Input if (digitalRead(buttonPin)) { Serial.println("Button Pressed: Manual Mode"); } else { Serial.println("Automatic Mode"); } delay(200); }
3. Red Pitaya Signal Analysis:
- Photodiode:
- Monitor light intensity changes and detect flicker.
- I²C Signals:
- Analyze communication between Arduino and RFID module.
- Push Button:
- Visualize the raw and debounced button signal.
Value:
- Combines multiple functionalities into a cohesive system.
- Demonstrates the use of light sensing, RFID, and user input in a smart application.
- Red Pitaya enhances understanding of signal behavior for debugging and optimization.