0x0000
Posts: 137
Joined: Tue Aug 27, 2013 8:59 pm

In context of i2c devices, What is the sampling rate ?

Tue Dec 31, 2013 4:03 pm

In context of i2c devices, What is the sampling rate ?

For example,

I am trying to understand the datasheet of BMP085 Pressure sensor and there is a whole lot of things that i couldn't digest,

In the datasheet it says that the sampling rate could be increased up to 128 samples / seconds.

Could anyone give me one example ?

Like,

If the output Pressure is 1016 hpa then how it will be calculated ?

Will the sensor calculate it in the form of voltage and then convert it into digital form and then in the pressure form ?

DBryant
Posts: 281
Joined: Sat Feb 02, 2013 12:41 pm
Location: Berkshire, UK

Re: In context of i2c devices, What is the sampling rate ?

Fri Jan 03, 2014 7:58 am

It's the frequency at which you can get a measurement from the device. It will take a finite time for a measurement to be realised in any device and could be to any number of physical reasons: the time the device to reach temperature or pressure, any period for the device to clear down and set its registers to reflect the new measurement, the time for the I2C bus to re-set and prepare for the data to be read and so on.

The BMP085 has a number of digital registers that have to be read and then the pressure value calculated. There are a set of registers associated with temperature and a further set associated with pressure, these are all read down a single pair of wires using i2c. There are also some calibration coefficients to be read that are specific to each device which have to be read by your software prior to calculating real values.

Take a look at page 13 of the datasheet at https://www.sparkfun.com/datasheets/Com ... 000-05.pdf which gives the code required to realise the physical quantities of temperature and pressure. It looks involved but its not really, just take your time and don't panic! Recognise that the data is spread over two bytes and these parts have to be combined within your code before you start processing to get real values. There are code examples out there, try searching 'Arduino bmp085' for example, older examples tend to expose the raw processing a little more easily (perhaps).

Hope this helps.

Return to “Beginners”