We are the Borg.
Key Goals Summary:
- 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
- Pi Zero
- Geek Glasses
- Enviro pHAT
- Powerboost 500
- OLED Screen
- Google Cardboard Lense
- Memory Card
- Extended Header
- USB Cable
- Blu Tack
- Tie Wraps
- Various screws and wires from ModMyPi
The Borg Protocols
So I wanted something wearable – simple enough, I thought; get the usual Powerboost 500, battery, Pi combo all together with some sensors and whack in an OLED screen – after using Google Cardboard I realised I could use the lenses from said to make the screen readable close to the eye.
I had a scout around for some sensor kits, some were too big such as this, it would have worked but would have been a bit too bulky and I didn’t need the lighting – after some further searching I discovered the Enviro pHAT.
It covers anything a growing nerd could need to monitor, over 4 different sensors: Temp/Pressure/Light/Motion – hit the link above to see more.
Down to work
Once it was reading out some data I decided to hook up the OLED screen on top, using jumper wires on the extended header.
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.
Once wired up it was OLED code time.
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:
After some tweaks and testing, the final code is on my GitHub.
As you can see the sensor data being read and displayed covers:
- Light amount 0-255
- RGB Light colour 0-255 per channel
- Temperature and Pressure
- Motion X, Y, Z
- Heading to north – calculated to show the degrees to north
To switch off you simply hold a finger over the light sensor for 5 seconds and it will execute a shutdown command on the Pi – the light levels pretty much never hit zero unless the sensor is entirely covered and I thought this would be more efficient than adding in a shutdown button.
For information on setting up the Raspberry Pi and getting code to run on boot see my previous project post for more details here.
24 hours of Sugru drying later it was of course time to try them on:
As you can see the weight of the hardware drags them to one side. So I will probably attach a counterweight to the left side at some point.
This is a great proof of concept – and with the memory card imaged I can make more similar devices quickly, possibly using different sensors or information to be relayed to the user.