0% found this document useful (0 votes)
7 views4 pages

Smart Room Implementation Guide

The document outlines the implementation of the 'Smart Room That Remembers You' project, detailing required hardware, software, wiring setup, and Arduino code. It describes how the system detects motion and identifies users via Bluetooth, providing personalized feedback on an OLED display. Additionally, it suggests enhancements for multi-user support and integration with real-time clocks and web dashboards.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Smart Room Implementation Guide

The document outlines the implementation of the 'Smart Room That Remembers You' project, detailing required hardware, software, wiring setup, and Arduino code. It describes how the system detects motion and identifies users via Bluetooth, providing personalized feedback on an OLED display. Additionally, it suggests enhancements for multi-user support and integration with real-time clocks and web dashboards.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Title

Smart Room That Remembers You - Full Implementation Guide

Overview

This document provides the complete implementation details of the 'Smart Room That Remembers
You' project. It includes the hardware setup, wiring, Arduino code snippets, Bluetooth proximity
detection, and system behavior.

1. Hardware Components Required

- ESP32 (ESP8266 optional, but ESP32 required for Bluetooth)


- PIR Motion Sensor (or IR/Ultrasonic)
- OLED Display (I2C)
- Buzzer or LED (optional for feedback)
- Power Supply (e.g., USB or battery pack)
- Smartphone (with Bluetooth turned on)

2. Software & Libraries

- Arduino IDE
- Libraries:
- Adafruit_SSD1306 (for OLED)
- BLEDevice (for Bluetooth scanning)
- EEPROM (for memory)
- Board Support: ESP32 board installed in Arduino IDE

3. Wiring Setup

- PIR Sensor: VCC to 3.3V, GND to GND, OUT to GPIO 15


- OLED: VCC to 3.3V, GND to GND, SDA to GPIO 21, SCL to GPIO 22
- Buzzer: VCC to GPIO 13, GND to GND

4. Arduino Code (Main Logic Snippet)


#include <BLEDevice.h>
#include <EEPROM.h>
#include <Wire.h>
#include <Adafruit_SSD1306.h>
#define PIR_PIN 15
#define BUZZER_PIN 13
String knownDevice = "XX:XX:XX:XX:XX:XX"; // Your phone MAC
Adafruit_SSD1306 display(128, 64, &Wire, -1);
bool motionDetected = false, deviceFound = false;

class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {


void onResult(BLEAdvertisedDevice advertisedDevice) {
if ([Link]().toString().c_str() == knownDevice) {
deviceFound = true;
}
}
};

void setup() {
pinMode(PIR_PIN, INPUT);
pinMode(BUZZER_PIN, OUTPUT);
[Link](115200);
[Link](SSD1306_SWITCHCAPVCC, 0x3C);
[Link](512);
BLEDevice::init("");
[Link]();
}

void loop() {
if (digitalRead(PIR_PIN)) {
BLEScan* pBLEScan = BLEDevice::getScan();
pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
pBLEScan->setActiveScan(true);
pBLEScan->start(5);

[Link]();
[Link](1);
[Link](0, 0);
if (deviceFound) {
[Link]("Welcome back, User!");
tone(BUZZER_PIN, 1000, 200);
} else {
[Link]("Welcome, Guest!");
}
[Link]();
delay(10000);
deviceFound = false;
}
}

5. System Behavior

- When someone enters, the PIR detects motion.


- ESP32 scans for nearby Bluetooth devices.
- If your phone is detected, a personalized message is shown.
- Entry time is logged using EEPROM.
- On re-entry, the display shows time since last visit.

6. Enhancements & Ideas

- Add more user MACs for multiple users.


- Use a real-time clock (RTC) for accurate timing.
- Store and display visit history on a web dashboard.
- Integrate mood lights using relay modules.

Conclusion
This project demonstrates a creative and low-cost way to personalize smart environments. It
integrates motion detection, Bluetooth-based identification, and memory-based interaction - all
running completely offline on a microcontroller. This project reflects a real-world IoT application and
highlights embedded system skills valuable in the industry.

Common questions

Powered by AI

Suggested enhancements include adding support for multiple user MAC addresses, integrating a real-time clock for accurate timing, displaying visit history on a web dashboard, and incorporating mood lights with relay modules. These improvements could diversify user interactions, enable detailed historical data viewing, and create dynamic environments through lighting changes, enhancing overall user experience and system capabilities .

The project uses a PIR motion sensor to detect movement and then initiates a Bluetooth scan using the ESP32. If the detected Bluetooth device matches a predefined MAC address of a smartphone, it identifies the specific user. This match triggers personalized interactions, such as displaying a welcome message on the OLED display .

The project requires the Arduino IDE and specific libraries: Adafruit_SSD1306 for OLED display functionality, BLEDevice for Bluetooth scanning, and EEPROM for memory operations. The ESP32 board support must be installed in the IDE. Each library handles different aspects; the Adafruit library manages graphical outputs on the OLED, BLEDevice handles device detection through Bluetooth, and EEPROM facilitates memory storage and retrieval operations to log user visits .

Bluetooth-based identification provides a seamless and user-friendly way to recognize individuals based on their smartphone presence. This method avoids the need for additional user interaction, such as card swipes or passwords. However, it may present limitations such as privacy concerns, potential interference from other Bluetooth devices, and dependency on users having Bluetooth enabled on their devices. Additionally, Bluetooth range might limit its effectiveness in larger spaces .

To handle multiple users, the system could be modified to store multiple MAC addresses in a list or array structure. During Bluetooth scanning, the system would check each detected device against this list. Potential challenges include increased memory usage, complexity in managing a dynamic list for entry and removal of user devices, and ensuring real-time performance as the list grows. Managing unique data for each user, such as personalized messages and logs, would also increase the complexity of data handling and retrieval .

The essential hardware components include an ESP32 for its Bluetooth capabilities, a PIR motion sensor for detecting movement, an OLED display for showing messages, a power supply to power the components, and optionally a buzzer or LED for feedback. ESP32 is crucial as it supports Bluetooth, which is required for device scanning. The PIR sensor detects motion to trigger the Bluetooth scan, the OLED displays messages to users, and the power supply powers the entire setup .

The buzzer provides auditory feedback when a recognized device is detected. Upon successful identification of a user, the buzzer emits a tone, signaling recognition and welcoming the user. This auditory cue complements the visual message on the OLED, offering an immediate, perceptible form of feedback indicating system activation and user acknowledgment .

Integrating an RTC would enhance the system by providing precise timestamping for user entries. This would allow the system to accurately log entry times and calculate the duration since the last visit. It could improve the personalization aspect by displaying detailed interaction history and potentially adapting responses based on the time of day. RTC integration would also enable more advanced features like setting time-based rules or alerts .

The EEPROM is utilized to store entry timestamps in the project. When a recognized device is detected, the system logs the current time to the EEPROM. This logging allows the system to display the time elapsed since the last entry, creating a more personalized user experience by referencing past interactions .

The Arduino code snippet defines a callback function that checks if the advertised Bluetooth device's MAC address matches the predefined known device MAC address. If a match is found, it sets a flag that triggers the OLED display to show a personalized welcome message. This logic ensures the system responds correctly based on whether the MAC address of the detected device is recognized .

You might also like