Sunday, February 1, 2015

The Stationmaster

Back in October I wrote about finally getting around to building my multi-port antenna relay matrix.  The matching component to "The Matrix" is my automatic antenna tuner/selector which I've christened "The Stationmaster"

In concept it is a very simple device.  The upper deck is an antenna tuner with motor-driven tuning capacitors and inductance selector.  The lower deck contains a microcontroller which adjusts the tuner components, selects the antenna matrix relays, and sets the channel on my amplifier (which also has motorized tuning presets for each amateur band). Although it all sounds fairly straightforward, the devil is in the details and between the massive amount of wiring under the hood and writing all the software, I'm relieved (and even a bit surprised) that it actually works!  

The entire contraption is built into an old UPS chassis.  I even found a way to utilize the original AC power receptacle opening for some switches!

The tuner uses a differential-T circuit with an extra tunable capacitor instead of a roller inductor.

Just about everything came out of the junk box except for the microcontroller.  No Arduino or Rasberry Pi here, for this project I used a controller from JKMicro called the Flashlite 186.  This board emulates an old 80186 processor and runs a freeware version of MS-DOS.  On top of having loads of digital I/O ports to drive relays with, you can program it in old-school BASIC!  That was just fine with me as this project wasn't about learning new tricks, it was about getting the job done.  I wrote all the firmware using Microsoft QuickBasic in a DOS box under Windows Virtual PC.  I hadn't written anything in QB for years but it all came back to me pretty fast.

There's no school like the old school...

The board at the top is the microcontroller, the one on the bottom is an analog I/O board with a real-time clock.  The three smaller boards are 16-port relay drivers and the terminal strips are for interfacing to the Matrix and the amplifier. There's almost a 100 feet of 30 gauge wire wrap in there!
On my main station computer I added a bunch of new code into a Windows project in Visual Basic that I wrote a couple of years ago to track propagation indicators and display some nice clocks and the weather.  The VB software was also straightforward although I'm a real hacker when it comes to coding.  I'm sure a professional developer would call my VB code rubbish but, happily, once its all compiled and working no one can tell the difference. Now, when I change bands on the radio (and in some cases when I change frequency within a band), my software will automatically determine which antenna is required, what tuner settings (if any) might be necessary, and what band-channel preset needs to be called up on the amplifier.  It sends all that data to the serial port on the Stationmaster which then goes about switching relays and turning knobs for the desired effect which is a 1:1 SWR on the proper antenna and full output from the amplifier.

The whole shebang.  I had to put in a bigger rack to make room for everything.