Prajjwal Nag
Published © CC BY-NC-SA

$10 Portable Arduino Weather Station (AWS)

Let us predict the changes around us with Arduino

IntermediateFull instructions provided2 hours46,347
$10 Portable Arduino Weather Station (AWS)

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
DHT22 Temperature Sensor
DHT22 Temperature Sensor
×1
bmp180
×1
Standard LCD - 16x2 White on Blue
Adafruit Standard LCD - 16x2 White on Blue
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Connection

Code

Code snippet #1

Plain text
<p>#include <wire.h>
#include <lcd.h>
#include 
<liquidcrystal_i2c.h>
#include "DHT.h"
#include <sfe_bmp180.h></sfe_bmp180.h></liquidcrystal_i2c.h></lcd.h></wire.h></p><p>SFE_BMP180 pressure;</p><p>#define ALTITUDE 20.56
 
#define I2C_ADDR 0x27 // <<- Add your address here.
#define Rs_pin 0
#define Rw_pin 1
#define En_pin 2
#define BACKLIGHT_PIN 3
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7</p><p>#define DHTPIN 2     // what digital pin we're connected to</p><p>// Uncomment whatever type you're using!
//#define DHTTYPE DHT11   // DHT 11
#define DHTTYPE DHT22   // DHT 22  (AM2302), AM2321
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
float t1,t2; </p><p>  
void setup()
{
 Serial.begin(9600);
 lcd.begin (16,2); // <<-- our LCD is a 20x4, change for your LCD if needed
// LCD Backlight ON
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);
 
lcd.home (); // go home on LCD
lcd.print("Weather Station");
delay(5000);
dht.begin();
  pressure.begin();
    
}
 
void loop()
{
 char status;
  double T,P,p0,a;
   status = pressure.startTemperature();
  if (status != 0)
  {
    
    delay(status);</p><p>    status = pressure.getTemperature(T);
    if (status != 0)
    {
      Serial.print("1");
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Baro Temperature: ");
      lcd.setCursor(0,1);
      lcd.print(T,2);
      lcd.print(" deg C ");
      t1=T;
      delay(3000);</p><p>      status = pressure.startPressure(3);
      if (status != 0)
      {
        // Wait for the measurement to complete:
        delay(status);</p><p>        status = pressure.getPressure(P,T);
        if (status != 0)
        {lcd.clear();
          lcd.setCursor(0,0);
          lcd.print("abslt pressure: ");
          lcd.setCursor(0,1);
          lcd.print(P,2);
          lcd.print(" mb ");
          delay(3000);</p><p>          p0 = pressure.sealevel(P,ALTITUDE); // we're at 1655 meters (Boulder, CO)</p><p>          a = pressure.altitude(P,p0);
          lcd.clear();
          lcd.setCursor(0,0);
          lcd.print("Altitude: ");
          lcd.setCursor(0,1);
          lcd.print(a,0);
          lcd.print(" meters");
          delay(3000);
        }
        
      }
      
    }
    
  }
 
  
 
float h = dht.readHumidity();
  // Read temperature as Celsius (the default)
  float t = dht.readTemperature();
  t2=t;
 lcd.clear();
 lcd.setCursor (0,0); // go to start of 2nd line
 lcd.print("Humidity: ");
  lcd.setCursor(0,1);lcd.print(h);
  lcd.print(" %");
  delay(3000);
  lcd.clear();
 lcd.setCursor (0,0); // go to start of 2nd line
  lcd.print("DHT Tempurature: ");
  lcd.setCursor(0,1);
  lcd.print(t);
  lcd.print(" deg C  ");
 
 delay(3000);
 lcd.clear();
 lcd.setCursor (0,0); // go to start of 2nd line
  lcd.print("Mean Tempurature: ");
  lcd.setCursor(0,1);
  lcd.print((t1+t2)/2);
  lcd.print(" deg C  ");
  delay(3000);
}</p>

Github

https://github.com/sparkfun/BMP180_Breakout_Arduino_Library/archive/master.zip

Github

https://github.com/adafruit/DHT-sensor-library

Credits

Prajjwal Nag

Prajjwal Nag

8 projects • 31 followers
So basically i am a crazy person, who loves to think the most odd way ever possible,who makes what he thinks and also let other also make those .

Comments