Arduino UNO Mini-Weather Station





Introduction: Arduino UNO Mini-Weather Station

This is the first generation of my Arduino based mini-weather station with wi-fi connection, which is able to post data publicly online using ThingSpeak platform.

The weather station collects the following data related to the weather and environment using different sensors:

  • Temperature;
  • Humidity;
  • Atmospheric pressure;
  • Light intensity;
  • UV index;
  • Dust concentration.

The aim is to make a small and simple weather station, using open hardware.

Let's get start and have fun!

Step 1: Electronic Components

For this project you'll need the following components:

  1. Arduino Uno (buy)
  2. Grove light sensor (buy)
  3. Grove UV sensor (buy)
  4. Barometric pressure sensor (BMP085) (buy)
  5. DHT22 (buy)
  6. Grove dust sensor (buy)
  7. ESP8266 (buy)
  8. Protoshield (for a more compact version) or an ordinary breadboard (buy / buy)
  9. 1 kohm resistor (x2)
  10. 10 kohm resistor (x1)
  11. 4k7 ohm resistor (x1)
  12. Some jumper wires
  13. A computer (for compiling and uploading Arduino code)

You won't need specific tools for the assembly of this project. All the components can be found online on your favourite e-commerce store.

The circuit is powered by the USB port (connected to a computer or a ordinary phone charger), but you may also add an external DC power supply or a battery connected to the Arduino power jack.

A case for the weather station circuit is out of the scope of this project.

Step 2: Connecting the Parts

Connect all the componets according to the schematic. You'll need some jumper wires to connect each sensor to the breadboard. You might use a protoshield (for a more compact circuit), an ordinary breadboard, or design you own Arduino shield.

Plug the USB cable to the Arduino Uno board and proceed to the next step.

Step 3: Coding

Assuming you have already installed the latest Arduino IDE, download and install the following libraries:

DHT22 library:

Adafruit BMP085 library:

For instructions on how to add the libraries to Arduino IDE, check the following Arduino guide:

Download Arduino code (weatherBox.ino). Replace XXXXX by your wifi router SSID YYYYY by router password and ZZZZZ by your ThingSpeak channel write API key (see how to obtain it on next step).

Connect the Arduino board to your computer USB port and upload the code.

Step 4: ThingSpeak Configuration

  1. Create a ThingSpeak account;
  2. Create a new Channel;
  3. Specify the name and description of your weather station. Assign the following channels and save the channel:
    • channel 1 = light
    • channel 2 = humidity
    • channel 3 = temperature (from DHT22)
    • channel 4 = UV index
    • channel 5 = dust concentration
    • channel 6 = pressure
    • channel 7 = temperature (from BMP085)
  4. Copy API write key. It is used in the previous step in Arduino code;
  5. When the station is turned on, sensor values will be uploaded to the channel periodically. You may configure public and private visualizations of each variable.

Example of a public channel:

Step 5: Using Android App

You'll be able to visualize weather station data in any browser. But you might also check it on you Android based smartphone and visualize it whenever you want.

  1. Download and install ThingsView app from Google Play store on your Android device;
  2. On the app, insert your channel ID number and click add. You'll find the ID on your ThingSpeak channel configuration;
  3. The current values of each variable will be displayed in a graph;
  4. Have fun!



    • Oil Contest

      Oil Contest
    • Make it Move Contest

      Make it Move Contest
    • Clocks Contest

      Clocks Contest

    We have a be nice policy.
    Please be positive and constructive.




    Hi Igor,

    please help me to get rid of theses errors.

    WARNING: Spurious .github folder in 'Adafruit BMP085 Library' library

    WARNING: Spurious .github folder in 'DHT sensor library' library

    C:\Users\sangeeth\Downloads\weatherbox_ino\weatherbox_ino.ino:6:31: fatal error: Adafruit_BMP085_U.h: No such file or directory

    #include <Adafruit_BMP085_U.h>


    compilation terminated.

    Multiple libraries were found for "DHT.h"

    Used: C:\Users\sangeeth\Documents\Arduino\libraries\DHT_sensor_library

    Not used: C:\Users\sangeeth\Documents\Arduino\libraries\DHT-sensor-library-master

    exit status 1

    Error compiling for board Arduino/Genuino Uno.

    1 reply

    Thi there!
    Arduino IDE has an issue when a library folder contains a "-" on its name. Maybe it's not compiling due to the "DHT-sensor-library-master" library. Did you try to remove it from the libraries folder?
    This way the IDE will see only the "DHT_sensor_library" folder and might compile your code.

    Hi Igor.
    I have a few questions about your project, please clarify:
    According to the scheme it is not quite clear where the power is taken (3v or 5v +) for the light sensor, UV, dust sensor, temperature sensor;
    When connecting DHT22 library, Adafruit BMP085 library when compiling the sketch, error - VHLGBXIOYPYS5O.ino: 5: 29: fatal error: Adafruit_Sensor.h: No such file or directory. When adding the library Adafruit_Sensor - error FVHLGBXIOYPYS5O: 15: error: 'dht' does not name a type
    Arduino 1.8.1. Best regards Andrew.

    1 reply

    Hi there.

    There was a mistake regarding dust sensor power input, and I forgot to add a jumper between Arduino Uno 5V pin and the breadboard. I corrected it on the drawings and added a higher resolution pdf file.

    All the sensors are powered from Arduino Uno 5V pin. 3.3V is only used as ESP8266 power supply.

    Regarding the problems you are facing with the libraries, please verify if their folders has a hyphen in their names (DHT-sensor-library-master, for instance). If that's the case, rename the folders, removing all "-". For some reason Arduino IDE doesn't recognize folders with hyphens.

    hi. perfect system! congrats!

    i am planning to use it for my little greenhouse :)

    one question:could you tell me please, how can i add this system "a soil humidity sensor" and a lcd screen 2x16 for real time checking on board? how can we add them to code? if you not to busy, could you write this part of code please? i am still not good at coding. thanks.

    12 replies

    Hi there. I've never used those LCD screens. In order to add a soil humidity sensor to the Arduino code you'll have to add the following pieces of code:

    - line 28:int soilPin = A2;

    - line 109: float soil = analogRead(soilPin);

    - line 125: String soilStr = dtostrf(soil, 4, 1, buffer);

    - line 126: soilStr.replace(" ","");

    - line 127: updateSensors(luminanceStr, humidityStr, temperatureStr, uvStr, dustStr, pressureStr, temperature1Str, soilStr);

    - line 146: void updateSensors(String luminanceStr, String humidityStr, String temperatureStr, String uvStr, String dustStr, String pressureStr, String temperature1Str, String soilStr) {

    - between lines 167 and 168:

    cmd += "&field8=";

    cmd += soilStr;

    I hope it helps.

    thanks Igor. i ordered already soil humity sensor. i hope i will make.

    but now i am trying to compile the original version of weather station.i am getting some errors. it is the 3th day that i can not resolve. could you help please when it will be ok for you?( thanks in advance)

    "weatherboxORJINAL:14: error: 'dht' does not name a type

    dht DHT;


    weatherboxORJINAL:15: error: 'Adafruit_BMP085_Unified' does not name a type

    Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);


    /Users/omac/Documents/Arduino/full wather station nemli/weatherboxORJINAL/weatherboxORJINAL.ino: In function 'void setup()':

    weatherboxORJINAL:42: error: 'bmp' was not declared in this scope



    /Users/omac/Documents/Arduino/full wather station nemli/weatherboxORJINAL/weatherboxORJINAL.ino: In function 'void loop()':

    weatherboxORJINAL:96: error: expected primary-expression before '.' token

    int chk = DHT.read22(DHT22_PIN);


    weatherboxORJINAL:97: error: expected primary-expression before '.' token

    float humidity = DHT.humidity;


    weatherboxORJINAL:98: error: expected primary-expression before '.' token

    float temperature = DHT.temperature;


    weatherboxORJINAL:101: error: 'bmp' was not declared in this scope



    exit status 1

    'dht' does not name a type

    Did you install the libraries for the DHT22 and BMP085 sensors before compiling the code?

    You can find the links for those libraries on Step 3.

    yes. couple of times. fist of all, iinstall libs. than i download weatherBox.ino

    open it, didnt work. rewrite the "include lib " lines.

    couple of times, several variations i tried.

    but did not worked

    That's strange. If I remove the "#include <library_name> from my code I have the error you described above. So maybe it's an issue related to the instalation of those libraries.

    Can you find those libraries if you access Sketches > Include library on the Menu? Did you try to add the libraries that way?

    oh God.

    i made it :)

    now adding the additional lines for soil humidity sensor...

    How did you solve that?

    thank you Igor. seems, everything is ok. i ordered the sensors.when i received them, i will make the weather station and inform you; whether i made or not.

    i also planningt to order this part:

    could we add this to our weather station?

    i remember, you mentioned about it before. could you add this part of code to the main code :)

    i would be very appreciated if you could write this part of code too.

    Yes, it's possible to add this component. I'm not sure on how to add this to the code. I think you'll have to measure the number of pulses in a given time, and from that calculate the wind speed.

    as you said; reinstalled them again.

    the last picture is:

    #include <dht.h>

    #include <DHT.h>

    #include <DHT_U.h>

    #include <Adafruit_Sensor.h>

    #include <Adafruit_BMP085.h>

    #include <Adafruit_BMP085_U.h>

    other variations did not worked.

    i reduced the errors to :

    In file included from /Users/omac/Documents/Arduino/FVHLGBXIOYPYS5O/FVHLGBXIOYPYS5O.ino:6:0:

    /Users/omac/Documents/Arduino/libraries/DHT-sensor-library-master/DHT_U.h:68:3: error: 'DHT' does not name a type

    DHT _dht;


    exit status 1

    Error compiling for board Arduino/Genuino Uno.

    no further

    I think the problem is the related to name of your library folde (DHT-sensor-library-master).

    The IDE will not load files with certain characters in the
    name, like dashes ('-') for instance. Replace each dash (‘-‘) with and
    underscore (‘_’) and maybe it will work.

    Hi Igor

    I'm trying to build you weather station. I'm a complete amateur at this but are there some items missing from you schematic, I can see the sensors on the photo but they are lacking in the breadboard image, I've just brought all the gear and apparently I have know idea, please can you advise. best regards R