Environmental Sensors
Using Arduino DHT22 and BMP180 sensors connected to an ESP32 Board, I will show you how to read environmental data as Temperature, Humidity, Atmospheric Pressure and Altitude ! (might add more sensors in the future for Luminosity, Rain, UV, etc.)
Project Name
ESP32
Weather Station
Project Type
Home Automation


Required Materials and Software
For this project, you will need the following Hardware:
- 1x ESP32 Development board
- 1x DHT22/AM2302 Humidity & Temperature sensor
- 1x BMP180 Barometric Pressure Sensor
To programm the ESP32, I will use Arduino IDE

Wiring
First things first, the wiring!
Following manufacturers specs, here is the proper wiring for the two sensors and the ESP32 Development Board:
ESP32 | BMP180 | DHT22 |
3V3 | VIN | VIN |
GND | GND | GND |
13 | DATA | |
21 | SDA | |
23 | SCL |
Your content goes here. Edit or remove this text inline or in the module Content settings. You can also style every aspect of this content in the module Design settings and even apply custom CSS to this text in the module Advanced settings.


Be careful to use the 3V3 pin on the ESP32 as the BP180 breakoutboard does not handle voltage over 3.6V !
Code
With the wiring in place, we are now going to upload a code to read sensors data in Arduino IDE Serial Terminal, in this code, as the DHT22 ans BMP180 have slightly different temperature readings, I went for the easy/sensible option, I will just average the two readings as a temperature reference.
Note that herebelow code will also send datas from the sensors to a PHP script for display and Database storage, which I will explain in next tutorial !
Related Projects

Quisque aliquet velit sit amet sem interdum.

In non pulvinar purus. Curabitur nisi odio.
