I setup ultrasonic sensor on B+, following instructions given in this video. But each time I test I get a different distance for the same object which hasn't moved, seems like it decreases every time i use it.

In my project I rely heavily on those sensors, I bought 5 of them and need them to stay consistent. Should I buy other kind of sensors or change the script or modify the way i setup the sensors?

  • What happens if you swap out the sensor for one of the others? This will help us diagnose the problem. Also, please edit your question and include the code you are using, and add a picture of the connections. You also say that the reading varies can you give a specific set of readings. Are you using multiple sensors at once, so that they may interfere with one another? – Steve Robillard Mar 15 '15 at 20:15
  • 1
    Ditto re: If you want someone to make the effort to provide you advice, you should make the effort to provide relevant useful information yourself -- few people are going to bother watching a video and committing various details from it to memory just to help you, so unless someone who has the same sensor and has had the same problem and knows a solution just happens to stumble in today, this question is guaranteed to collect dust. – goldilocks Mar 15 '15 at 20:27
  • 2
    Also make sure you are powering them from 5V (with a suitable voltage divider to 3V3 on the echo line). They will function off 3V3 but the readings will be erratic. – joan Mar 15 '15 at 20:29
  • ill edit it tomorrow to include every detail u want, please wait till then and I'll notify u, if u dont want to watch the video, and i'll try the suggestions tomorrow and update the question then – Lynob Mar 15 '15 at 20:39
  • 1
    For interest the difference between 3V3 and 5V power – joan Mar 15 '15 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.