Obstacle-Detecting Walking Stick
Moderators: AmyCowen, kgudger, bfinio, MadelineB, Moderators
-
amyCC
- Site Admin
- Posts: 398
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Obstacle-Detecting Walking Stick
Posted on behalf of student/family
-------------------------------------------------
We need your support in finalising our project.
We have ordered kit for the project as given below.
Build an Obstacle-Detecting Walking Stick for Blind People.
We have fixed all items as per video & uploaded the code but it is not beeping.
Photos:
Project url: https://www.sciencebuddies.org/science- ... king-stick
-------------------------------------------------
We need your support in finalising our project.
We have ordered kit for the project as given below.
Build an Obstacle-Detecting Walking Stick for Blind People.
We have fixed all items as per video & uploaded the code but it is not beeping.
Photos:
Project url: https://www.sciencebuddies.org/science- ... king-stick
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
Hi - looking at your pictures, the black wire from your buzzer is in breadboard row 10, but the black jumper wire going to ground is in breadboard row 8. These two rows are not connected so you have an open circuit and your buzzer will not work. Move these two wires to the same row and that should work.
It also looks like your ultrasonic sensor is backwards. It should be facing the other direction so it does not get interference from sound waves reflected off the Arduino and jumper wires. Note the order of the sensor's pins in Figure 2 in the project instructions - look at the labels on your sensor and make sure the connections match: https://www.sciencebuddies.org/science- ... #procedure
It may help to refer to our How to Use a Breadboard tutorial and watch the video before you proceed: https://www.sciencebuddies.org/science- ... breadboard
It also looks like your ultrasonic sensor is backwards. It should be facing the other direction so it does not get interference from sound waves reflected off the Arduino and jumper wires. Note the order of the sensor's pins in Figure 2 in the project instructions - look at the labels on your sensor and make sure the connections match: https://www.sciencebuddies.org/science- ... #procedure
It may help to refer to our How to Use a Breadboard tutorial and watch the video before you proceed: https://www.sciencebuddies.org/science- ... breadboard
-
amyCC
- Site Admin
- Posts: 398
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
From family/student
----------------------
I put in the code from your science buddies video in the “Arduino IDE”, but it makes a continuous beeping sound. Check these photos.
----------------------
I put in the code from your science buddies video in the “Arduino IDE”, but it makes a continuous beeping sound. Check these photos.
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
Hi -
In the code, please delete the two slashes at the beginning of this line in the setup() function:
// Serial.begin(9600);
so it appears as
Serial.begin(9600);
do the same for this line in the loop() function
// Serial.println(cm);
so it appears as
Serial.println(cm);
Then, re-upload your program and select Tools --> Serial monitor from the menu. It should continuously print out the distance measured by the ultrasonic sensor in centimeters. This distance should change if you move your hand back and forth in front of the sensor, or move the sensor up and down while aiming it down at a table. If the values do not change at all, then your ultrasonic sensor is not working for some reason and it may be wired incorrectly (we can't see the sensor in the photos so can't say for sure).
In the code, please delete the two slashes at the beginning of this line in the setup() function:
// Serial.begin(9600);
so it appears as
Serial.begin(9600);
do the same for this line in the loop() function
// Serial.println(cm);
so it appears as
Serial.println(cm);
Then, re-upload your program and select Tools --> Serial monitor from the menu. It should continuously print out the distance measured by the ultrasonic sensor in centimeters. This distance should change if you move your hand back and forth in front of the sensor, or move the sensor up and down while aiming it down at a table. If the values do not change at all, then your ultrasonic sensor is not working for some reason and it may be wired incorrectly (we can't see the sensor in the photos so can't say for sure).
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Dear Team,
Thank you for your swift response.
We have made the necessary changes as you advised. However, it is still beeping continuously. We have attached the pictures with the incorporated changes. We would appreciate it if you could refer to those & guide us accordingly.
Thanks a lot for your support.
Thank you for your swift response.
We have made the necessary changes as you advised. However, it is still beeping continuously. We have attached the pictures with the incorporated changes. We would appreciate it if you could refer to those & guide us accordingly.
Thanks a lot for your support.
- Attachments
-
- Project-01.29.pdf
- (432.71 KiB) Downloaded 162 times
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
Hi - in the PDF you attached, I do not see a screenshot of the serial monitor. You correctly uncommented the serial print commands but then you need to select Tools --> Serial monitor to open the serial monitor. Depending on the version of the Arduino IDE you have installed, this will either open in a separate window, or at the bottom of the code window there will be a tab called "Serial monitor" that you need to click on. We need to see that data to confirm that your sensor is working.
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Dear Team,
Please find the attached snapshot of the serial monitor & with the given description on serial monitor it beeps constantly. Please advise
Thanks,
Kishore
Please find the attached snapshot of the serial monitor & with the given description on serial monitor it beeps constantly. Please advise
Thanks,
Kishore
- Attachments
-
- IMG_8599.jpeg (3.83 MiB) Viewed 10985 times
-
- IMG_8601.jpeg (3.11 MiB) Viewed 10985 times
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
Hi - if it's printing out all zeroes like that then you are not getting readings from your sensor. It's hard for me to tell in the pictures because there isn't a single picture where the sensor and breadboard connections are both easily visible, but please trace your sensor connections and make sure you do not have any wires switched.
VCC on the sensor should be connected to the breadboard's "+" bus which is connected to 5V on the Arduino
GND on the sensor should be connected to the breadboard's "-" bus which is connected to GND on the Arduino.
If you get power and ground pins reversed, the sensor will not work.
TRIG pin on the sensor should be connected to Arduino pin 6 - this is the blue wire in our diagram, but in your photos it looks like your blue wire goes to pin 7, so you may have these reversed.
ECHO pin on the senor should go to Arduino pin 7 - this is the green wire in our diagram, but again looks like your green wire goes to pin 6.
To clarify, it does not actually matter what color wire you use, the wires all behave the same. What matters is the electrical connection from TRIG <--> 6 and ECHO <--> 7. If you get the wires mixed up on either end then the sensor will not work.
VCC on the sensor should be connected to the breadboard's "+" bus which is connected to 5V on the Arduino
GND on the sensor should be connected to the breadboard's "-" bus which is connected to GND on the Arduino.
If you get power and ground pins reversed, the sensor will not work.
TRIG pin on the sensor should be connected to Arduino pin 6 - this is the blue wire in our diagram, but in your photos it looks like your blue wire goes to pin 7, so you may have these reversed.
ECHO pin on the senor should go to Arduino pin 7 - this is the green wire in our diagram, but again looks like your green wire goes to pin 6.
To clarify, it does not actually matter what color wire you use, the wires all behave the same. What matters is the electrical connection from TRIG <--> 6 and ECHO <--> 7. If you get the wires mixed up on either end then the sensor will not work.
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Hi,
Thanks a lot for the swift reply. What do you mean by BUS?
Regards,
Kishore
Thanks a lot for the swift reply. What do you mean by BUS?
Regards,
Kishore
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Also it would be great if you please share the picture of same project clearly showing all pins & wire connections and the code that we need to run after making all connections. We have already followed directions as given on website but still not working.
Thanks a lot in advance!
Regards
Kishore
Thanks a lot in advance!
Regards
Kishore
-
bfinio
- Expert
- Posts: 964
- Joined: Mon Aug 12, 2013 2:41 pm
- Occupation: Lead Staff Scientist, Science Buddies
- Project Question: Expert
- Project Due Date: n/a
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
Hi Kishore - the "buses" are the long strips on the sides of the breadboard marked with "+" and "-" symbols. It is very important to understand how a breadboard works and the related terminology in order to do Arduino projects. Before you continue we STRONGLY recommend watching our How to Use a Breadboard video if you have not already: https://youtu.be/6WReFkfrUIk
There are no additional pictures or code to send you - the project should work as-is if you build the circuit shown in Figure 2 in the project procedure and upload the code from the Test the Code section. As I mentioned in my previous reply, getting all zeroes in your serial monitor indicates that your ultrasonic sensor is not connected properly, and you need to make sure the sensor pins are connected as outlined in Step 1 of the "Prototype the Circuit" section of the procedure and Figure 2. If you have the sensor pins connected backwards then it will not work.
If you can upload pictures with your sensor, breadboard, and Arduino all clearly visible, showing the cable connected to the labeled sensor pins (so we can see which color wire is going to which pin), then I can help you troubleshoot whether the sensor is connected correctly.
There are no additional pictures or code to send you - the project should work as-is if you build the circuit shown in Figure 2 in the project procedure and upload the code from the Test the Code section. As I mentioned in my previous reply, getting all zeroes in your serial monitor indicates that your ultrasonic sensor is not connected properly, and you need to make sure the sensor pins are connected as outlined in Step 1 of the "Prototype the Circuit" section of the procedure and Figure 2. If you have the sensor pins connected backwards then it will not work.
If you can upload pictures with your sensor, breadboard, and Arduino all clearly visible, showing the cable connected to the labeled sensor pins (so we can see which color wire is going to which pin), then I can help you troubleshoot whether the sensor is connected correctly.
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Dear Team,
Thanks a lot for your untiering support. It is working now.
Once again thanks a lot & we will acknowledge your support while presenting this during regional competitions.
Regards,
Kishore
Thanks a lot for your untiering support. It is working now.
Once again thanks a lot & we will acknowledge your support while presenting this during regional competitions.
Regards,
Kishore
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Dear team,
One more question, how to adjust distance in the code? I want the buzzer to beep from a longer distance.
Thanks
Kishore
One more question, how to adjust distance in the code? I want the buzzer to beep from a longer distance.
Thanks
Kishore
-
amyCC
- Site Admin
- Posts: 398
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
Hi Kishore - You'll want to change the threshold variable value in the code. The threshold is a distance in centimeters.
This is explained in the video, as well. It's just a few second after this point: https://www.youtube.com/watch?v=7hmTb7Iqm4s&t=220s (3:54)
Amy
Science Buddies
This is explained in the video, as well. It's just a few second after this point: https://www.youtube.com/watch?v=7hmTb7Iqm4s&t=220s (3:54)
Amy
Science Buddies
-
Kishorekumar1979
- Posts: 7
- Joined: Fri Jan 10, 2025 9:51 pm
- Occupation: Parent
Re: Obstacle-Detecting Walking Stick
Dear Amy,
Thanks a lot & we are now good to present tomorrow.
Regards,
Kishore
Thanks a lot & we are now good to present tomorrow.
Regards,
Kishore
-
amyCC
- Site Admin
- Posts: 398
- Joined: Wed Apr 01, 2020 4:02 pm
- Occupation: Moderator
- Project Question: *
- Project Due Date: *
- Project Status: Not applicable
Re: Obstacle-Detecting Walking Stick
We hope things went well!
Amy
Science Buddies
Amy
Science Buddies

