Introduction: Arduino Assistive Technology for the Visually Impaired

This contraption uses servos and buzzers that react to the read distance returned by 2 ultrasonic distance sensors. So if you're blind and somehow you managed to read this and thought the pictures were cool the next thing that you have to do is put the really small parts together without being able to see them, easy right, after that you will no longer be breaking your nose and stubbing your toes on things so yeah totally worth it. On both shoulders you will have an ultrasonic distance sensor that returns the distance which a servo (on the same shoulder) that presses a specific amount (depending on the distance), and when the item (thing that the distance sensor is seeing) comes too close a buzzer, on the same shoulder, beeps quietly just to emphasise that there is an object right next to your shoulder.

Step 1: Parts

So this project has a decent amount of parts since we will be doing 2x the amount of sensors/output devices needed for one shoulder.

Parts:

2 Servos (since they are only meant to gently press on your shoulder I used the cheapest ones I could find): http://www.ebay.com/itm/Align-T-Rex-Micro-Servo-Mo...

2 Ultrasonic distance sensors: http://www.ebay.com/itm/1pcs-Ultrasonic-Module-HC-...

2 Buzzers (you can use whatever buzzers you want, like piezo buzzers or passive buzzers, but I will be using passive buzzers): http://www.ebay.com/itm/Passive-Buzzer-Alarm-Modul...

Arduino Uno (you can use whatever Arduino microcontroller you want/have, but I will be using the Uno because it's bigger than the nano/mini and for demonstration purposes, it's easier to see): http://www.ebay.com/itm/NEW-ATmega328-UNO-R3-Devel...

Jumper wires (in this project we use female to male and male to male, so you should just buy a pack of all three types, you'll definitely end up using them): http://www.ebay.com/itm/120pcs-Dupont-Wire-Male-to...

Breadboard (this is used simply to distribute the ground and 5v power to all of the sensors/output devices, I just used a really small one): http://www.ebay.com/itm/5pcs-Mini-25-Points-Breadb...

USB A/B (this is the USB to Arduino Uno cord, this is included in the Arduino Uno link up above, but if you bought a different one that didn't already include it, here it is: http://www.ebay.com/itm/For-HP-CANON-DELL-Lexmark-...)

And now, after waiting for the parts for a year we are ready to start actually building and programming.

Step 2: Hooking Up the Circuit

So as with most projects, you first want to put together the hardware before writing the software. First, you want to connect all of the 5v (+, or Vcc) ports in the buzzers, servos, and distance sensors to the breadboard (in which the leftmost and column will be connected to the 5v on the Arduino Uno, then a wire will be connected to the 3rd column over from the left so you can continue to connect wires to the 5v ports). Now do the same for the grounds (-s), again connecting a cable between the columns. If you have a bigger breadboard than a 5x5 the only change you need to make is just don't use multiple columns (you can if you want, but there's no point), so don't use a connecting cable just line up the 5v and ground cables going to the sensors, and output devices with the wires coming from the Arduino Uno's 5v output and ground.

Next, we want to hook up the digital out/input pins to the correct sensors. Since the distance sensors are slightly more complicated than the other one pin control and input. The ultrasonic distance sensors have two different digital pins, one named Echo, and one named Trig. What these do is the Trig pin outputs a little pulse and the Echo pin receives it. Basically, one acts as a little mini speaker and the other is a microphone, and it calculates the distance using the fact that the speed of sound is 340.29 meters per second (or 1125 feet per second), and plugs that into the formula distance = time * speed of sound, where time = the time between outputting the ultrasonic wave, and the sensor receiving it. So, now that we understand how the sensor works we can use it. First, connect the left distance sensor's Trig pin to the digital pin 12 and it's Echo pin to d11. Next, connect the right distance sensor's Trig pin to d10 and the Echo pin to d9. Later on in the code, we will set the pin mode of the Echo pins to input, and the Trig pins to output.

Next, we're going to setup the servos and their pins, for these it's only going to be one pin per servo just controlling the angles that servos are going to be set to. Servos control gears that attach whatever you want them you, and they will rotate the thing between 0 and 180 degrees. So, now attach the left servo to d5 and the right one to d3.

Now we are going to setup the final component, the buzzers. How a piezo buzzer works is it contains a piezoelectric element, which deforms back and forth depending on how much voltage is applied to it, creating an audible sound. So, now, connect the left buzzer's pin to d6, and the right buzzer's pin to d4.

And finally, plug it into either a USB port on your computer or a USB to outlet adapter.

Step 3: Testing the Base Hardware

Now that we have hooked everything up we should test it before proceeding to write the code, wondering for hours why it isn't working. So upload the code in the file using the Arduino IDE, which you can download from this link: https://www.arduino.cc/en/Main/Software. Click your OS in the rectangle second from the top, then click "JUST DOWNLOAD" under the donate box thing, or donate if you want...

What SHOULD happen when you run the program is:

left servo 0 degrees, then 90 degrees, 150. (1-second delay between each movement)

right servo 0, degrees, then 90, then 150. (same thing)

right buzzer frequency of 1000 for 1 second then turn off.

left buzzer frequency of 1000 for 1 second then turn off.

then open the serial monitor, and the right distance sensor's distance will be printed out.

then the left one's. (it's in cm, but if you want to convert then multiply by .3937, or you can change the code, lines 72 and 87, I put the conversions there)

If any of these (or all of them...) didn't work then check the corresponding (to the sensor/output device) digital pin, and change it to the correct one, it could also be the ground of Vcc, so check those too. If not then great you're done with physical stuff, now onto the software.

Step 4: Programming

So, now we are ready to program this. In the file, I go into great detail with comments, so I won't say much here. One thing that may not be very apparent by looking at my comments/code is the function that I defined for calculating (based on the distance returned from the sensors) how much the servos should press on your shoulder. To do that I define a piecewise function (depending on the x value the equation that will determine the y value will change). The function looks like this: f(x) = { x < 5: - 3 / 2 (ln(x)) + 3.5, x >= 5: - x + 6. It defines the curve that is shown in the image. Basically exponentially getting harder (the pressure that the servo exerts) the closer the object gets to the sensor/person, and at 6 feet away stops pushing at all.

Invention Challenge 2017

Participated in the
Invention Challenge 2017