Hi, i'm trying to get my ultrasonic sensor working on a rover, when i set it up on its own (not on the rover) its working just fine, but when i wire the rover motors and the sensor, the sensor either reads 0, or a crazy high (and inaccurate) number!
This is what everything looks like with batteries underneath. Im using the Sensor Shieldv5.0, but i'm more than willing to ditch the sensor if its going to make things easier! I think the sensor and motor controller are in series, how should i fix this?
In such cases its best to use a "star" ground technique.
Simply put connect the Motor controller ground at the battery negative. Then connect your processor and shield grounds to the physically same point.
You might also try temporarily moving the ultraSonic sensor to the other side of the vehicle. See if the ultrasonic sensor provides more stable values.
When I use this sensor I usually take readings in groups of 9 readings. Sort them and use the middle reading. Or sort them and average the middle 3 readings. This eliminates the readings that are a result of no reflected signal.