Software for the MS5637-02BA03 Barometric Pressure Sensor

#1
Hi gents
I am struggling with this. I have read all the documentation tried the example software which does not seem to scratch the surface. I only need the pressure
I don,t need it converted to any units just the raw data will do. I understand the pressure comes in 3 bytes which is located some where in the 112 byte memory.
If anyone could help I would be in your debt. I have a 14M2 picaxe and have never used the i2c bus before.
Cheers AC
 

AllyCat

Senior Member
#4
Hi,
I only need the pressure ... just the raw data will do.
So how do you want to use the data; just for detecting changes is altitude? Remember that atmospheric pressure can change enormously over a period of a few hours or days. Or a "barometer" will need the raw data to be calibrated. I note the chip is SMD with a maximum supply of 3.6 volts, which I assume you are accommodating with a breakout board and suitable PICaxe supply rail?

The thread on the GY63... doesn't seem to include a link to its data sheet so I can't say how similar it is to your MS5637, but the data sheet (thanks to hippy) suggests that the absolute minimum required to read some (pressure) values from the chip might be:

The I2C Slave address is: $EC . First, you need to send a Reset Command ($1E) and then a "Convert D1" (pressure) command. This contains an "oversampling" (sensitivity) value, so start somewhere in the middle with perhaps $44 . Then read the ADC value as three bytes, High Byte First (PICaxe normally uses Low Byte First) with an "ADC Read" at command address $00. Thus, try the following (which is entirely untested and unvalidated) :
Code:
#picaxe 14m2
#terminal 4800
hi2csetup  i2cmaster , $EC , i2cslow , i2cbyte
hi2cout ($1E)
pause 10                             ; or as required
do
    hi2cout ($44)
    pause 10                           ; or as required
    hi2cin 0 , ( b4 , b3 , b2 )     ; Might need to omit the 0,
    sertxd ( cr , lf , "Hi:Lo= " , #b4," : " , #w1)
    pause 1000
loop
Cheers, Alan.
 
Top