Categories
Statistics
Flag Counter
Since 08.08.2014
Counts only, if "DNT = disabled".

Your IP is 54.198.216.180
ec2-54-198-216-180.compute-1
Info
Valid HTML 4.01 Transitional Creative Commons Lizenzvertrag
rss
เราจะทำแบบวิศวกรผู้ยิ่งใหญ่
We love the King
Your valuable opinion :
3.5 stars

Avg. 3.67 from 3 votes.



Envico_Barometer.php   7545 Bytes    08-11-2015 18:49:39


ENVICO®light


Barometer Adapter




ENVICO Barometer Adapter




✈ Circuit Description




This Adapter / Sensor consists only of two integrated circuits. One is an eeprom which holds information such as type of sensor, warning and alarm levels, the other one is an integrated Miniature I2C Digital Barometer, MPL115A2, from Freescale Semiconductor. Some decoupling capacitors as well as pull-up resistors round the design up.



✈ Downloads







✈ Arduino Sketch - The TEST - Code



Double click on code to select ...


/*
 Standalone Sketch to test the Barometer sensor with an MPL155A2
 (Just to test the sensor and the I2C communication)
 Do not forget to supply the arduino with Vin, +12V !!!
 Alexander C. Frank, 15.07.2015, Version 1.0
*/
 
#include <Wire.h>

byte I2C_address = 0x60; 

void setup()
{
 Wire.begin();        // join i2c bus (address optional for master)
 Serial.begin(9600);  // start serial for output
 Serial.print("Barometer MPL-115 Test\n");
}

void loop()
{

 // START CONVERSION
 Wire.beginTransmission(I2C_address);
 Wire.write(0x12); 
 Wire.write(0xAF);
 Wire.endTransmission(); 
 // WAIT FOR MEASUREMENT TO COMPLETE
 delay(5);  // max. 3 ms
 // READ ALL MEMORY LOCATIOSN
 Wire.beginTransmission(I2C_address);
 Wire.write(0x00); 
 Wire.endTransmission(); 
 
 Wire.requestFrom(I2C_address,12);
 unsigned int Padc_MSB = Wire.read();      // 0x00
 unsigned int Padc_LSB = Wire.read();      // 0x01
 unsigned int Tadc_MSB = Wire.read();      // 0x02
 unsigned int Tadc_LSB = Wire.read();      // 0x03
 unsigned int a0_MSB = Wire.read();        // 0x04
 unsigned int a0_LSB = Wire.read();        // 0x05
 unsigned int b1_MSB = Wire.read();        // 0x06
 unsigned int b1_LSB = Wire.read();        // 0x07
 unsigned int b2_MSB = Wire.read();        // 0x08
 unsigned int b2_LSB = Wire.read();        // 0x09
 unsigned int c12_MSB = Wire.read();       // 0x0A
 unsigned int c12_LSB = Wire.read();       // 0x0B
 // COMBINE MSB AND LSB
 unsigned long Padc = ( ( Padc_MSB << 8 ) + Padc_LSB ) >> 6 ;          
 unsigned long Tadc = ( ( Tadc_MSB << 8 ) + Tadc_LSB ) >> 6 ;               
 float a0 = ( a0_MSB << 5 ) + ( a0_LSB >> 3 ) + ( a0_LSB & 0x07 ) / 8.0 ;         
 float b1 = ( ( ( ( b1_MSB & 0x1F ) * 0x100 ) + b1_LSB ) / 8192.0) - 3 ;
 float b2 = ( ( ( ( b2_MSB - 0x80 ) << 8 ) + b2_LSB ) / 16384.0 ) - 2 ;
 float c12 = ( ( ( c12_MSB * 0x100 ) + c12_LSB ) / 16777216.0 )  ;    
 // CALCULATE PRESSURE
 float Pcomp = a0 + ( b1 + c12 * Tadc ) * Padc + b2 * Tadc ;
 float PressurekPa = Pcomp * 0.0635 + 50 ;
 float PressuremBar = 10 * PressurekPa ;
 // Serial.print(PressurekPa, 2); Serial.write(" kPa");Serial.write("\n");
 Serial.print(PressuremBar, 2); Serial.write(" mBar");Serial.write("\n");

 delay(10000); 
}







✈ Share your thoughts


✈ Nothing more to be seen below this point ? Maybe your browser blocks the facebook iframe.
The webmaster does not read the comments regularly. Urgent questions should be send via email.








 
t1 = 3941 d

t2 = 360 ms

★ ★ ★  Copyright © 2006 - 2017 by changpuak.ch  ★ ★ ★

PRchecker.info Impressum