Rev 2m distance Sensor reads -1

We are using a Rev 2m distance sensor via the 12c port. The sensor reads correctly sometimes, but sometimes it reads -1 unless something is at a really close distance. This seems to happen when the battery is super low, but sometimes it happens when the battery is full.

We’ve tried multiple sensors and cables to make sure it wasn’t the sensor itself.

Is it possible the sensor is underpowered? Its says it needs 3.3v - 5v and the I2C says it provides 3.5v i believe.

Any help on this matter would be greatly appreciated!

I do not know if this is the case, but there are some devices that might return a certain value by default. Not sure what it is for I2C though. It could be that the device is missing/not found.

1 Like

Are you saying it correctly gives short distances? How short? Make sure you haven’t wired it for the FTC pinouts. The roboRIO is different.

I’m using the 4pin JST to 4pin I2C cable from rev 4-pin JST PH to 4-pin roboRIO I2C Cable - REV Robotics

It works most of the time, but periodically it will only read within a few inches. Sometimes not at all. The value it gives when it isn’t working is -1.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.