Code for HP03 Barometric Pressure Sensor

Hi,

I have a HP03 presuure sensor and try to get some form of reading from it. There have been a couple of posts on the forum in 2009 and 2010 with code attached and/or discussed, but none of these seem to run on my scenario:
Arduino 0022 and the Mega 2560 platform.
I wonder if someone can point me towards some code that will work in my case?
My further intentions are to get it modified to an altimeter

Thanks in anticipation Klaus

Hi Klaus,

Can you post your non working code and explain why "none of these seem to run on my scenario"

What is your scenario?
What do you try to accomplish?
What doesn't work?
does it not compile?
does it not execute?
does it not execute as expected?
what did you expect?

Can you post the links to the code you tried allready?

I know that are many questions, but help is only possible if the problem is understood well enough and your post has not enough details, sorry.

Oh yes, a link to the datasheet of the HP03 pressure sensor would be nice too,

Rob

Hi Rob,

Thanks for the fast reply. I try to answer your questions:
Please find a schematic attached to explain the set-up. The Arduino is a Meg2560.

What I try to accomplish is, at this stage,to get a valid pressure reading from the HP03 to the Serial Monitor.
Further-on I want to build a 'contraption' similar to the altimeter of an aircraft. It would allow to enter QNH (current atmospheric pressure at sea level) and return my current altitude. Or in reverse, for entering my current known altitude it would return the current QNH.

Once I get the pressure reading from the sensor, I should be fine, taking my project further in small steps.

I am using code provided by mem (London) on the old forum thread 'i2c Pressure Sensor' dated 12/10/2008.
I have copied and saved the files HP03.pde, HP03.h, and HP03.cpp directly from there. Other libraries like wire.h and FrequencyTimer2.h are from the Arduino web site. All are in the approprate folders.

When I try to compile HP03.pde, I get the following error messages, which I don't know how to 'handle':

In file included from C:\Program Files\arduino-0022\hardware\arduino\cores\arduino/WProgram.h:6,
from HP03.cpp:10:
c:/program files/arduino-0022/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
c:/program files/arduino-0022/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected )' before 'double' c:/program files/arduino-0022/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected )' before 'double'

I hope this will give you an idea of my project. Any hint on how to conti ue would be warmly appreciated.

Best regards Klaus

HP03 schematic001a.jpg

Can you provide the links to 'i2c Pressure Sensor' from 2008 etc?
I don't have time to completely reconstruct your project...

Please find attached the files I was using. More in the following message.

HP03.pde (2.04 KB)

HP03.cpp (8.86 KB)

HP03.h (1.71 KB)

FrequencyTimer2.h (1.34 KB)

.. more files and this is the link to the HP03 data sheet:

FrequencyTimer2.cpp (3.85 KB)

Wire.h (1.95 KB)

Wire.cpp (6.49 KB)