ardy345678903456789
Published

Blind Hat Helper

This device will help blind people be able to know if objects are in front of them.

BeginnerFull instructions provided954
Blind Hat Helper

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
The brains to the operation.
×1
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
Buzzer
Buzzer
×1
Male/Male Jumper Wires
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1

Story

Read more

Schematics

Schismatics To Helping Hat

Just the schematics to the project :>

Code

The Code To The Helping Hat

C/C++
This is code that sends out a short pulse of noise from the distance sensor and waits to hear how long it takes to come back. It also has an if-else statement witch will sound a Pizzo if an object gets too close.
// defines pins numbers
const int triger = 9;
const int echo = 10;
const int Pizzo = 8;
const int Threshold = 45;
// defines variables
long duration;
int distance;
void setup() {
pinMode(triger, OUTPUT); // Sets the trigPin as an Output
pinMode(echo, INPUT); // Sets the echoPin as an Input
pinMode(Pizzo, OUTPUT);
Serial.begin(9600); // Starts the serial communication
}
void loop() {
// Clears the trigPin
digitalWrite(triger, LOW);
delayMicroseconds(2);
// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(triger, HIGH);
delayMicroseconds(10);
digitalWrite(triger, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echo, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

if(distance <= Threshold)
tone(Pizzo, 1500);

else
noTone(Pizzo);

}

Credits

ardy345678903456789
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.