Github: DIY_Weather_Station
Hackster.io: Weather Station
You would have seen Weather Application right? Like, when you open it you get to know the weather conditions like Temperature, Humidity etc. Those readings are the average value of an a big area, so if you want to know the exact parameters related to your room, you can't just rely upon the Weather Application. For this purpose lets move on to the making of Weather Station which is cost effective, and is also reliable and gives us the accurate value.
A weather station is a facility with instruments and equipment for measuring atmospheric conditions to provide information for weather forecasts and to study the weather and climate. It requires little bit of effort to plug and code. So lets get started.
About Nodemcu:
NodeMCU is an open source IoT platform.
It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module.
The term "NodeMCU" by default refers to the firmware rather than the dev kits. The firmware uses the Lua scripting language. It is based on the eLua project, and built on the Espressif Non-OS SDK for ESP8266. It uses many open source projects, such as lua-cjson, and spiffs.
Sensors and Software requirement:
1. Nodemcu (esp8266-12e v1.0)
2. DHT11
3. BMP180
4. Arduino IDE
Description:
The BMP180 consists of a piezo-resistive sensor, an analog to digital converter and a control unit
with E2PROM and a serial I2C interface. The BMP180 delivers the uncompensated value of pressure and temperature. The E2PROM has stored 176 bit of individual calibration data. This is used to compensate offset, temperature dependence and other parameters of the sensor.
Technical Specs:
Description:
Technical Specs:
What is Blynk?
Blynk is a Platform with iOS and Android apps to control Arduino, Raspberry Pi and the likes over the Internet.
It's a digital dashboard where you can build a graphic interface for your project by simply dragging and dropping widgets. It's really simple to set everything up and you'll start tinkering in less than 5 mins. Blynk is not tied to some specific board or shield. Instead, it's supporting hardware of your choice. Whether your Arduino or Raspberry Pi is linked to the Internet over Wi-Fi, Ethernet or this new ESP8266 chip, Blynk will get you online and ready for the Internet Of Your Things.
For more info in setting up Blynk: Detailed Blynk Setup
//Comments for each line is given in the .ino file below #include <Adafruit_Sensor.h> #define BLYNK_PRINT Serial #include <DHT.h> #include <ESP8266WiFi.h> #include <BlynkSimpleEsp8266.h> #include <Wire.h> #include <Adafruit_BMP085.h> Adafruit_BMP085 bmp; #define I2C_SCL 12 #define I2C_SDA 13 float dst,bt,bp,ba; char dstmp[20],btmp[20],bprs[20],balt[20]; bool bmp085_present=true; char auth[]="Put your Authication key from the Blynk app here"; char ssid[] = "Your WiFi SSID"; char pass[] = "Your Password"; #define DHTPIN 2 #define DHTTYPE DHT11 DHT dht(DHTPIN, DHTTYPE); //Defining the pin and the dhttype BlynkTimer timer; void sendSensor() { if (!bmp.begin()) { Serial.println("Could not find a valid BMP085 sensor, check wiring!"); while (1) {} } float h = dht.readHumidity(); float t = dht.readTemperature(); if (isnan(h) || isnan(t)) { Serial.println("Failed to read from DHT sensor!"); return; } double gamma = log(h/100) + ((17.62*t) / (243.5+t)); double dp = 243.5*gamma / (17.62-gamma); float bp = bmp.readPressure()/100; float ba = bmp.readAltitude(); float bt = bmp.readTemperature(); float dst = bmp.readSealevelPressure()/100; Blynk.virtualWrite(V5 , h); Blynk.virtualWrite(V6 , t); Blynk.virtualWrite(V10, bp); Blynk.virtualWrite(V11, ba); Blynk.virtualWrite(V12, bt); Blynk.virtualWrite(V13, dst); Blynk.virtualWrite(V14, dp); } void setup() { Serial.begin(9600); Blynk.begin(auth, ssid, pass); dht.begin(); Wire.begin(I2C_SDA, I2C_SCL); delay(10); timer.setInterval(1000L, sendSensor); } void loop() { Blynk.run(); timer.run(); }