A 2-part hackathon project consisting of an Android app that sends phone notifications to an ESP32 over Bluetooth Low Energy (BLE), which displays them on a small OLED screen.
- File:
esp32_ble_display.ino - Hardware: ESP32 with 0.96" SSD1306 128x64 I2C OLED
- Features:
- BLE server with device name "AR_Glasses"
- JSON-based communication protocol
- Time display and notification display with text wrapping
- Auto-revert to time display after 10 seconds
- Language: Native Kotlin
- Features:
- BLE client that connects to ESP32
- Notification listener service
- Automatic time synchronization
- Real-time notification forwarding
- SDA: GPIO 21
- SCL: GPIO 22
- VCC: 3.3V
- GND: Ground
-
Install required libraries:
BLEDevice.hAdafruit_GFX.hAdafruit_SSD1306.hArduinoJson.hWire.h
-
Upload
esp32_ble_display.inoto your ESP32
- Open the project in Android Studio
- Build and install on your Android device
- Grant all required permissions when prompted
- Enable notification access in device settings
- ESP32: Power on the device - it will start advertising as "AR_Glasses"
- Android: Open the app and tap "Scan & Connect"
- Permissions: Tap "Notification Permission" to enable notification access
- Notifications: Any notification received on your phone will be displayed on the ESP32 screen
The app communicates with the ESP32 using JSON messages:
{"type":"time", "time":"14:30"}{"type":"notify", "app":"WhatsApp", "title":"New message from John"}The ESP32 display shows:
- Time mode: Current time in HH:MM format
- Notification mode:
- Line 1: App name (12 chars max)
- Line 2-4: Notification title (wrapped to fit)
- Automatic time sync: Updates every 60 seconds
- Notification capture: Captures all phone notifications
- Text wrapping: Long notifications are properly wrapped
- Auto-revert: Returns to time display after 10 seconds
- BLE connection management: Handles connection/disconnection
- Connection issues: Ensure ESP32 is powered and advertising
- No notifications: Check notification permission in Android settings
- Display issues: Verify I2C connections and OLED address (0x3C)
- BLE issues: Ensure device is within range and not connected to other devices
- ESP32 BLE Arduino
- Adafruit SSD1306
- Adafruit GFX Library
- ArduinoJson
- AndroidX Core
- AndroidX AppCompat
- Material Design Components
- LocalBroadcastManager