A weather station is a fun project that teaches you a ton about electronics with the added benefit being an actually useful little device. The project requires a bunch of cheap parts and sensors totaling less than $15, and the whole thing ends up fitting in your hand. The station creates a web site that monitors temperature, dew point, humidity, pressure, light index, and rain (Thingspeak channel). It’s a pretty easy set up, and you’ll just need some basic electronics skills to get it going.
There are some other NodeMcu or ESP8266 weather stations published on the web. Nevertheless they do not include the sensors I used and often are programmed in the more difficult language: LUA. This weather channel has got the following (unique) characteristics:
- NodeMcu board (V0.9 or V1.0), programmed with arduino IDE (easy);
- Streaming data to Thinkspeak (also easy!);
- DHT11/22 sensor;
- BMP180 sensor;
- Rain sensor;
- Light sensor;
- Piezzo indicating buzzer;
- Flashing indication led.
This channel will stream the following sensor data to a Thingspeak channel:
- Temperature DHT11/22;
- Temperature BMP180;
- Humidity DHT11/22;
- Pressure BMP180;
- Dew point temperature DHT11/22;
- Altitude BMP180;
- Light intensity LDR;
- Rain value.
The specific materials needed for this project are mentioned per step. General materials needed are:
- NodeMCU V0.9 or 1.0;
- Some wires;
- Micro USB to USB cable;
- 2 ‘1N4001 1A 50V Diodes’
- 3 ’10K resistors’
Step 1: The NodeMcu board
As I am a newby, I bought the NodeMcu board for less than 6$, more or less per exident. I was looking for a board that could connect my projects to the internet. The NodeMcu board did look a lot like an arduino and therefore it felt very familar. At that time I had no idea of the big advantages of the board.
The NodeMcu board is in fact an arduino with a wifi shield. You can reconise this shield by the metal plate on top of it. This wifi shield is called the esp8266. The shield can be bought and used as an individual controler, a well known version is the esp8266 V1 which has only got 2 digital pins. The later version (one of them is placed on top of the NodeMcu board) do have more digital pins.
The big advantage of the NodeMcu board is that the board can be programmed in the arduino environment: arduino IDE. Also, the board consists of a 5 volt step down converter. You can safely connect the board by USB to your computer without having to buy a 3.3 volt stepdown module.
If you want to buy a NodeMcu board you can buy either the 0.9 version or the 1.0 version. The only difference I know is that the 0.9 version is wider than the 1.0 version. Yyou can not use the 0.9 version on a broadboard and plug in wires next to it.
I found a lot of tutorials on the internet where they programmed the board with LUA software. As I never used this software before I preffered to stay with the arduino IDE software.
Programming the nodeMCU with arduino is easy!
Simply open arduino IDE, the latest version (I use 1.6.6). Go to ‘file’ and click on ‘preferences’. Add the following link in the field ‘additional board URL’:
After this you can restart the software and you must be able to select the board in the board manager (V1.0 or V0.9).
Pins of the NodeMcu
A small note: when you are programming an NodeMCU board, the pin layout is slightly different from an arduino board. Use the image below to compare the pins. If you mention an GPIO pin in the sketch for the NodeMCU, you have to connect the wire to the pin indicated in the picture below. (google: ‘NodeMCU pin map’)
For example: If you want to connect some sensor to D5, you have to mention pin 14 in your arduino code. In the code below and the corresponding Fritzing visualisation, the connections are already adjusted.
For more detail: Easy IoT weather station with multiple sensors