Project Report Smart Glasses
Project Report Smart Glasses
Project Report Smart Glasses
MAY, 2020
SUBMITTED BY
Name of Students (Full Name) Enrolment No.
DIVANSHU SAINI SG-20561
KARTIKAY SG-20562
Branch:-E.C.E Semester:- 6TH
PROJECT FILE-:
Smart Glasses (SG)
🧑💻 🧑💻
PUNJAB UNIVERSITY SWAMI SARVANAND GIRI
REGIONAL CENTRE
HOSHIARPUR –146021
SUBMITTIED TO:-
DR.Ankur Singh Kang Sir
Page 1
INTRODUCTION
Smart-glasses or smart glasses are eye or head-worn wearable computers that offer
useful capabilities to the user. Many smart-glasses include displays that add
information alongside or to what the wearer sees.Alternatively, smart-glasses are
sometimes defined as glasses that are able to change their optical properties, such as
smart sunglasses that are programmed to change tint by electronic means.
Using the touch pad built on the side of the 2013 Google Glass to communicate with
the user's phone using Bluetooth. Man wearing a 1998 EyeTap, Digital Eye Glass.
Page 2
Like other computers, smart-glasses may collect information from internal or external
sensors. It may control or retrieve data from other instruments or computers. It may
support wireless technologies like Bluetooth, Wi-Fi, and GPS. A small number of
models run a mobile operating system and function as portable media players to send
audio and video files to the user via a Bluetooth or WiFi headset.Some smart-glasses
models also feature full life logging and activity tracker capability.
Page 3
COMPONENT USED
-Arduino nano v3
-Mirror
-Reflector
Nano’s got the breadboard-ability of the Boarduino and the Mini+USB with smaller
footprint than either, so users have more breadboard space. It’s got a pin layout that
works well with the Mini or the Basic Stamp (TX, RX, ATN, GND on one top, power
and ground on the other). This new version 3.0 comes with ATMEGA328 which offer
more programming and data memory space. It is two layers. That make it easier to
hack and more affordable.
Specifications:
Microcontroller Atmel ATmega328
Page 4
Flash Memory 32 KB (of which 2KB used by bootloader)
SRAM 2 KB
EEPROM 1 KB
Features:
• Automatic reset during program download
Power:
The Arduino Nano can be powered via the mini-B USB connection, 6-20V
unregulated external power supply (pin 30), or 5V regulated external power supply
(pin 27). The power source is automatically selected to the highest voltage source.
Page 5
HC-05 Bluetooth Module
• HC-05 is a Bluetooth module which is designed for wireless communication.
This module can be used in a master or slave configuration.
Bluetooth serial modules allow all serial enabled devices to communicate with each
other using Bluetooth.It has 6 pins,
1. Key/EN: It is used to bring Bluetooth module in AT commands mode. If Key/EN
pin is set to high, then this module will work in command mode. Otherwise by
default it is in data mode. The default baud rate of HC-05 in command mode is
38400bps and 9600 in data mode.
HC-05 module has two modes,
1. Data mode: Exchange of data between devices.
Command mode: It uses AT commands which are used to change setting of HC-05.
To send these commands to module serial (USART) port is used.
2. VCC: Connect 5 V or 3.3 V to this Pin.
3. GND: Ground Pin of module.
Page 6
4.TXD: Transmit Serial data (wirelessly received data by Bluetooth module
transmitted out serially on TXD pin)
5.RXD: Receive data serially (received data will be transmitted wirelessly by
Bluetooth module).
6. State: It tells whether module is connected or not.
HC-05 module Information
• HC-05 has red LED which indicates connection status, whether the Bluetooth
is connected or not. Before connecting to HC-05 module this red LED blinks
continuously in a periodic manner. When it gets connected to any other
Bluetooth device, its blinking slows down to two seconds.
• This module works on 3.3V. We can connect 5V supply voltage as well since
the module has on board 5 to 3.3 V regulator.
• As HC-05 Bluetooth module has 3.3V level for RX/TX and microcontroller
can detect 3.3 V level, so, no need to shift transmit level of HC-05 module. But
we need to shift the transmit voltage level from microcontroller to RX of
HC-05 module.
• The data transfer rate of HC-05 module can vary up to 1Mbps is in the range of
10 meters.
•
Specification of HC-05 Bluetooth Module
• Bluetooth version: 2.0 + EDR (Enhanced Data Rate)
• Frequency: 2.4 GHz ISM band
• Modulation: GFSK (Gaussian Frequency Shift Keying)
• Transmit power: Class 2 (up to 4 dBm)
• Sensitivity: -80 dBm typical
• Range: approximately 10 meters (or 33 feet) in open air
• Profiles supported: SPP (Serial Port Profile), HID (Human Interface Device)
and others
• Operating voltage: 3.3V to 5V DC
• Operating current: less than 50mA
• Standby current: less than 2.5mA
• Sleep current: less than 1mA
• Interface: UART (Universal Asynchronous Receiver/Transmitter)
• Baud rates: 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400,
and 460800
• Operating temperature: -20°C to 75°C (-4°F to 167°F)
•
Bluetooth communication between Devices
Bluetooth communication between Devices E.g. Send data from Smartphone terminal
to HC-05 Bluetooth module and see this data on PC serial terminal and vice versa.
Page 7
To communicate smartphone with HC-05 Bluetooth module, smartphone requires
Bluetooth terminal application for transmitting and receiving data. You can find
Bluetooth terminal applications for android and windows in respective app. store.
Page 8
• Following are some AT command generally used to change setting of
Bluetooth module.
• To send these commands, we have to connect HC-05 Bluetooth module to the
PC via serial to USB converter and transmit these command through serial
terminal of PC.
•
Alternate options for HC-05 Bluetooth Module
1. HC-06 Bluetooth module: This is a similar module to the HC-05, but it is
limited to a slave role only. It has a smaller form factor and is generally
cheaper than the HC-05. However, it does not support some of the advanced
features of the HC-05, such as the ability to enter AT mode to configure the
module.
2. HM-10 Bluetooth module: This is a more advanced Bluetooth module that
supports Bluetooth 4.0 (BLE) and can act as both a master and slave device. It
also supports a wider range of AT commands for configuring the module, and
has a longer range than the HC-05. However, it is generally more expensive
than the HC-05.
3. RN-42 Bluetooth module: This is another Bluetooth module that supports both
the SPP and HID profiles, similar to the HC-05. It has a longer range than the
HC-05 and supports faster data rates. However, it is also more expensive and
may require additional configuration to work properly.
4. ESP32 Bluetooth module: This is a powerful Wi-Fi and Bluetooth module that
includes a dual-core processor and support for both Bluetooth Classic and
BLE. It is more expensive than the HC-05, but offers more advanced features
and capabilities.
5. nRF24L01+ Wireless module: This is a wireless module that operates at
2.4GHz and uses a different protocol than Bluetooth. It is generally cheaper
than Bluetooth modules and can be used for applications where a shorter range
and lower data rate are acceptable.
Page 9
Specifications of 3.7V 450mAH Lipo Battery KP-372224:
1.Voltage: 3.7V
2.Battery Type: Lithium Polymer
3.Battery Chemistry Type: LiPO
4.Capacity: 450mAh
5.Size : 24x22x3.7 (in mm)
4. 10mm Focal Lens-:
• led lens, focal length, lens led,Cheap led lens,High Quality focal length, China
lens led Suppliers
• All pictures shown are for illustration purpose only.Actual product may vary
due to product Enhancement
• CATEGORY TYPE:Measurement & Analysis Instruments
• Diameter 10mm Focal length 10mm PMMA LED lens : Clear, 10mm
• Efficiently Working Device.
Page 10
DRAWING
Page 13
6. Reflector-: an object that reflects light and shines when light shines on to it
Origin and usage
The word reflector comes from the Latin word ‘reflector’ meaning ‘turn back’. It
dates back to the 1660s in English, though it didn’t become associated with vehicles
until the early 20th century, sometime around 1909.
Example:- Reflector refers to an object, usually made of plastic, that appears to glow
or shine when light reaches it. Reflectors are most frequently found on bicycles and
products associated with safety for drivers or pedestrians.
The plastic reflectors attached to the spokes of a bicycle wheel provide safety and
increase visibility for riders to travel at night. When a car approaches the bicycle in
the dark, its headlights shine on the plastic reflector and reflect the light back, making
the reflector look like it’s glowing. This helps drivers see bicycle riders more easily
and helps prevent accidents.
Sometimes, joggers or walkers wear special clothing with reflector tape so they can
be seen more easily in the dark. Like plastic reflectors, this tape reflects the light and
appears to glow when it is exposed to car headlights or street lamps. Road workers
also wear safety clothing and use equipment like cones or road blocks with reflectors
on them in order to improve their visibility when working at night.
Safety reflectors can be purchased in a variety of stores and websites online, making
it easy for pedestrians, cyclists, road workers and others to increase their visibility in
the dark and keep themselves safe.
Reflectors come in a variety of colours, including yellow, orange, red and white. The
reflectors on tape or clothing items usually look silver in the light but glow bright
white when reflecting light in the dark.
Page 14
PROJECT SMART GLASSES
Supplies
• Arduino nano v3
• Bluetooth module HC-05
• Battery 3.7v 450mah
• Mirror
• 10mm focal lens
• OLED display 0.95 inches
• Reflector
•
Prototype
I built my first prototype of these glasses a while back and their main capability was
taking pictures and doing basic text recognition and then giving the user some
information on it with Wolfram. For example, if it took a picture of say a detour sign,
the glasses would recognise the text and give the user a definition; however, these
glasses were very buggy and the text recognition had a very long delay. After some
consideration For the new version, I decided this feature wasn't very practical and if
the user wanted that information they could just ask the chat bot anyway. I decided
this iteration should focus more on reliability and efficiency while still adding more
features. I think I have done that successfully considering the last prototype didn't
even have a battery.
INTRODUCTION
Now a days, the usage of wireless communication has been developed and the
gadgets involves in the usage of the wireless communication are being released and
selling like a hot cake and this is the prototype which comes under the wireless
Page 15
communication which is used as a device by which the notifications that we receive
in the mobile for example calls, messages and other type of notifications can be
viewed in front of our eye. This will help the people to get the know their
notifications even if they are their work and for people who are driving and there will
be no disturbance for drivers even because we will project the display on the
transparent material and the letters which we project are not dark so it will not create
any disturbance and also helps bikers to know about their notifications even in
driving in the heavy traffic and in the cities whether it is important and it will help the
user to not to miss their notifications
PROBLEM FORMULATION
The main problem that we identified to get this idea is that many people are facing
some issues to check their phone notifications while they are working especially
some people who need to sit and work for long time and also for the people who are
driving in the heavy traffic which has been the common issue all over the world and
the people are searching for the device that can resolve their issue that to make the
easy way to get to know their notification which helps the people and the solution to
get to use the smart glasses by which the user can connect the mobile to the device
and check the notification which he got while they are working and also driving in
heavy traffic
BLOCK DIAGRAM
HC-05(Bluetooth Module)
Bluetooth module establishes the connection between the mobile and the Arduino and
we design it in a way which is to send the serial data to the Arduino Bluetooth
module by establishing the connection by connecting the TX pin to the receiver pin in
the The Arduino and also able to receive data by the RX pin by connecting it with TX
Page 16
pin in the Arduino and this is also the most important component of the project which
connects both devices together
Arduino Nano:
The Arduino Nano is a small, complete and breadboard friendly and it is very small
so that it can be attached to the leg of spectacles. Arduino nano is made up with a
crystal oscillator of frequency 16 MHz and it will produce a clock of exact frequency
using the constant voltage and this Arduino nano has total of 22 pins which there 14
digital pins and 8 analogue pins. This has a number of facilities for establishing
connection with the computer or another Arduino or any other device like micro
controllers and the main the ATmega328 provides UART TTL serial connection
which is of 5 V and in these digital pins the pin 0 is the digital receiver pin and pin1
is the transmission pin. This is coded in the Arduino IDE software.
Page 17
OLED Display
OLED display is nothing but the organic light emitting diode display which are
mainly used for the digital displays for the mobiles television screens and also
computer monitor, and it is flash light emission technology which is by placing a
series of organic thin films which are in between the two conductors when there is the
application of electric field the light will be obtained and this oled emits display
transparent oled is used in front of display screens such as in airplanes which helps in
the display of any notification such as day, time, phone call ,messages etc.
Connecting Wires
connecting wires are used to establish the connection between the OLED display,
Bluetooth module and the Arduino which will be soldiered, and this will be
connected, and the entire module will be kept in the model which will be attached to
the glasses
Page 18
CIRCUIT DIAGRAM
WORKING
In this paper, we are discussing about the smart glasses using Arduino which is used
for establishing communication with mobile here the mobile is connected with the
Bluetooth module and the entire work can be observed through an application. We
need to supply power to the Arduino by using a battery After establishing the
connection with the HC-05 Bluetooth module then the connection is established as
we connected the transmission node of the HC-05 to the receiver node of the Arduino
and this Arduino will receive the transferred notification and this converts the past
information to the format which will be displayed in the Organic light emitting diode
display which will be displayed there through the reflecting mirror and projected in
front of the glass of our normal spectacles and this will gives the notifications which
are arrived in our mobile phone this entire model will be placed on the side of one leg
of the spectacles
ADVANTAGES:-
1. No need to carry mobiles in hand always
2. Easy of operation
3. Maintenance will be simple
Page 19
APPLICATIONS
One of the growing trends of wearable computing is Head Mounted Displays (HMD),
as the head is a great gateway to receive audio, visual information. To make worth
out of technology trends and to make life more easier by wearable computing
devices. The aim is to assist people to use augmenting real life with extra information
constantly and ubiquitously.
The purpose of the project is to minimise the use of mobile phones while working.
The Smart specs help to avoid spams messages and calls received on the phone. Thus,
it gives choices to use the phone urgently or not. One can use it at the places where
mobile has to be kept at silent mode for eg. Workplace, Library, Hospitals ,etc. It can
be useful for handicapped or disabled people.
Augmented glasses are innovative, fresh, exciting and bring attention to users who
perceive it as useful, valuable, helpful and time saving. It is simple to use, control,
convenient and user-friendly.
The smart glasses can be implemented in workplaces where using phones during
work hours is strictly prohibited. Even the price issue then can be sponsored by the
company to its employees. In this way Employees won’t be kept away from any
urgent work calls, family emergencies, etc
FULL CODE
########Section_1##########
import sys
import bs4
from bs4 import BeautifulSoup as soup
from urllib.request import urlopen
import os
import sys
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306, ssd1325, ssd1331, sh1106
import time
import datetime
import wolframalpha
import speech_recognition as sr
import pyaudio
import wikipedia
from picamera import PiCamera
import dropbox
import picamera
from twilio.rest import Client
Page 20
##########Section_2###########
contacts= {'Pizza Hut': "718-822-2909", 'Papa John's': "415-586-7272", 'Friend3':
"316-316-316"}
#Wolfram
app_id = ('') #WolfRam Alpha ID
#Dropbox
dropbox_access_token= "" #Unique Dropbox token
#Twilio
twilio_account_sid = '' #You will find this information in your Twilio account
twilio_auth_token = ''
twilio_client = Client(twilio_account_sid, twilio_auth_token)
client = wolframalpha.Client(app_id)
res = client.query('what is the temperature in San Fransisco') #Replace with the name
of your city
answer = next(res.results).text
str1 = answer
str2 = str1.split('(', 1)[0]
bad_chars = [';', '|', '(', ')', '+', '=', '1'] #We use this to remove all of the characters that
Espeak can't say
num = ["05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "0"] #At these
points in every hour the glasses will refresh the weather data
#######Section_3#################
def util2():
cdt = datetime.datetime.now()
min1 = str(cdt.minute)
hour = str(cdt.hour)
Page 21
def util3():
cdt = datetime.datetime.now()
min1 = str(cdt.minute)
hour = str(cdt.hour)
def listen():
print('listening...')
util3()
#with canvas(device) as draw:
#draw.text((0, 115), "...", fill = "white")
os.system('arecord -d 4 -f cd -t wav -D
bluealsa:DEV=A0:18:12:00:9D:55,PROFILE=sco test.wav') #Replace the MAC
address with that of your hedset
r = sr.Recognizer()
try:
harvard = sr.AudioFile('test.wav')
with harvard as source:
audio = r.record(source)
global val
val = r.recognize_google(audio)
print(val)
except:
print('sorry I couldnt understand')
def say(statment):
statment1 = statment.replace(" ", "_")
os.system('espeak ' + str(statment1) + ' -ven+f3 -k5 -s130 --stdout | aplay -D
bluealsa:DEV=A0:18:12:00:9D:55,PROFILE=sco') #Change the MAC address here
as well
Page 22
def query(query):
client = wolframalpha.Client(app_id)
res = client.query(query)
answer = next(res.results).text
answer1 = answer.partition('\n')[0]
print(answer1)
def start_up():
hour1 = int(datetime.datetime.now().hour)
if hour1 >= 0 and hour1 < 12:
#print('computer: good morning')
say('good_morning')
elif hour1 >= 12 and hour1 < 20:
#print('computer: good afternoon')
say('good_afternoon')
else:
#print('computer: good evening')
say('good_evening')
say('how may i help you')
cdt = datetime.datetime.now()
#date = str(cdt.day) + "/" + str(cdt.month) + "/" + str(cdt.year)
start_up()
Page 23
def utilitys():
cdt = datetime.datetime.now()
min1 = str(cdt.minute)
hour = str(cdt.hour)
def util(func1):
cdt = datetime.datetime.now()
min1 = str(cdt.minute)
hour = str(cdt.hour)
def upload_img():
file = open('img.txt', 'r')
file51 = file.read()
file.close()
file45 = int(file51)
file45 += 1
global img
img = 'img{}.jpg'.format(file45)
print(img)
Page 24
def save_img():
file1 = open('img.txt', 'r')
file99 = file1.read()
file1.close()
file100 = int(file99)
file100 += 1
file2 = str(file100)
open('img.txt', 'w').close()
new_num = open('img.txt', 'w')
new_num.write(file2)
new_num.close()
print(file2)
def upload_vid():
file3 = open('vid.txt', 'r')
file61 = file3.read()
file3.close()
file47 = int(file61)
file47 += 1
global vid
vid = 'vid{}.h264'.format(file47)
print(vid)
def save_vid():
file3 = open('vid.txt', 'r')
file101 = file3.read()
file3.close()
file102 = int(file101)
file102 += 1
file7 = str(file102)
open('vid.txt', 'w').close()
new_num2 = open('vid.txt', 'w')
new_num2.write(file7)
new_num2.close()
print(file7)
########Section_4#############
while True:
utilitys()
listen()
try:
if len(val) >= 2:
Page 25
if 'news' in val:
news_url="https://news.google.com/news/rss"
Client=urlopen(news_url)
xml_page=Client.read()
Client.close()
soup_page=soup(xml_page,"xml")
news_list=soup_page.findAll("item")
# Print news title, url and publish date
i=0
util('news...')
for news in news_list:
print(news.title.text + "\n")
say(news.title.text)
#print(news.link.text)
#print(news.pubDate.text)
#print("-"*60)
i += 1
time.sleep(1)
if i == 3:
break
del val
util("news...")
time.sleep(3)
if 'SMS' in val:
del val
say('who would you like to send a text to?')
listen()
dude = str(val)
del val
say('what would you like to say')
listen()
msg_to_send = str(val)
del val
send_sms(dude, msg_to_send)
util("SMS sent!")
time.sleep(3)
if 'time' in val:
Page 26
cdt1 = datetime.datetime.now()
h = cdt1.hour
m = cdt1.minute
print(str(h) + ':' + str(m))
say(str(h))
say(str(m))
del val
util("time...")
time.sleep(3)
if 'picture' in val:
camera = PiCamera()
upload_img()
img_name = img
camera.start_preview()
time.sleep(5)
camera.capture(img_name)
camera.stop_preview()
save_img()
dropbox_path= "/SmartGlassesAPI/{}".format(img_name) #Go to your
Dropbox profile and make a folder named SmartGlassesAPI
computer_path = r'/home/pi/{}'.format(img_name)
client = dropbox.Dropbox(dropbox_access_token)
client.files_upload(open(computer_path, "rb").read(), dropbox_path)
print('image saved to dropbox account')
say('image save to drop box account')
del img
del val
util("saved...")
time.sleep(3)
Page 27
os.system('aplay -D bluealsa:DEV=00:00:00:00:00:00,PROFILE=sco /home/
pi/Desktop/BeautifulName.wav')
del val
say('would you like me to play the next song')
listen()
if 'yes' in val: #Lol, you have to do it again
os.system('aplay -D bluealsa:DEV=00:00:00:00:00:00,PROFILE=sco /home/
pi/Desktop/Oceans.wav')
del val
if 'no' in val:
del val
continue
if 'video' in val:
upload_vid()
vid_name = vid
#vid_name = str(vid_name)
with picamera.PiCamera() as camera:
camera.start_recording(vid_name)
time.sleep(30)
camera.stop_recording()
save_vid()
new_vid_name = vid_name.replace('.h264', '.mp4')
command = "MP4Box -add {} {}".format(vid_name, new_vid_name)
subprocess.call([command], shell=True)
dropbox_path= "/SmartGlassesAPI/{}".format(new_vid_name)
computer_path = r'/home/pi/{}'.format(new_vid_name)
client = dropbox.Dropbox(dropbox_access_token)
client.files_upload(open(computer_path, "rb").read(), dropbox_path)
time.sleep(3)
print('video saved to dropbox account')
say('video save to drop box account')
del vid
del val
util("saved...")
time.sleep(3)
#############section_5######################
try:
client1 = wolframalpha.Client(app_id)
res1 = client1.query(val)
answer1 = next(res1.results).text
answer2 = answer1.partition('\n')[0]
Page 28
for i in bad_chars:
answer2 = answer2.replace(i, '')
print(answer2)
say(answer2)
except:
try:
print(wikipedia.summary(val, sentences = 1))
say(wikipedia.summary(val, sentences = 1))
except:
print('')
del val
except:
print(' ')
#del val
################THE_END##########################
Page 29
Conclusion
The prototype just contains the basic feature of notification such as time and date,
messages and calls. The next version can include advanced features like checking
humidity of surrounding, temperature and many others. Audio assistance, smart
speakers and voice controlling functions can be include din advanced versions. A
camera can be added to smarts pentacles for facial recognition. As it develops for face
recognition, we can push the limitation further by including 360°view.
Using Machine learning and Artificial Intelligence these glasses can be used for
reading texts which will be beneficial for blind people. Improvisation can be done at
an advanced level, a virtual reality environment can be provided. Also, smart glasses
have vast scope in Augmented Reality. As technology advances navigation options
along with audio options can be added.
Page 30
Page 31