I wanted to have a log of outdoor weather with PC logging and graphs for quite some time now. There are such devices in the market but their cost is really high. So, decided to build one by myself and enjoy the experience too.

  • Temperature, Humidity and barometric pressure measurement
  • No external power for outdoor sensors required (solar powered)
  • Wireless communication between outdoor sensor and PC
  • Full logging and reporting on weather information on PC
  • Relatively inexpensive and easy to build

Code is also available at https://github.com/zmashiah/arduino-StalkerV2WeatherStation

Components of the solution
  • Arduino compatible Seedstudio Stalker board for remote sensors.
  • XBee based communication between outdoor sensor and PC
  • Solar panel and LiPo battery for outdoor sensor power
  • XBee Explorer connected to PC for communication reception
  • C# based PC application to store, report and graph all data

What will you need to build this?
  1. Seeduino Stalker v2 ($39). If you chose v2.1 there will be some code modifications required.
  2. Solar panel for powering the outdoor sensor ($ 2.00)
  3. A LiPo battery of 1000mAH or 2000mAh ($7.5 - $12)
  4. DHT22 Humidity sensor ($ 9.95)
  5. BMP085 Barometric pressure sensor ($19.95)
  6. A 10K Resistor
  7. 2x Xbee series 2 modules (2x $25.95)
  8. XBee Explorer ($ 24.95)
  9. Jumper wires
  10. USB Cable to connect PC to XBee Explorer
  11. Optional small bread-board to hook up the two sensors above. Choose either a solder-less one or something like this that does require soldering or any other alternative you think is suitable for you.
You will need UartBee board to program the Seedstudio Stalker. Optionally you will also need an FTDI board, 3.3V to see debug information from the stalker board. If you are in the business or hobby of building stuff, you should probably have one in the house. These module are not required after the assembly is done.

Notes about the components:
Battery: I built the outdoor sensor unit with 2000mAh battery, however by monitoring the device for few months now, including winter I can tell you this is really an overkill as the battery does not get drained or even close to that. I have every reason to believe a 1000mAh or even less will be enough.
Price: For almost any of the components above, I recommend spending some time online, including eBay to find a much better price for each. My experience in the last 6months is that you can find things on eBay for fraction of the cost compared to the amateurs sites.
Board: I used the Seedstudio Stalker for remote sensor controller, however one can really build it with many other Arduino compatible boards. The reason I chose this one is because it has both XBee module socket, on-board real-time-clock (RTC), ready for LiPo battery power and charger, which are all great features that are required here. I did take advantage of the RTC for waking up the board periodically.
XBee: I used the 2mW Series 2 ZigBee modules while in fact for this application without future enhancements that I consider, one can use Series I modules and perhaps the 1mW versions. Since I plan future enhancements I used the Series 2 modules. As for transmitting power, the 2mW will be my recommendation. My house is built of concrete and the distance between outdoor sensor station and PC is not too long, still if I take it 5 meters further, the reception becomes very poor.
DHT22: You can choose to use DHT11 instead of the DHT22

Other Tools you will need:
  1. Arduino IDE. I use the version 0022. Porting the code and libraries to newer IDE version should not be too difficult but pointless as far as I am concern. 
  2. X-CTU tool for configuring the XBee modules
  3. I use the following libraries: TMP102 (Stalker on-board temperature sensor), R8025 (Stalker on-board RTC), BMP085 (barometric pressure sensor), DHT (for DHT22 humidity sensor), NewSoftwareSerial (for debugging console), Xbee-arduino (for wireless communication). All these libraries are included in the code ZIP file here, however if you decide to port or modify things here, I thought is important to mention this list. Specifically when porting to newer IDE note the name of NewSoftwareSerial was changed, and you need to use #include instead of #include (back-compat of the IDE was not high on the list I guess :-))
  4. Soldering Iron

This is a hobby build and not a product. I did not include any languages support other than English. I use only Celsius temperatures (you can modify code to use Fahrenheit if you want), there is no data archiving and grooming support and more similar stuff that makes something a product rather than a hobby build.

Step 1: Assembly Instructions

To Assemble the remote weather station you will go through the following step, and will elaborate on each below:
  1. Connect all the sensors to the Stalker/Arduino board
  2. Make minor modification to the Stalker
  3. Configure the XBee modules
  4. Load program onto the Stalker
  5. Run program on the PC
Connecting the sensors:
DHT22 connected to digital pin 2.
DHT22 Pin 1 to 3.3 Volt of Arduino
DHT22 Pin 4 to GND of Arduino
DHT22 Pin 2 to digital pin 2 of Arduino
10KOhm resistor between pin 1 (Vcc) to pin 2 (data) of the sensor
DHT22 Pin 3 is left not connected.
Consider using small bread-board for this small circuit
Console for debugging (optional) on digital pins 3 and 9 (9600 based console)
This is only useful if you want to see debug messages, change things in the SW etc.
For this to work you will need to connect the FTDI to the below pins or simply use
additional FTDI board (that's what I did). If you only use one board then you will need
to connect it to the programming side, load the program then connect to the console pins to see the output, which is pretty tedious if you ask me.
To connect console only, here are the connections required:
GND from the FTDI to Arduino GND
Rx from the FTDI to digital pin 9 of the Arduino
Tx from the FTDI to digital pin 3 of the Arduino
BMP085 is connected to the I2C interface (analog pins 4 and 5 of the Arduino).
Vcc from sensor breakout board to 3.3V of Arduino
Gnd from sensor breakout board to GND of Arduino
SDA from sensor breakout board to Aruino analog pin 4
SCL from sensor breakout board to Arduino analog pin 5
If you are using small bread-board for the DHT22 sensor, you can probably include this sensor on it too.

Minor modification to the Stalker board
I used the Stalker v2.0 board, now there is v2.1 board too.
In the v2.0 you will need to place a short on the bottom side of the board to connect INTA\ and PD2 pads, see this picture.
I did not checked it with v2.1 of the Stalker, but could see the same functionality still exist there. Having said that, the RTC module used in the Stalker v2.1 is very different DS3231 compared to R8025 on the v2.0. There are Arduino libraries for this new version RTC module out there, but it will obviously require some code modifications on the sketch I have here. This is not very difficult though, so don't be too scared of that.

Next connect Arduino digital output 5 to XBee pin 9. You will see Pin 1 marked on the XBee and Pin 9 is one before last on that row. The Stalker does expose 0.1" header that represents the XBee pins so it is easy to solder a header and do the connection, or use simple wire for that.

Configuring the XBee modules
There is quite a bit of information and in-depth on the XBee modules on the net. I will not go into all the details here. Few notes though: The XBee modules have API mode and Command mode firmwares. I use the library that requires the API mode. Also, with Series 2 of XBee, there is a role for each module, so we need one coordinator that is connected to the PC and one endpoint which is the module installed on the remote weather station. Also there is some addressing information that needs to be identical between units, and I chose this address code to be 2266 (my birthday if anyone is curious). Obviously you can choose something different. On the coordinator side (PC) the AO needs to be 0. On the weather station side the AO should be 2 (but in any case I ignore the return codes, so it will work anyway).
  1. Install the X-CTU utility
  2. Optionally do firmware upgrade to the XBee Modules (please note you need the API mode firmware)
  3. Configure one unit to be coordinator and another to be endpoint
  4. Configuration for both coordinator and endpoint (the sensor) is included in the ZIP file for this instructable
  5. Write down the Coordinator XBee address (Nodes Addressing/SH and Addressing/SL).
  6. Place the XBee module configured as endpoint into the Stalker socket
  7. Place the XBee module configured as coordinator into the XBeeExplorer and connect it to the PC
Loading Program onto the Stalker board:
  1. Connect the UartBee to the Stalker programming pins (see Seeduino site for details).
  2. Make the recommended modifications to Arduino IDE so that it will know about this type of board (see the content in ArduinoIDE sub directory of the ZIP file attached here)
  3. Add the libraries from the ZIP file sub directory Libraries to the user libraries of your Arduino IDE
  4. Connect the UartBee to your PC USB
  5. Place the code for the Stalker in your development area,
  6. Go to the line in the ..pde file that says "static XBeeAddress64 addr64 = XBeeAddress64(0x0013A200, 0x40869EF2);" and modify the numbers to have the address of your coordinator as you wrote down in previous section XBeeAddress64(SH, SL);
  7. Compile and load the program onto the Stalker
  8. Connect battery and solar charger once you also assembled all in your enclosure
Run the program on the PC
  1. Place the .exe and .dll files on your PC in some directory of your choice (no, did not do an install program). WeatherSationMan.exe and DTG.Spreadsheet.dll are located in the WeatherStationMan\bin\Debug
  2. Run the program and double click on the COM port to which your XBee is connected to
  3. After a minute or so, you should start to see readings of the weather information from the remote station
  4. Add the program to automatically start on boot time by following steps in this explanation. Follow the path and file name of the program with the parameter specifying the COM port to which the XBee is connected. For example, if the COM port is COM20, you will do something like: C:\Temp\WeatherStationMan.exe COM20
<p>Can you explain how you placed a short on the Stalker board? </p>
<p>Hi Thomason,</p><p>The short is done between two pads that are really close to each other (see the picture in the instructable text). Use your iron and drop of tin to make the short mentioned.</p>
<p>Hi Zmashia, </p><p>the text and picture are very vague. Can you send a specific picture and text that shows the exact area and give more detailed directions? thanks!</p>
<p>There is a picture showing the bottom of the board (Red PCB).</p><p>Right in the middle of the picture are pads marked with INTA_RTC (If you look at the S of the Seeduino logo, follow left the leads on the PCB until they make a bend down (south), you will see the mention pads.</p>
<p>Thank you for the Instructable. I want to note that since you state cost is an issue, you could think about replacing those Xbee's with generic RF modules for a fraction of the price (1.25$ on eBay for a set of receiver and transmitter including shipping). Also you can easily run this on a simple Arduino on a breadboard solution and add a step up converter and a lipo charger module for a total of 7 or 8 bucks. Last you can find barometric pressure sensors for as little as $1.40 on eBay. These changes will save you $120 easily. </p>
Thanks Rick. Not all options you mentioned were available at the time, and indeed you can save quite a bit on this if you go with different HW options. The biggest savings could be the RF modules as I use very little features of the Zigbee stack (nothing but CRC actually). I was suspicious about the range and reliability of the other modules. Time proved I was wrong. The Zigbee modules were replaced few times due to module problems and other projects I done with penny RF modules continue to work flawlessly. You always learn something new...
<p>Hi again! I updated the arduino code to the new stalker 2.3 and it&acute;s fine on the arduino side. There is however a parsing error on the PC app.</p><p>I don&acute;t know C so I am stuck. </p><p>I think this may be a small sequencing size or order thing inside the packets, as they are received and obviously you structured the sending and receiving.</p><p>I understand this is now an old project for you but, believe me, you can&acute;t find much help on sending and receiving digital sensors data on API mode!</p><p>Can you help?</p><p>Regards!</p>
It is C# not C. Much easier than C, but without debugging I can't really help. Sorry
<p>Hi Zakie</p><p>I reconfigured the xbees and now I get a reading on the PC side with no errors. The problem is the PC program WeatherStationMan stops working as soon as the first set of data is received and Windows closes the program (which actually is showing the correct data on the background.</p><p>Can you help? We are almost there this time!</p><p>Regards</p>
<p>Please check your XBee configuration in case your configuration now sends to the PC some of the Mesh internal message. I don't quite remember the name of that configuration parameter, but I remember there is one. The C# program does not know how to parse those messages, and we don't need that in this case.</p>
<p>Always happy to help.</p><p>Have you modified code on the sending side (arduino)? If so, send me that code please.</p><p>Do you know how to use X-CTU by any chance? If so, please send me the dump of the received packet on the PC side. That will be very helpful</p>
<p>Hi Zmashiah</p><p>Thanks for your reply. I was away for a few days so I am answering only now.</p><p>I did modify the code a bit to include the new RTC; works fine on the arduino side.</p><p>Problem is on the PC side: error or parsing packets.</p><p>I have the code ready to send you and a few sample packets, as you asked but I don&acute;t know if it will upload.</p><p>If you don&acute;t receive them let me know how to send.</p><p>Regards</p><p>Pedotech</p>
<p>Hi,</p><p>I did receive the files, and couldn't find the issue easily. I think you will need to go into debugging to find out. On the PC side, place a breakpoint in source file <strong><em>MainWindow.cs</em></strong> and method: <strong><em>SerialDataReceivedEventHandler</em></strong>. Look at the flow of bytes and see if there is any need to change the offset of those.</p>
<p>Hi!</p><p>I am a complete ignorant on C, so I can't do anything on the PC side.</p><p>Thanks for your interest anyway</p>
<p>HI! Here is the code and the xbee packets; changed your original code minimally adding DS3231 lib and little more.</p><p>Thanks for your help</p>
<p>Hi! Seems to be a wonderful project, especially the PC part, but the arduino doesn't upload. With IDE 0022 or newer ones, with old libs with newer ones.</p><p>I understand from your previous replies you are not inclined to update your code.</p><p>What can make you change your mind? A big PLEASE!</p>
Hey Pedero,<br>The Arduino code is very easily portable to any of the newer IDE versions.<br>The biggest issue I see today in building it is to find an Arduino board like the one I used. SeeedStudio moved to a newer version of this board with different RTC, Thermometer etc. I don't have that board in hand, so can't tell you how different it will be, but based on the data-sheet, quite different.
<p>Hello! I'm currently trying to put this together and I have the latest version of the stalker(2.3) and it has the rtc ds3231. I was wondering how i would go about modifying the code for this change?</p>
<p>Hi,</p><p>SeeedStudio does provide library for the new RTC they placed in the newer revision of the Stalker board. I know of few people who did take this instructable and built it with the new Stalker. It is not suppose to be very difficult if you have programming experience with C++. I will have to search email history as I believe someone shared it with me a while ago.</p>
Great project! <br> <br>I'm building with VS2012, and its not finding the reference DTG.Spreadsheet? I don't thing that's in Jetcell? Where would I find this? <br> <br>Thanks...
I believe I included the Dll if not google it.<br>You have to add it to the solution in vs as reference/assembly
Awesome project! <br> <br>Having a little trouble though and am fairly new to arduino and coding in general. <br> <br>When I go to verify the code I'm getting the following issues: <br> <br>In file included from Battery.cpp:3: <br>/Users/admin/Documents/Arduino/libraries/NewSoftSerial/NewSoftSerial.h:33:2: error: #error NewSoftSerial has been moved into the Arduino core as of version 1.0. Use SoftwareSerial instead. <br>In file included from Battery.cpp:3: <br>/Users/admin/Documents/Arduino/libraries/NewSoftSerial/NewSoftSerial.h:99: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)' <br>/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/cores/arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)' <br>Battery.cpp: In function 'void Battery_init()': <br>Battery.cpp:15: error: 'INTERNAL' was not declared in this scope <br>Battery.cpp:15: error: 'analogReference' was not declared in this scope <br>Battery.cpp:16: error: 'INPUT' was not declared in this scope <br>Battery.cpp:16: error: 'pinMode' was not declared in this scope <br>Battery.cpp:18: error: 'HIGH' was not declared in this scope <br>Battery.cpp:18: error: 'digitalWrite' was not declared in this scope <br>Battery.cpp: In function 'void Battery_charge_status()': <br>Battery.cpp:27: error: 'boolean' was not declared in this scope <br>Battery.cpp:27: error: expected `;' before 'OK' <br>Battery.cpp:28: error: expected `;' before 'CH' <br>Battery.cpp:29: error: 'OK' was not declared in this scope <br>Battery.cpp:29: error: 'CH' was not declared in this scope <br>Battery.cpp:50: error: 'OK' was not declared in this scope <br>Battery.cpp:50: error: 'CH' was not declared in this scope <br>Battery.cpp: In function 'void Battery_voltage_read()': <br>Battery.cpp:56: error: 'analogRead' was not declared in this scope <br> <br>Any idea's what I'm doing wrong? <br> <br>Thanks
The code was written with IDE 0022 version. It seems to me the errors you get are result of using the IDE 1.00 or 1.01 which have some breaking additions to it, specifically with software serial. <br> <br>If you have some experience you can port the code to the new IDE, but if not and you are only looking to build it, use the older version of the Arduino IDE.
Thank you very much, I will download the older version of the IDE. <br> <br>Do I need to track down the older versions of the libraries(other than the ones you have included in the zip)? <br> <br>Thanks
Those included in the ZIP should work fine, and I believe I included all libraries that did not came in with the IDE itself. <br>In other words, you don't need to track changes for the libraries. <br> <br>I am planning to update this with newer version of the code that will work with newer Stalker version (contribution of another reader) and newer IDE. It will take me time, and not high enough on my endless todo...
I can see the Battery and R8025 libraries in the zip, but the other ones like NewSoftSerial, Xbee, dht, BMP085 and TMP102 are not in the zip. I'll see if I can track down compatible versions. <br> <br>Thanks for you help!
Send me email to zmashiah@gmail.com and I will send you the libraries you need.
<strong>1. Updating with few minor bug fixes:</strong><br> &nbsp; &nbsp;a. Faster memory freeing<br> &nbsp; &nbsp;b. In some cases the &quot;packet&quot; button remained green after reception of data is over.<br> &nbsp; &nbsp;c. Move program and data to D: instead of C: by default&nbsp;<br> <br> <strong>2. Howto for&nbsp;Windows 8 people, a link to add this program to your automatically stated list:</strong><br> <a href="http://www.eightforums.com/tutorials/5180-startup-items-manage-windows-8-a.html" rel="nofollow">http://www.eightforums.com/tutorials/5180-startup-items-manage-windows-8-a.html</a><br> The link you should create is as following:<br> &nbsp; (a) assuming program is located in <strong>D:\Temp</strong><br> &nbsp; (b) The serial port of the Xbee is <strong>COM3</strong><br> Then the link is <strong>D:\Temp\WeatherStationMan,exe COM3</strong><br> <br> <strong>3. Notes:</strong><br> &nbsp;- If you need to change the default drive, modify the code in <strong>WeatherStationManConstants.cs</strong><br> - Latest was built with Visual Studio 2012, as oppose to VS2010 for previous builds<br> <br> <br> <br>
Very Well Done!!!!!
<strong>Thanks!</strong><br> Always happy to hear a good thing
I think in the comments on DX there was a link to that manual <br>$23 difference is a lot for a manual :-) <br>
nice project. I got the DHT22 sensor for I think 4 USD or something at DealExtreme. no shipping cost
Yep, on DX and eBay one can find good prices instead of the traditional DIY online shops. I learned the lesson too, and now buy things mostly on eBay. On the other hand, I got a BT module from DX but could not locate its manual was not available. So $7 worth instead of the $ 30 on Sparkfun, but without manual it is pretty useless.

About This Instructable




Bio: An experienced manager in Hi-Tech that never gets bored with technology or life
More by zmashiah:Turning Stereo Amplifer On and Off automatically Colorful Countdown Clock for tight timeline management Bluetooth mobile phone accessory for Missed calls and SMS 
Add instructable to: