Team Star Glasses Tech Notes

For Starglasses: I did some looking around today, and there are a lot of resources for similar projects, mainly around AR glasses.  The guides aren't in any way thorough, but there are a lot of them.  Here's a few to look at:


https://www.youtube.com/watch?v=YK3YPtgHQnc







Ooooh, you might chat with Amir Alsad—freshman in advising seminar fall 2024. He made a pair of AR glasses. amir_a@mit.edu

Meta AR Glasses
https://www.meta.com/ai-glasses/meta-glasses/


Google Sky Map
https://play.google.com/store/apps/details?id=com.google.android.stardroid&hl=en_GB&gl=US




Building your own Augmented Reality (AR) glasses is a fantastic physical computing challenge that bridges optics, microcontrollers, and 3D fabrication. While commercial headsets use multi-million dollar waveguide technology, you can create a highly functional prototype on a maker budget using accessible components.

Here is a breakdown of the core architecture and how to implement it.

1. The Processing Core

You need a brain that is small enough to wear but powerful enough to drive a display and process sensor data.

  • Microcontrollers (ESP32 / Arduino Portenta): Ideal for lightweight, text-based HUDs (Heads Up Displays). They sip power and are perfect if you just want to stream sensor data, notifications, or simple vector graphics via I2C or SPI.

  • Single Board Computers (Raspberry Pi Zero 2 W): Better if you need computer vision (like OpenCV), a full OS, or more complex graphical overlays. You can run lightweight Python scripts to handle the display output and wireless communication.

2. The Display & Optics

This is the hardest part of the build. You cannot simply put an OLED screen directly in front of your eye, because the human eye cannot focus on something that close. You need optics to push the focal plane further out.

For DIY builds, "Birdbath" optics or simple Combiners are the most practical routes:

  • The Display: You will need a micro-display. A 0.49-inch to 0.96-inch OLED display is standard.

  • The Combiner: This is a semi-transparent mirror (a beamsplitter) placed at a 45-degree angle in front of your eye. The micro-display sits above it, pointing down. The light from the display hits the combiner and bounces into your eye, while ambient light passes straight through from the real world.

  • The Magnifier: A convex lens placed between the display and the combiner magnifies the tiny screen and sets the focal distance so your eye can actually read it.



3. Tracking & Sensors

To make the glasses "smart," they need context about the physical world.

  • IMU (Inertial Measurement Unit): A 6-axis or 9-axis sensor (like the MPU-6050 or BNO085) tracks your head's pitch, roll, and yaw. This allows you to lock digital text to a specific compass heading or stabilize the display.

  • Camera: If using a Pi, a small MIPI camera module allows you to run basic object recognition or QR code scanning.

Implementation Sequence

If you are building your first prototype, here is the recommended path to avoid getting bogged down in optical physics before your code works:

1.Bench-Test the Hardware:Electronics first.

Wire your microcontroller (e.g., ESP32) to your micro-OLED and IMU on a breadboard. Write a simple sketch to pull pitch/yaw data from the IMU and print it to the OLED. Ensure your refresh rate is high enough to prevent nausea.

2.Prototype the Optics:The cardboard phase.

Do not 3D print anything yet. Use foam core or cardboard to build a temporary rig holding your OLED, convex lens, and beamsplitter glass. Adjust the distances manually until the text is in focus when you look through the glass. Measure these exact distances.

3.CAD and 3D Print the Frame:Iterative design.

Using the measurements from Step 2, design a frame in CAD (like Fusion360 or Tinkercad). The frame must securely hold the optics at the correct angles while housing the electronics. Keep the center of gravity as close to the face as possible to prevent nose strain.

4.Assemble and Calibrate:Final integration.

Mount the components into your 3D-printed frame. You will likely need to write a software calibration routine to adjust the software's center-point to match where your eye naturally rests.

Design Note: Pay close attention to cable management. Stiff wires running from the glasses to an external battery pack or processing unit will constantly pull the glasses off your face. Use highly flexible, silicone-coated wire for any tethering.



Switching to the BNO055 is a massive upgrade for an AR display. Instead of raw accelerometer and gyroscope data that you have to filter yourself, the BNO055 has an onboard Cortex-M0 processor that performs sensor fusion (Kalman filtering) directly on the chip.

This means it outputs rock-solid Euler angles or Quaternions with virtually no jitter, completely eliminating the need for complex filter mathematics in your sketch.

The BNO055 Stabilization Code

You will need the Adafruit BNO055 library installed in your IDE. This code pulls the pre-calculated Euler angles (Yaw, Roll, and Pitch) and uses them to draw a highly stable artificial horizon.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// Initialize BNO055 (ID 55, default I2C address 0x28)
Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28);

void setup() {
Serial.begin(115200);

// 1. Initialize the BNO055
if (!bno.begin()) {
Serial.println("No BNO055 detected");
while (1) { delay(10); }
}
// Use the external crystal on the breakout board for better accuracy
bno.setExtCrystalUse(true);

// 2. Initialize the OLED
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
Serial.println("SSD1306 allocation failed");
for(;;);
}
display.clearDisplay();
display.display();
}

void loop() {
// 3. Get absolute orientation from the BNO055's built-in sensor fusion
// This outputs a stable vector. Adafruit maps X=Yaw, Y=Roll, Z=Pitch
imu::Vector<3> euler = bno.getVector(Adafruit_BNO055::VECTOR_EULER);

float yaw = euler.x();
float roll = euler.y();
float pitch = euler.z();

// Print data to the serial monitor for calibration
Serial.print("Pitch= ");
Serial.print(pitch);
Serial.print(" Roll= ");
Serial.print(roll);
Serial.print(" Yaw= ");
Serial.println(yaw);

// 4. Map the physical angles to screen coordinates
int centerY = SCREEN_HEIGHT / 2;
int centerX = SCREEN_WIDTH / 2;
// Pitch shifts the line vertically
// Depending on how the sensor is mounted on your glasses, you may need to invert this by making it: centerY - (int)pitch;
int lineY = centerY + (int)pitch;

// Keep the line bounded to the screen
if (lineY < 0) lineY = 0;
if (lineY > SCREEN_HEIGHT) lineY = SCREEN_HEIGHT;

// Roll rotates the line. Convert degrees to radians.
int lineLength = 80;
float rollRad = roll * PI / 180.0;
// Calculate the rotation endpoints
int dx = cos(rollRad) * lineLength / 2;
int dy = sin(rollRad) * lineLength / 2;

// 5. Draw the frame
display.clearDisplay();
// Draw the stabilized horizon line
display.drawLine(centerX - dx, lineY - dy, centerX + dx, lineY + dy, SSD1306_WHITE);
// Draw a fixed "crosshair" representing the center of your vision
display.drawPixel(centerX, centerY, SSD1306_WHITE);
display.drawPixel(centerX - 3, centerY, SSD1306_WHITE);
display.drawPixel(centerX + 3, centerY, SSD1306_WHITE);
display.drawPixel(centerX, centerY - 3, SSD1306_WHITE);
display.drawPixel(centerX, centerY + 3, SSD1306_WHITE);

display.display();
// The BNO055 sensor fusion runs at roughly 100Hz
delay(10);
}
C++

What Changed?

  1. No Trigonometry Required: Notice that the atan2 calculations are completely gone. We are simply pulling the euler.z() and euler.y() vectors directly. The BNO055 has already done the heavy math.

  2. True Yaw (Heading): The MPU-6050 cannot measure true absolute Yaw because it lacks a magnetometer—it can only guess rotation based on the gyro, which drifts over time. The BNO055 includes a magnetometer, meaning the euler.x() value is a true compass heading (0-360 degrees) that won't drift.

3 comments:

  1. There is a more recent (and more expensive) DLP board that supports using a Raspberry Pi

    https://www.ti.com/tool/DLPDLCR230NPEVM

    Also here is a 2025 post on using the older DLP unit with an RPi-4:
    https://www.intellar.ca/blog/raspberry-pi-evm2000

    In the blog the author notes that he did a proof of concept using jumper wires, but had problem with data corruption and ended up designing a custom board to connect the devices together.

    ReplyDelete
  2. Adapter board available for $35 (Canadian, since I think he is in Quebec)
    https://intellar.square.site/product/evm2000-ti-adapter-board-for-raspberry-pi/KPYOC73DPLJ3OU2VVH3XMLKP?cs=true&cst=custom

    ReplyDelete
  3. And a video here on using a Raspberry Pi-5 running Trixie OS
    https://www.youtube.com/watch?v=jDVM0gjWmZA

    ReplyDelete