Friday, February 22, 2013

XBee Interface for the Davis Vantage Vue Personal Weatherstation

About a month ago I finally purchased a good personal weather station, a Davis Vantage VUE. I performed a ton of research over the past few months and the Davis models seemed to be some of the best within a reasonable budget. One of the main features I liked about the Davis models is the wireless capability of the sensor unit and most importantly the two second data update interval. This was important to me as I wanted to be able to submit real-time data up to the Weather Underground utilizing their rapid-fire servers and API.

I had been doing this previously via some home made sensors I had put together, at the time I was sending temperature and humidity data to my Wunderground station (KMIWESTB14) via one of my datacenter temperature monitoring sensors I had built. The sensor was mounted outside and transmitted data via an XBee to a linux server in the basement rack where a simple bash script listened to the serial port, reformatted the data and sent it up to Wunderground. While it was cool, I wanted more data. My station was lame compared to many of the other nearby stations, so I looked to expand. Barometric pressure was easy as SPI/i2c sensors to receive air pressure are cheap and prevalent  but the remaining sensors, notably wind direction and speed were not. These sensors would require mechanical designs (which I am all for building) along with calibration which would be the more difficult piece to solve. Calibrating a wind vane would be simple, but calibrating a anemometer would require a calibrated source or device, I would at least have to invest in a good handheld anemometer to calibrate my home built one. With the cost of these even used not really cheap, I finally decided to retire my station and purchase a commercial one.



The Davis Vantage VUE system is awesome and I have been very happy with it for the first few weeks of using it. The only complaint I have is it did not have any type of available interface to access it by, no direct serial, ethernet, USB, etc. These were all additional add-ons that were necessary to purchase along with the unit. I knew this when purchasing it, and I had plans to reverse engineer it as soon as I received it.

The Davis Vantage VUE console is a rather simple device, the main board has a handful of components which include a common ATMEL microcontroller, so this was going to be easy. Figuring out the pinout on the back of the unit was trivial at best, but it turns out that a group of people already have. A few weather forums out there have a good amount of information on the Davis interface which consists of a 20pin, (2x10) 2mm pitch connector that the factory options can install onto. A pinout of this interface is readily available along with a full API of the serial interface.

Once discovering that a serial interface was available on the back of the unit, my immediate thought was to use an XBee. Checking the pinout of the connector there was also +3V and Gnd available. Perfect! Since an XBee can run between +2.8V and +3.4V,there would be no issues as long as not too much current was consumed eliminating the need for any additional power source. Because I had no data on how much current I could actually draw off of this port, I stuck with a standard XBee (non-pro) as its transmitting current at 3.3V is only 45ma. Assuming it may be slightly higher at 3.0V, it would still be low enough (I had hoped) to run the XBee, and after some testing I proved that it was.

Once some basic testing was made with the XBee to prove that it worked, I designed up a simple board and sent it off. Once received, I threw it together and here is the final device:


Davis weather station XBee interface

It tucks neatly into the back of the Davis console. I chose to use an original V1 XBee (still wearing the MaxStream logo as it was pre-Digi) because it was the only one on hand that I had with a nice low profile chip antenna.


Hacking Davis Vantage VUE

Once I had it installed, which fit very nicely into the back of the console, I wired up another XBee to serial interface on my desktop and powered up the Davis. The unit initially responds with an 'LCD ok' message at the same time the unit goes through its self testing at which point it is ready for commands. The easiest is to send an 'STRMON' to it which will dump all of the raw sensor data from the external sensor unit every two seconds.



I have had this running for a few days now without any issues, the next step will be to rewrite my simple script to grab this new data and reformat it according to the Wunderground API and send it.

One additional note on this, apparently Davis has limited the usability of the serial port on the newer versions of firmware. Luckily my new unit came with the older version of firmware which still allows access to the serial interface. It is unfortunate that this has happened, I can't imagine getting around whatever was put in place to figure out how to re-enable the serial interface would be too difficult, but I am not about to update my unit to find out.



10 comments:

  1. Nice! Any plans to share the board design?

    ReplyDelete
  2. Yes, I can since there appears to be interest. I'll put the board gerbers up on github along with all the python code I have wrote once it is completed.

    -Brad

    ReplyDelete
  3. How does the Xbee connect to the Vue - I've read there is a 20 pin connector, is this correct?

    ReplyDelete
  4. Brad, did you ever post the gerbers? Could really use those. Tried my hand with some board design tools, but had trouble with the 2mm spacing on the connector. All I need is a board, no code.

    ReplyDelete
    Replies
    1. Jim,

      I have the code and gerbers available here on github: https://github.com/bradthx/davis-weather

      Delete
  5. Dear Brad, finally my Raspberry Pi with Xbee running Weewx! Have a look at dessert.weerstation.blogspot.nl and http://members.ziggo.nl/kanis01 Thanks for your help!!

    Michiel

    ReplyDelete
    Replies
    1. Hello Michiel, excellent work! I'm glad you found my board useful.

      Delete
  6. sorry dessertweerstation.blogspot.nl

    ReplyDelete
  7. Who is interested in a Davis Vantage xbee interface?

    ReplyDelete
  8. hallo
    ik ben wel geïnteresseerd in een interface
    mail me als je iets kunt maken
    lesavelo@gmail.com

    ReplyDelete