Pi Glass For Measuring Environmental Conditions

THINGS USED IN THIS PROJECT

Hardware components:
Raspberry pi zero
Raspberry Pi Zero
× 1
PiBow Zero 1.3
× 1
Geeky Glasses
× 1
Enviro pHAT
× 1
Adafruit industries ada258 image 75px
Li-Ion Battery 1000mAh
× 1
Adafruit PowerBoost 500
× 1
Adafruit OLED Screen
× 1
Google Cardboard Lens
× 1
SD Card
× 1
Extended Header
× 1
E switch eg1218 image 75px
Slide Switch
× 1
Adafruit industries ada592 image 75px
USB-A to Micro-USB Cable
× 1
Sugru
× 1
Tie Wraps
× 1
Blu Tak
× 1
Openbuilds nylon spacer
OpenBuilds Nylon Spacer
× 1
Nylon Standoffs
× 1
F/F Jumper Wires
× 1
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)

PiGlass

STORY

  • Make a device that can measure environmental conditions and relay to the user.
  • Make it wearable.

In the interests of producing more wearable tech, I thought; what would be cooler than a Raspberry Pi attached to a pair of glasses that can show sensor data to the wearers eye?

I will of course require this fancy lot:

Components of Borg

  • Various screws and wires from ModMyPi

Down to work

I hooked the board up to my Black HAT Hack3r and checked out this handy tutorial to get reading some data from it. Thank you Pimoroni.

Once it was reading out some data I decided to hook up the OLED screen on top, using jumper wires on the extended header.

PiGlass

As usual the simple thought turns into a few hours of trying to figure out how everything is even wired. Thanks to this random person for figuring out the correct wiring for a Raspberry Pi, if you ever see this.

Here's the OLED wiring from the above:

oled (GND/G) — Pi ( Pin 6 Gnd) oled (Vin/+) — Pi (Pin 1 3.3v) oled (MOSI/SI) — Pi (Pin 19) GPIO 10 (MOSI) oled (SCK/CL) — Pi (Pin 23) GPIO 11 (SCLK)) oled (DC/DC) — Pi (Pin 16) GPIO 23 oled (Reset/R) — Pi (Pin 18) GPIO 24 oled (OLEDCS/OC) — Pin 24 (GPIO 8 CE0)

You can get a good look at the Pin layout of a Pi here.

The pins on the OLED should be shown on the PCB of the board itself.

Once wired up it was OLED code time.

First I hit up a tutorial here. < This one is the most important as it guides you through the installation of the necessary software.

Then looked at some code from here. And also this handy stuff here.

I’d suggest the tutorial first followed by looking at the second links examples, these will get you setup writing stuff to the screen successfully. The third link has some further cool stuff for drawing shapes to the screen.

On my first attempts with the above I had some issues getting the screen to work, when trying to run text examples I ended up with a garbled screen – a bad feeling when you think you’ve busted a new piece of hardware in the first five minutes.

However I eventually discovered how to display a picture of a cat. With further trial and error I was able to display text – I combined this with the code for reading the Enviro pHat data and BEHOLD:

At this point I was excited – I moved onto making the text tidier and added some spacers to get the correct distance from the glasses + the lens:

Read More: Pi Glass For Measuring Environmental Conditions


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top