Introduction: DIY Weather Station Using Arduino, DHT11 & BMP180 Sensors
Have you ever looked at those weather stations in your local retail catalogues and wish you had one but couldn't justify the expense ? Well, using a few components and a little tinkering you can build one for yourself, maybe even cheaper than the one at the shops.
A weather station monitors local weather an can have many sensor to monitor temperature, humidity, air pressure, rainfall, wind speed, etc. Building one from scratch using a few cheap sensors and an arduino uno board (or compatible) can be quite simple, it just requires a little of your time once you have the components.
You can watch a video of the project here:
Step 1: How the System Works – DHT11, BMP180, 16x2 LCD, Microcontroller Board
Our project uses the DHT11 (or DHT22) to measure temperature and humidity and the BMP180 to measure air pressure. The sensors gather the readings and send them to the microcontroller, then the microcontroller processes them and outputs them to a 16x2 LCD Display.
For a background on each of the components used in this project you may want to look at our previous projects that can be found on our website at smartmicrocontroller.com.
- Arduino Uno (or compatible board)DHT11 (or DHT22) temperature and humidity sensor
- BMP180 air pressure sensor
- 16x2 LCD display shield
- Prototyping PCB board
- 8 Pin IC Socket
- Mounting hardware and case ( we are using a plastic pill bottle)
- Computer and USB cable
- Arduino IDE
Step 2: Wiring the Weather Station Sensors
To wire the sensor circuitry we use a small prototyping PCB (see image above) and place an 8 pin IC socket on the board. Once the PCB is wired up correctly as the diagram above the sensor can be plugged into the IC socket. The use of the socket allows for easy removal of the sensors for maintenance or reuse in other projects.
The 5V and ground pins are shared by both sensors so only 5 wires are required in total when we add in the SDA, SCL and DHT11 data pin. The senors are connect to the arduino uno board using the following pins:
Arduino Uno Pins >>>> Sensor PCB Pins
5V >>>> 5V
GND >>>> GND
A5 >>>> SCL
A4 >>>> SDA
Pin 2 >>>> DHT11 data pin
Step 3: Building the Sensor Housing
The housing is used to protect the sensor from the environment at the same time allowing the natural air to flow through it. The sensor housing is best placed in an area such as under the house eaves protected from direct rain and direct sun light as any water that comes in contact with the sensors will most likely damage them. The avoidance of direct sunlight is to protect the sensors from false readings and also to not over heat them.
We recycled an empty plastic pill bottle and drill holes in it to allow the air to flow through. Then used a bracket to attach the housing to a wooden door frame. A small hole should also be drilled at the lowest point of the lid to allow any water condensation to drain out. The video on the introduction page shows in detail how we made the sensor housing.
Step 4: Coding the Weather Station
In the arduino program we required 4 libraries for the attached sensors and LCD display.
The libraries are:
If your IDE does not have these libraries installed, they can easily be installed by using the "manage libraries" tool by searching for them then installing them.
The flow of the program starts by initializing the sensors and LCD display, then reads the sensor data into float variables, then displays the measurements to the LCD Display. The program loops to update the sensor measurements every two seconds.
The code is available on the smartmicrocontroller website at the link below:
Once the source code is entered in the Arduino IDE, upload it to the arduino uno board and if all goes well the LCD should start displaying the weather measurements within a few seconds after the upload competes.
I hope this Tutorial has been useful to you. If you liked it please share it with a friend.
Also, I'd really appreciate it for you to join my email subscriber list where we'll keep you up to date with our latest videos, tutorials and articles relating to microcontrollers, Arduino and other electronics information. You'll also receive our free newsletter which is exclusive to our email subscribers only !
Thanks for spending your time to read this Instructable.
I really appreciate it !