loading

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
  2. Grove light sensor
  3. Grove UV sensor
  4. Barometric pressure sensor (BMP085)
  5. DHT22
  6. Grove dust sensor
  7. ESP8266
  8. Protoshield (for a more compact version) or an ordinary breadboard
  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 uploadinf 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:

https://github.com/adafruit/DHT-sensor-library

Adafruit BMP085 library:

https://github.com/adafruit/Adafruit-BMP085-Library

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

https://www.arduino.cc/en/Guide/Libraries

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: https://thingspeak.com/channels/35540

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!
<p>hi. perfect system! congrats!</p><p>i am planning to use it for my little greenhouse :) </p><p>one question:could you tell me please, how can i add this system &quot;a soil humidity sensor&quot; 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.</p>
<p>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:</p><p>- line 28:int soilPin = A2;</p><p>- line 109: float soil = analogRead(soilPin);</p><p>- line 125: String soilStr = dtostrf(soil, 4, 1, buffer);</p><p>- line 126: soilStr.replace(&quot; &quot;,&quot;&quot;);</p><p>- line 127: updateSensors(luminanceStr, humidityStr, temperatureStr, uvStr, dustStr, pressureStr, temperature1Str, soilStr);</p><p>- line 146: void updateSensors(String luminanceStr, String humidityStr, String temperatureStr, String uvStr, String dustStr, String pressureStr, String temperature1Str, String soilStr) {</p><p>- between lines 167 and 168:</p><p>cmd += &quot;&amp;field8=&quot;;</p><p> cmd += soilStr;</p><p>I hope it helps.</p>
<p>thanks Igor. i ordered already soil humity sensor. i hope i will make.</p><p>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)</p><p>&quot;weatherboxORJINAL:14: error: 'dht' does not name a type</p><p> dht DHT;</p><p> ^</p><p>weatherboxORJINAL:15: error: 'Adafruit_BMP085_Unified' does not name a type</p><p> Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085);</p><p> ^</p><p>/Users/omac/Documents/Arduino/full wather station nemli/weatherboxORJINAL/weatherboxORJINAL.ino: In function 'void setup()':</p><p>weatherboxORJINAL:42: error: 'bmp' was not declared in this scope</p><p> if(!bmp.begin())</p><p> ^</p><p>/Users/omac/Documents/Arduino/full wather station nemli/weatherboxORJINAL/weatherboxORJINAL.ino: In function 'void loop()':</p><p>weatherboxORJINAL:96: error: expected primary-expression before '.' token</p><p> int chk = DHT.read22(DHT22_PIN);</p><p> ^</p><p>weatherboxORJINAL:97: error: expected primary-expression before '.' token</p><p> float humidity = DHT.humidity;</p><p> ^</p><p>weatherboxORJINAL:98: error: expected primary-expression before '.' token</p><p> float temperature = DHT.temperature;</p><p> ^</p><p>weatherboxORJINAL:101: error: 'bmp' was not declared in this scope</p><p> bmp.getEvent(&amp;event);</p><p> ^</p><p>exit status 1</p><p>'dht' does not name a type </p>
<p>Did you install the libraries for the DHT22 and BMP085 sensors before compiling the code?</p><p>You can find the links for those libraries on Step 3.</p>
<p>yes. couple of times. fist of all, iinstall libs. than i download weatherBox.ino</p><p>open it, didnt work. rewrite the &quot;include lib &quot; lines.</p><p>couple of times, several variations i tried.</p><p>but did not worked</p>
<p>That's strange. If I remove the &quot;#include &lt;library_name&gt; from my code I have the error you described above. So maybe it's an issue related to the instalation of those libraries.</p><p>Can you find those libraries if you access Sketches &gt; Include library on the Menu? Did you try to add the libraries that way?</p>
<p>oh God.</p><p>i made it :)</p><p>now adding the additional lines for soil humidity sensor...</p>
<p>How did you solve that?</p>
<p>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.</p><p>i also planningt to order this part:</p><p><a href="http://www.ebay.com/itm/322206596553?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT" rel="nofollow">http://www.ebay.com/itm/322206596553?_trksid=p2057...</a></p><p>could we add this to our weather station?</p><p>i remember, you mentioned about it before. could you add this part of code to the main code :)</p><p>i would be very appreciated if you could write this part of code too.</p>
<p>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.</p>
<p>as you said; reinstalled them again.</p><p> the last picture is:</p><p>#include &lt;dht.h&gt;</p><p>#include &lt;DHT.h&gt;</p><p>#include &lt;DHT_U.h&gt;</p><p>#include &lt;Adafruit_Sensor.h&gt;</p><p>#include &lt;Adafruit_BMP085.h&gt;</p><p>#include &lt;Adafruit_BMP085_U.h&gt;</p><p>other variations did not worked.</p>
<p>i reduced the errors to :</p><p>In file included from /Users/omac/Documents/Arduino/FVHLGBXIOYPYS5O/FVHLGBXIOYPYS5O.ino:6:0:</p><p>/Users/omac/Documents/Arduino/libraries/DHT-sensor-library-master/DHT_U.h:68:3: error: 'DHT' does not name a type</p><p> DHT _dht;</p><p> ^</p><p>exit status 1</p><p>Error compiling for board Arduino/Genuino Uno.</p><p>no further</p>
<p>I think the problem is the related to name of your library folde (DHT-sensor-library-master).</p><p>The IDE will not load files with certain characters in the<br>name, like dashes ('-') for instance. Replace each dash (&lsquo;-&lsquo;) with and<br>underscore (&lsquo;_&rsquo;) and maybe it will work.</p>
<p>Amazing project!</p>
<p>Thanks!</p>
<p>Hi Igor </p><p>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</p>
Hi Richard,<br>Which sensors you couldn't find on the breadboard imagem? I verified it, and I think all the sensors are there (dust sensor, UV sensor, light sensor, humidity and temperature sensor, and pressure and temperature sensor). Please let me know, so that I can correct breadboard imagem.<br>Notice that some sensors measure more than one variable. DHT22, for instance, measures air temperature and humidity.
<p>Cool project. I always wanted to build my own weather station </p>
Thanks! Now you can build yours! :D
nice instructable. it would be cool to add wind speed and direction too
<p>Thanks, RamblinLane! I'm plan to add other sensor (wind sensors and some gas sensors for instance). The problem is that wind sensors are too expensive and I haven't found cheap ones yet.</p>

About This Instructable

4,260views

63favorites

License:

More by IgorF2:Solar Charged Battery Powered Arduino Uno Wi-fi controlled FPV rover robot (with Arduino, ESP8266 and stepper motors) Controlling LED matrix array with Arduino Uno (Arduino powered robot face) 
Add instructable to: