E.D.I.T.H - How Did I Build a Powerful Smart Glass Under 40$?
by AbrarFairuj in Circuits > Raspberry Pi
10779 Views, 34 Favorites, 0 Comments
E.D.I.T.H - How Did I Build a Powerful Smart Glass Under 40$?
I bet, you love the technologies built by Tony Stark AKA Ironman in movies.
I am always surprised with them and wish to build them in real life.
So I decided to build a real life E.D.I.T.H smart glass myself.
I know, smart glasses are not something new. Google Glasses, Focals, Vuzix all did it. But I wanted to build something that's -
- Powerful like E.D.I.T.H
- Really cheap, not like 1000$ Google Glass
- Can be built with stuffs available near me
When researching on the available glasses, I found that Google Glass is by far the most advanced smart glass. But I didn't like their Prism Projection system. I want something like E.D.I.T.H, projection on glass.
The researching part took a long time, more than 2 months. I just learnt and planned about what I am going to build.
And this is how it looks like (2nd Image)
I know, not so good. Very large, not that wearable, heavy, looks bad etc etc. But this is only version 0.1! I already started working on v2, which solves all these problem and will be the most advanced smart glass
The embedded video was for a science fair in Bengali(my native language). But the conversation with E.D.I.T.H was in English
(Third image & Cover background image credit: Marvel)
Supplies
At the end of the day, I found that it costed less than 35$ to build my glasses. Here are all the parts I used -
1. Raspberry Pi Zero – 5$
2. OLED Module – Around 4.5$
3. Microphone – 3$
4. Speaker – Less than 1$
5. Mini USB Bluetooth Dongle – Less than 5$
6. Mini Wi-Fi USB Dongle – Less than 5$
7. Battery – Less than 5$
8. Frame and Lens – Less than 5$
9. Wires and other necessary items and tools – Less than 1$
TOTAL: 34.5$
Depending on your local price, the cost may vary.
Planning
Grab a mug of coffee and relax! So, I listed some features that I want in it -
- Voice controlled
- AI Assistant built in
- Shows Phone Calls, SMS, Notification
- Time and Weather Information
- Browsing internet
- Listening to Music
- Listing and managing To-Do
- Get latest News, Headlines
- Map Directions
We gonna use Raspberry Pi Zero, as this is the smallest board with good computing power. So, we actually have a few requirements behind -
- We need a heavy script running on boot
- We need internet connection
- We need to be connected with the phone, probably with Bluetooth
- We need a Speaker and Microphone to interact with the system
Setting Up Raspberry Pi
I had a Raspberry Pi Zero at home, so I started with it.
If you can get a Zero W, that will be way better. Then, you won't need to worry about Wi-Fi and Bluetooth, Your glass will be smaller.
First thing first, get the OS running. Your SD card should be at least 16GB. Check this instructable to know how to prepare your OS - https://www.instructables.com/How-to-Set-Up-a-Micro-SD-Card-for-Raspberry-Pi/
My old SD card was not working. So, I bought another one(32GB), formatted it. It took whole week just to setup the OS 😐
I used a USB Hub to connect Wi-Fi and Bluetooth Adapter. If you use Zero W, you don’t need these. For the microphone part, I once again simply used a USB microphone. This is the easiest option to setup a microphone on Pi Zero.
The Display
After searching for a while, 0.96inch OLED display appears to be the best and easiest option. This is available everywhere.
Of Course, a smaller one would be better. But I could not find one in our country :(
I bought one of these
This display has I2C interface. Easy deal right? Still, I added an image to show how you gonna wire it up with raspberry pi zero. And... This is the wiring in table -
Display => Pi Zero
VCC => 3.3V
GND => GND
SDA => SDA (GPIO 2)
SCL => SCL (GPIO 3)
⚠️ NOTE: Don't do the mistakes that I did. Some OLED displays has resolution 128x64 but it can have a I2C address of 0x3C not 0x3D which is usual.
The Speaker
Here comes a tricky part man!
Pi Zero doesn't contain a Audio Jack and by default has no audio output other than HDMI. But we can't use that in a glass right? So, after researching for a while, I found this: Adding Basic Audio Output to Pi zero
This is what to do in short -
Pi zero can output audio signal from certain PWM pins. If we simply use a low pass filter to cut the high frequency(50MHz), we can hear it!
Firstly, we need to configure the PWM pins:
(From that article) Simply adding the following line to your /boot/config.txt will reconfigure the pins at boot without any external software or services:
dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4
Now, We need to force Pi to output sound on the Audio Jack (we hacked it through PWM pins).
In Raspbian OS, Open console and run
sudo raspi-config
Go to Advanced
Then Audio
Finally Force 3.5mm (Headphone)
👉 If you can't see this option, try restarting your Raspberry Pi. Make sure all the wirings are correct.
I don’t know why, but my speakers started working without any filtering circuit 😐 and didn't work with the filtering circuit after a while. Later, I just used a transistor to amplify it. The sound quality was satisfying.
But, that might not be your case, so you gotta build the simple circuit shown in the image. Also make sure to amplify it after filtering.
(Last 3 image credit: Adafruit)
⚠️ NOTE: I used mono speaker. If you do so, you need to use this command in boot config file:
dtoverlay=pwm,pin=13,func=4
Programming Part
Raspberry Pi Code
The time has come!
Basically, most of the features are basically tricks of codes. You can use either Python or Node.JS But I found Node.JS to be faster than my Python script. I am not going deeper about the code but here is my primary code
I will describe some key points about what's happening in the code:
- First, we are checking if Bluetooth is connected with the smartphone. All other processes are stopped before Bluetooth is connected.
- When Bluetooth connection is established, we start the system. We fetch the weather data from phone, and update the time.
- We also keep listening to Bluetooth, so whenever new data arrives from phone, we can process them. We send call, SMS, notification data from phone over bluetooth.
- Now, we setup a new Dialogflow agent. I built a dialogflow project with all the ability I need. Based on the reply, we can display list, alert or just reply over mic.
App Code
We need a mobile app to control the stuffs right? I created a very simple one using React Native. Check the main App.js code here If you look at the code, I actually could not do the Map direction part. This is because I can't test it inside my home 😏. By the way, here is some key points again -
- Firstly, we display all paired devices.
- When user taps one and connects successfully, we switch to a list where all the data transmission is displayed.
- Instantly after connection, we also need to send the weather information which is fetched from an API based on the mobile location. Using GPS from mobile is way better than doing it in Raspberry pi. It eats power!
The Projection System
I didn't go with waveguide or mini projector. I made a very simple system which is possible with usual stuffs and knowledge. In next version, I will change it though.
So, as shown in the image above, the OLED display is kept at 22.5deg and the glasses are tilted at 45deg. This reflects the screen towards eyes, so you can see it. But the screen won't be visible to others!
This is why my glasses look weird. Another point to keep in mind is that you need fully flat glass for this system if you want to keep the screen size same. If you use a concave lense or convex lense, the virtual display dimension will change.
The Power
Sadly, Raspberry Pi zero requires much power. Around 2000maH and 5V. Because of Wi-Fi, Bluetooth usage and OS running all the time, the power usage is high as well.
I used a heavy 4000maH 3.7V Li-on battery with a Power Bank circuit that ensures correct voltage as well as provides a charging system! But, this battery is so heavy, it added a lot of weight to my glasses.
The first image shows the exact model I used(collected from internet). Last image shows my setup.
A better option for you will be using some light weight Lipo battery. Like the second image. Check out that battery here
Putting in Glasses
Before we arrange everything, we actually need to make everything as small as possible. As I said before, I had a Pi Zero. So I used an USB Hub. To make it smaller, I broke it, took out the main circuit board. I needed three USB port. My USB Hub had 4. So, I cut it, took out USB ports so I can directly solder them.
As the images shows, we also need to break the adapters to keep the least, main circuit boards. Finally, soldering the USB boards to Hub board makes it completed.
If you have a Zero W. You don't need a USB Hub. You can directly solder the microphone to the only one USB port pins in Raspberry Pi board.
I used two boxes to arrange all the parts on each side of glasses. I kept the Battery, Speaker and Power Button on left, and everything else on right side. You can make the body using cardboards or if you can 3D print a model that would be a lot better!
Finishing Task
Yes, it's true.
We are Done!
Beautifying the product is your duty. Maybe, put some color/designs, use fancy glasses instead of simple sheets as glasses. You can make it look like the way you want. It may not be a super cool looking Smart Glass, but this is a good start I think! After all, it was less than 50$ deal 😌. And if you are a hobbyist, it's possible that you already had 90% of the components needed.
The image you can see is a 3D model I created(I am not a pro at this). Check my model: https://www.tinkercad.com/things/l1MXpnD8rrG
Also, check my Project Report for science fair: https://drive.google.com/file/d/18yzOfCVXMdVLbOCa7wmwDyhFCvgMqZW3/view?usp=drivesdk
EDITH V2
Just to keep you guys updated, I am already on EDITH V2. If hopefully, I can make it real, it will be the most powerful Smart Glass on earth. Check its power at a glance -
- Octa Core Processor with 2GB RAM
- 32GB Storage
- Lightweight, Slim design
- Camera, 3 Axis Gyro, Accelerometer and Magnetometer included
- SIM card support, Video and Voice calls
- Full OS control, Installing Apps like you do in mobile
And many more!
As you can guess, I am actually going to build a custom board. Obviously, this project is huge and can't be done alone. If you are interested in this project, reach me, we will work together.
Reach me at:
youcanreplylishup@gmail.com
Abrar#7757 (Discord)
👉 Image Credit: amazon.in
Final Words
I hope you enjoyed the build and the concept as well. This was my most advanced project honestly. If you have any question, suggestions or tips, feel free to share with me.
Thanks a lot! Have a nice Day 😇