Ultrasonic sensor on rover

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!

Any tips?

I think electrical noise from the motors are being "picked up" by the ultrasonic sensor board and/or the processor board.

Are the wires for the motor and the sensor close to each other?

Not sure how to determine if the sensor or processor boards are the entry point....have to stay with dressing the wires and maybe some filtering.

What else is connected to the processor board?

Hi, yes they were close to each other, i'm using a sensor shield as well so i'm having a bit of trouble figuring out which pins to use.

I've got a motor driver board connected to the shield as well.

Without seeing your setup its hard to give specific recommendations. I'm not a shield type of guy so my sensors and motor controllers can be physically separated.

One thing you should investigate (report?) is how your boards are connected to power. Connecting the motor controller and the ultrasonic sensor using grounds that are in series is not a good idea.

What shields are you using?

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.

Thank yo so much for the help! i will try that this week :))