Home        Store        Learn        Blog

Bar30 connected with USB

Hello! We have a Raspbery Pi where most pins are occupied, but we would like to add on a Bar30 pressure sensor to the setup. Could we interface the sensor with the RPi through a I2C Level Converter + BLUART USB to TTL Serial and RS485 Adapter? Similar to how the Ping Sonar Altimeter and Echosounder can be connected to a microcontroller.


Hi Fred,

UART (TTL Serial) and I2C are different communication protocols, and RS-485 is basically UART but at \pm 1.5V instead of the 0-3.3V or 0-5V that UART uses. The “BLUART” converts a TTL Serial or RS485 signal into a USB signal that a computer (like the RPi) can read.

To interface your I2C with the Raspberry Pi via USB instead of one of the sets of I2C pins would require using an I2C to USB converter. These do exist, but I believe you’d need to make the relevant data connection yourself, since the ms5837-python library that we provide expects and tries to create an I2C connection. At minimum you’d need to replace the lines that use self._bus, to write_bytes or read_i2c_block_data, to do appropriate equivalents with your USB connection. I’m unfortunately not sure how to do that, since I haven’t worked with an I2C-USB converter before.

1 Like