Abstract
Many visually impaired people use canes to detect obstacles at ground level. What about detecting an obstacle at face level, like a tree branch? What if you need to keep both your hands free and cannot hold a cane? Solve both problems at once with these obstacle-detecting glasses! The glasses use an ultrasonic sensor to measure distance and a buzzer to alert the user of nearby objects. You can customize the design to add or swap out features, like using a vibration motor instead of a buzzer. What other ideas can you think of?
Summary
Previous experience with Arduino is recommended before you try this project. See our How to Use an Arduino page.
A kit is available from our partner Home Science Tools®. See the Materials section for details.
Be careful if you practice using your glasses with your eyes closed. Have another person watch you to make sure you do not get hurt.
If you have never used an Arduino before, please go through at least the first few tutorials on our How to Use an Arduino page before attempting this project.
Objective
Design and build obstacle-detecting glasses using an ultrasonic distance sensor and a buzzer.
Introduction
Check out this video from the Broadcom Foundation showing projects by Damini Jordan and Johan Santana from the Renaissance Youth Center in Bronx, New York:
People who are blind or visually impaired can use a variety of assistive technologies to help them navigate the world. For example, they can use braille to read physically printed text and screen reader software that reads text on a computer screen out loud. Many of them use white canes to detect obstacles when walking by sweeping the cane back and forth in front of them as they walk (Figure 1). The canes are white to help other people nearby (like pedestrians and drivers) identify that the user is visually impaired and use appropriate caution. The main color of the cane and the significance of any additional colors, like red bands signaling that the user is also hard of hearing, can differ from country to country.

Figure 1. A woman crossing the street using a white cane.
Some people use smart canes or electronic walking sticks that have additional features. For example, a stick might connect to an app on your phone and have built-in microphones and speakers to work with voice commands. Some sticks contain an ultrasonic distance sensor to detect obstacles. An ultrasonic sensor emits a burst of ultrasonic sound and measures how long it takes the sound wave to reflect back to the sensor - just like a bat uses sonar to echolocate objects. The stick can then provide some sort of feedback to the user - like a beep or vibration - to alert them of the obstacle. A forward-facing sensor can help detect obstacles at ground level. In theory, an upward-facing sensor could detect obstacles above ground level, helping users avoid bumping their shins on a coffee table or their face on a tree branch. However, ultrasonic sensors have a limited range and may not always accurately detect obstacles at head level. Sometimes users might also want hands-free operation of an obstacle-detecting device. This is where mounting ultrasonic sensors on other pieces of clothing or accessories, like a headband or pair of glasses (Figure 1), can become useful.

In this project, you will need to decide how to mount an ultrasonic distance sensor and other electronics on a pair of glasses so they are comfortable and practical for a user to wear. You can also edit the code that controls the buzzer. Watch this video to get started learning how to use an ultrasonic distance sensor with an Arduino. Check out our How to Use an Arduino page for tutorials on other parts like buzzers and motors.
Terms and Concepts
- Blind
- Visually impaired
- Assitive technology
- White cane
- Smart cane
- Electronic walking stick
- Ultrasonic distance sensor
- Sonar
- Echolocate
Questions
- What are some ways that blind or visually impaired people can navigate safely when walking around?
- Search online for "smart cane" and "electronic walking stick" etc. What are some features of canes/sticks that you can buy online? Can you find glasses or other wearable assistive technologies with similar features?
- What features do you want to include in your glasses/headset?
Bibliography
- Finio, B. (n.d.). How to Use an Arduino. Science Buddies. Retrieved April 25th, 2024.
- Science Buddies Staff (n.d.). Engineering Design Process. Science Buddies. Retrieved April 25th, 2024.
Materials and Equipment 
Recommended Project Supplies
This is an engineering design project. The exact materials you will need depend on what you decide to build. The list below is for the circuit shown in the procedure with one ultrasonic sensor and one buzzer. You may wish to add multiple ultrasonic sensors or other outputs like a vibration motor.
-
Electronics Kit for Arduino, available from our partner Home Science Tools®.
The kit includes the following parts that you need for this project:
- Arduino-compatible microcontroller board
- Note: This project will work with the Arduino UNO R3, UNO R4 Minima, UNO R4 WiFi, and compatible third-party boards.
- USB cable
- Breadboard
- Jumper wires
- 9V battery
- 9V battery snap connector
- HC-SR04 ultrasonic distance sensor
- Arduino-compatible microcontroller board
- Windows or Mac computer. See this page if you have a Chromebook. Your computer will need:
- Access to the Arduino IDE, either installed local version or web-based editor. Watch this video for a comparison of the two options.
- USB port. The Science Buddies kit comes with a USB-A to C cable. The "C" end plugs into the Arduino, and the "A" end plugs into your computer. You will need an adapter or different cable if your computer only has USB-C ports. Watch this video to learn about the different types of cables and adapters.
- Active buzzer. The example code in this project is for an active buzzer that produces a single tone. If you want to use the Arduino tone() function to produce sounds with different pitches, you can use a passive buzzer instead. See our buzzer tutorial video to learn about the differences between the two types.
- 5.5x2.1mm barrel jack connector with switch
- Glasses, headset, headband, etc. to modify
- Materials to attach things to your glasses, such as zip ties, electrical tape, double-sided foam tape, duct tape, a hot glue gun, etc.
- Scissors
Disclaimer: Science Buddies participates in affiliate programs with Home Science Tools®, Amazon.com, Carolina Biological, and Jameco Electronics. Proceeds from the affiliate programs help support Science Buddies, a 501(c)(3) public charity, and keep our resources free for everyone. Our top priority is student learning. If you have any comments (positive or negative) related to purchases you've made for science projects from recommendations on our site, please let us know. Write to us at [email protected].
Experimental Procedure

Design Your Glasses
It may be tempting to just jump right in and start building something, but the engineering design process involves some careful planning and research before you build a prototype. See our engineering design process guide for more details, but here is an overview of some things you should consider for this project:
- What problem are you trying to solve? Specifically, as discussed in the introduction, how is your device supposed to help blind or visually impaired people?
- What features are available on existing smart glasses/headsets? What type(s) of sensor(s) do they use? What are some pros and cons of the different sensors?
- What features do you want to include in your design?
- If you are using multiple sensors to detect obstacles in different directions, how will you alert the user? For example, could you use different beeping or vibration patterns to indicate obstacles in different locations?
Prototype the Circuit
You should build and test your circuit on a breadboard before you mount everything to your glasses. Figures 2 and 3 show one possible breadboard layout and circuit diagram for a circuit with a single ultrasonic sensor and buzzer. You will need to modify the circuit for additional sensors or outputs. You can access a Tinkercad Circuits simulation of the circuit here.
Important: depending on where you bought your breadboard, the left/right orientation of the power (+) and ground (-) buses may be reversed.
- Connect the ultrasonic sensor directly to the Arduino using male-female jumper wires.
- GND pin to GND
- ECHO pin to Arduino pin 7
- TRIG pin to Arduino pin 6
- VCC pin to 5V
- Connect the buzzer directly to the Arduino pins.
- Negative (-) pin to GND
- Positive (+) pin to Arduino pin 11


Test the Code
If your circuit is identical to Figures 2 and 3, you can download our example code. You will need to modify the code if you add more sensors or outputs.
- Upload the code to your Arduino.
- Hold your hand in front of the ultrasonic sensor and slowly move it back and forth. Listen to how the buzzer responds.
- If the buzzer does not work, double-check that you have all of the connections correct and that no wires are loose.
- Experiment with changing the
threshold,buzzerDelayMin, andbuzzerDelayMaxvariables in the code. How do they let you change the buzzer's behavior? - Once you have the code working the way you want it, you are ready to mount your circuit to your glasses.
Build the Glasses
You can decide how to mount your circuit to your glasses. How you do this will depend on the materials you have available and the criteria for your project - are you just building a prototype for demonstration at a science fair, or do you want something more durable for long-term use? Figures 4 and 5 show two different views of our example, but how you build your glasses (or headset, headband, etc.) is up to you.
- Mount the Arduino vertically to one side of the glasses with electrical tape.
- Mount the ultrasonic sensor forward-facing on the front of the glasses.
- Note: if your male-female jumper wires are not long enough to reach where you want to mount the sensor, you can connect two wires end-to-end to extend them.
- Tape a 9V battery on the opposite side from the Arduino (this helps distribute the weight so the glasses are not too lopsided).
- Connect the 9V battery to the Arduino with a barrel jack connector that has a built-in switch. This lets you easily turn the glasses on and off without needing to unplug the battery. The barrel jack connector can wrap around the back of the user's head/neck.


Test the Glasses
Once you have the prototype built, it is time for some real-world testing! Remember that the engineering design process is iterative. It is OK if your design does not work perfectly on the first try - you can always change it and make improvements.
- Try moving your hand back and forth in front of the ultrasonic sensor again to make sure your circuit is still working properly.
- If something does not work, double-check that all your connections to the ultrasonic sensor and buzzer are secure. Wires may have come loose when you mounted everything on the glasses.
- Try wearing the glasses, walking, and moving your head around to get a sense of how well they detect obstacles. Keep your eyes open for now. If you decide to test with your eyes closed, have another person observe you for safety.
- Detecting obstacles with the glasses is different from waving your hand in front of the sensor. Revisit the
thresholdandbuzzerDelayMin/Maxvariables, adjusting them if needed. What values provide the best overall combination of adequate warning without unnecessary beeping? - If possible, ask blind or visually impaired people to test your glasses for you. Ask for their feedback. Can you incorporate it into an improved version of your design?
See the Variations section for more ideas about other features you could add to your project.
Ask an Expert
Global Goals
The United Nations Sustainable Development Goals (UNSDGs) are a blueprint to achieve a better and more sustainable future for all.
Variations
- Can you mount sensors on other clothing or accessories like a walking stick?
- Can you miniaturize the circuit using a smaller Arduino instead of the UNO to make the glasses lighter and more compact?
- Can you solder all of the connections using a protoboard instead of a solderless breadboard? This will help make the design more permanent, so the wires do not accidentally rip out during use.
- Can you think of other ways to make the glasses more practical and durable for everyday use? What about waterproofing them for use in the rain?
- Can you power the Arduino with a rechargeable battery instead of a disposable 9V battery?
- For an advanced project, can you add a camera to the glasses and use artificial intelligence and computer vision for object recognition? This will require something more powerful than an Arduino for processing.
Careers
If you like this project, you might enjoy exploring these related careers:
Contact Us
Our kits are developed in partnership with Home Science Tools®. If you have purchased a kit for this project, Home Science Tools® is pleased to answer any questions.In your email, please follow these instructions:
- Include your Home Science Tools® order number.
- Please describe how you need help as thoroughly as possible:
Examples
Good Question I'm trying to do Experimental Procedure step #5, "Scrape the insulation from the wire. . ." How do I know when I've scraped enough?
Good Question I'm at Experimental Procedure step #7, "Move the magnet back and forth . . ." and the LED is not lighting up.
Bad Question I don't understand the instructions. Help!
Good Question I am purchasing my materials. Can I substitute a 1N34 diode for the 1N25 diode called for in the material list?
Bad Question Can I use a different part?
Contact Support












