BLE Data Glasses With XIAO Microcontroller (only a Few Parts)
by Markus Opitz in Circuits > Microcontrollers
21527 Views, 166 Favorites, 0 Comments
BLE Data Glasses With XIAO Microcontroller (only a Few Parts)
The Story
Long before I published on Instructables, a great project caught my eye in 2018: Alain's data glasses
I was fascinated by the idea. Alain used the glasses to display his voltage meter via Bluetooth. Although I didn't have such a measuring device, I tried to replicate it and built in a few gadgets: compass with circuit board, crosshairs, countdown. The device was controlled via an app on my cell phone. This way I had to learn how to use the MIT App Inventor 2. Unfortunately, the device was never finished due to the lack of a good housing.
Recently, however, I discovered the amazing capabilities of an XIAO nRF52840 sense from SeeedStudio: ESP32 with BLE, WiFi, LiPo charging, accelerometer, and microphone. All in a device the size of a thumbnail (my thumbnail).
So all you need for the data glasses is XIAO nRF52840 sense, battery and mini display. And a 3D printer would be helpful.
There are two approaches to DIY data glasses: The display beams its image forwards parallel to the frame, where it is directed towards the eye by two mirrored surfaces. The second mirror in DIY data glasses is often a foil or plexiglass. I found the second mirror particularly problematic: the projection surface was not flat enough (distortion) and the image was not bright enough, especially outside in the sun.
A further development seemed more logical to me: projection directly into the eye using just one mirror. Although the eyepiece appears to be in the way, the restriction of the field of view with two healthy eyes is only minimal in practice.
After I had developed the new device and a slimmer housing, I went looking for Alain's other projects and discovered that he had also developed this second method before me. After the initial disappointment of not being the sole developer, I see it as confirmation of my work and Alain deserves the credit of the inventor.
I can at least take credit for having pursued my own approach with the app and the small XIAO nRF52 sense.
And all together only 24 grams!
Of course there are better smart glasses available right now. But they cost 700€ +. Mine are < 40€ ! And DIY! You WILL get attention with them :-)
Supplies
No complicated production steps.
No complex soldering.
Only a few parts.
Simple do it yourself.
XIAO nRF250 sense (~ 16 $)*
Battery 150mAh/3.7V (~ 4.50 €)
0.49inch OLED display module, 64×32 pixel (~ 13 €)
plastic lense f=49mm
plastic mirror
3D printer
* you can also use other XIAOs of the same size: nRF52840 (~ 10 $), ESP32C3 (~ 5 $), ESP32S3 (~ 7.50 $), ESP32C6 (~ 5.20 $).
The Parts
The XIAO nRF52 sense* is an amazing microcontroller: very small (~21x18mm), equipped with IMU chip, LiPo charge control and microphone, 64 MHz processor, Bluetooth 5.0 and built-in antenna
* provided by Seeed Fusion. Be creative and make your own PCBs and PCBAs with Seeed Fusion services, free prototype and functional testing on first sample.
You could also use an XIAO ESP32C3 or ESP32C6 for our data glasses, but you would need an external antenna, which would take up a bit more space.
Battery: I was able to find a very flat battery: 150mAh/3.7V, not even 3mm thick.
Display: The display is also one of the smallest I could find. Unfortunately, the resolution is not very good. But I'm sure there will be better developments soon.
Cost: depending on the microcontroller model 25-35 €
The Microcontroller
The XIAO nRF52840 microcontroller: an amazing and tiny device, fast and versatile, easy to boot, BLE, antenna and microphone on board. Wow!
The Wiring
Simply follow the wiring diagram. There are only a few parts that need to be soldered.
Shorten the display cable and solder it to the ESP32. Solder two cables to the bat connection on the underside. Lead GND to the negative pin of the battery, + via the connections of the switch to the positive pin.
The Display
The display image is only mirrored once in these data glasses, so the original image must be mirrored by software. This is done by the command U8G2_MIRROR
The Software
The software actually only consists of a Bluetooth receiver and the OLED display. Apart from the Accelerator data, nothing is utilised at first. Time, telepromter text and message signals are controlled from the mobile phone.
You can find a very good description of the upload here from the manufacturer SeeedStudio.
Downloads
The Optics
Mirror & Plastic lense
The display image is only mirrored once in these data glasses, so the original image must be mirrored by software. This is done by the command U8G2_MIRROR
However, the display is far too close to the eye to be read clearly. That's why I use a plastic lens with a focal length of 49 mm. If the image is not clear, here's a little trick:
You can correct the image with a Fresnel lens (plastic, cheque card size, a few cents).
The plastic mirror can be cut to size with scissors or a pen knife. For the plastic lens, I can only recommend a file and sandpaper. First mark the center of the lens, it should definitely be the center of the new lens.
Caution, do not use superglue for the optical parts; the solvent vapours will blind the mirror and lens!
The Housing
I don't need to say much about the casing: A 3D printer is extremely helpful. I love to do a quick work with Tinkercad.
I have optimized the housing so that it is now as small as possible. The optics are just plugged into the main body. The two lids can now be closed and secured with a few drops of superglue.
You can still match the filament color to your glasses.
Downloads
All Together
Fix the display, switch and ESP32 with a little hot glue. The main part of the device is now complete and does not need to be modified. The XIAO nRF52 sense has a big advantage over other XIAO devices: When uploading programs, you no longer need to press the boot button!
The optical part still has to be fitted into the main unit and secured with superglue.
And all together only 24 grams!
The BT Glasses can now be attached to almost any spectacle frame. To charge the device, simply plug in a USB-C cable and don't forget to switch it on. If the software needs an update, simply connect via the USB cable.
As the XIAO nRF52 sense has a built-in microphone, it could in principle be controlled via audio commands.
The App
Explaining the function of the MIT App Inventor would go beyond the scope of this article. However, I am happy to make all the relevant files available for further development. Import the aix file to further edit the program. The overview of the blocks helps when revising commands.
How it works:
Depending on the selected functions, the app sends a string command to the smart glasses (e.g. CrosshairOn). Or if the smartphone rings, an icon is displayed.
Usage:
Switch on BLE Data Glasses. Start the app on the cell phone, press <SCAN>, select “...Data-Glasses...” from the list, <Connect>. The indicator light shows the connection.
Although the app requires access to the phone settings and Bluetooth, it does not save anything or pass on any information.
Downloads
Outlook and Summary
Outlook for the future:
Voice commands, connect OBD2 adapter for vehicle data, display with more resolution at the same size.