Go Down

Topic: ms 5607 can't get correct altitude and pressure (Read 1 time) previous topic - next topic

Apr 13, 2013, 02:15 am Last Edit: Apr 13, 2013, 02:19 am by JeanCoutu Reason: 1
 Hi everyone, I am currently using an Arduino Uno with a ms5607 breakout board to read altitude and pressure values, however, I can't figure out why the sensor sends me garbage data(I assume it is anyway). I tried some codes I found and they give me weird readings.

I connected my Arduino to my ms5607 like so:
 gnd to gnd
 vin to 5v
 ps to 5v
 scl to A5
 sda to A4

The code I am using:
Code: [Select]

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

Intersema::BaroPressure_MS5607B baro(true);

void setup() {

void loop() {
 int alt = baro.getHeightCentiMeters();
 Serial.print("Centimeters: ");
 Serial.print(", Feet: ");
 Serial.println((float)(alt) / 30.48);
 int temp = baro.getTemperature();
 Serial.print("Temperature: ");

The IntersemaBaro.h is too big to post but here it is : http://code.google.com/p/marauders-map-gps/source/browse/trunk/arduino/trunk/IntersemaBaro.h?spec=svn24&r=24

The results:
Code: [Select]

Centimeters: -16656.00, Feet: -546.46
Temperature: 69
Centimeters: -16689.00, Feet: -547.54
Temperature: 69

I tried several variations of this same code and other programs altogether but this one sums up what I want(temperature is not necessary but is a nice +).
I know that the altitude is off since on : http://www.daftlogic.com/sandbox-google-maps-find-altitude.htm I am on approx 120 feet higher than sea level.

I tried changing the int to long as suggested here : http://arduino.cc/forum/index.php?topic=104247.0 to no success.

Any help would be appreciated!

Link to ms5607Breakout board : http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/altimeter/List/0/SortField/4/ProductID/780/Default.aspx
Other info are found on the same link.


Generic steps:

Check your device is actually communicating using I2C.    Run the I2C scanner sketch and see if it responds.

Check your device is actually initialized properly.

I am not familiar with your particular device,  but all these barometric devices work similarly.   They return
some numbers from their actual measurement device,   which then get processed using some formulas and
some constants embedded in the device.   You need to check this process,  step by step.

I've had several similar devices fail,  and generate rubbish like what you have.  They don't seem to be
very reliable.

Apr 13, 2013, 05:02 pm Last Edit: Apr 13, 2013, 05:06 pm by JeanCoutu Reason: 1
I checked and it is communicating using I2C, I ran both the I2C scanner(device on 0x76) and my sketch without the 5v and it shows different value which lead me to think it is not broken. Also, the results are different from day to day, today I get :
Code: [Select]
Centimeters: -15092.00, Feet: -495.14
Temperature: 65
Centimeters: -15125.00, Feet: -496.23
Temperature: 65
Centimeters: -15125.00, Feet: -496.23
Temperature: 65

I have no idea how to check if it initialized properly, but I don't get any errors messages.

Thanks for the reply.

Checking step by step right now.


Hello JeanCoutu,

this sensor require a voltage between 1,8 to 3,6 volts, not 5 Volt you have connectet!

Connect your MS 5607 to 3,3 volt and if you got good readings, then you have luck.

Read the datasheet bevor you work.


From datasheet(breakout board not ms5607): Power requirements: 3.3 to 6.5 VDC

I did try to change 5V for the 3.3V but it gives the same results.


I think I just solved this 10 minutes ago on my end using the info here:

long alt = baro.getHeightCentiMeters();   // <<<<<< CHANGED

I don't know if the results are accurate, I'm looking into that now. The links here http://www.parallax.com/tabid/768/productid/780/default.aspx have helped me tremendously.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131