How do you turn off Analog Ultrasonic Sensors?

Our team is using two analog ultrasonic sensors and we are having problems since they interfere with each other. Our team wants to disable them when we don’t need them so that we can run them at different times, but we don’t know how. We are using analog channels for our sensors, and we have tested them both individually and they work fine.

What kind of sensor are you using? What is the part number?

If it’s an LV-MaxSonar-EZ part, I think you can pull the RX pin low in order to inhibit it.

Yes, we figured that out, but we don’t know how to send a signal from the code. Do we use Analog Channels?

There are very few opportunities in FRC to use a Digital Output. This is one of them. Connect the sensor’s RX input to the SIG (signal) pin of one of the DIO ports on the Digital Sidecar. Use the DigitalOutput’s Set() method. If I’m reading the sensor’s datasheet properly, False will turn off the ranging; True will turn it on.

If you read the Maxbotix data sheets, you’ll find there is a pin that can be used to trigger the ultrasonic on a different ping rate. With this pin being used, you can set the ultrasonics up at different ping rates so they don’t interfere with each other nor with other ultrasonics from other bots.

HTH,

Mike