Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Distance Sensor HC-SR04: Incorrect measurement

Distance Sensor HC-SR04: Incorrect measurement

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 3 Posters 716 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sunnyboy69
    wrote on last edited by
    #1

    I experimented with several HC-SR04 using a very simple scetch with Arduino 1.8.5, reading the measurements on the serial monitor. For a static setup I fastened the HC-SR04 in a vice and had it point against a white wall, inside a dust free room. No matter which distance between the wall and the sensor adjusted, the readings kept on being more or less constant BUT all of a sudden for a few readings the values decreased to almost zero and then continued with the expected measurement.
    Does anybody have an explaination for this phenomena?
    Thanks for your assistance in advance.

    zboblamontZ 1 Reply Last reply
    0
    • bjacobseB Offline
      bjacobseB Offline
      bjacobse
      wrote on last edited by
      #2

      I have had similar issue and to bypass this, I did 3 last measurements needed to be equal, before the result was accepted.
      Off cause this requires that your moving target was not too quick, which mine wasn't

      1 Reply Last reply
      0
      • S sunnyboy69

        I experimented with several HC-SR04 using a very simple scetch with Arduino 1.8.5, reading the measurements on the serial monitor. For a static setup I fastened the HC-SR04 in a vice and had it point against a white wall, inside a dust free room. No matter which distance between the wall and the sensor adjusted, the readings kept on being more or less constant BUT all of a sudden for a few readings the values decreased to almost zero and then continued with the expected measurement.
        Does anybody have an explaination for this phenomena?
        Thanks for your assistance in advance.

        zboblamontZ Offline
        zboblamontZ Offline
        zboblamont
        wrote on last edited by
        #3

        @sunnyboy69 Getting false readings can be anything as it depends if it is a serial read from the device or simple timing of the echo, unstable voltage, or even an object caught in the path of quite a wide cone, but without further details it is impossible to identify. I've been caught before with a serial reading device, took a while before I realised....
        An extension of what @bjacobse suggested is to repeat readings until you get two identical consecutive results which are <> known limits and not cuckoo results..

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        20

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular