I'm going to show you how to build personal wireless weather station using NodeMCU (ESP12)
One year ago I was create weather station based on Arduino. But always there are ways how to improve things to be better.
NodeMCU (ESP12) WiFi module send sensors data to wunderground.com , weathercloud.net and thingspeak.com
A Weather station is a device that collects data related to the weather and environment using many different sensors. We can measure many things like:
- Temperature
- Humidity
- Wind
- Barometric Pressure
- UV index
- Rain
The following is a list of measurement devices that are used in weather stations:
1) NodeMCU (ESP12) main board
2) Thermometer Dallas DS18B20 thermometer measures temperature. You can measure both the temperature indoors and outdoors, record highs and lows, show trend arrows to indicate temperature rising or falling, and even predict short-term future temperature ranges.
3) Hygrometer (BME280)- A hygrometer measures relative humidity. Relative humidity is the quantity or percentage of water vapor (water in gas form) in the air. Humidity influences environmental factors and calculations like precipitation, fog, dew point and heat index.
Barometer (BME280) – A barometer measures atmospheric pressure. A barometer can help to forecast upcoming weather based on the changes it measures in the atmospheric pressure.
4) Davis 6410 anemometer measures how fast the wind is blowing, or wind speed. ESP8266 weather stations can display wind speed in MPH, KPH or knots, and record current, peak and average wind speed readings.
Wind Vane – A wind vane, or weather vane, is an instrument that determines which direction the wind is blowing.
5) Ventus W174 rain gauge measures rainfall or liquid precipitation
Step 2: Schematic and Wiring DiagramDesign printed circuit board (PCB), I was used,, Sprint-Layout" software. Exported to Gerber files. Download PCB was made https://jlcpcb.com
To create this NodeMCU ESP12 weather station shield you will need:
- NodeMcu Lua CH340G/CH340/ ESP8266 Wireless WIFI Internet Devolop Module Ebay
- Waterproof Digital Thermal Probe or Sensor DS18B20 Arduino Sensor Ebay
- JST-XH Kit 4Pin 2.54mm Terminal Housing PCB Header Wire Connectors Ebay
- Atmospheric Pressure Sensor Temperature Humidity Sensor Breakout BME280Ebay
- 2x 1K 0805 resistor
- 1x 120R 0805 resistor
- 2x 4.7K 0805 resistor
- 1x 10K 0805 resistor
- 1x RJ45 socket Ebay
- 1x 47uF electrolytic capacitor
- 1 x 40pin 2.54mm Female Single Row Breakaway Pin header Ebay
1. Instal ESP8266 board into Arduino http://esp8266.github.io/Arduino/versions/2.0.0/do...
2.Enter your's Wifi router ssid and password.
- const char* ssid1 = "xxxxxxxxxx";
- const char* password1 = "xxxxxxxxxx";
3. Before upload code into your NodeMCU you will need register in wunderground.com to obtain a WU station ID and Key.
- char ID [] = "xxxxxx";
- char Key [] = "xxxxxx";
4. Register in weathercloud.net to obtain Weathercloud ID and Key.
- char ID2 [] = "xxxxxxxx";
- char Key2 [] = "xxxxxxxxxxx";
5. Change altitudepws in meters (m) to get relative pressure.
6. Register in thingspeak.com to obtain apiKey
- String apiKey ="XXXXXXXXXXXXXXX";
7. Change UTC_OFFSET to correct time zone
- int UTC_OFFSET = 3 ; // (GMT +3 )
I'm using 30 second loop time sending data to wunderground.com. And 10 minutes loop time sending data to weathercloud.net and thingspeak.com
Last edit: 2019 10 11
NodeMCU ESP12 is sending sendors data to wunderground.com, weathercloud.net and thingspeak.com.
So it looks everything it's working. Job done.
Mine weather station which you can check >
OTA (Over the Air) update is the process of loading a new firmware to ESP8266 module using WiFi connection rather than a serial communication. This type of functionality is extremely useful in case of no physical access to the ESP module.
Uploading a new sketch wirelessly from Arduino IDE is intended for the following typical scenarios:
- during firmware development – as a quicker alternative to uploading a new sketch over a serial
- for updating the firmware of multiple ESPs in your network
Prepare for OTA capability
- Install Python on Your System You need to install python27 on your system in order to program ESP8266 from your system you need to run OTA script. Install python27 on System from where your going to upload firmware.
- Download and Install Arduino OTA Library Download The library and tools required for OTA
- Install "ArduinoOTa.zip" in arduino library.
- Go to Tools to select your ESP board model. You also have to choose your ESP’s COM port
- Open the BasicOTA.ino example: File > Examples > Arduino OTA > BasicOTA.ino
- Press the “Upload” button in the Arduino IDE and wait for the “Done uploading” message
Uploading a new sketch OTA (Over the Air)
Now your ESP8266 is ready to receive OTA firmware updates. You can unplug your ESP8266 from your computer and power it through any power source. If your ESP8266 has a wireless connection to your router, you should be fine to upload new firmware.
- Go to your Arduino IDE. Open Tools tab select the Port option and you should see something like this: esp8266-xxxxxx at your_esp_ip_address
- Open Nodemcu_weather_station.ino and upload over the air.
Info is taken from (Rui Santos)
https://randomnerdtutorials.com/esp8266-ota-updates-with-arduino-ide-over-the-air/
Step 7: Making Solar Radiation ShieldSolar Radiation Shield is made from flower pot lower pad
The location weather station is the most important part of installation. If weather station is located under a tree or an overhang, the rainfall data measured by the station will not be correct. If you place your weather station in an alley, you could very well get a wind tunnel effect on the anemometer, resulting in erroneous wind data. Weather station should have good "fetch", or distance from any other tall object. The standard wind measurement should be taken at 10 meters above the ground. A roof-top works the best for me. Weather station is powered from solar panel. So it is autonomous.
The most common error in installing a weather station is associated with misplacing the thermometer sensor. Meteorologists define temperature as the temperature in shade with plenty of ventilation. When placing weather station, make sure:
- The thermometer sensor never receives direct sunlight.
- The thermometer receives plenty of ventilation and is not blocked from the wind.
- If the thermometer is placed on a roof-top, make sure it is at least 1.5 meters above the roof-top.
- If the thermometer is placed above grass, again, it should be at least 1.5 meters above the grass surface.
- The thermometer is at least 15 meters from the nearest paved surface.
So I'm using weather shelter. Solar Radiation Shield is made from flower pot lower pad. This way, weather station can be placed in direct sunlight, with the thermometer located inside the shelter. More information about installing weather station here
Added compatibility to check WiFi signal quality. If your weather station is to far from your router, you will lost communication. So you can try to mount weather station where WiFi signal strength is higher.
- Cactus.io http://cactus.io/projects/weather/arduino-weather...
- Jakub Nagy https://www.instructables.com/id/Arduino-Weatherc...
- Jordan Blanchard http://chynehome.com/web/station-meteo-a-base-de-e...
- Wunderground.com PWS Upload Protocol https://feedback.weather.com/customer/en/portal/ar...
- Davis 6410 vane manual https://www.davisinstruments.com/product_documents...
Comments