Bar30 Pressure Sensor Documentation


The Bar30 is a high resolution, water proof pressure and temperature sensor that comes in a Blue Robotics penetrator which provides a waterproof, high-pressure seal for your enclosure.

Quick Start

  1. Download MS5837 Arduino Library.
  2. Install software such as the Example Code to your microcontroller.
  3. Connect the DF13 or bare wires to the appropriate microcontroller pins, using a logic level converter if your board has 5V logic:
    • Green: SCL (3.3V logic)
    • White: SDA (3.3V logic)
    • Red: +2.5-5.5V
    • Black: Ground



The EagleCAD files for the schematic and board are available on our GitHub page.

Bar30 Schematic.png

Specification Table

For further information please see the MS5837-30BA Data Sheet.

Item Condition Value
Supply Voltage 2.5-5.5 volts
I2C Logic Voltage (SDA and SCL) 2.5 - 3.6 volts
Peak Current 1.25 mA
Item Condition Value
Maximum Mechanical Pressure 50 bar
Operating Pressure 0-30 bar [up to 1000 ft (300 m) in water]
Absolute Accuracy (0-40°C) From 0-6 bar +/- 50 mbar (51 cm in freshwater)
  From 0-20 bar +/- 100 mbar (102 cm in freshwater)
  From 0-30 bar +/- 200 mbar (204 cm in freshwater)
Absolute Accuracy (-25-85°C) From 0-6 bar +/- 100 mbar (102 cm in freshwater)
  From 0-20 bar +/- 200 mbar (204 cm in freshwater)
  From 0-30 bar +/- 400 mbar (408 cm in freshwater)
Item Condition Value
Operating Temperature -20 to +85°C
Storage Temperature -40 to +85°C
Absolute Accuracy From 0-10 bar at 0-60°C +/- 1.5°C
  From 0-30 bar at -20-85°C +/- 4.0°C
Wire Colors Green - I2C Clock (SCL, 3.3V)  
  White - I2C Data (SDA, 3.3V)  
  Red - Positive (2.5-5.5V)  
  Black - Ground  
Overall Length 37 mm  
Thread Size M10x1.5 20 mm threaded  
Recommended Through Hole Size 10-11 mm  
Wrench Flats 16 mm  

DF13 Pinout

1 Δ Red - Positive (3.3-5.5V)
2 Green - I2C Clock (SCL)
3 White - I2C Data (SDA)
4 Black - Ground

Mating Connector: Hirose 4-pos DF13 on Digi-Key

2D Drawing

3D Model

All 3D models are provided in zip archives containing the follow file types:

  • SolidWorks Part (.sldprt)
  • IGES (.igs)
  • STEP (.step)
  • STL (.stl)
Bar 30 Pressure Sensor    
Bar30 Pressure Sensor  
Bar30 Penetrator Nut  


Step 1: Lubricating the O-ring

Use a small amount of silicone grease on the O-ring for lubrication and place it in the groove of the Bar30 Pressure Sensor.

Step 2: Installation

Install the Bar30 Pressure Sensor into an endcap and tighten by hand or with a wrench.

Example Code


This example uses the BlueRobotics MS5837 Library with the connected sensor. The example reads the sensor and prints the resulting values to the serial terminal.

Please remember to use a logic level converter, such as this one, to convert Arduino 5V levels to 3.3V!

If you’ve never used Arduino before, we suggest checking out some tutorials!

#include <Wire.h>
#include "MS5837.h"

MS5837 sensor;

void setup() {

  sensor.setFluidDensity(997); // kg/m^3 (997 freshwater, 1029 for seawater)

void loop() {;

  Serial.print("Pressure: "); 
  Serial.println(" mbar");
  Serial.print("Temperature: "); 
  Serial.println(" deg C");
  Serial.print("Depth: "); 
  Serial.println(" m");
  Serial.print("Altitude: "); 
  Serial.println(" m above mean sea level");



This example uses the BlueRobotics MS5837 Python Library with the sensor connected to a Raspberry Pi. The Raspberry Pi uses 3.3V logic levels on the I2C pins, so a logic level shifter is not required.

import ms5837
import time

sensor = ms5837.MS5837_30BA() # Default I2C bus is 1 (Raspberry Pi 3)

# We must initialize the sensor before reading it
if not sensor.init():
        print "Sensor could not be initialized"

# Print readings
while True:
                print("P: %0.1f mbar  %0.3f psi\tT: %0.2f C  %0.2f F") % (
                sensor.pressure(), # Default is mbar (no arguments)
                sensor.pressure(ms5837.UNITS_psi), # Request psi
                sensor.temperature(), # Default is degrees C (no arguments)
                sensor.temperature(ms5837.UNITS_Farenheit)) # Request Farenheit
                print "Sensor read failed!"