Arduino Weather Box: The Best Arduino Weather Station tutorial

From our STAR Maker: Manas Manohar
Edited by: Ajay Narayanan

Arduino weather station

How cool would it be if you had 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 of that inaccurate results from the weather channel anymore. You could 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!

What are the stuff required to do this project?Arduino weather station components

  1. Arduino Uno
  2. DHT11 (Temperature and Humidity Sensor)
  3. 16*2 character LCD display
  4. Potentiometer
  5. Jumper Wires (Male to Female(MF) and Female to Female(FF))
  6. Header Pins
  7. Glue gun

How does it work?

So we’ve got this ultra-low cost sensor called 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 sensor

STEP 1: 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.
     
    Arduino weather station

    Image courtesy: MIYmakers.com

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

STEP 2: Wiring the circuit for the Arduino weather station

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

Arduino weather station Connection diagram                                                                             Image courtesy: 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

STEP 3: Install DHT11 library for Arduino

Download the Arduino DHT11 library from here.

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 :https://www.arduino.cc/en/Guide/Libraries

STEP 4: Upload 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("%   "); 
}


STEP 5: Find something to encase 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

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

Arduino weather station                                                                      Image courtesy: MIYmakers.com

Manas Manohar

Manas Manohar – STAR Maker at DIY Hacking

 

-Submitted by Manas Manohar and
Edited by Ajay Narayanan

Manas is an extremely talented school student from Kannur, Kerala who was the winner at the Raspberry Pi – Learn to Code competition hosted by the Kerala Government. Check out his blog featuring easy to follow tutorials: MIYmakers.com

Recommended Posts
Showing 5 comments
  • Kevin
    Reply

    Yo, Code isn’t working? Got any tips. Copy/Pasted the code and it says: #include expects “FILENAME” or

  • Nath
    Reply

    What Potentiometer do? and What size Potentiometer ?

  • Nathan Crout
    Reply

    my computer is having trouble verifying the code is there any simplified version of the code?

  • pet shop
    Reply

    That is very interesting, You’re a very skilled blogger.
    I’ve joined your feed and sit up for looking for extra of your wonderful
    post. Additionally, I have shared your web site in my social networks!

    • Manas Manohar
      Reply

      Thanks Buddy!
      Follow me on fb :www.facebok.com/miymakers

Leave a Comment

53 + = 62

Start typing and press Enter to search