[SOLVED] Ultrasonsic Sensor Issue - us_dist() gives erroneous data

I would like to start by commending you on this product, it works great. Currently I am having the following issue. If I reinstall the Raspbian for Robots and test the call us_dist(15) it works perfectly. However if I restart pi, the function call us_dist(15) always returns 674- 678! This is very frustrating.

This started happening after I updated the GoPiGo api to latest version on https://github.com/DexterInd/GoPiGo. During the first installation the installer complained about not finding the Firmware folder. So I cloned the git repo and tried the installation again, which worked fine. Then I started having the issue described above. Even if I reinstall raspbian for robots, the senor fails to work properly if the pi is rebooted.

I am part of the planning committee for an IT camp for kids which is supposed to start within 2 weeks and would greatly appreciate your assistance.

Hi @KrisManohar,

I’m confirming you here that I’ve followed your indications and that the Grove Ultrasonic sensor worked as expected, even after I’ve updated the GoPiGo with the latest software.


Just to be sure, can you do the following things (again):

  1. Burn the latest Raspbian For Robots image to your micro SD Card.

  2. Update the GoPiGo with the following command :
    sudo curl https://raw.githubusercontent.com/DexterInd/Raspbian_For_Robots/master/upd_script/fetch_gopigo.sh | bash

  3. Check the Grove Ultrasonic sensor again and tell us if there’s a change.

I’m asking you to do this again, because I saw you’ve encountered a couple of issues when you’ve tried to install the GoPiGo (as a consequence of not finding the Firmware folder).

Before we come to a conclusion, I think it’s best to narrow down the list of possible causes as much as possible - this is my reason for asking you do try it again.


I’ll be here if there are any more questions and we’ll try to solve the issue before your IT Camp starts in less than 2 weeks.


Thank you!

Hey Thanks for the reply. I will try. I tried the sensor on the digital port A1 and calls to us_dist(10) work fine. However calls on the analog port, us_dist(15) are erroneous. Should i still proceed with the instructions you outlined?

Hey Robert

I followed the instructions, did not work. See here for the cmd log https://pastebin.com/V60XCAQn
I also tried loading firmware version 15, but same issue. Only now instead of 678, I am getting 517.
Is there anyway we can know 100% that it is a bad sensor? We only got this sensor a few weeks ago, does it go bad that fast?

Hi @KrisManohar,

That seems like it is a faulty ultrasonic sensor.

I’ve given you a reply on this post.
Please check it out and follow the suggestions found there.

Is there anything else you might want to add to this thread or can we close it now?

Thank you!