Objetivo:
Criar um sistema de pressão e temperatura. Este projeto irá fazer com que o sensor BMP180 sinalize a pressão e temperatura do ambiente.
Componentes necessários:
*Protoboard;
*Sensor BMP180 Breakout (GY-68);
*Quatro fios jumper;
*Um cabo USB;
*Um computador com a IDE do Arduino instalada;
*Arduino MEGA 2560.
*Sensor BMP180 Breakout (GY-68);
*Quatro fios jumper;
*Um cabo USB;
*Um computador com a IDE do Arduino instalada;
*Arduino MEGA 2560.
O sensor BMP180, é um sensor que coleta a pressão atmosférica do local, é um sensor compacto e muito eficiente, utilizando bem pouca energia e ocupando pouco espaço.
Um resistor é um componente que é utilizado para controle da quantidade de energia que sera transmitida a algum outro componente.
Montagem do Circuito:
Conecte os componentes no Protoboard como mostra a figura abaixo. Verifique cuidadosamente os cabos de ligação antes de ligar seu Arduino. Lembre-se que o Arduino deve estar totalmente desconectado da força enquanto você monta o circuito.
(Fio azul Communcation SCL21, verde Communcation SCL20, preto GND, vermelho 5V)
Adafruit-DHT-BMP085-library
Wire-library
Após baixar o arquivo colocar ele no libraries do arduino
Código do sistema:
#include <Wire.h> //INCLUSÃO DE BIBLIOTECA #include <Adafruit_BMP085.h> //INCLUSÃO DE BIBLIOTECA Adafruit_BMP085 bmp; //OBJETO DO TIPO Adafruit_BMP085 (I2C) void setup(){ Serial.begin(9600); //INICIALIZA A SERIAL if (!bmp.begin()){ //SE O SENSOR NÃO FOR INICIALIZADO, FAZ Serial.println("Sensor BMP180 não foi identificado! Verifique as conexões."); //IMPRIME O TEXTO NO MONITOR SERIAL while(1){} //SEMPRE ENTRE NO LOOP } } void loop(){ Serial.print("Temperatura: "); //IMPRIME O TEXTO NO MONITOR SERIAL Serial.print(bmp.readTemperature()); //IMPRIME NO MONITOR SERIAL A TEMPERATURA Serial.println(" *C (Grau Celsius)"); //IMPRIME O TEXTO NO MONITOR SERIAL Serial.print("Pressão: "); //IMPRIME O TEXTO NO MONITOR SERIAL Serial.print(bmp.readPressure()); //IMPRIME NO MONITOR SERIAL A PRESSÃO Serial.println(" Pa (Pascal)"); //IMPRIME O TEXTO NO MONITOR SERIAL delay(2000); //INTERVALO DE 2 SEGUNDOS }
#include <Wire.h> //INCLUSÃO DE BIBLIOTECA #include <Adafruit_BMP085.h> //INCLUSÃO DE BIBLIOTECA Adafruit_BMP085 bmp; //OBJETO DO TIPO Adafruit_BMP085 (I2C) void setup(){ Serial.begin(9600); //INICIALIZA A SERIAL if (!bmp.begin()){ //SE O SENSOR NÃO FOR INICIALIZADO, FAZ Serial.println("Sensor BMP180 não foi identificado! Verifique as conexões."); //IMPRIME O TEXTO NO MONITOR SERIAL while(1){} //SEMPRE ENTRE NO LOOP } } void loop(){ Serial.print("Temperatura: "); //IMPRIME O TEXTO NO MONITOR SERIAL Serial.print(bmp.readTemperature()); //IMPRIME NO MONITOR SERIAL A TEMPERATURA Serial.println(" *C (Grau Celsius)"); //IMPRIME O TEXTO NO MONITOR SERIAL Serial.print("Pressão: "); //IMPRIME O TEXTO NO MONITOR SERIAL Serial.print(bmp.readPressure()); //IMPRIME NO MONITOR SERIAL A PRESSÃO Serial.println(" Pa (Pascal)"); //IMPRIME O TEXTO NO MONITOR SERIAL delay(2000); //INTERVALO DE 2 SEGUNDOS }
Para ver a temperatura e a pressão que o sensor está detectando:
Passo 1: Vá em Ferramentas(Tools) e Monitor Serial(Serial Monitor) ou clique Ctrl+Shift+M.