SMART Augmented Reality Glasses

My SMART AR Glasses is a pair of glasses that depicts many things such as a greeting page, time, etc into your view. Augmented Reality depicts a computer-generated code into the viewer’s real world view.

Engineer

Foyez

Area of Interest

Mathematics

School

Trinity School

Grade

Rising Sophomore

Reflection

Bluestamp has been nothing short of an incredibly amazing time. I’ve been able to create a really cool piece of technology, my SMART AR Glasses. I was inspired to do this project after a talk by John Werner at my school during our community time. Augmented Reality caught my attention because it was a step up from Virtual Reality and seemed like it could be useful in real life. I learned a ton about raspberry pi, a platform I had never worked with. Bluestamp helped me learn to work with raspberry pi in a minimal time. Aside from the technological side of things, Bluestamp taught me invaluable lessons that I will carry with me throughout my life. They taught me key problem solving skills that forced me to independently try to find answers to my questions. Throughout the building process, I learned that some problems might seem impossible to solve and take numerous days or weeks, but with a little perseverance and creativity, I can find a solution. The speakers they had gave me deep insight into the technological and engineering world, which has expanded my knowledge in these fields. Overall, Bluestamp has proved to be an invaluable experience.

Final Milestone

At the beginning of my last day, my raspberry pi zero was not booting when it was plugged in. I plugged the sd card into my raspberry pi 3, but the sd card was not working. I believe that I short circuited the pi, which also fried my sd card, which is tough because that was the my full work. I made the grand mistake of not having a copy of my sd card, which basically had all my work. This is a big lesson I’ve learned and it’s something that I won’t forget going forward. The change I’ve made was creating a holder for the OLED display and adding a magnifying sheet to make it easier to see the text. I’ve recreated part of the project on a new SD card and have just used my raspberry pi 3. However, losing my work on my last day is devastating, but the lesson of always, ALWAYS saving my work locally has been learned.  

First Milestone

I’ve just reached my first milestone. I used my raspberry pi to program multiple codes to display onto my 128 by 64 pixel OLED display. To make the OLED work, I had to download multiple imaging libraries. I have a basic greeting screen, which utilizes a defined display function that is essential to make the words display on the screen. I have a time feature, which displays the time and date. The random function played a major part in 3 of my displays, my flip a coin display, my roll a die display, and my random motivation quote display. The random function selects a number from a finite set that I define. For each number that the computer selects, the computer will display something different on the screen. For example, for the flip a coin function, the finite set included only 2 numbers, 1 and 2. If the computer selected 1, then, the display would depict heads. If the computer selected 2, the display would depict tails. The roll a dice and random motivational quote codes both work in a similar way except they both have a larger finite set. Now, the hardware is what gives the glasses the augmented reality feature. The prism here is a cube made of clear acrylic glass. Opposite of the OLED, there is a mirror. Running diagonally through the prism is semi-clear 2 way mirror. Basically, the OLED image will first reflect off of the mirror and bounce off the semi-clear mirror to into your eye to produce a virtual image in front of you. One challenge I faced was placing the mirror close enough to your eye so you can see it, but far enough so that you could clearly make out the image. This piece that holds the prism is there to give the virtual image some space from your eye to see it. From here, the next step will be adding voice control.

Greeting Code


import time
import random
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306

from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

# Raspberry Pi pin configuration:
RST = 24
# Note the following are only used with SPI:
DC = 23
SPI_PORT = 0
SPI_DEVICE = 0

# 128×32 display with hardware I2C:
disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST)

# Initialize library.
disp.begin()

# Clear display.
disp.clear()
disp.display()

width = disp.width
height = disp.height
image = Image.new(‘1’, (width, height))

# Get drawing object to draw on image.
draw = ImageDraw.Draw(image)

padding = 2
shape_width = 20
top = padding
bottom = height-padding
x = padding

font = ImageFont.load_default()

draw.text((x, top), ‘Hello World!’ , font=font, fill=255)

# Display image.
disp.image(image)
disp.display()

Clock Code
from lib_oled96 import ssd1306
import time, datetime
from PIL import ImageFont, ImageDraw
from smbus import SMBus
i2cbus = SMBus(1)        # 1 = Raspberry Pi, early REV1 boards use 0
oled = ssd1306(i2cbus)
draw = oled.canvas   # “draw” onto this canvas, then call display() to send the canvas contents to the hardware.
font = ImageFont.load_default()
while True:
draw.rectangle((0, 0, 128, 64), outline=0, fill=0)
draw.text((0, 15), time.strftime(“%I:%M:%S %p”), font=font, fill=1)
draw.text((0 , 25), time.strftime(“%a, %d %b %Y”), font=font, fill=1)
oled.display()
time.sleep(-time.time() % 1)
Flip A Coin Code


import time
import random
import Adafruit_GPIO.SPI as SPI
import Adafruit_SSD1306

from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont

# Raspberry Pi pin configuration:
RST = 24
# Note the following are only used with SPI:
DC = 23
SPI_PORT = 0
SPI_DEVICE = 0

# 128×32 display with hardware I2C:
disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST)

# Initialize library.
disp.begin()

# Clear display.
disp.clear()
disp.display()

width = disp.width
height = disp.height
image = Image.new(‘1’, (width, height))

# Get drawing object to draw on image.
draw = ImageDraw.Draw(image)

padding = 2
shape_width = 20
top = padding
bottom = height-padding
x = padding

font = ImageFont.load_default()

x=random.randint(1,2)
print x
if x==1:
draw.text((x, top+10), ‘Heads’ , font=font, fill=255)
else:
draw.text((x, top + 10), ‘Tails’ , font=font, fill=255)

# Display image.
disp.image(image)
disp.display()

Starter Project

My name is Foyez and I am a rising sophomore at the Trinity School. This is my rainbow LED light show. It utilises an RGB LED strip in which the colors are controlled by your hand using infrared proximity motion sensors. The closer your hand is to the sensor, the brighter the color will get. The sensor is made up of 2 components, an infrared light and a phototransistor. When the phototransistor is exposed to infrared light, current is able to flow through. The more light it is exposed to, the more current that is allowed to flow through. Additionally, the device shuts off after 30 seconds of inactivity. To turn it back on, I have attached a wake button. I soldered 8 resistors of different resistance to the board to control different levels of current flow. I also soldered an integrated circuit or IC, which is a combination of resistors, transistors, capacitors, and more. The IC is basically the brain of the circuit. I soldered a transistor to amplify current and power as your hand comes closer to the sensor. I soldered 2 capacitors, one of .1 microfarads and the other measuring 220 microfarads, which stores electrical energy. This device is powered by a 5V DC power supply. One challenge I encountered was the LED’s were not turning on. This problem was caused by not soldering properly which is important to create electrical connections. At the end of the day, I was forced to desolder multiple times. At the end, once you are done, you will have a very cool motion controlled LED light show.

Leave a Comment

Start typing and press Enter to search