I built this pair of AI-Enabled sunglasses after watching Spider-Man Far From Home.
They use a Raspberry Pi 0 W to access an Amazon AVS API, although this has trouble accessing the microphone so to operate fully they need to be connected to a phone for now. They also have a camera capable of photo and video recording.
I started this project in 2019, but left it when I was busy with school work. I picked it up again in 2020 when applying for my Arkwright Scholarship, as I needed a project to submit.
The frames and lenses of the glasses are from movie-replica glasses I found on ebay, the arms of the glasses were designed and 3D printed by myself. It was tricky to design the arms to interact well with the existing frames, and I made many iterative variations of each hinge mechanism (shown below).
One arm pivots directly on the frame, the other arm folds part-way down, so that it sits nicely on top of the other. I actually put the micro-USB charging port in this second hinge, so that when you fold the arm, it reveals the charger.
One problem I faced was how to connect the stereo speakers and the mini condenser microphone to to the Raspberry Pi 0. The analogue GPIO pins would not work with an audio signal. I ended up using a Bluetooth board from a wireless headset, connected to my own speakers and microphone. It also conveniently acted as a charging circuit for the LiPO with micro USB.
It was hard to find troubleshooting support for this project, as there were no similar setups documented on the internet. People had used the same software, but not with the Raspberry Pi 0 W, and especially not powered by a tiny battery and using a Bluetooth sound board. The two speech recognition and assistant models I tried were Mycroft and Amazon Alexa. Mycroft was far more customisable, with different wake-word compatibility and more integration with the system; but the Alexa model had better voice recognition capability and a more sophisticated user chat experience. In the end, neither worked perfectly: Mycroft could access the microphone, but couldn't speak through the speakers, and Alexa could speak through the speakers, but could never be woken as it couldn't receive microphone inputs.
This project taught me so many valuable lessons in problem solving, from how to troubleshoot and pin-down the source of a software issue, to how to solder tiny surface-mounted resistors to fix a broken PCB. (Also not to use cheaply made soldering irons, they can break your PCBs 😉)