Does anyone else have issues with their sonar sensors fluctuating to read 255? The sensors work and they do provide distance values as I move an object in front of them, but every few seconds the readings jump to 255. It does this on my hc-sr04 sensors and Parallax PING sensors. Is this normal?
I'm not using the radar scan. I'm using either the distance or the collision avoidance controls with the sensor and not both at the same time.
Upgrade to ARC Pro
Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.
I believe it may be down to one or more of a few things;
1. Sonar sensors struggle to detect some materials. Sound absorbing materials are no good in this case.
2. Lost echoes and ghost echoes...
3. I read somewhere that the voltage supplying the sensor needs to be dead on for it to work correctly.
4. Poor quality wires - there are reports of some people using cheap Chinese cables to wire these and having problems, re-wiring with better quality solved the problem.
This is why I use IR and Ping. IR has it's pros and cons too but combine both and overall it's the best of both worlds.
I do use the hcsr04 myself though because I can buy 5 sets and two are pretty good while the others are off.
There are intelligent ways to wait a few milliseconds between pings , pause then trigger and read echo. Once that first echo is read it waits a few milliseconds before triggering another ping.
Rich is absolutely right about the echo issue in a corner or on a edge. A SHARP I distance module uses angle of light transmission and receive angle to measure the distance. It's the most accurate but doesn't work against black very well or outdoors. Using a sharp module directly above the ultrasonic ping gives the best of both worlds. You can have script average the readings between the two I believe for better accuracy. That's something I have seen other hobbiest play with. Ezb combined with a pc has plenty of power to make the basic calculations.quickly.