Voice Controlled Glasses and Magnifying Lens

This project automatically move the lens of a magnification glass using voice commands

Public Chat
Similar projects worth following
Many professionals work for many hours looking at very small areas, such as surgeons, watchmakers, jewellery designers and so on. Most of the time theses professionals use some kind of magnification glasses that helps them to see better the area they are working on and other tiny items used on the job. There are many magnifiers that allow the professionals see better and the most common ones are the magnification glasses.

The devices that have magnifications lens on a form factor of a glass usually allow the professional to move the lens out of their eye sight, i.e. put aside the lens. However, in some scenarios touching the lens or the glass rim to move away the lens can contaminate the fingers. Also, it is cumbersome and can break the concentration of the professional.

Therefore, the goal of instructable is to automatically move the lens of a magnification glass using voice commands such as "up" or "down".

Although the idea for this project is very simple, after showing to some people I found that there are some other interesing use case scenarios:

* Welding. It is common to see that many welders use large protective masks that go up and dow many times while welding. Hence this project could help these professionals and avoid moving up and dow the mask manually to check the status of the weld.

* Leaning. Some kids became very excited when I show them the project! They said it was very cool and I should use it when teaching servos.

* Driving. Imagine that you are using sunglasses and driving. Then you enter a tunel and have to remove the lens to see better inside the tunel. And do the oposite movement when exiting the tunel. This project could be used in this scenario to move out the lens of the sunglass on your command.

* Drinking. Remember that funy glasses with plastic tubing that carry liquids from a can around your glasses while you suck the tip of the tube? Yeah, this project can replace the sucking with your mount and automatically send the liquid to your mouth!


NodeJS file to store the Watson's STT credentials

x-javascript - 184.00 bytes - 08/01/2018 at 18:11


Python code to lift up the servo

plain - 763.00 bytes - 08/01/2018 at 18:11



Package requirements for the NodeJS app

JavaScript Object Notation (JSON) - 397.00 bytes - 08/01/2018 at 18:11



Main NodeJS app

x-javascript - 1.68 kB - 08/01/2018 at 18:11


Python code to lift down the servo

plain - 761.00 bytes - 08/01/2018 at 18:11


  • 1 × Raspberry Pi Zero W Kit (Board, memory card, case, pins bar, OTG cable)
  • 1 × Magnification lens glasses I recommend the New Loupe Microscope model. Check this link:
  • 1 × Power Pro 9g servo (SG90)
  • 1 × USB Microfone
  • 1 × Power Bank (5v 1A)

  • The final project

    Mauro Pichiliani08/01/2018 at 18:52 0 comments

    After some testing with the code I finished the project. Here's a video showing how it works (using the TJBot cardboard head as a model):

    Some future improvements and lessons learned:

    * Initially I wanted to control the two lens individually. Howerver, at the time I only had one servo. Since they are very lightweight, adding another servo on the other side wont increase that much the overall weight of the glass

    * I was wanted to control the lights that are close to each lens, but I did not follow through. If anyone want to do that open the cases where you can replace the tiny round watch power battery and attach a cable to one of the GPIO's of the RPI Zero W. This should be an easy task but requires extra programminng to active the leds.

    * I could create a better cable management and print 3D parts to accomodate the servo and the supporting ice screen stick instead of the hot glue. Maybe this will come in a next version of the prototype.

    * There are alternatives for the hardware. For instance, I could replace the RPI Zero W with a tinyduino and two tinyshields: one to allow bluetooth communication with a mobile phone (which would capture the audio and do the STT)  and one to connect the tinyarduino to the servo (the Proto Board TinyShield).

    * Another option I had was use a voice assistant device such as the amazon echo or GoogleHome to receive the audio. However, this approach may have some issues when doctors use masks on their faces. I tested this scenarion with the USB microphone connected with the RPI Zero W and have no problem to understand the two commands (up and dow).

  • The software part

    Mauro Pichiliani08/01/2018 at 18:37 0 comments

    Among all the options I had to recognize the user voice commands I choosed the Watson Speech to Text service. This choice was based on how simple is to use the service after creating an evaluation account. Also, they provice simple examples of API calls using NodeJS.

    I was wondering how to keep a constant open connection with the service and receive events when specific keywords were spoken, i.e.   UP or DOWN. Instead of programming everything from scratch I used the TJBOT lib, a NodeJS project that was used for the IBM's TJBot cardbord robot. This allow me to have a prototype with very few lines of code. Here's the link for it:

  • The hardware components

    Mauro Pichiliani08/01/2018 at 18:33 0 comments

    I stared to search with type of hardware I should use in this project. My natural choice was an arduino (maybe a tyniduino) since I need something lightweight that can be fixed on the glass rim.

    However, since I was going to use audio I needed a microphone and sound processing features to record and audio file and send it to a STT engine. Therefore I choosed and Raspberry Pi Zero W, which can connect to the servo using the GPIO  and also allow a small USB microphone.

    To power up the RPI Zero W I try some battery packs and other approaches, but all of them insert some extra weight in the glass that make it cumbersome and fatige factors when wering the glass for some time. 

    My solution was simple: use the RPI Zero W fixed in the rim of the glass and connect the micro USB power cable to a powerbanl that should be stored inside a pocket of the user's pants. This way the weight of the power source is not on the user face.

  • Looking for similar ideas

    Mauro Pichiliani08/01/2018 at 18:25 0 comments

    After the initial ideia I was the following thought:

    Its such a 90's looking project!

    Moving on, I searched for similar project and did find any! Indeed, the available comercial solutions for sugeons and others did not have voice automated lens. I found fancy models with many lens and lights, but all of the are manual.

    After I while I talked with my dentist and she confirmed to me that there are no voice activated glasses to control the lens and lights.

  • The main ideia

    Mauro Pichiliani08/01/2018 at 18:20 0 comments

    I had the ideia for this project when I give on of these magnifying glasses to my stepsister, which is a veterinarian:

    I know these are used by watchmakers and are not medical graded products. Nevertheless, I wonder how I could modified to make it easier to move up and down the lens. After studying the mechanism (which is very nice use of plastic) I decided to automate the movement of the lens with voice commands.

View all 5 project logs

  • 1
    Components and tools

    Besides the components alread listed, I recommend the following suplies and tools: jumper cables, hot glue gun, power drill with a small bit, a piece of plastic bread bag tie, a small servo screw, an ice cream wooden stick and a nail file.

  • 2
    Modifying the Glasse's Rim

    The first step is remove the support of the lens in the glass. This support is on top of each "bar" that allows it to spin and move the lens. Take extra care to not break the plastic parts that connect the two supports.

    Next we need to use the nail file to sand a little bit the two tubular supports ("bars"). This sanding is needed because there some very small plastic slots that prevent the lens' support to be completely free, i.e. move without any obstacle. Check the images that shows how the tubular supports should be after the sanding.

    After the sanding choose one of the two tubular supports (I choose the left one) and create a small hole with the power drill and the small bit. Make sure that the hole can accommodate the screw that will latter be used to fix the servo.

    Connect the two lens supports on the tubular support to their original spot. After that check if the support move the lens back and forth freely without any resistance. The next step is to use the ice scream stick to make the two lens move together. Use the hot glue to connect the lens taking care of NOT drip hot glue on the area where you turn the lens to remove them. There is just enough space to do that but without any margin for mistakes. Again, avoid gluing the lens to the support, since this mistake will prevent the user to change the focal lens that came with the glasses (I guess they have 5x, 15x and 25x magnification factors).

    Now we must pin the servo. Use the screws and the two small plastic screws nuts so that you have the screw, one screw nut, the servo hole, another screw nut and the screw head. Check the images for a reference of the sequence. Finally attach the servo on the glasses bu fixing the screw on the hole drilled with the power drill.

    Finally, use one of the bread bag wires to tie the tip of the plastic pinned to the servo with the center of the ice scream stick. Make sure the wire is stretched out, just like the last figure of this step shows.

  • 3
    Setting Up the Raspberry Pi

    n this step we need to setup the Raspberry Pi Zero. This is very strait forward and I recommend the following guide that uses the NOOBS software to write the Raspbian Operating System on the SD Card. Please note that there are some differences, since we are using the Raspberry Pi Zero instead of the Raspberry PI 2.

    After setting up the Raspian make sure you can access it via WiFi using the remote terminal and the SSH software. You need to configure the WiFi networking by changing the /etc/wpa_supplicant/wpa_supplicant.conf file manually to insert the network's name (SSID) and the password.

    Connect the OTG cable on the Raspberry Pi port and connect the USB microphone on the other end. You need to setup the ALSA software to make sure you can use the microphone. Watch the following video to see how to setup the mic. on the RPI:

    After making sure you Raspberry Pi is ready its is time to connect the wires from the computer's GPIO pins to the servo. Connect a red cable to the 5V pin (the second one of the firs column) of the RPI to the middle connection of the servo. Connect a black cable to ground pin on the Raspberry (the second of on the third column) to the most dark wire of the servo (usually a dark brown). Finally, connect a yellow cable in the pin number 4 of the raspberry to the yellowish/orangle port of the servo. Check the image of this setup for the pinout setup.

View all 5 instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates