I am a 14 year old and it is the first time for me on the arduino forum
I am new to arduino and got a HC-SR04 for a school project.
it worked fine and showed the correct distance on an I2c 16*2 display , but the second time i tested it , it showed the distance as 4cm or 5cm even if there was nothing kept in front of it.
The correct distance is shown when the object is closer than 5 cm(approx).
Please help me out
Sujan
Arduino library - enjoyneering/HCSR04
Features:
- Read distance from 4cm to 250mm**
- Compensate speed of sound according to the ambient temperature
- Pass distance thought median filter
- Set maximum distance to speed up measurement
**Library returns 38000 if OUT OF RANGE
Sujan17:
Please help me out.
Spares, and spare parts can sometimes save a lot of time. Sometimes. If for some reason your sensor module has failed (hardware issue developed, which can actually happen), then using another module of the same kind can often tell you whether or not you had a hardware failure. Sometimes, even the replacement module might be faulty, so a third spare module could also be tested.
It could be that your original sensor has no problem, and something has simply changed with your circuit (wiring issue, something was moved/altered), or your code was altered. It all depends on what changed since the last time it 'worked'.
Advising on other libraries does not make sense (to me) if the original worked and now stopped working.