Title: BLE Data Glasses With XIAO Microcontroller (Only a Few Parts!)

 Introduction

Imagine having smart glasses that can display real-time data directly in front of your eyes—without the complexity of building a bulky system. With the help of a XIAO microcontroller and a few additional components, you can create BLE (Bluetooth Low Energy) data glasses in just a few steps. In this blog, we will walk you through how to build this innovative project with minimal components and effort.



Materials Needed

  • XIAO BLE microcontroller (compact and powerful)
  • OLED display (small and lightweight for easy integration)
  • Battery (3.7V Li-Po battery)
  • Bluetooth module (if not using XIAO BLE variant)
  • Frame of old glasses
  • Wires, resistors, and soldering kit

Step 1: Preparing the Glasses Frame
Take a pair of glasses that you’re no longer using, ideally one with enough space on the sides for mounting the components. Remove the lenses if needed. You will be attaching the OLED display to one lens area, and the XIAO microcontroller can be mounted on the temple or side of the frame.

Step 2: Connecting the OLED Display to the XIAO Microcontroller
The OLED display will act as the screen, showing real-time data that is streamed via Bluetooth. Connect the OLED to the XIAO microcontroller using these simple connections:

  • VCC of OLED to 3.3V on XIAO
  • GND of OLED to GND on XIAO
  • SCL to Pin A1 (or any available I2C pin)
  • SDA to Pin A2 (or any available I2C pin)

Step 3: Powering the System
Use a small 3.7V Li-Po battery to power the entire system. Connect the positive terminal of the battery to the XIAO’s power input and the negative terminal to ground. Ensure the battery fits well inside the frame or along the arm of the glasses.

Step 4: Programming the XIAO for BLE Communication
Program the XIAO using the Arduino IDE. Install the necessary libraries for Bluetooth communication and OLED display support. The XIAO BLE model makes it easy to communicate wirelessly with smartphones or other BLE-enabled devices.

Here is a sample code to start with:

cpp
#include <Wire.h> #include <Adafruit_SSD1306.h> #include <ArduinoBLE.h> // OLED display settings #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 32 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); void setup() { // Initialize display if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { Serial.println(F("OLED allocation failed")); for (;;); } display.clearDisplay(); display.setTextSize(1); display.setTextColor(WHITE); // Initialize Bluetooth if (!BLE.begin()) { Serial.println("starting Bluetooth® Low Energy failed!"); while (1); } // Display a message on the OLED display.setCursor(0,0); display.println("BLE Glasses Ready"); display.display(); } void loop() { // Bluetooth code to receive data and display on OLED // BLEDevice central = BLE.central(); // Add this for central devices display.setCursor(0,10); display.println("Data: 123"); // Replace this with actual data display.display(); delay(500); }

Step 5: Testing the Glasses
Once the programming is done, pair the BLE data glasses with your smartphone or any BLE-compatible device. The OLED should start displaying the data, whether it’s sensor readings, notifications, or even text messages sent via Bluetooth.

Step 6: Assembly
Now, fit the components neatly on the glasses. Use glue or double-sided tape to attach the OLED and XIAO microcontroller. Ensure that the wiring is tight and secure to avoid any loose connections while wearing the glasses.

Conclusion
With just a few parts, you can turn any ordinary glasses into BLE-enabled smart data glasses. This project is great for hobbyists interested in wearable electronics or IoT. The compact XIAO microcontroller and the ease of connecting it with an OLED display make this project quick yet impressive. Customize it further by adding additional sensors or different types of data!


Stay tuned for more DIY electronics projects! Drop a comment below if you have any questions or want to share your own version of BLE Data Glasses!