Go Down

Topic: HC-SR04 ultrasonic sensor (Read 525 times) previous topic - next topic

demonic_crow

I'm using the NewPing library. I'm trying to use my ping sensor to control a robot. My problem is that it keep dropping down to 0 which is interfering in my reading. How do I get the reading to stay smooth and steady. Didn't know if there may be a way to add capacitors or something.

wildbill

Can you solve it in software and just ignore zero readings?

demonic_crow

Like getting the average of 5 readings or something. I haven't really done any math with arduino yet. I will have to try to find somewhere to read about it.

demonic_crow

I just shorten down how long I waited in between ping to 20 millisecond and got my reading between 5cm range. Works pretty good. So all the drop out to zero or the large number it spit out every once in a while it will just ignore it.

Go Up