DongGeun LeesoungjunjoungPark s cgledel
Published

Fab Lab Final Project - Jesus Cane

We made a cane for the blind.

IntermediateProtip6 hours1,181
Fab Lab Final Project - Jesus Cane

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
Jumper wires (generic)
Jumper wires (generic)
×15
Ultrasonic Sensor - HC-SR04 (Generic)
Ultrasonic Sensor - HC-SR04 (Generic)
×1
LED (generic)
LED (generic)
×1
Buzzer
Buzzer
×1
Resistor 10k ohm
Resistor 10k ohm
×1
9V battery (generic)
9V battery (generic)
×1
9V Battery Clip
9V Battery Clip
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Laser cutter (generic)
Laser cutter (generic)
Hot glue gun (generic)
Hot glue gun (generic)

Story

Read more

Custom parts and enclosures

ultrasonic sensor case

case

ultrasonic sensor case

rdwork case file

Code

Jesus cane

Arduino
using ultrasonic sensor and buzer
// defines pins numbers
const int trigPin = 9;
const int echoPin = 10;
const int buzzer = 11;
const int ledPin = 13;

// defines variables
long duration;
int distance;
int safetyDistance;


void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(buzzer, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600); // Starts the serial communication
}


void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(2);
digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculating the distance
distance= duration*0.034/2;

safetyDistance = distance;
if (safetyDistance <= 50, safetyDistance > 40){
  digitalWrite(buzzer, HIGH);
  delay(200);
  digitalWrite(buzzer, LOW);
  delay(700);
}
if (safetyDistance <= 40, safetyDistance > 30){
  digitalWrite(buzzer, HIGH);
  delay(200);
  digitalWrite(buzzer, LOW);
  delay(400);
}
if (safetyDistance <= 30, safetyDistance > 20){
  digitalWrite(buzzer, HIGH);
  delay(100);
  digitalWrite(buzzer, LOW);
  delay(100);
}
if (safetyDistance <= 20, safetyDistance > 1){
  digitalWrite(buzzer, HIGH);
else{
  digitalWrite(buzzer, LOW);
}

// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}

Credits

DongGeun Lee
4 projects • 1 follower
Hi, glad to meet you. I'm a high school student and studying arduino now. I look forward to your kind cooperation. thx :)
Contact
soungjunjoung
1 project • 0 followers
Contact
Park s c
1 project • 0 followers
Contact
gledel
100 projects • 116 followers
Looking back on my childhood, I was happy when I was making something and I was proud of myself. "Making is instinct!"
Contact

Comments

Please log in or sign up to comment.