ms 5607 can't get correct altitude and pressure

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:

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

Intersema::BaroPressure_MS5607B baro(true);

void setup() { 
    Serial.begin(9600);
    baro.init();
}

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

The IntersemaBaro.h is too big to post but here it is : Google Code Archive - Long-term storage for Google Code Project Hosting.

The results:

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 : Find the Elevation on a Map I am on approx 120 feet higher than sea level.

I tried changing the int to long as suggested here : Arduino Forum 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.

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 :

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.

Jürgen

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.