Close

Create a diving computer using MS5803–01BA Pressure Sensor

varul-jainvarul jain wrote 03/11/2019 at 11:20 • 3 min read • Like

Now we can check out the depth of the sea level by using the Pressure Sensor(MS5803–01 BA) connected with Arduino and display the sensor data in Node-Red Dashboard

In this blogtut, we will find out the best way to find out the depth of sea level as well as test out the pressure using MS5803–01BA sensor the sensor is easy to connect with ESP32, Xbee, and many other Communication devices.

Hardware

MS5803–01 BA Pressure Sensor

Arduino Uno

Arduino Sheild

Software Platforms

Node-Red

Arduino IDE

About Pressure Sensor

The ROHS compliant MS5803–01BA pressure sensor shares the precise parameters of operational pressure range from 1kPa to 130kPa and which uses the high resolution of about 10cm. We can receive the 24bits precise variation using MS5803–01BA sensor

Application of Pressure Sensor

Being a newbie to this sensor we have figure out the way to receive the sensor data by using the modular I2C breakout board. We were able to find out the pressure as well as temperature and with the help of the earlier blogtut we will be able to find out the distance between the object and the earth using specified formulae and process called as Altitude measurement

But being good robust designs and for underwater process system, we recommend to use this sensor to find out the depth of sea from earth surface to the core easily. These sensors can majorly be used in submarines for various other application to monitor as well as controlling the actuators. With the help of various communication devices, you will be able to operate the sensor data at longer miles also.

I2C Code

#include <Wire.h>
#define Addr 0x77
void setup(){  // Initialise I2C communication as MASTER  Wire.begin();  // Initialise Serial Communication, set baud rate = 9600  Serial.begin(9600);
if(Wire.available() == 3)  {     data[0] = Wire.read();     data[1] = Wire.read();     data[2] = Wire.read();  }
unsigned long ptemp = ((data[0] * 65536.0) + (data[1] * 256.0) + data[2]);
unsigned long dT = temp - ((Coff[4] * 256));
temp = 2000 + (dT * (Coff[5] / pow(2, 23)));
// Offset and Sensitivity calculation
unsigned long long off = Coff[1] * 65536 + (Coff[3] * dT) / 128;    unsigned long long sens = Coff[0] * 32768 + (Coff[2] * dT) / 256;
// Convert the final data  ptemp = (((ptemp * sens) / 2097152) - off);
ptemp /= 32768.0;
float pressure = ptemp / 100.0;
float ctemp = temp / 100.0;
float fTemp = ctemp * 1.8 + 32.0;
// Output data to serial monitor  Serial.print("Temperature in Celsius : ");  Serial.print(ctemp);  Serial.println(" C");  Serial.print("Temperature in Fahrenheit : ");  Serial.print(fTemp);  Serial.println(" F");  Serial.print("Pressure : ");  Serial.print(pressure);  Serial.println(" mbar");   delay(500);

Node-Red

With the help of node -red you will be able to display the sensor data in dashboard format which is already been mentioned in previous blogtuts.

The newbies can check out the tutorial for Node-Red installation here.

Code

https://github.com/varul29/Node-Red_Tutorial

https://github.com/varul29/MS5803-01BA/blob/master/Arduino/MS5803_01BA.ino

Credits


Like

Discussions