Using more then one color sensors per the one I2C port on the Roborio

The KOP comes with an rev robotics color sensor v3 witch runs through the I2C port and I would like to utilize more then one color sensor yet the Roborio only has one I2C port yet I believed my life could still be saved after I found out that the I2C protocal is actually a bus like can according to this article with a lot of ads about back posture. yet when I looked at the example code on the rev web site they don’t specify an address or ID for the color sensor just the built in port
sprivate final I2C.Port i2cPort = I2C.Port.kOnboard;

/**

  • A Rev Color Sensor V3 object is constructed with an I2C port as a
  • parameter. The device will be automatically initialized with default
  • parameters.
    */
    private final ColorSensorV3 m_colorSensor = new ColorSensorV3(i2cPort);

so I am confused please help
thanks have a good day

There have been several discussions about i2C multiplexers, like this one: I2C Mux for multiple Sensors in FRC?

Specifically for REV sensor, the address is not configurable so you need a Multiplexer if you’re using more than one REV sensors. Other I2C sensors have configurable addresses.

As @risho900 mentioned, the address for the Color Sensor V3 is fixed, so only one can exist on a single bus at time.

There is an additional I2C bus on the roboRIO MXP, the 32-pin port in the middle of the roboRIO. There are many breakout boards out there that make it easier to connect to this extra port. Our More Board is an MXP breakout with compatible headers for the 4-Pin JST PH to 4-Pin roboRIO I2C Cable that came in your Kickoff Kit, but any MXP breakout should be relatively simple to adapt.

Using the MXP gives you two I2C buses. If you need more, you’ll have to use an I2C multiplexer like Joe mentioned:

An I2C mux would work well here. Another option would be to use color sensors from different manufacturers on the same I2C bus. For example the Rev sensor uses I2C address 0x52 and the Playing With Fusion sensor uses 0x39. Both should be able to coexist on the same bus

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