Pages: [1]   Go Down
Author Topic: HC-SR04 ultrasonic sensor  (Read 464 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 67
Posts: 3694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 74
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: