BMP085 calibration data

ac246

New Member
Hi, I have been searching for days for all sorts of code and have desided that I will still use a picaxe for my data logger but all the calculations will be done after the data logger mission on Excel,

I am making a data logger which will be put into an abandoned mine to log the temperature, humidity, oxygen level, and barometric pressure. I will leave it there for a couple of weeks taking readings at set intervals.

The problem I am having is with the calibration data.

The values are not always the same, and some of them are showing as 65535. And 32768.

I understand about some of them are signed, and need converting to their twos compliment. The readings I am getting are shown below and I am using the code I found on the forum to read the values. But they keep changing. Is this normal?
I am using the format hi2cin $AA,(b3,b2) : sertxd("AA=",#w1,cr,lf) through to BE.

Also do I need to read these values or can I store them through my coding as variables. As I'm not going to be using them except on Excel.
Any help would be appreciated.

Results
AA 5578
AC 65535
AE 51083
BO 31339
B2 24741
B4 17428
B6 5498
B8 46
BA 32768
BC 54461
BE 65535
UT 32768
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

65535 and 32768 are in hexadecimal $FFFF and $8000 which may be significant as these are likely not simply 'random results'.

It would be a help if you could post your full code as that will make it easier to understand what you are doing and the results you report.

Get the raw data readings correct first, then consider how they can be logged and later passed on to a PC and used in Excel.
 

ac246

New Member
Hi,
Thanks for the reply, The code i am using is pretty much un changed from another page on the forum here, i have my main program but this is just running in a new program first just to test out the BMP085 first before i impliment it. The BMP085 code is below. i have just ran the code again and the results this time are different again. B2 has changed from 65535 to 24741, B6 has changed from 5498 to 65535. and UT is still 32768. and just ran it again and UT has changed to 25028. and now back to 32768.

i dont understand why they keep changing if the results are just stored in EEPROM within the BMPO085 chip. I am just going to Log the UT and UP readings within my data logger. of which i am using 4 24LC1025 chips which i am currently figuring out pretty well. (i know they are huge but i already had them) I understand the chip is split into 2 x 512's but so far i have only managed to write upto i think it was address 64000 and something on each chip before it produced an error. but this will be more than enough locations anyway. so i wont need the other half. but anyways, i have posted the BMP085 code below.
Thanks.

------------------------------------------------------------
Code:
hi2csetup i2cmaster, %11101110, i2cslow_8, i2cbyte  ; set up bmp085 i2c device
pause 2000

#terminal 9600
hi2cin $AA,(b3,b2) : sertxd("AA=",#w1,cr,lf)
hi2cin $AC,(b3,b2) : sertxd("AC=",#w1,cr,lf)
hi2cin $AE,(b3,b2) : sertxd("AE=",#w1,cr,lf)
hi2cin $B0,(b3,b2) : sertxd("B0=",#w1,cr,lf)
hi2cin $B2,(b3,b2) : sertxd("B2=",#w1,cr,lf)
hi2cin $B4,(b3,b2) : sertxd("B4=",#w1,cr,lf)
hi2cin $B6,(b3,b2) : sertxd("B6=",#w1,cr,lf)
hi2cin $B8,(b3,b2) : sertxd("B8=",#w1,cr,lf)
hi2cin $BA,(b3,b2) : sertxd("BA=",#w1,cr,lf)
hi2cin $BC,(b3,b2) : sertxd("BC=",#w1,cr,lf)
hi2cin $BE,(b3,b2) : sertxd("BE=",#w1,cr,lf)

pause 1000

readtemperature:
hi2cout $F4,($2E)
hi2cin $F6,(b3,b2)
sertxd("UT=",#w1,cr,lf)
pause 1000
end
--------------------------------------------------------------
The latest serial terminal results are:

AA=5578
AC=64599
AE=51083
B0=31339
B2=24741
B4=17428
B6=65535
B8=46
BA=32768
BC=54461
BE=2432
UT=32768
 

rq3

Senior Member
Welcome to the PICAXE forum.

65535 and 32768 are in hexadecimal $FFFF and $8000 which may be significant as these are likely not simply 'random results'.

It would be a help if you could post your full code as that will make it easier to understand what you are doing and the results you report.

Get the raw data readings correct first, then consider how they can be logged and later passed on to a PC and used in Excel.
For the OP, keep in mind that atmospheric pressure is by no means stable. Even when he fixes the wide variation in data, there WILL be a slow variation in measured pressure (altitude) over a period of a few (1 to 300) seconds.

Rip
 

ac246

New Member
Hi rq3,
i plan to read all the sensors every minute or maybe every 30 minutes, i am not sure yet. The datalogger will be used in an old abandoned ironstone mine. ironstone takes the oxygen out of the air through oxidation so it stops us from venturing in too far to the mines workings as there is no ventilation except the entrance, which could be the size of a typical doorway with maybe 100 to 200 miles of mine passage within. so i am hoping to investigate to what extent the air pressure within the mine makes to the oxygen readings. whether increased pressure will pull fresher air into the mine, or whether low air pressure will allow the lower oxygen air to expand and stop us getting as far into the mine. i dont know how quickly the air pressure will change so i dont know the time period for the data logger yet.

but the calibration data should stay the same that is read from the EEPROM on the BMP085. i just dont understand why it keeps changing.. could it be a problem with my circuit? maybe adding some capacitors to stabalize the power supply but i havent had any other problems atall while reading and writing to the 24LC1025 chips.

The UT reading i am getting is confusing me also as sometimes it is around the 24000 mark and then jumps to 32768. so it is as if there is an issue reading the value from the BMP085 chip.

A lot of coffee and a lack of sleep later and i shall hopefully figure it out
 

ac246

New Member
Hi hippy,
you replied while i was writing my previous reply,
I am using a 40X1 and the pullup resistors on the circuit are 10K as i couldnt find my pack of 4K7. Could this make a difference?
 

g6ejd

Senior Member
You only need to run the calibration routine once to get device data/characteristics. Are you doing that? 10K pull-ups should be OK.
 

hippy

Technical Support
Staff member
I am using a 40X1 and the pullup resistors on the circuit are 10K as i couldnt find my pack of 4K7. Could this make a difference?
Possibly, 10K is the maximum according to the BMP805 datasheet. The datasheet also suggests reading $FFFF (65535 ) indicates a communication error. The device is nominally a 2.5V device ( 1.8V to 3.6V ) so that could affect things too. Probably best to post your full circuit diagram.

If you have a logic analyser you could monitor the I2C bus when it starts, try to see why it goes wrong after having read the $AA location value. Also; is the $AA location value always correct (or does that also change ?
 

ThierryP

New Member
3670ac,

I've copied the example code you provided and programmed a 28X2 with it, connected a BMP085 breakout module to the I2C pins and this works out of the box and as it should: the calibration data are always the same and also same as I recorded them since I have the unit more than 1y ago.
My BMP085 is on a GY65 breakout board, which means it operates at 3..5V and pullup resistors already provided on both I2C lines, costs around 3$ (see Ebay).
Looks like you need to check your wiring / circuitry?

Thierry
 

ac246

New Member
Hi, I'm at work at moment so I can't test it but the picaxe chip it fwas running at about 5.6 volts from the wall adaptor I was using, I will try tonight running it from 4 AA 1.2V rechargeable a with the 3.3 volt Regulator I have now swapped everything over from my own 40 pin board to a new 14m2 proto board purchased from tech supplies. So I will test it tonight.

I changed the 10k to 2 x 10k in parallel to give 5K. But that didn't seem to help. I am assuming it could have been the wall adaptor creating the problem as sometimes the picaxe would lock up and need a power cycle to work again.

$AA always seemed to stay the same.

Is it essential to run the calibration data routine to initialise the BmP085 or can I just program these values in once I know what they are.

Many thanks for all your help! :) I will update tonight on the latest.
 

g6ejd

Senior Member
The BMP085 is calibrated at the factory and loaded with eleven 16-bit calibration coefficients stored in the device's EEPROM. These variables all play a part in calculating the absolute pressure. They only need to be read just once, usually at the start of the program and stored/used for later use. As these are device specific, you could hard-code the values rather than read them, but obviously if you change the device you would need that devices' data set.
 
Top