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

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


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
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 !


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.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec sed finibus nisi, sed dictum eros.
In non pulvinar purus. Curabitur nisi odio.
Quisque aliquet velit sit amet sem interdum faucibus. In feugiat aliquet mollis etiam tincidunt ligula.
Nisl massa, ultrices vitae ornare sit amet, ultricies eget orci.
In non pulvinar purus. Curabitur nisi odio, blandit et elit at, suscipit pharetra efficitur elit.