Introduction: Weather Station With Arduino/Genuino , ESP8266, BMP180, DHT22 and Thingspeak

It's a bit of years that "game" with Arduino / Genuino and, when I saw what he could do a ESP8266, I wanted to build a small weather station.

This is the evolution of my Weather Clock

Material

  • Arduino/Genuino
  • BMP180 - Barometric Pressure/Temperature/Altitude Sensor
  • DHT22 - temperature-humidity sensor
  • ESP8266 - WiFi Module
  • LM317 - Voltage regulator
  • Capacitor:
    • 10-100 μf
    • 100 nF = 0,1pF
  • Resistance
    • 270Ω
    • 510 Ω
    • 220Ω
    • 370 Ω
    • 1K Ω
  • Card 1000 holes
  • electric wires

Step 1: Set the ESP8266-01

Connect the ESP to Arduino following the pattern in the figure, be sure to fuel the ESP with a voltage of 3.3 volts using a voltage regulator (I used an LM317) powered by an external source, because needs a lot of energy that arduino can not give.

Upload to Arduino / Genuino the code: https://create.arduino.cc/editor/Tittiamo/7e4b0e1b-ffd9-4ab7-b007-8c24c063c152/preview, open the serial monitor and give the command "AT" followed by ENTER, if nothing appears you need to set the speed of the serial monitor, make several attempts until you see "OK".

Now type the command "AT+CWMODE=1" to set the ESP as "Client"
Give the command "AT+CWLAP" to see which WiFi networks are nearby, with the command "AT+CWJAP="SSID","password" " you connect the ESP to your WiFi network, to check if it is well connected, type "AT+CIFSR". Now that the ESP8266 has been set, you can switch to connect other components

Step 2: Prototyping

Connect the rest of the components following the Fritzing scheme.

Record a "thingspeak" account (https://thingspeak.com/) and create a new channel, give it a name and description.

Field 1: Temperature

Field 2: Humidity

Field 3: Pressure

Save and open the API Keys tab, and store the "api_key reading".

Load the "https://create.arduino.cc/editor/Tittiamo/37999913-81ae-4a32-a79d-cc68b18c5c72/preview" code in Arduino, by replacing line 35 with your api_key, in line 26 to replace the altitude with that of your location, load the design, and enjoy the card's results: "Private View" into thingspeak.

If you want to publish your channel, go to settings and give the flag to "make public"

Step 3: Assembling

Tested that everything worked, I built the circuit on a breadboard a thousand holes

For personal enjoyment I also built an Arduino Standalone.

In order to replicate the work, I have attached the designs made in Excel.

As container I used a metal box I had at home, the DHT sensor was put externally to box while the BMP inside

To feed the weather station I used an old telephone charger

Step 4: My Channel

I positioned the weather station below the balcony of my house and if you want to know the climate of Bussero, just go in https://thingspeak.com/channels/125766 or visit my site in https://sites.google.com/site/tittiamo68/MeteoTitti

Comments

author
Thomas1953 (author)2017-04-01

Dear Tittiamo,

I receive in my Serial Monitor message "AT+CIPCLOSE" after every Temp, Hum and Pressure reading. This means (I think) that the data is NOT uploaded to thingspeak (I see no data there). Can you help me out ?

regards, Tom

author
tittiamo68 (author)Thomas19532017-04-04

I too, at times, I get the message, but then operate normally.

author
Thomas1953 (author)tittiamo682017-04-04

Again . . . the station works fine, but there is only data visible in my SerialMonitor but NOT on Thingspeak. I think it has to do with the settings of the BaudRate but I am to unfamiliar with this technique to get it right. Can you help me out, regards Tom.

author
tittiamo68 (author)Thomas19532017-04-05

You have verified that ESP8266 is connected to the router?

You've put your api_key to line 34 (apikey String = "your channel's thingspeak API key";)?

Let me know...

author
Thomas1953 (author)tittiamo682017-04-05

Yes and Yes . . .

I noticed that ESP8266's baudrate is 115200.
In you ino-file you are using 9600 . . . can that be the problem ?

regards, Tom

author
tittiamo68 (author)Thomas19532017-04-05

Try changing the speed, the line 45. From ser.begin (9600); to ser.begin (115200);

author
ArduinoElectronics (author)2017-01-12

Cool Project!! Appreciate your project...

author

Thank you very much