InsightEd is a Bluetooth Low Energy (BLE)-based attendance system where each student device advertises a unique UUID, an ESP32 scanner detects it inside the classroom, and attendance is written to Firebase in real time.
InsightEd-App/: Android app (Kotlin + Compose) that advertises a BLE service UUID.esp32/: ESP32 firmware (Arduino/C++) that scans BLE advertisements and logs attendance.Firebase/: Realtime Database rules and sample data structure.
- Automatic BLE-based attendance capture
- UUID-based student identification
- Real-time Firebase Realtime Database updates
first_seenandlast_seentimestamp tracking- Attendance status derivation (
pendingorpresent)
- Student opens the Android app on a real device.
- App starts foreground BLE advertising with a unique service UUID.
- ESP32 scans advertisements and filters UUIDs (prefix
ADC1/adc1). - ESP32 timestamps detections for the active class period.
- ESP32 writes attendance data to Firebase.
- Dashboard or mobile clients read attendance in real time.
InsightEd/
README.md
InsightEd-App/ # Android app (BLE advertiser)
esp32/
BLE-code/BLE-code.ino # ESP32 scanner firmware
Firebase/
rules.json # Firebase Realtime DB security rules
example-structure.json # Sample database shape
- Android Studio (latest stable)
- Android SDK (configured via
local.properties) - Physical Android device (BLE advertising is unreliable in emulators)
- ESP32 development board
- Arduino IDE with ESP32 board package
- Libraries:
Firebase ESP Client(Mobizt)ESP32 BLE Arduino(Espressif)
- Firebase project with Realtime Database enabled
Some files and values are intentionally local/private. If they are absent in your clone, create/provide them before running.
| Path | Needed For | Required Action |
|---|---|---|
InsightEd-App/local.properties |
Android Gradle build | Set local SDK path, for example sdk.dir=C:\\Users\\<you>\\AppData\\Local\\Android\\Sdk |
InsightEd-App/app/google-services.json |
Firebase config in Android app | Download from Firebase Console and place in this path |
esp32/BLE-code/BLE-code.ino constants |
ESP32 runtime connectivity | Replace placeholders: WIFI_SSID, WIFI_PASSWORD, API_KEY, DATABASE_URL |
#define WIFI_SSID "YOUR_WIFI"
#define WIFI_PASSWORD "YOUR_WIFI_PASSWORD"
#define API_KEY "YOUR_API_KEY"
#define DATABASE_URL "YOUR_DATABASE_URL"- Create/select a Firebase project.
- Enable Realtime Database.
- Apply rules from
Firebase/rules.json. - Optionally import
Firebase/example-structure.jsonto seedstudents,periods, and sampleattendance. - Ensure anonymous auth is enabled if ESP32 uses anonymous sign-up.
- Open
InsightEd-App/in Android Studio. - Ensure
local.propertiesandapp/google-services.jsonare present. - Sync Gradle.
- Install and run on a physical phone.
- Grant Bluetooth/location permissions when prompted.
- Open
esp32/BLE-code/BLE-code.inoin Arduino IDE. - Install required board package/libraries.
- Replace Wi-Fi and Firebase placeholders.
- Upload to ESP32.
- Open Serial Monitor to confirm Wi-Fi, NTP sync, BLE detections, and Firebase writes.
Main attendance path:
attendance/{dd_mm_yyyy}/{period}/{uuid}/
first_seen: <unix_timestamp>
last_seen: <unix_timestamp>
status: "pending" | "present"
- Current rules allow public read and authenticated write under
attendance. - For production use, tighten read access and add role-based write restrictions.
- App build fails with Google Services error:
- Confirm
InsightEd-App/app/google-services.jsonexists and matches your Firebase project.
- Confirm
- ESP32 cannot write to Firebase:
- Verify
API_KEY,DATABASE_URL, and that Firebase auth/rules allow the write path.
- Verify
- No BLE detections:
- Check phone Bluetooth permissions and ensure advertised UUID prefix matches scanner filter (
ADC1/adc1).
- Check phone Bluetooth permissions and ensure advertised UUID prefix matches scanner filter (
InsightEd-App/build/contains generated artifacts and should not be used as source.- Keep secrets out of version control and rotate keys if exposed.