Crypta Glass V2: Raspberry Pi Smart Glasses With Display, Microphone & Camera

by PythoErgo in Circuits > Wearables

415 Views, 6 Favorites, 0 Comments

Crypta Glass V2: Raspberry Pi Smart Glasses With Display, Microphone & Camera

IMG_25680528_051515.jpg
IMG_25670715_210907.jpg

Two years ago, I made my first pair of homemade smart glasses, the Crypta Glass V1 (right image above). It used an Arduino Pro Micro and had Bluetooth, a 0.91" OLED display, navigation buttons, and a rechargeable LiPo battery with 3 hours of runtime. So this year, I've made a new and highly improved version (left image) that uses the powerful Raspberry Pi Zero 2W.


This full build guide will go through components, 3D printing, wiring, coding, and everything else needed to make your very own pair.


Features/Specs:

  1. 5MP portrait camera (max 60fps I think)
  2. 80x160 0.96" full color display
  3. Bluetooth and WiFi
  4. Standalone music player
  5. Many other "apps"
  6. Fully removeable from the glasses itself at anytime
  7. Can be fully disassembled and repaired once built
  8. 100% open-source
  9. Custom AppInventor app
  10. Swappable power input between battery and USB Micro PWR input without powering off
  11. 3 navigation buttons
  12. Magnetic power cable
  13. Fold-out display
  14. 100g total weight (will be significantly reduced in next version, closer to 80g hopefully)
  15. Roughly 50$ total build cost


DISCLAIMER: This project is quite advanced, requiring past project experience and many skills such as 3D modelling. I wouldn't call it a beginner friendly build, but you're welcome to give it a shot!

I'm writing this Instructables in the middle of exam week, and there are a few improvements I'd like to make to the 3D printing housing, some code bugs, and a few other things. A Crypta Glass support Discord server will be made soon, along with all the improvements (I will hopefully start within a week).


Notes:

  1. Some images have helpful notes in them. Click on a photo to see its notes (outlined with a black rectangular border).
  2. You should always read the entire Instructables before attempting to follow it.

Supplies

CryptaGlassV2 Electronic Parts.png
CryptaGlassV2 Other Parts.png

Required Skillsets:

  1. 3D modelling with a software like Onshape
  2. 3D printing
  3. Soldering
  4. Python programming
  5. A tiny bit Raspberry Pi experience
  6. MIT AppInventor experience


Tools needed:

  1. FDM 3D printer (might be a resin printed version in the future)
  2. Soldering iron
  3. Soldering tools (solder sucker, wire strippers, etc)
  4. Soldering helping hands
  5. Rotary Dremel
  6. Small file set, sandpaper
  7. Phillips precision screwdriver set
  8. Drill and 1.2-2mm bits
  9. Tweezers
  10. Needle nose pliers


Numbers in brackets refer to part in the picture (example: [0])

Electronic parts:

  1. [1] Raspberry Pi Zero 2W
  2. [2] 5MP OV5647 flex cable Pi Zero camera
  3. [3] 3.7V LiPo battery (Probably won't be able to find the exact battery I use, will need to find a good sized one and edit Onshape project for it to fit. Recommend roughly 600-800mAh, depending on how heavy or large vs. runtime you want. Make sure it's thin, mine is a cheap generic 600mAh, 60x20x6mm battery. Definitely would not recommend, find a high quality, lightweight one with more capacity.)
  4. [4] Micro USB TP4056 charging module
  5. [5] I2C ADS1115 ADC module (purple board)
  6. [6] I2S MEMS microphone (SPH0645LM4H)
  7. [7] 0.96" 80x160 RGB TFT display module
  8. [8] Mini DC-DC 5V step-up boost converter
  9. [9] Flat Kailh silent push buttons (x3)
  10. [10] Generic DPDT slide switch with screw holes
  11. [11] Single sided perfboard
  12. [12] 30AWG silicone wire (preferably 7 colors, 1 meter each should be fine)
  13. 26 or 24AWG silicone wire (red and black, for long power wires, 1 meter each)
  14. [13] Magnetic Micro USB tips (x2, only one in the picture)
  15. [14] MicroSD card (I personally used a "SanDisk Extreme PRO 64GB A2 V30", but do some research.)


Other parts:

Raspberry Pi related

  1. [15] HDMI cable
  2. [16] Mini HDMI to HDMI adapter
  3. [17] 2A brick and Micro USB cable
  4. [18] Micro USB OTG adapter (Male Micro USB to female USB A)
  5. Keyboard


  1. [19] 34mm diameter generic acrylic VR lens (recommend getting more than 1 just in case, very cheap)
  2. [20] Clear double-sided tape (should be a bit thick, I think it's called "nano tape")
  3. [21] Thin double-sided paper tape
  4. [22] Glue tack
  5. [23] 8x3x2mm neodymium magnets (I used a total of 8, so you should get at least 10. If you can find the right size, just get small rectangular ones, but ensure they're 2mm thick. Also check the Onshape project to ensure they'll fit properly.)
  6. [24] 8x10mm mini hinges (Usually used in dollhouses and jewelry boxes, they're gold/brass colored. These glasses only use one, but definitely get at least 5.)
  7. [25] M2 Phillips self tapping screws set (My set is 800pcs, from M2x4mm to M2x16mm, here's the full name on the box: Black Zinc-Plated Carbon Steel Pan Flat Head Self Tapping Screws Metric. Although the box says pan head, they're actually countersunk. I recommend a countersunk screw head shape over pan head, since they keep the 3D printed pieces from moving around better, from my experience.)
  8. [26] Micro Phillips self tapping screw set (Mine goes from M1x3mm to M1.7x6mm, I recommend M1.4)
  9. [27] Small zip ties
  10. [28] Super glue
  11. [29] 540 degree magnetic charging cable (Mine has a built-in LED on the charging end, cool. Make sure it's not a data cable, because then it's finnicky to clip on, because you need to align it right.)
  12. [30] Power bank (Optional if the glasses' built-in battery is powerful. In my case the battery should only be used to keep the glasses running for a short time when momentarily unplugging the main Micro USB PWR cable. Crypta Glass External Battery Pack coming soon!)
  13. [31] Spray paint (If you want to paint the perfboard to match the rest of the glasses)
  14. [32] Masking tape (for perfboard painting)

3D Printing

CryptaGlassV2OnshapeScreenshot.png

I used my trusty Ender 3 V2 to print all of the electronics housings and other parts. Based on some quick research, I'm quite sure PLA is the lightest material you can use that isn't extremely expensive, although I might be wrong. Either way, you might want to try printing with an exotic filament, like carbon fiber infused ABS, or something else unique.


I exported my Cura Slicer print profile to make it easier to get the exact same prints as I did. Instructables doesn't support .curaprofile files, so here is the official CryptaGlassV2 GitHub repository. The STL files can be found below, or in the repository. Be warned though, there's a very high chance the glasses clip, distance from display to lens, and other aspects of the design will not work with your glasses or eyesight. I actually had to stick the lens on the inside of the glasses lens because the display was too close to my eye (not ideal). If you have some solid Onshape experience, feel free to try editting the Onshape project yourself. Please let me know how confusing my sketches are... this is my first time ever using Onshape for a project.


Things you'll need to change:

  1. Display arm length
  2. Display arm magnet slot positions
  3. Arm slider placement
  4. Main case lid magnet slot
  5. Glasses clips shape
  6. Top clip shape
  7. Battery compartment dimensions
  8. Display angle
  9. Most likely more I haven't listed


If you'd like to use the exact same glasses as I did, I might be able to order and ship them to you soon. There are many prescription options.

Navigation Button Array

IMG_25680522_173415.jpg
IMG_25680522_173929.jpg
IMG_25680522_182103.jpg
IMG_25680522_182032.jpg
IMG_25680522_181952.jpg
IMG_25680524_161821.jpg
IMG_25680524_163851.jpg
IMG_25680524_164131.jpg

There are 3 buttons:

  1. Up
  2. Select
  3. Down

Start by cutting out a section of the perfboard with a Dremel, using a cut-off wheel. It should be around 30mm long and 8mm wide. First, do a test fit of the buttons before cutting. Cut the length and width roughly, with width being 10mm (grind down a bit later), going from hole to hole in the perfboard to make cutting easier. Be sure to wear a dust mask and safety goggles, maybe some ear protection, although it's not that loud.


Then plug the push buttons back into the perfboard, using it as a guide to grind down the board smooth. Remove the buttons and apply some masking tape onto the copper side of the perfboard before spray paint it.


Soldering:

  1. Plug buttons into perfboard, ensuring the pins are horizontally positioned (this is very important).
  2. Solder each pin to the perfboard first, then wire one pin of each button to each other by either bridging solder or using wires. This will be the common ground.
  3. Solder one wire to each remaining button pin, ensuring they're long enough to reach the Raspberry Pi's GPIO pins (refer to last image above, wires should reach bottom left of the Pi when positioned below the Pi to the right)
  4. Strip wire ends by a few millimeters and twist them before tinning

Attach Clip to Main Electronics Case (left of Glasses)

Untitled drawing.png
Screenshot 2025-05-27 222116.png
IMG_25680524_165125.jpg
IMG_25680524_165230.jpg
  1. Find "MainElectronicsCaseClip" and "MainElectronicsCase" 3D prints
  2. Remove all supports carefully and file down where needed
  3. Gently try test fitting the Raspberry Pi, inserting the ports into the holes at an angle first, then follow through (Usually shouldn't fit first try, this is intentional. Using a knife and file, cut down the wall extension, refer to Onshape image above, until it fits snug)
  4. Using the thin, 1mm thick guide built into the clip, align the bottom edge of the protruding bar to the top edge of the large cutout in case (refer to Onshape image above)
  5. Apply small drops of superglue to the contact area of the clip, avoiding gluing the guide bar (might need to snap it off and adjust later)
  6. Cut guide bar off using side cutters
  7. Test the clip on your glasses, should be a perfect fit and not slide back and forth too much, just a few millimeters (if loose or unsatisfied, snap clip off carefully by cutting the corners of the glued edges flush using side cutters, then redesign and reprint)
  8. Enlarge screw holes on perimeter of MainElectronicsCase with 1.5mm drill bit

Cut VR Lens

IMG_25680527_230807.jpg
  1. Place lens onto the display and draw border lines with non-permanent marker
  2. Cut lens with Dremel and cut-off wheel with proper safety equipment, careful not to scratch it
  3. Smooth edges with sandpaper against flat surface
  4. Use paper towel and alcohol to remove marker lines

Test Display Distance

IMG_25680527_230114.jpg
  1. Find "MainElectronicsCaseLid", "DisplayArm" and "DisplayCase" 3D prints
  2. Drill out the lid screw holes to 1.5mm
  3. Write some words on a small piece of paper and put it inside the display case
  4. Using glue tack, temporarily attach display arm, case, and case lid together (refer to image above)
  5. Screw lid onto case and attach lens onto the outside of the left glasses lens using more glue tack around the edges
  6. Adjust arm length and display angle until suitable (default angle is 120 degrees between display arm and face of display
  7. Note display arm length from the display end to where it overlaps with the main electronics case, along with display end to magnet slot on the back of the main case (might need more than just these measurements)

Tip: Try to position the display case and lens in a way where the lens blocks your vision the least (should be happy with less than half your view obstructed). Might even need to raise the case lid's thickness where the display arm slider attaches to it and redesign magnet slot on main case to accommodate (to move the display more to the left). Where the lens blocks your sight you will have no depth perception, unfortunately.

Main Electronics Wiring

IMG_25680525_022257.jpg
RaspberryPiZero2WPinout.png

Using the 3D printed MainElectronicsCase and lid as a guide, we can now go ahead and solder the voltage booster, adc module, microphone, and button array to the Raspberry Pi Zero 2W. We will be using the 30AWG silicone wire for signal/logic wires and the thicker wire for power related connections. A full visual wiring schematic and separate component to component schematics will be posted soon.


Note: Never solder components whilst they're in the case. Only use the 3D printed case as a guide to cut wires the right length.

Wiring: Voltage Booster and ADC Module

IMG_25680525_000945.jpg
IMG_25680525_001014.jpg
IMG_25680525_031107.jpg
Screenshot 2025-05-27 235219.png

The voltage booster and ADC module will be positioned side by side below the Raspberry Pi to the left (refer to image above). With the coil of the voltage booster point upwards and the pin holes facing the Raspberry Pi, the three components on the bottom of the booster should fit in the rectangular hole in the case (refer to image above). Using the case as a guide, cut the wires to the right lengths, always a bit longer than needed. The GND of both components are daisy chained, along with Vin of the voltage booster and A0, VDD of the ADC module.


Voltage Booster

  1. GND → ADS1115 GND → Pi pin 6 (GND)
  2. VIN → ADS1115 A0 and VDD
  3. VOUT → Pi pin 2 (5V)

ADS1115

  1. SCL → Pi pin 5 (GPIO3/SCL)
  2. SDA → Pi pin 3 (GPIO2/SDA)
  3. GND → Shared with Booster and Pi pin 6 (GND)
  4. VDD → Connected to Booster VIN



Wiring: MEMS Microphone

IMG_25680525_002746.jpg
IMG_25680525_031518.jpg

The microphone will be mounted onto the lid of the case with non-permanent double sided tape, so ensure wires are long enough to open the lid wide enough. The mic hole will conveniently poke through one of the many holes in the lid. Also make sure the wires aren't soldered on the flat side of the module (refer to image above)


I²S MEMS Microphone

  1. GND → Pi pin 6 (GND)
  2. 3V → Pi pin 1 (3.3V)
  3. BCLK → Pi pin 12 (GPIO18)
  4. DOUT → Pi pin 38 (GPIO20)
  5. LRCL → Pi pin 35 (GPIO19)

Wiring: Button Array

FSIPJQ7MB53NK99.jpg

Button Array

  1. Common GND → Pi pin 34 (GND)
  2. Up Button → Pi pin 40 (GPIO21)
  3. Select Button → Pi pin 36 (GPIO16)
  4. Down Button → Pi pin 32 (GPIO12)

Heat Insert Hinge Into Display Case

images (1).jpg
Screenshot 2025-05-28 004619.png
IMG_25680528_013458.jpg
IMG_25680528_013537.jpg
IMG_25680524_171710.jpg
IMG_25680524_172349.jpg

That's all the wiring we can do for now, let's add the hinge. Before that though, drill the screw holes of the display case to 1.2mm. We'll be using M1.4 screws instead of M2 to "reduce weight".


The hinges might be tight out of the factory, and we don't want that. I managed to jam the thinnest flathead screwdriver bit I had into the gaps where the two hinge halves were bent around the shaft and pry them loose just a tad bit. We need to make sure the hinge orientation is right, so it can pivot 270 degrees.


Place it flat on a table with the pivot bulge pointing downwards. Lift it up flat and rotate it so that the pivot shaft is vertical, with the pivot bulge facing you. Then, rotate the right half of the hinge 90 degrees clockwise. The left half face of the hinge that's facing away from you should be melted into the display case.


I set my soldering iron to something like 300 degrees Celsius and used an old blade shaped tip, since it had the largest heat contact area. There's a small channel space on the back of the display case (refer to image above) that's a little bit smaller than the hinge. The channel should be on the right hand side of the case when the back of the display case is facing upwards.


Melt the hinge into the channel until it's a bit deeper than flush. The pivot joint of the hinge should be sticking out the right hand side. Using some scrap 3D printer filament I melted some onto the hinge and spread it thinly over it, making sure it fused with the display case around the edges of the hinge. After that I sanded it a bit, ensuring nothing was sticking out.

Attach Display Case to Display Arm

IMG_25680524_172637.jpg
IMG_25680524_185157.jpg
IMG_25680524_185314.jpg
IMG_25680528_010604.jpg
IMG_25680528_010549.jpg
Screenshot 2025-05-28 011716.png
Screenshot 2025-05-28 011427.png

The other half of the hinge must be melted into the display arm at the exact right depth in order for it to fully open and close flat. I had to do lots of careful filing and repositioning before I got it perfect, so you might want to print a second pair of display case and arm to practice on first.


Now with the other hinge half on the left hand side of the display case, and the front facing you, the hinge should be melted into the display arm from the right facing side inwards. The arm also has a hinge channel. The images will help you understand. The last image has a comment in it. Click the image to see it.


You can see that I ended up melting the display case a bit and warping it whilst trying to heat the hinge with a hot air gun, so I don't advise doing that.

Check Hinge Movement

IMG_25680524_185258.jpg
IMG_25680524_185235.jpg

If the display case and arm are hitting each other anywhere when moving the hinge, try sanding that area down, but if the hinge is melted too far into the plastic or something like that, you'll need to reheat it and adjust very carefully.

Wiring: Display

IMG_25680524_231138.jpg
F6Z36HIMB6J4Y74.jpg

We're using every pin on the display except for backlight, since it's a waste of power. Measure the wire lengths from the through-holes in the display to the Raspberry Pi when it's clipped onto the side of the glasses and cut quite a bit longer than needed. Solder the wires to the display first, we'll wire them to the Raspberry Pi soon after the display assembly is finally attached to the main electronics case lid.


I designed the hex holes on the back of the display case to have 7 columns for 7 wires. Threading the wires through the top and bottom holes of each column seemed to work well for built-in strain relief. We'll add a zip tie around the loose wires later too. To fix the display into the case you can just use some glue tack on the corners.

Screw on Display Lid

IMG_25680525_035037.jpg
IMG_25680525_041611.jpg

Drill the screw holes on the lid to 1.2mm and attach it to the display case using M1.4 screws. Refer to image above for lid orientation.

Wiring: Display to Raspberry Pi

Screenshot 2025-05-28 020319.png
IMG_25680525_022252.jpg


Note that there is a small channel in the electronics case for the display wires to go through. Ensure all 7 wires will fit (they should). If not, just file it down to widen the channel. You could use a few short pieces of heat shrink tubing spaced evenly to keep wires together whilst maintaining high flexibility instead of one zip tie.


SPI TFT Full-Color Display

  1. VCC → Pi pin 2 (5V)
  2. GND → Pi pin 39 (GND)
  3. SCL (SPI CLK) → Pi pin 23 (GPIO11/SCLK)
  4. SDA (SPI MOSI) → Pi pin 19 (GPIO10/MOSI)
  5. RES (Reset) → Pi pin 22 (GPIO25)
  6. DC (Data/Command) → Pi pin 18 (GPIO24)
  7. CS (Chip Select) → Pi pin 24 (GPIO8/CE0)


Attach Display Assembly to Electronics Lid Case

IMG_25680524_201340.jpg
IMG_25680524_201648.jpg
IMG_25680524_201749.jpg
IMG_25680524_201132.jpg
IMG_25680524_201142.jpg
IMG_25680524_205014.jpg

Find the "ArmSlider" and remove the tiny support under the small temporary guide bar. Check whether the display arm slides in it smoothly. If not, you'll need to sand either the arm or slider depending on any imperfections you notice. Then add a magnet into the slot. It should be a perfect press fit right off the printer. If not, file down the inside edges a bit. Drip superglue around seam to lock it in.


Refer to the image above that shows where the slider should be glued onto the lid. Keep in mind that you might need to change this based on your tests from Step 5.


Add magnets into every magnet slot, ensuring opposing polarities are facing each other where desired (refer to images). The magnet slot built into the case and lid is split in half by the case and lid, so glue that magnet into the case, not the lid. The lid magnet slot will slide over the case magnet slot.


The slider gap was designed to be thicker than the display arm, so that you could sand it down to your liking. Now put the arm into the slider in the orientation showed above and glue the slider into place, ensuring the magnets in the arm align with both the slider magnets and lid magnet.


Note: Screw hole near the lid magnet slot prevents display arm assembly to be positioned down any further that it already is. Will be redesigned soon.

Battery Pack Assembly (Right Side of Glasses)

IMG_25680522_220040.jpg
IMG_25680527_215515.jpg
Screenshot 2025-05-28 022049.png
IMG_25680522_214513.jpg
IMG_25680522_215330.jpg
IMG_25680522_215449.jpg
IMG_25680522_220333.jpg
IMG_25680522_220643.jpg
IMG_25680525_025133.jpg
IMG_25680525_025140.jpg
Screenshot 2025-05-28 024521.png
IMG_25680525_034340.jpg

Note: You'll need to resize the battery compartment to fix your battery in the Onshape project.

  1. Find "BatteryPackCase", "BatteryPackCaseLid" and "BatteryPackCaseClip" 3D prints and remove supports
  2. Align clip with top of battery pack case (refer to Onshape image above), glue, cut guide rail off, same as the other side
  3. TP4056 charging module slot is designed to be a bit small, file down the two small ears on the back of the module until snug fit achieved
  4. Small slot next to slide switch slot for power and ground wires, will need to widen quite a bit, since I designed it for 30AWG wire, which was way too thin to provide the necessary current and voltage needed during higher power tasks like video recording
  5. Drill all screw holes, including slide switch screw holes with 1.5mm bit, use M2 screws with different lengths for slide switch and rest of case


Note: Long power and ground wires (use 26-24AWG wire! I made the mistake of using 30AWG, and they were way too thin to provide enough current to the Raspberry Pi, it would keep trying to power on and crash repeatedly) going between the left and right cases should be measured in length by using the top of the glasses frame as a reference, cutting them longer than the length of the frame. These two wires will be superglued to the top of the camera clip (that step's coming soon). There's a similar slot for the two power wires on the main electronics case side (refer to onshape image above).

TP4056 Charging Module

  1. B+LiPo +
  2. B-LiPo -
  3. OUT- → Booster GND
  4. OUT+Slide Switch Middle Pin


Note: Slide switch wiring will affect which direction switch needs to slide to turn on/off

Slide Switch

  1. Middle Pin → TP4056 OUT+
  2. Right Pin → Booster VIN
  3. Left Pin(Not connected)


Stick some double sided paper tape onto the bottom face of both the battery and charging module to attach them to the battery pack case, then screw in the switch over the charging module (switch stops charging module from moving laterally, that's a bonus design accident). Route power and ground wires through slot and screw the lid closed.

Final Assembly of Main Electronics Case

FPOIWYTMB53NKG4.jpg
IMG_25680525_025732.jpg
IMG_25680525_030700.jpg
IMG_25680525_030724.jpg
IMG_25680525_030747.jpg

With every component wired, stick some strips of double sided paper tape to the back of the Raspberry Pi, ADC module, and microphone module (be careful to avoid taping over the mic hole) and attach them into the case, doing some wire management during the process. As for the voltage booster, use some glue tack to hold it in place. The button array is still flopping around, so superglue it to the case in the right place (refer to image above). Route all wires that exit the case correctly before screwing the lid closed.

Camera Clip

IMG_25680524_205758.jpg
IMG_25680525_032619.jpg
IMG_25680525_033528.jpg
IMG_25680525_034718.jpg

Find the "CameraClip" 3D print, remove supports and file everything down smooth, being carefully not to snap off the flex cable holder. After a dozen iterations of the clip, I got it to snap satisfyingly onto the top of my glasses and hold without any glue. Remove the protective backing of the camera's double sided tape and stick it straight, ensuring the flex cable goes under the holder. This puts strain off the tape and prevents it from coming loose. Route the power wires on the top of the camera clip with small beads of superglue.

Attach Lens

IMG_25680525_042318.jpg
IMG_25680525_043258.jpg
61iuVhCVWnL._AC_UY1000_.jpg

Use small strips of nano tape to stick the lens onto the glasses lens, ensuring it is centered with the display.


And that's everything for hardware! You can now plug your two magnetic Micro USB tips into the charging module socket and PWR in socket in the Raspberry Pi. For this particular version I recommend buying either glasses ear hooks or an adjustable elastic strap, due to the weight. Also, consider washing your face before wearing these, since they're quite hard to clean with all those components on it. Another cool feature is that since the display is facing outwards when stowed away, you can use it perfectly normally when the glasses aren't on your head.

Raspberry Pi Setup

imager.png
os-customisation-general.png

Follow this official Raspberry Pi setup tutorial, ensuring these things (some things you'll have to search up online, but they're easy to do):

  1. Choose latest Raspberry Pi OS Lite (32 bit) image in Raspberry Pi Imager (I recommend playing around with Raspberry Pi OS 32 bit first, since it has a desktop interface)
  2. Autologin enabled
  3. RPI-connect shell enabled
  4. WiFi autoconnect
  5. Default username (pi)

Crypta Glass V2 Setup

In console boot, do these things below to set everything up to run the Crypta Glass V2 code.


Install PuTTY and FileZilla

PuTTY is a free SSH client for Windows, which will allow us to interact with the Raspberry Pi without needing an HDMI cable, monitor, or peripherals being directly plugged into the board.

FileZilla can read, edit, upload, download files from one device to another. This is great, since we can write any code or files on our main computer, and then just upload it to the Raspberry Pi whenever we want.

With these two tools, you can fully access and control the glasses 100% wirelessly! You could even program them while wearing them if you'd like.


Setup config.txt

In remote shell using rpi-connect:

sudo nano /boot/firmware/config.txt

This will open the config file, compare your config with my config and modify accordingly:

# For more options and information see
# http://rptl.io/configtxt
# Some settings may impact device functionality. See link above for details

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtoverlay=i2s-mmap
dtoverlay=googlevoicehat-soundcard
dtparam=spi=on

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# Additional overlays and parameters are documented
# /boot/firmware/overlays/README

# Automatically load overlays for detected cameras
camera_auto_detect=1

# Automatically load overlays for detected DSI displays
display_auto_detect=1

# Automatically load initramfs files, if found
auto_initramfs=1

# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2

# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1

# Disable compensation for displays with overscan
disable_overscan=1

# Run as fast as firmware / board allows
arm_boost=1

[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[cm5]
dtoverlay=dwc2,dr_mode=host

[all]
boot_delay=1
gpu_mem=128

Right-clicking on the remote shell window provides you with a bunch of useful tools like copy and paste that PuTTY doesn't have, so if rpi-connect isn't active or is down, open shell from PuTTY, enable rpi-connect, then switch to rpi remote shell.


Setup Microphone

Follow this tutorial by Adafruit to get your MEMS microphone active and working.


Setup Bluetooth

In console, do:

PythoErgo@PythoPiZeroW:~ $ bluetoothctl
Agent registered
[CHG] Controller B8:27:EB:76:15:10 Pairable: yes
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# agent on
Agent is already registered
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller B8:27:EB:76:15:10 Discoverable: yes
[bluetooth]# exit
PythoErgo@PythoPiZeroW:~ $

Once Bluetooth is set up, you shouldn't have to restart it every time you boot up.


Create Python VENV

In console, run:

python3 -m venv --system-site-packages env

then

source env/bin/activate

You should now be in the Python VENV. To exit, type "deactivate" and press enter. Once the virtual environment is created, just run "source env/bin/activate" to activate it.


Install requirements

Both apt package and python env requirements can be found on the GitHub repository here.

Using FileZilla, upload both txt files into your user directory.

In console, run:

sudo apt update

# then

sudo xargs -a apt-requirements.txt apt install -y

# then activate python VENV

source env/bin/activate

# then

pip install --upgrade pip

# then

pip install -r py-requirements.txt

That should be it.


DISCLAIMER: I'm not entirely sure I covered every single apt package that isn't preinstalled. When I have time I will create a fresh Pi OS image on another MicroSD card and try following this software guide I wrote step by step.


Run the CryptaGlassV2 Python Code

Using FileZilla, create a new folder in /home/<username>/Documents called "Python". In there, upload the code from your main computer.


Activate the Python VENV and run this command:

python Documents/Python/CryptaGlassV2_release1.py

Everything should hopefully work.

Setup CryptaGlassV2 Code to Autorun on Bootup

(remember to replace pi with your username, unless it's pi)

Create launch script

sudo nano /home/pi/Documents/Python/start_cryptaglassv2.sh

Inside, paste:

cd /home/pi/Documents/Python
source env/bin/activate
python CryptaGlassV2_release1.py

Make it executable:

sudo chmod +x /home/pi/Documents/Python/start_cryptaglassv2.sh

Create flag file

touch /home/pi/Documents/Python/autorun.flag

Create systemd service

sudo nano /etc/systemd/system/cryptaglassv2.service

Inside, paste:

[Unit]
Description=CryptaGlassV2 Auto Launcher
After=network.target

[Service]
Type=simple
ExecStart=/bin/bash -c '[ -f /home/pi/Documents/Python/autorun.flag ] && /home/pi/Documents/Python/start_cryptaglassv2.sh'
WorkingDirectory=/home/pi/Documents/Python
User=pi
Restart=on-failure
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=default.target

Enable it

sudo systemctl enable cryptaglassv2.service

Toggle autorun

To enable autorun:

touch /home/pi/Documents/Python/autorun.flag

To disable autorun:

rm /home/pi/Documents/Python/autorun.flag

CryptaGlassV2 Mobile App

Crypta Glass V2 App Icon.jpg
blocks (2).png

AppInventor project file can be found here.


Log in or sign up to the AppInventor website, find the "Projects" option on the top bar, expand it and click "import project (.aia) from computer". Find the CryptaGlassV2 aia app you downloaded and import it.


Create a free OpenWeatherMaps account here for free weather API calls, needed for weather call feature in CryptaGlassV2. Generate an API key and paste it into the "&appid=<OpenWeatherMapsAPIKey>&units=metric" text block that's part of the WeatherAPI URL (refer to image above).


Setting phone numbers is very intuitive and easy to figure out.


In the CryptaGlassV2 project UI, find "build" option and choose "Android App (APK)". Scan the generated QR code with your phone and open the link. The APK file will be downloaded, open it to begin the app installation.

There are some permissions that need to be enabled, and you should set the app to run in background for best performance/functionality.


I'd like to improve the app a lot more in the future, it's just a basic, but functional app at the moment.


Ensure bluetoothctl is on in the Raspberry Pi console, your phone paired and trusted, but not connected (phone will get connected by Python program, not bluetoothctl):

bluetoothctl
power on
agent on
default-agent
scan on

pair AA:BB:CC:DD:EE:FF
trust AA:BB:CC:DD:EE:FF
scan off
exit


Run the Python CryptaGlassV2 code on the glasses, make sure Bluetooth is enabled on phone, open the app, click "Choose Bluetooth Device", select your Raspberry Pi. Everything should work perfectly.


Comments will be added to the code blocks soon.


Disclaimer: App currently only usable by Android phones.

Personalize and Optimize Battery Life

Once everything is set up and working as you like, you can begin to play around with the settings on your own. There are many things you can personalize and disable, here are just a few.


Change Bluetooth name and hostname

-Bluetooth device name-
sudo nano /etc/machine-info
Add or modify:
PRETTY_HOSTNAME=CryptaGlassV2
Ctrl+O, Enter, then Ctrl+X to save
sudo systemctl restart bluetooth

-Hostname-
sudo nano /etc/hosts
Add or modify:
127.0.1.1 CryptaGlassV2
Ctrl+O, Enter, then Ctrl+X to save
sudo systemctl restart systemd-logind.service
sudo hostnamectl set-hostname CryptaGlassV2

From my experience, you'll need to unpair the Raspberry Pi and your phone on both sides after changing the Bluetooth name, then repair.

Remember to use your new hostname when using PuTTY, FileZilla, and other programs.


Disable WiFi and RPI-Connect

WiFi is needed for SSH (PuTTY and FileZilla) and to fetch date and time. If you don't need those often, feel free to disable WiFi.

rfkill block wifi

To reenable it, you'll have to plug in a monitor and keyboard, so it might not be worth the effort.


We've used RPI-Connect in the past, just because it has a lot of tools like copy and paste, but now we can just use PuTTY and disable RPI-Connect to save more power.

rpi-connect off

Future Plans

I will be posting multiple YouTube videos in the near future to go along with this Instructables tutorial, as well as talking about CryptaGlassV1 and doing a comparison between the two versions.


A Crypta Glass Discord support server will be created.


Bug fixes and other tweaks will be made.


Improved case design and flip-out display mechanism.


Reorient display to embrace landscape mode limitations of camera, plus vision will be less impaired.


Related add-ons and side projects coming soon!:

  1. Rainproof charging case
  2. External Crypta Glass battery pack (for long video recording, long map directions, or anything else)


This Instructables guide is only the beginning, stay tuned for much, much more!