Planning the I2C Address Space for Sensors



As the day gets closer to when I'll be able to start wiring sensors onto my OpenROV, I decided it was time to start taking a look at the I2C address space for the Arduino on the OpenROV cape, and make sure there were no conflicts.

Here's a snapshot of the spreadsheet I put together, tracking the devices I want to put on my ROV:

So there are a couple of things that can be noticed immediately, before I get deeply into wiring sensors.

Most of the sensors can use either a 3.3V or a 5V I2C bus (the Cape is currently set up with a 5V I2C bus on the Arduino). If we end up going with the Measurement Specialties MS5803 pressure (depth) sensor, this part will not work at 5V.

Real-time clock boards based on the DS1307 will not run at 3.3V. In addition, the Sparkfun version of this seems to have a reputation of keeping poor time. I'm going to try the clock board made by Gravitech, which is a bit more expensive but can run at either 3.3 or 5V.

The ST L3GD20 gyro chip that is used on some of Pololu's sensor boards has a possible address conflict with the real-time clock boards. The gyro board will need to be set up with the sensor using 0xD2,D3 for its address space.

Note that I'm sketching out having an auxiliary A/D board, so that I can have a lot more current/voltage diagnostics than what's currently on the Cape.



I would add some GPIO chips aswell, these can also be used to expand with more servos, transistors for driving solenoids, relays etc: SX1509 Adress 0x3E, 3F, 70 & 71 it looks to need 3.3V vcc, but the inputs handle 5V. PCF8575 adress: 0x20 to 27. designed for 5V operation only

pressure sensors: i think though these are expensive for the hobbyist. a 100Bar version cost around 150usd. but it maybe cheaper for a lower rating.

hows the price on the meas spec sensors?


Hi Thomas:

Yes, you're right, we should probably reserve some space for GPIO since the Arduino is about out of it.

Digi-Key sells the Measurement Specialties MS5541, which is an SPI version of the pressure sensor, for $24 in small quantities. I haven't found a vendor yet for the I2C version.

Is the SPI bus on the Cape even usable? When I look at the schematic it seems to share pins with the servo outputs.

I think in the long-term we're going to need to migrate to an Arduino Mega to get a clean interface to a decent amount of I/O.



I think you are right, the spi is not directly usable because of the starboard esc.

isnt this the sensor you have specified?

I agree that a mega would probably be easier to work with for the common "tinkerers" than gpio circuits. its a pitty that they dont make the 2560 in a compact version that could be plugged into a cape the same way we do with the 328p mcu. an alternative would be the 644, they come in dip package. or to see if the BB would "mate" with a mega board with some kind of interface board in between.

or have two 328 mcu's and differentiate them. one for tinkering and one dedicated to control of the rov. say one in QFP and one in the classical DIP.


Hi Thomas:

Yes, that's the one. The last time I looked no distributor carried it. Now it looks like Mouser is listing it, but it's not in stock yet. I think the issue is just that this is a brand new part, and it takes a while to get into the distribution chain.

At some point I'm going to contact Measurement specialties to ask them:

1.) When are distributors going to have production quantities?

2.) Can we get a couple samples for testing?

3.) Can we talk to an application engineer for advice on how to mount this thing so that exposure to salt water does not affect the gel capsule?

It would be nice if someone with an OpenROV e-mail address contacts them, but I don't have this yet so I've kind of been putting it off.



i havent been aware that these sensors had i2c interface, i saw them with spi earlier trough a project at work.

I could ask them these questions(1 & 3) trough work, its benefitial for my own uses aswell.


I talked to one of the norwegian agents for meas-spec today.

they didnt discard the use of this sensor in saltwater. they misunderstood my inquiry at first, so ill get a better answer probably tomorrow.

they said that the most common usage for their customers, where to keep the sensors inside pressure compensated hulls, and then measure the pressure trough the compensation system. this way you dont expose the sensor directly to the medium, but still keep quite a good functionality.

the delivery time for them was normally 8-12weeks dependent of the specific sensor(i asked them about 14 and 30bar versions)

price was also dependent on volume and type.


I know this is an old post, but it would have been nice to notice that from the DS1307 datasheet says:

The slave address byte contains the 7-bit DS1307 address, which is 1101000

which is 0x68. The DS1304 is the same as is the DS3231.

The MPU9150 which I guess was a later addition to the OpenROV project has an address of either 0x68 or 0x69. Unfortunately my soldering skills aren't up to pulling the AD0 pin high.

I'm at a loss as to how I can use the IMU/depth module with a RTC.


Hi Ryan:

The address picked for the MPU9150 was 0x69, for exactly the reason you stated- we want to be able include an RTC on the vehicle.

I've got more comments in your "Three requests" forum post.



Hello Walt!

It seems you know a lot of this matter so I would like to ask you a couple of questions.

I want to connect an arduino to the I2C bus but I don't know how to do it as an arduino must be connected to 7V. I don't know if I should separate the power of this arduino from the bus or doing some other thing. Any advice will help.



Hi Javier:

You need to power the arduino independently from some power source, and then, since the arduino uses 5V for its I2C interface, you just hook it to the 5V I2C interface that is on the prototyping headers on the controller board. Download the schematic for the controller board off of GitHub and you will see that the I2C bus has connections for both 3.3V and 5V devices.

If you are connecting your device to the I2C bus that is run outside of the ROV, that is at 3.3V, and you will need to get a level shifter ( I think both Sparkfun and Adafruit sell them) to convert the Arduino 5V I2C bus to 3.3V.



Thank you a lot, I thought that since arduino uno has a 3.3V header I would be able to connect it without using a level shifter, but I don't know much about electronics.

I want to connect it to the I2C that is outside the rov after the Depth sensor, so I suposse I would have to use a level shifter after it, isn't it?

Do you mean this one:


Yes, that Sparkfun level shifter should work. Alternatively, you could use an Arduino clone that runs off of 3.3V, rather than 5V. I know they exist, but I don't know of any specific models. By using a 3.3V Arduino clone, you could use the existing 3.3V power line that extends outside the ROV.



Hi All,

Im trying to connect to multiple i2c device to my rov.
Now i have 2 sensors that and .

When i try connect both of them to arduino mega i2c pins , cockpit always shows me your openrov imu/depth sensor but there is no effect from bluerobotics’ sensor. My purpose, using your sensor in my pressure box and bluerobotics’ sensor in water. Im using 30.0.3 release.

Im waiting for your advices.
Thank you.


The OpenROV IMU/Depth module and the BlueRobotics depth sensor both use the MS5837 pressure sensor, which does not have an I2C address select pin- it operates at a fixed address, and therefore only one of them can be used on the I2C bus at a time.

To put multiple pressure sensors on the I2C bus, you’re going to have to find one that uses a different I2C address.

If you just want the IMU chip inside the pressure vessel (without the pressure sensor), I would recommend desoldering the MS5837 off of the IMU/Depth Module. This will allow the BlueRobotics sensor to operate as it should.



Thanks for your quick response. I desoldered the MS5837 module, it solved the problem.

Have a nice day.