Do It Yourself

Our teacher Tommi Itkonen in action.

When I was a kid, I was a big fan of MacGyver. I didn’t really think such people existed until I started my physics studies here at the University of Eastern Finland. I ran into all sorts of self-built gadgets that were meant to demonstrate a wide range of physics phenomena. When I took a course in practical electronics, it turned out our teacher was the guy who had built all of them. This time he had designed DIY augmented reality (AR)-glasses combining components that just happened to be available. Our task was to construct them.

3D printed AR-glasses
You want to build your own AR-glasses?

Basically, what you need to create your own AR-glasses, is a way to reflect an image that brings new information to your field of view without blocking your real-world view. Of course, there are many ways to implement this. Since it was relatively easy, I’ll show you how we built such a device, and we even did it using low-cost components.

The image that eyes receive comes from a small OLED display and goes through a lens. Light first reflects from a mirror and then partially reflects from glass plates into the viewer’s eyes. This works much in the same way as a red dot sight with the exception that it is built for both eyes. The distance of the image we see can be adjusted by changing the angle of the glass plates.

Simplified plan of the glasses we built.

Find out more about light traveling from OLED display to eyes.

We are actually tricking the brain a bit. When we look an object that is close to us, our eyes have to rotate inwards, and the closer a thing is, the greater the inward movement must be. When we tilt the glass plates, our eyes have to adjust accordingly to focus on the reflected light. Our brain concludes the distance of the image by the amount of the movement the eyes have to make. And our brain has no idea what we see, is not really there.

Find out more about human 3D vision.

To call this augmented reality, we couldn’t just add any random image. We needed to add information, so we added sensors to measure things. One prototype we made, was glasses with an ultrasonic sensor to measure distances. I will present this project here, but don’t let it limit your imagination. With some changes, you can use other sensors, or Bluetooth, phone apps, etc.

How To Do It:

Here is a list of components you need. There are also links to some shops where you can buy them (just to show the kind of parts I mean). The following links will take you to shops like Thorlabs, Thermo Fisher Scientific, Partco, Arduino Store, Distrelec and Biltema.

  • Lens: We used 3D printed plano-convex lens with focal length 100 mm and 25 mm diameter. Plano-convex means that the lens has one spherical surface and one flat surface. Plano-convex lenses are very suitable for collimating light. For example, you may find an equivalent lens from Thorlabs.
  • Mirror: We used the first surface mirror we made with a vacuum evaporator. A first surface mirror is a type of mirror with the reflecting surface on the first layer. If you cannot find a reasonably priced first surface mirror, or you do not happen to have an extra vacuum evaporator lying around, just use a regular mirror. Either a small one, about 30 mm x 30 mm, or a cut piece from a larger one. In case you insist on using a first surface mirror, you may again find one from Thorlabs.
  • Reflecting surfaces: Clear glass or plastic plates. We used microscope slides cut in half, size about 26 mm x 38 mm x 1 mm. Nearly any transparent plane plate, big enough to cover your eyes, will do the trick; however, the amount of light reflecting varies with different materials.
  • Headset: This was a bit of a headache. The purpose of a headset is to keep the optical axis in line and to attach all the components firmly around your head making you look cool and smart (I’m the one who didn’t think it would actually show in the picture that the device is not on). So, let your imagination fly. We built our second-generation headset using 3D printed parts and attached them to the headband from a helmet. If you don’t know anyone who has a 3D printer, check if there is a library near you it is possible to make 3D prints.

1. Program Arduino Nano

For programing, you will need Arduino IDE. If you are not interested in building your own program, this code should work with an ultrasonic sensor. Just copy the code, paste it to Arduino IDE and sent it to your Arduino. If you haven’t done this before, here is how it’s done.

There are plenty of tutorials and ready built programs for Arduino on the internet. If you are not into ultrasonic sensors but just want to try how to get an image on these AR-glasses, you can find some examples from Random Nerd Tutorials. Optical illusion animations look cool in this system, for example, this 3D cube animation.

2. Connect the Ultrasonic Sensor and the Display to Arduino

Once the program has been uploaded to the Arduino, you can connect the display and the ultrasonic sensor to Arduino with female jumper wires.

Arduino, ultrasonic sensor and OLED display wired
Arduino, ultrasonic sensor and OLED display wired.

OLED display to Arduino Nano:

  • SDA to A4
  • SCL to A5
  • VCC to 3V3
  • GND to GND

Ultrasonic sensor to Arduino Nano:

  • VCC to 5V
  • Trig to D3
  • Echo to D4
  • Gnd to GND
Arduino, ultrasonic sensor and OLED display schematic
Schematic of Arduino Nano, ultrasonic sensor and OLED display.

Now, simply connect the Arduino to the power bank. You should now see the distances measured by the ultrasonic sensor at the screen of the OLED display.

You may check the calibration of the ultrasonic sensor by placing it 1 meter from a wall. If the displayed measurement is not correct, you will have to adjust the conversion factor k in your Arduino Nano program in the “My variables” section. One easy way to do this is to reprogram your Arduino by setting the conversion factor to k = 1000.0. If, for example, the display then gives a reading of 1.18 m, the conversion factor should be adjusted to k = 1180.0. Upload the updated program to your Arduino, and it should now give you the correct distance.

Arduino Nano program, My variables section.

3. Build the Headset

Optical components on a same axis.
Optical components need to be on the same optical axis.

The main things when building your headset:

  • You want to get the display, the lens, the mirror, and the glass plates all on the same optical axis. This means that there should be a straight line passing from the center of the display, through the center of the lens, and then to the center of the mirror. Then again, a straight line from the center of the mirror to the center of both glass plates. To help make the task easier, it is good to have some mechanism to adjust the tilt of the mirror.
  • The distance between the display and the lens must be the same as the focal length of the lens, or at least close, anyways. You might want to make some structure that allows you to adjust the distance between these components.
  • There are three different kind of glass plate adjustments that you need to make in the setup. First, you need to set the distance between the glass plates according to the distance between your pupils so that you can see at least some reflection with your left and right eye. Second, you need to rotate the glass plates so that your brain can combine the images from the left and right eye together as one image. Third, you will need a very fine rotation so that you may adjust the position of the image you see. Note that when the left glass plate rotates clockwise, the right must rotate counterclockwise and vice versa.
  • Then, of course, you will need some structure to attach the whole system firmly around your head. We used helmet headband we found from a local hardware store.
AR-glasses headset
Here is one headset prototype one of our students made. It is designed and drawn with Fusion 360 program. It is modified to g-code with Ultimaker Cura 4.7 and printed with Ultimaker 3 using black Ultimaker PLA filament. With this design, you can adjust the apparent distance of the image by rotating the screw on the front.

Feel free to use these files, but please notice that they are designed for only our specific headband. You might have to modify the design quite a bit.

If you want to ask about the project, introduce your own device or just chat about AR-glasses, you are welcome to our forum.