top of page

Sensor detection part 2

To solve the erratic readings problem, I have added a timeout parameter in the sensor calibration code as shown below.

By adding the 17000 μs timeout parameter, I managed to restrict the sensor distance range up to 290 cm, anything further than that will give me a preset value of 999 cm, thus indicating a data error by showing the preset data in the serial monitor. This has helped in mitigating the erratic readings problem I faced earlier and the results are shown as below.


About Me.

I'm a paragraph. Click here to add your own text and edit me. I’m a great place for you to tell a story and let your users know a little more about you.

  • Black Facebook Icon
  • Black Instagram Icon
  • Black Twitter Icon
Never Miss a Post!
bottom of page