Basically I’m using “MS5837-30BA” (https://bluerobotics.com/store/sensors-sonars-cameras/sensors/bar30-sensor-r1/) this sensor. While debugging I observed the following values,
Temp = 106.76(varies)
Pre = 1021
I’m gerrting incorrect temp data. I just want to know whether I’m using correct commands or not?
Also is there C Library available for this sensor if yes then please let me know.
#define reset_cmd 0x1E
#define BLRBTCS_PR_SENSE 0x00 //DEVICE ROUTINE SELECTION ID FOR PRESSURE SENSOR.
#define BLRBTCS_TEMP_SENSE 0x01 //DEVICE ROUTINE SELECTION ID FOR TEMPERATURE SENSOR.
#define RESET 0x02
#define PR_SENSE_I2C_ID 0xEC
#define TEMP_SENSE_I2C_ID 0xEC
#define BR_PRSENSE_RESET 0x1E //RESET PRESSURE SENSOR.
#define BR_PRSENSE_PROM_FD 0XA0
#define BR_PRSENSE_PROM_C1 0xA2
#define BR_PRSENSE_PROM_C2 0xA4
#define BR_PRSENSE_PROM_C3 0xA6
#define BR_PRSENSE_PROM_C4 0xA8
#define BR_PRSENSE_PROM_C5 0xAA
#define BR_PRSENSE_PROM_C6 0xAC
#define BR_PRSENSE_STACONV_P 0x48 //START ADC CONVERSION FOR PRESSURE CHANNEL.
#define BR_PRSENSE_STACONV_T 0x58 //START ADC CONVERSION FOR TEMPERATURE CHANNEL.
#define BR_PRSENSE_ADCREAD 0x00 //READ ADC.
#define BR_TMPSENSE_RESET 0x1E //RESET TEMPERATURE SENSOR.
#define BR_TMPSENSE_PROM_K4 0XA2
#define BR_TMPSENSE_PROM_K3 0XA4
#define BR_TMPSENSE_PROM_K2 0XA6
#define BR_TMPSENSE_PROM_K1 0XA8
#define BR_TMPSENSE_PROM_K0 0XAA
#define BR_TMPSENSE_STACONV 0x48 //START ADC CONVERSION.
#define BR_TMPSENSE_ADCREAD 0x00 //READ ADC.
Regards
Omkar