For testing, schematic is very simple:
and test montage is:
I use this sketch:
// adapted sketch by niq_ro from http://nicuflorica.blogspot.ro/ & http://arduinotehniq.blogspot.com/
// https://github.com/adafruit/Adafruit-BMP085-Library
#include <Wire.h>
#include <Adafruit_BMP085.h>
/***************************************************
This is an example for the BMP085 Barometric Pressure & Temp Sensor
Designed specifically to work with the Adafruit BMP085 Breakout
----> https://www.adafruit.com/products/391
These displays use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
// Connect VCC of the BMP085 sensor to 3.3V (NOT 5.0V!)
// Connect GND to Ground
// Connect SCL to i2c clock - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 5
// Connect SDA to i2c data - on '168/'328 Arduino Uno/Duemilanove/etc thats Analog 4
// EOC is not used, it signifies an end of conversion
// XCLR is a reset pin, also not used here
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
/* -------------------
| LCD | Arduino |
-------------------
LCD RS pin to digital pin 7 | RS | D7 |
LCD Enable pin to digital pin 6 | E | D6 |
LCD D4 pin to digital pin 5 | D4 | D6 |
LCD D5 pin to digital pin 4 | D5 | D4 |
LCD D6 pin to digital pin 3 | D6 | D3 |
LCD D7 pin to digital pin 2 | D7 | D2 |
LCD R/W pin to ground | R/W | GND |
-------------------
*/
Adafruit_BMP085 bmp;
void setup() {
lcd.begin(16, 2);
// Print a logo message to the LCD.
lcd.print("www.tehnic.go.ro");
lcd.setCursor(0, 1);
lcd.print("creat de niq_ro");
delay (2500);
lcd.clear();
// Print another message to the LCD.
lcd.setCursor(2, 0);
lcd.print("termometru -");
lcd.setCursor(0, 1);
lcd.print("barometru ver1.0");
delay (2500);
lcd.clear();
Serial.begin(9600);
if (!bmp.begin()) {
Serial.println("nu exita senzor compatibil BMP085 sau BMP180");
while (1) {}
}
}
void loop() {
Serial.print("Temperatura = ");
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print("Presiune = ");
Serial.print(bmp.readPressure());
Serial.print(" Pa / ");
// Serial.print("Presiune = ");
float presiune1 = bmp.readPressure()/101.325;
presiune1 = presiune1 * 0.760;
Serial.print(presiune1);
Serial.println(" mmHg");
// Calculate altitude assuming 'standard' barometric
// pressure of 1013.25 millibar = 101325 Pascal
Serial.print("Altitudine = ");
Serial.print(bmp.readAltitude());
Serial.println(" m");
Serial.print("Presiune la nivelul marii (calculata) = ");
Serial.print(bmp.readSealevelPressure());
Serial.print(" Pa / ");
// http://en.wikipedia.org/wiki/Atmospheric_pressure#Mean_sea_level_pressure
// Serial.print("Presiure la nivelul marii (calculata) = ");
float presiune = bmp.readSealevelPressure()/101.325;
presiune = presiune * 0.760;
Serial.print(presiune);
Serial.println(" mmHg");
// you can get a more precise measurement of altitude
// if you know the current sea level pressure which will
// vary with weather and such. If it is 1015 millibars
// that is equal to 101500 Pascals.
Serial.print("Altitudine reala = ");
Serial.print(bmp.readAltitude(101500));
Serial.println(" m");
Serial.println();
lcd.setCursor(1, 0);
lcd.print("temp.= ");
if ( bmp.readTemperature() < 10)
{
lcd.print(" ");
lcd.print(bmp.readTemperature());
}
else
{
lcd.print(bmp.readTemperature(),1);
}
lcd.write(0b11011111);
lcd.print("C ");
lcd.setCursor(1, 1);
lcd.print("pres.= p");
lcd.print(presiune,0);
lcd.print("mmHg ");
delay(2500);
}
24.11.2014In last weak-end, I received 3 pics from Dave (http://g4rvh.wordpress.com/) with a shield for Arduino Uno, made after my schematic:
He made with board with CNC Cutter:
I change the sketch for present the temperature in Fahrenheit, not in Celsius degree, using information from article http://www.mathsisfun.com/temperature-conversion.html: