Use an Arduino to make your own backyard weather station and get accurate results for your location.

1 Arduino Uno
1 DHT11 (temperature and humidity sensor)
1 16x2 character LCD display
1 Potentiometer
Jumper wires — male to female (MF) and female to female (FF)
Header pins
1 Glue gun
top.jpg

How cool would it be to have your own Arduino weather station right in your backyard? Sounds fun? Geeky? Having your own weather station means that you don’t need any more inaccurate results from the weather channel! You can even log the data and play around with it. Set mood lighting according to the weather? Why not? This tutorial will get you kick-started with your own DIY Weather Box to chart out local weather. What are you waiting for? Let’s get started!

components-min.jpg

How Does It Work?

So we’ve got this ultra-low-cost sensor called the DHT11. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air and spits out a digital signal on the data pin. Since the output data isn’t analog, it requires some coding to get the data, but don’t sweat it. It’s got its own library that takes care of the hard parts. It’s fairly simple to use but requires careful timing to grab data. You can only get new data from it once every 2 seconds, but that’s more than enough for our Arduino weather station.

dht11-module-min.jpg

Connecting the Headers for the Arduino Weather Station

Since you’re going to be using an LCD display for your Arduino weather station, you’ll need to solder the pin headers onto the LCD. The best way to do this is to affix header pins onto the Arduino and use jumpers to connect it to the LCD display.

  1. Place the header pins onto the ports of the Arduino, and make sure that there’s contact and that the header pins are not loose.
  2. Carefully, using a glue gun, glue the header pins onto the Arduino, keeping sure that it doesn’t get loose while you’re doing it.

ArduinoGlue-min.jpg

Image courtesy of MIYmakers.com

  1. Now solder the LCD display onto the header pins after aligning it on top of the LCD display.

arduinoLCD-min.jpg

Wiring the Circuit for the Arduino Weather Station

Connect the Arduino, LCD display, DHT11 sensor, and potentiometer as shown in the connection diagram below.

unnamed-2-min.jpg

Image courtesy of MIYmakers.com

LCD Connections

LCD D7 ­–>DIGITAL PIN 2

LCD D6 –> 3
LCD D5 –> 4
LCD D4 –> 5
LCD E – > 11
LCD RS –> 12
LCD VDD –> (+) RAIL BREADBOARD
LCD A –> (+) RAIL BREADBOARD
LCD VSS –> (-­)RAIL BREADBOARD
LCD K –>(­-)RAIL BREADBOARD
LCD RW –> (-­)RAIL BREADBOARD
LCD VO –> Potentiometer Middle Pin

Installing the DHT11 Library for Arduino

Download the Arduino DHT11 library.


Next, open Arduino IDE, Go to Sketch –> Include Library –> Add Zip File and then close the Arduino IDE and open it again. After doing this, you will find the library included.

For more info on how to add libraries, visit the Arduino website.

Uploading the Code for the Arduino Weather Station

Copy and paste the code below into your Arduino IDE and save the sketch. Next, upload the code to your Arduino.

#include 
#include 

//led blink tutorial!
//Get more tutorials on --> --> -->
//"MIYMAKERS" https://miymakers.wordpress.com/

#define dht_dpin A1 //no ; here. Set equal to channel sensor is on
dht DHT;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup(){

;lcd.begin(16, 2);
lcd.print("TEMP HUMIDITY");
Serial.begin(57600); 
}
void loop(){
lcd.setCursor(1,3);
DHT.read11(dht_dpin);

//lcd.print(abs(moisture)); 
//Serial.println(moisture);
lcd.print(round(DHT.temperature));
lcd.print("C  "); 
lcd.print(round(DHT.humidity));
lcd.print("%   "); 
}


Finding an Enclosure for Your Arduino Weather Station

  1. Take an old plastic box or container. Since we are going to place it outside, don’t use stuff like thermocol that easily wears out.
  2. Cut holes for the LCD Screen and the DHT11 sensor carefully using a paper knife. If you are using a battery to power the Arduino, make sure there’s space for that. If you’re going to use an adapter, cut a hole for the wire as well
  3. Place the Arduino circuit inside the Box and make sure nothing obstructs the display and DHT11 sensor
  4. After going outside, calibrate the contrast of the display so that you can easily see the output

That’s it! Your very own Arduino weather station is ready for use!

top.jpg

Image courtesy of MIYmakers.com

Manas Manohar

Forks

Related Projects