Step-by-Step Guide
Materials List
- 1 Arduino Board - 1 DHT11 Temperature and Humidity Sensor - 1 BMP180 Pressure Sensor - 1 Breadboard - 1 Resistor (10k ohm) - Jumper wires
Assembling
1. Connect the DHT11 sensor to the Arduino board's digital pin 2. 2. Connect the BMP180 sensor to the Arduino board's I2C pins. 3. Connect the resistor to the DHT11 sensor's pin and the Arduino board's pin 2. 4. Connect the jumper wires to the breadboard and the Arduino board.
Arduino Code & Libraries
The required libraries are: - Adafruit_BMP.BMP085 - DHT arduino #include <Adafruit_BMP085.h> #include <DHT.h> #define DHTPIN 2 #define DHTTYPE DHT11 Adafruit_BMP085 bmp180; DHT dht(DHTPIN, DHTTYPE); void setup() { Serial.begin(9600); bmp180.begin(); dht.begin(); } void loop() { float temperature = dht.readTemperature(); float humidity = dht.readHumidity(); float pressure = bmp180.readPressure() / 100.0F; Serial.print("Temperature: "); Serial.print(temperature); Serial.println("°C"); Serial.print("Humidity: "); Serial.print(humidity); Serial.println("%"); Serial.print("Pressure: "); Serial.print(pressure); Serial.println("hPa"); delay(1000); }
Project Resources
No downloadable resources added yet.
Please login to leave a comment.
No comments yet. Be the first to share your thoughts!