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.



Monday, November 12, 2012

A Silly USB Stick, It Presses 'F1'

So it happened to me. Recently I received some alert that my colocated servers were down at a local datacenter. There had been a power event where the UPS units there had failed causing a reboot of everything in this specific DC. While driving the the DC at 1am to figure out what was going on, I received alerts that some of my servers had came back up, while one had not. Upon arriving there were already a ton of people there dealing with their own equipment. Looking at my specific servers I could see there was a bad DIMM error on the front display, classically flashing orange. "All I need to do is press F1 To Continue" I thought, but unfortunately all of the crash carts were in use by other people there. Anyone who has Dell servers has seen this message during boot at some point if there has ever been any issues with their server. It is a classic error message which I wish Dell had always by default just made the server boot if possible. Because of the queue of people waiting for crash carts, I had to wait until one finally became available to press 'F1' to get my server alive. This could have easily been avoided if I had set this specific server to boot up regardless of error in the bios, but it was too late for this now.

The solution? Well, make sure your servers are set to boot regardless of error in the bios. But a backup solution is my "F1 USB Stick":



What does it do? It is a UDB HID Keyboard that presses F1 repeatedly! That's all!

Simply plug it into a server and it presses F1 for you. No keyboard needed! Your server will be back up in no time.

F1!

I had fun with this one, looking at the kernel messages upon plugging in and you will see this:


usb 3-2: new full speed USB device using uhci_hcd and address 3
usb 3-2: configuration #1 chosen from 1 choice
input: Brad Boegler  Press F1! as /class/input/input3
input,hidraw0: USB HID v1.11 Keyboard [Brad Boegler  Press F1!] on usb-0000:00:1d.1-2

It is based on a Microchip PIC18F14K50 USB enabled microcontroller, a 12Mhz crystal, and the necessary passive components for operation and USB communication. I added a few LEDs in there just to be able to see what was going on. I wrote the code in Microchips C18 which utilizing Microchips USB libraries made this as simple as can be.

I will be keeping one of these in my laptop bag at all times... just in case. ;)


Monday, October 8, 2012

Hydrogen Line 1.42Ghz RF Front End - Radio Astronomy

After finally completing the power supply for my RF front end last week, I spent some time tonight assembling the power supply onto the back of the feedhorn assembly and wiring all of the amplifiers and downconverter to the necessary voltage supplies. Here is a look of what it currently looks like:


From the front, you have the feedhorn, LNA, 1420Mhz cavity filter, downconverter, low pass filter, second LNA, then the power supply on the very back. Now that it is completed, I performed some testing tonight to check operation, sensitivity, and power supply stability. So far everything is looking good, the video below shows its operation on my bench for testing purposes:





Saturday, September 29, 2012

Radio Telescope Power Supply - Progress

Today I received my power supply boards for the RF frond end of my radio telescope. Due to the number of amplifiers and the voltage requirements of my downconverter, I needed a supply that provided a stable and clean +5V, +10V, +12V, +15V, and adjustable 8V to 15V output.


Current requirements on all outputs is very small (less then 20mA at each respected output) with exception of the 12V supply which powers the mini-circuits ZRL-2400LN low noise amplifier. It has a 350mA @ 12V requirement so I have utilized the aluminum enclosure to sink some heat off of the 12V regulator. I slightly miscalculated the boards size for the aluminum enclosure I had chosen to use for it. Due to the mounting standoffs inside the case, I was not able to mount the board flush against the side of the enclosure... although it was nothing a band saw couldn't fix. All voltage outputs are passed through the enclosure using feed through capacitors.

There is nothing really exciting about this supply other than the fact that it is now completed. Power supplies are probably the least exciting components of any project to build, even though their importance and stability are critical. Now that it is completed I can install it on the back of my RF frontend and start prepping the actual mount for the dish.

Here is the final assembled board mounted in its shielded enclosure:





Thursday, September 6, 2012

A Repair Story: EIP 545A 18Ghz Frequency Counter

This post is about a frequency counter, specifically an EIP 545A 18Ghz frequency counter that I had purchased off of eBay. The purpose of this post is to describe the steps that I took to repair this specific counter as upon receiving, it was not working. I consider myself very good at troubleshooting and here I will outline the steps I took to get his unit repaired. The physical repair itself was simple as it ended up only being a single cap that was bad, although the steps taken to isolate and troubleshoot this unit to locate this specific cap were very complex. As I repaired this unit I could see remnants of previous people attempting to repair this unit, who had ultimately given up and failed. While normally I would never write about specific repair steps that I had taken, this one was specifically fun, fulfilling, and worth talking about. Hopefully the troubleshooting procedure and methodology I describe here can be of use to someone else.

This specific EIP frequency counter I purchased is older, from the 1980s but is a very solid unit and when combined with a stable 10Mhz frequency reference it is extremely accurate even for its age. The range of prices for these specific units is all over the map, some guaranteed dead units going for as little as $75, with fully functioning and calibrated versions with all options up into the thousands of dollars. Most working units are in the $200 - $500 range in various conditions. This is a steal for a counter of this range, resolution, and accuracy.

I went with my staple bid on the unit that was listed by a seller who did not deal with test and measurement equipment. It was listed as working, but 'we don't know anything about this unit so we are selling it as-is' by the seller. The auction showed a picture of the actual unit powered up with all zeros on the display and no reported errors during power up. The seller also stated if it didn't work it could be returned as well. I purchase a lot of equipment this way. There is a risk involved as it could have been messed with and someone is lying and unloading it, but often I end up with a great piece of gear in these auctions. Based on all the info I had I went for the purchase.

Sold.

Upon receiving the unit the first thing I noticed is the calibration stickers had been broken indicating someone had been inside the unit, big red flag. Why was someone inside it if it was working?  I wanted to know so I took the main cover off and looked inside. Other than being very dusty which I promptly blew out with an air compressor, nothing seemed loose or broken from shipment. Some board clips were broken indicating someone had removed a few modules at one time, the plastic gets brittle with age. There were a few boards missing but these were to a few options that this specific unit did not have installed that I was already aware of so we should be good. The good news is it looks like no modules were cannibalized from it for a different unit. To the bench to power up:

EIP 545A Frequency Counter

Upon power on the display came up, registered all zeros. So far so good. The top of the unit had a couple of the basic self tests labeled right on it, starting with test 01:


Test 01 injects the internal 10Mhz time base through a few multipliers into the counter to verify the time base reference, signal chain, and local oscillator. Unfortunately instead of displaying 200Mhz, the display was all blank.

Fail.

Now I know why the calibration stickers were broken, someone had most likely been poking around inside in an attempt to fix. This could end very badly.

The good news is all of the other self tests passed. There were no ram / rom errors, all display and keypad functions worked, and overall the unit seemed fine with no additional reported errors. Using my HP 8656B RF frequency generator as an RF source on the counters inputs resulted in the same result, no frequency displayed. So the troubleshooting begins.

Once opened back up, the first steps are a simple visual inspection. Is everything plugged in? Do all cables seem to be routed appropriately, as in not plugged into the wrong locations? Is anything look loose or moving around? Have any zip-ties been cut indicating wiring harnesses have been moved around or replaced? In this case the answers were no. For the most part everything seemed tight and undisturbed.


The basic internal layout of the unit is pretty straight forward. Starting on the left you have a linear power supply followed by a series of removable cards. The digital section is on the left followed by the analog section on the right. On the very right you have the 10Mhz oven reference oscillator and the RF converter / mixer assembly.

The 10Mhz reference oven oscillator is a prime candidate for failure or issues. I had noticed that the main processor board had its own crystal so it was most likely not using the reference 10Mhz for clock. If the reference oscillator had failed it would be an easy explanation for why the RF frontend was not able to downconvert any input frequencies and not report the internal 200Mhz test. I probed the 10Mhz oscillator, and it was indeed oscillating at 10Mhz. I then tried my external 10Mhz source to see if there was any difference, which there was not.

To further troubleshoot I first re-seated all of the modules and connectors I could see. After 30 years connections can become corroded, dust can work its way into connections, and connectors can be come loose from shipping it around. Note at this point I removed the very leftmost card out of the unit. It is the GPIB interface card and is not necessary for proper operation of the unit. Removing it now just removes one additional variable out of the counter. Once everything else was re-seated, I powered up again but still no success, test 01 fails and any external RF input results in all zeros on the display.

The next step was a simple visual inspection of every board. I pulled everything out and looked at each board for any obvious signs of burnt or charred components, leaky caps, chips with holes blown in the top of them, etc. Everything looked clean and pristine. So time to dig deeper.

One of the very best parts of older equipment is the easy availability of service manuals. After a minute of searching I had the complete user / operation manual and the complete service manual. The really cool part of the service manual, and something you never see anymore is a complete schematic for the counter.

Win.

With the schematic I now have details on the power supply including correct voltages and test points. Most service manuals, this one included, will also have some simple flowcharts to help diagnose and troubleshoot any operating abnormalities. In this case I found the flowchart for a failed test 01, following this flowchart I ended up with a result of:  'Impedance converter or signal select on A109 bad'. Well, this is good and bad. It's good because at least it is isolated to a specific board. It's bad because this board is a very complex analog board so troubleshooting it will not be fun. Time to check some voltages.

Probing the voltages, everything seemed present, +5v, -5v, +12v, +18v... but -12v seemed to be missing! Before getting too excited, I powered the counter down, unplugged the power cable from the power supply to the main board, powered back up and measured again. -12v was now present. So something in the unit was sinking -12v to ground. Module A109 which had been previously identified via the service manual flowchart was the first board I was going to look at. I powered the unit back down, reconnected the supply cable, then pulled module A109. When powered back up -12v was still present, so this board was indeed the culprit.

Now going to the schematic for this module I isolated the -12v and ground pins on the edge card and measuring for continuity it was a dead short. So something on this specific board had most likely failed closed causing the problems. Going to the schematic I located every -12v entry point to the circuitry, there was a lot. Over 30 in total.



Semiconductors are usually my first guess for failing, so I began to check all of them first. There was only a handful and all of them appeared to unfortunately check out correctly so time to move on to the passive components. After probing a few caps and resistors that were good candidates based on their location (  between ground and -12v ) I needed to segment the board up further to better isolate portions of the circuit. To do this I would make small cuts in the -12v traces on the bottom of the board probing in sections.



By divide and conquering I eventually ended up at a small .01uF cap, C48 to be specific. Removing one leg of this cap, resoldering my cut traces, and reinserting the board followed by powering up and test 01 resulted in a nice clean 200Mhz frequency on the display.

Success.


So a single .01uF cap was all of the trouble. A ten cent component was the reason that this unit was removed from service and sold on the surplus market for next to nothing. It's sad in a way that such an amazing piece of gear can be considered obsolete with no one willing to spend the time to fix it. Granted to most corporations this piece of gear was wrote off in the books decades ago and to pay someone to spend time repairing it would never probably happen. But for me... it's a huge win. I replaced the bad cap with a new one along with a few other on the board just because it was easy and now have a rock solid, 18Ghz frequency counter with great calibration on my RF bench for about two hours of time spent troubleshooting.


FTW.

Saturday, August 11, 2012

New 10Ghz Oscillator

I have been needing a stable 10Ghz oscillator for a few projects I have been working on and was able to pick this brick up for pretty cheap. This is a Digital Microwave Corp 10.210763 GHz phase locked oscillator. This unit consists of a dielectric resonator oscillator that is phase locked to the x100 harmonic of a 102.10763 MHz crystal.
 

10Ghz PLL oscillator

While not a YIG, it should be more than stable enough for my needs now (I hope). The new 10Ghz project will be coming after I finish up my 1420Mhz front end for the radio telescope which is nearing completion :)




Friday, July 6, 2012

Radio Astronomy Hydrogen Line 1420Mhz RF Front End Testing

I have been building the RF front end for my radio telescope for a few weeks now and am finally at a point where I can sit down and test it. Right now I have the feedhorn assembly completed and the necessary front end electronics mounted to the back of it.

The feedhorn feeds directly into a mini-circuits ZRL-2400LN low noise amplifier. The output of this then feeds into a cavity filter with a center frequency of 1420Mhz. This was a rare but exciting eBay find hat I came across a few years ago, it actually had come off of the VLA in New Mexico. It had been originally tuned to 1430Mhz but with the assistance of a VNA I was able to tune it down to 1420Mhz. This then outputs to my own custom built downconverter which I have mounted in a custom copper enclosure. I will eventually mill a aluminum enclosure for it but this will suffice for now. Finally after the amplified output stage on my downconverter, I pass the IF through a mini-circuits SLP-450 low-pass filter to remove the original source frequencies, LO, and image frequencies. For testing I have my LO set to 1200Mhz which will result in a 220Mhz IF based on the 1420Mhz source. Ideally I will probably downconvert to 70Mhz as there is plenty of 70Mhz detection gear available on the surplus market. I'm still most likely going to build my own I/Q demodulator for the detection side.

Here is a quick video demonstrating the testing setup: