ADX-BMP085 : The BMP085 pressure sensor interface board documentation 1
ADX-BMP085 BMP085 interface board Features : There is female header for plugging the BMP085 Pressure sensor module Supply voltage +5V with on-board +3.3V regulator circuit Available 2 types of interface connector; 3-pin JST connector and IDC female header I2C bus resistors pull-up connected already Includes 2 of JST3AA-8 sensor cables.
+VDD IN
+3.3V OUT
IC1
R2 4.7k +3.3V
LP2950L-33
K1 SCL
C1 0.1F 63V
+ S
GND
R3 4.7k
C2 0.1F 63V C3 R1 4.7k 10F
R4 47
GND EOC XCLR
MOD1 BMP085
SCL + S
SDA
K2 SDA
R5 47
+VDD IC1 LP2950L-33
K3
I2C-bus +V CC SDA SCK GND
OUT IN GND
Figure 1 : ADX-BMP085 schematic diagram
+5V PORT GND MCU port
2ADX-BMP085 : The BMP085 pressure sensor interface board documentation
Example : This is simple air pressure monitoring with INEX’s Unicon board (Arduino Leonardo compatible board). The Unicon interfaces with BMP085 via the ADX-BMP085 board and displays the result on GLCD-XT board. The full example sketch is shown below. This example code requires the unicon.h library. It is customized of the INEX’s Unicon board. Free download available from www.uniconboard.com or www.ineglobal.com. Also get more information of the Unicon board from our international website; www.inexglobal.com.
Interface circuit :
ADX-BMP085 : The BMP085 pressure sensor interface board documentation ď Źď€ 3
Example code :
#include <unicon.h> #define DEVICE_ADDRESS 0xEE >> 1
// Includes the custom Unicon board library // BMP085 I2C address
const unsigned char OSS = 0; int ac1; int ac2; int ac3; unsigned int ac4; unsigned int ac5; unsigned int ac6; int b1; int b2; int mb; int mc; int md; long b5; float temperature; long pressure; void setup() { Wire.begin(); setTextSize(2); glcd(1, 0, "Temp"); glcd(4, 0, "Pressure"); bmp085Calibration(); }
//short temperature;
// Heading message of Temperature // Heading message of Air pressure // Call BMP085 calibration function
4ADX-BMP085 : The BMP085 pressure sensor interface board documentation
void loop() { temperature = bmp085GetTemperature(bmp085ReadUT()); // Read temperature pressure = bmp085GetPressure(bmp085ReadUP()); // Read pressure glcd(2, 0, "%f C ", temperature); // Show value in Celcius degree glcd(5, 0, "%l Pa ", pressure); // Show value in Pascal unit delay(1000); } void bmp085Calibration() { ac1 = bmp085ReadInt(0xAA); ac2 = bmp085ReadInt(0xAC); ac3 = bmp085ReadInt(0xAE); ac4 = bmp085ReadInt(0xB0); ac5 = bmp085ReadInt(0xB2); ac6 = bmp085ReadInt(0xB4); b1 = bmp085ReadInt(0xB6); b2 = bmp085ReadInt(0xB8); mb = bmp085ReadInt(0xBA); mc = bmp085ReadInt(0xBC); md = bmp085ReadInt(0xBE); }
// BMP085 calibration function
float bmp085GetTemperature(unsigned int ut) // Temperature conversion { long x1, x2; x1 = (((long)ut - (long)ac6)*(long)ac5) >> 15; x2 = ((long)mc << 11)/(x1 + md); b5 = x1 + x2; float temp = ((b5 + 8)>>4); temp = temp /10; return temp; } long bmp085GetPressure(unsigned long up) // Pressure conversion { long x1, x2, x3, b3, b6, p; unsigned long b4, b7; b6 = b5 - 4000; x1 = (b2 * (b6 * b6)>>12)>>11; x2 = (ac2 * b6)>>11; x3 = x1 + x2; b3 = (((((long)ac1)*4 + x3)<<OSS) + 2)>>2; x1 x2 x3 b4
= = = =
(ac3 * b6)>>13; (b1 * ((b6 * b6)>>12))>>16; ((x1 + x2) + 2)>>2; (ac4 * (unsigned long)(x3 + 32768))>>15;
b7 = ((unsigned long)(up - b3) * (50000>>OSS)); if (b7 < 0x80000000) p = (b7<<1)/b4; else p = (b7/b4)<<1;
ADX-BMP085 : The BMP085 pressure sensor interface board documentation 5
x1 = x1 = x2 = p +=
(p>>8) * (p>>8); (x1 * 3038)>>16; (-7357 * p)>>16; (x1 + x2 + 3791)>>4;
return p; } char bmp085Read(unsigned char address) { unsigned char data; Wire.beginTransmission(DEVICE_ADDRESS); Wire.write(address); Wire.endTransmission(); Wire.requestFrom(DEVICE_ADDRESS, 1); while(!Wire.available()); return Wire.read(); } int bmp085ReadInt(unsigned char address) { unsigned char msb, lsb; Wire.beginTransmission(DEVICE_ADDRESS); Wire.write(address); Wire.endTransmission(); Wire.requestFrom(DEVICE_ADDRESS, 2); while(Wire.available()<2) ; msb = Wire.read(); lsb = Wire.read(); return (int) msb<<8 | lsb; } unsigned int bmp085ReadUT() { unsigned int ut; Wire.beginTransmission(DEVICE_ADDRESS); Wire.write(0xF4); Wire.write(0x2E); Wire.endTransmission(); delay(5); ut = bmp085ReadInt(0xF6); return ut; }
// BMP085 reading function
6ADX-BMP085 : The BMP085 pressure sensor interface board documentation
unsigned long bmp085ReadUP() { unsigned char msb, lsb, xlsb; unsigned long up = 0; Wire.beginTransmission(DEVICE_ADDRESS); Wire.write(0xF4); Wire.write(0x34 + (OSS<<6)); Wire.endTransmission(); delay(2 + (3<<OSS)); Wire.beginTransmission(DEVICE_ADDRESS); Wire.write(0xF6); Wire.endTransmission(); Wire.requestFrom(DEVICE_ADDRESS, 3); while(Wire.available() < 3); msb = Wire.read(); lsb = Wire.read(); xlsb = Wire.read(); up = (((unsigned long) msb << 16) | ((unsigned long) lsb << 8) | (unsigned long) xlsb) >> (8-OSS); return up; } /****************************************************************************/
ADX-BMP085 : The BMP085 pressure sensor interface board documentation 7
About BMP085 Breakout module This is a simple breakout board for the BMP085 high-precision, low-power barometric pressure sensor. The BMP085 offers a measuring range of 300 to 1100 hPa with an absolute accuracy of down to 0.03 hPa. It's based on piezo-resistive technology for EMC robustness, high accuracy and linearity as well as long term stability. This sensor supports a voltage supply between 1.8 and 3.6VDC. It is designed to be connected directly to a micro-controller via the I2C bus
This breadboard-friendly board breaks out all pins of the BMP085 to a 6-pin 0.1" pitch header. The analog and digital supplies (VDDD and VDDA) of the BMP085 are tied together and broken out to a single pin. We've also put two 4.7k pull-up resistors on the I2C lines.
Features: Digital two wire (I2C bus) interface Wide barometric pressure range Flexible supply voltage range Ultra-low power consumption Low noise measurement Fully calibrated Temperature measurement included Ultra-flat, small footprint 0.65 x 0.65" (16.5 x 16.5 mm) dimensions
www.inex.co.th www.inexglobal.com
(c) Innovative Experiment