Ultrasonic Aid: an Aid Using an Ultrasonic Sensor for the Visually Impaired
by Avengers3648 in Circuits > Assistive Tech
2371 Views, 16 Favorites, 0 Comments
Ultrasonic Aid: an Aid Using an Ultrasonic Sensor for the Visually Impaired
Hello, Today I am going to make a sunglasses mounted "Blind" Aid. I put the quotations on blind because I imagine It could be used more for the visually impaired. this is a rather old concept but I hope that you will be able to understand more about the components through this Instructable. Now onto the fun part!
Supplies
- Ultrasonic Sensor (HC-SR04)
- 6 Male to Female Jumper Cables
- Peizo Buzzer
- Arduino Genuio Uno
- Arduino IDE
- Sunglasses (or another mount)
The Wiring
Wire Color-Pin on Component-Pin on Arduino
RED-VCC-5v
BLUE-TRIG-9
ORANGE-ECHO-8
BLACK-GND-GND
PURPLE-Negative-10
BLACK-positive-GND
The Code
#define echopin 8 // echo pin
#define trigpin 9 // Trigger pin
long duration, distance; //To get some accuracy in time and distance
int buzz=10;// Inititalizing buzzer at pin 10
void setup()
{ Serial.begin (9600);
pinMode (trigpin,OUTPUT);
pinMode (echopin,INPUT );
pinMode (buzz,OUTPUT); }
void loop()
{
{ digitalWrite(trigpin,HIGH);
delayMicroseconds(0);
digitalWrite(trigpin,LOW);
delayMicroseconds(0);
duration=pulseIn (echopin,HIGH);
distance= duration/100;
Serial.println(distance); }
if(distance>300) {
digitalWrite(buzz,LOW);
delay(1000);
digitalWrite(buzz,LOW);
delay(1000); }
else if(distance<300 && distance>200)
{ digitalWrite(buzz,HIGH);
delay(500);
digitalWrite(buzz,HIGH);
delay(500); }
else if(distance<200 && distance>10)
{ digitalWrite(buzz,HIGH);
delay(250);
digitalWrite(buzz,LOW);
delay(250); }
else if(distance<70)
{ digitalWrite(buzz,HIGH);
delay(100);
digitalWrite(buzz,LOW);
delay(100); }
else if(distance<25){
digitalWrite(buzz,HIGH); } }