Computer Controllable Stepper Switch


[Home]


[Shack]


[Projects]


[Tech Topics]


The band switch on my 60 foot vertical developed some reliability problems related to a certain amount of arachnid activity around the servo loop feedback pot (maybe they like the Spiderbeam pole). It would have been easily fixed with a cleanout and reassembly, maybe some window screen to keep future critters out, but I had some other modifications in mind. For one, I had found a nice surplus switch that was much bigger and beefier than the existing small wafer. I'm also starting to play with remote control of my station over the internet. Ham Radio Deluxe makes it very easy to control my radio remotely, Skype seems to work okay for handling audio, but all my antennas are manually switched. Ham Radio Deluxe has a neat feature though, as do some other rig control programs. It can output a bit pattern on the parallel port to switch different antennas. For a simple relay controlled switch, like my Ameritron RCS-8V, this allows an easy modification using MOSFET's to control the relay coils. But for the servo drive switch, remote control means sourcing an analog signal! This is possible, but would require a major project anyway, so I figured I'd try something new. And finally, the +/- supply required for the old servo circuit was kind of a problem if the power went out, as it plugged into the mains AC. So, the new design goals of the new switch were that it:

  • Be computer controllable, but not REQUIRE computer control at all times
  • Be under open loop control, with no feedback required
  • Keep all old functions, including the ability to detune the antenna for receiving.
  • Run off +12VDC only, for emergency use.
With these goals in mind, I decided to use a microcontroller driving a stepper motor as the heart of this switch. I've built a couple of projects at the lab with the Arduino Microcontroller Board so I decided that I would use it for the controller. Based around an ATMega168 microcontroller, it has 14 digital I/O, six analog inputs, and an easy programming environment with a lot of relatively "intuitive" functions. A nice side effect of using a microcontroller is that it's very easy to change the operation a great deal without changing the basic hardware at all.

The control box front panel, labeled using toner transfer.

The microcontroller board also simplifies the rest of the hardware. One required add-on is some external switching transistors to boost the logic level, maximum 50mA digital outputs up to the 12V 3A or so required by my particular stepper motor. This is pretty simple. I had P-channel MOSFETs on hand, so I used the circuit shown in the schematic. When the base of the 2N4401 transistor is held low, it does not conduct, and the 1kΩ resistor pulls the gate of the MOSFET up to 12V, turning it off. When the base of the 2N4401 is brought high, it conducts, pulling the gate to ground, and turning the MOSFET on. One of these circuits is required for each phase of your stepper motor. If you don't understand stepper motors, you might want to start with a tutorial. The basic mechanism is to apply pulses in the right sequence to the multiple windings of the motor, making it click along in fixed-size steps. The benefit is that as long as your stepper has enough torque to reliably turn the load, all your controller has to do to set a position with a stepper is to count steps as it makes them.

Schematic of the extra hardware needed. There's not much.

Now, I did say I wanted "open loop" control with "no feedback," but really it's useful to have one occasional feedback element ... it's useful to have a "zero" position of some kind and a way for the controller to know where this is and reset to it. The first thing the controller does when you power it on is that it steps backward until it finds the limit switch, and sets the position to "zero" at that point. This makes sure it is aligned properly with the switch contacts even if it accidentally missed some steps at some point or got moved externally. The switch itself can be hand operated out at the antenna, which is very useful for tuning each band. So the "reset to zero" limit switch is important. Once it's set that zero, though, the controller just counts steps as it takes them to keep track of the switch position.

     
The inside of the switch, side and bottom views. Limit switch and actuator are visible in the right image.

The ceramic switch itself appears to be just like the one sold by Multi-Tech, a model 86 switch or similar, good for something like 7kV and 20A. I think Multi-Tech has acquired the rights to many switches or something, because this is a very old one as far as I know. Perhaps they made it in the first place. These switches are expensive, but the exact switch doesn't matter much for this project. For low power, a small switch is just fine. And this type of switch is available at hamfests and on eBay. There are lots of opportunities for a good deal on the switch itself, and modifications in controller firmware can adjust for different switch positions, etc. The important thing for matching network switching is that you have two poles, and in my case, it is important that at least one wafer be non-shorting, so that I can move to the "in between" position for disconnecting my antenna wire from all matching networks. This is used to detune it on 160m and 80m where re-radiation bothers my flag.

Warner Electric stepper/synchronous motor, a three phase weirdo.

Some care needs to be taken about the stepper motor. For the simplest form of the other circuitry, you should choose a unipolar stepper. Then you can ground one end of all the windings and apply +12V to the other end in sequence or you can put +12V to one side of each and pull the bottom end of the winding down to ground in sequence. A bipolar stepper can still be run off a single supply but needs an "H-bridge" controller, which complicates the external circuitry a little. The other thing to consider is the number of steps and how that might line up with your switch contacts. The stepper motor I used is a weird type. Many steppers have an even number of phases and a large number of steps (100 or 200) per phase and use permanent magnets. Mine doesn't do any of these. As far as I can tell, mine is a "variable reluctance" stepper, so it has no permanent magnets, has THREE phases, and only has, I think, 18 positions per revolution seperated by 20 degrees. This is no good for a switch with 30 degree seperated contacts, but my motor needed a bit more torque anyway, so I geared it down with some gears I had on hand. With this gearing, it's approximately 10 steps of the motor between switch positions. Stepping 5 positions away from a switch position parks the antenna wire in between positions, so it does not resonate on 80m or 160m while receiving. "Detune by disconnect" doesn't work on 40m where it's a half wave but I don't seem to have big trouble on 40 with flag/vertical interaction anyway.

External view of the switch box with no networks connected.

The switch is housed in a Carlon plastic junction box. For best access, I decided to build the switch entirely on the box lid, but I soon found I didn't have enough room for all the terminals, the motor, and the reducing gear there. I solved this problem by moving the transmitter-side matching network connections and the ground connection down to the side of the box. The solution can be seen in the pictures of the inside of the switch. A SO-239 on the top lid of the box is connected to the common of the transmitter wafer by RG-8/X for the coax out to the radio. RG-8/X coaxial cable connects each contact of the "transmitter" wafer of the switch to a "hacksaw-etched" piece of PCB with nuts soldered to it, one per switched band and ground. A piece of perfboard holds the PCB with nuts in place. I measured really carefully (measure *three* times, cut once) and was able to drill holes through the side of the junction box in just the right spots to line up with the soldered nuts when the box body was assembled to the lid and tightened. Bolts go through the side of the box and make contact with the captive nuts. Since this side of the networks will always have 50 ohm impedance, less than 400V peak with respect to ground will ever be present on these terminals, and the PVC is a fine insulator. Since it is possible for much higher voltages to exist on the "antenna" side of the switch, I used ceramic feedthrough insulators through the top lid for all "antenna" side network connections, including the orange PowerPole for the antenna wire and Teflon insulated wire connects those feedthroughs to the "antenna" side wafer.

Inside of the control box.

The inside of the control box is straightforward. To the far left in the picture is the Arduino board. The front panel "switch" is actually NOT a switch. It's a potentiometer, with the top connected to +5V and the bottom connected to ground. The wiper is connected to an analog input on the Arduino. I hacked on the detent assembly from a wafer switch onto this pot so that it "clicks" like a switch. I used a pot, though, because I was running out of digital inputs on the Arduino, and I would have needed at least three to encode 6 bands. So I used the analog pot instead, and the Arduino reads the voltage and translates that to a band command based on the voltage being inside some pre-defined ranges. It's still very reliable (with wide voltage ranges with lots of space for error) and saves both input pins and space in the controller box. To the right of middle, mounted upside down on perfboard, are the MOSFETs and their transistor drivers. And to the far right is a ferrite common mode choke on the stepper connection wires, which exit the back of the box through some PowerPole connectors.

The rear panel connectors. Good labeling is important!

In addition to the sextet of connectors going out to the switch box, the rear panel has another set of PowerPoles for +12VDC power, a DB25 for most of the I/O lines, and a couple of other connectors. One of the features of the control box is that when it detects that the system is in "RX mode," it applies +5V to the "Transmit inhibit" pin of my radio so that it won't produce any RF even if I key it accidentally. Since the CAT/accessory cable for my radio had to be connected to the box anyway, what I did was to have it connect via the DB-25 connector. Nine pins on the top row of the DB-25 actually connect to the computer through an eight conductor cable, bringing parallel port data bits D0 through D7 and ground into the controller box. Eight pins on the bottom row connect to my FT-857D CAT/LINEAR/TUNER port through a cable with the proper DIN connector on the other end. The USB connector on the right of the back panel is the USB to TTL serial converter I use to connect the computer to the radio using Ham Radio Deluxe. It's completely independent of all the other circuitry in the box at the moment, but it was convenient to house it there and wire the connections to the CAT/LINEAR/TUNER cable inside the box. The 1/8" phone jack is the "TX GND" pin on the FT-857's connector, which gets pulled low when I key the radio. Eventually, it may be important to interface this to the microcontroller and to other hardware, so I put the back panel connector on. The rest of the DB-25 pins exit the DB-25 shell with the computer and radio cables and just connect to a terminal block for connection to other stuff.

At the moment, I've got the "RX mode" footswitch and interlock seen on the flag connected there, and I've also hacked MOSFET/bipolar switches like the stepper driver into my RCS-8V in parallel with the main switch and driven directly by D3 thru D6 on the parallel port. Then I coded appropriate action into HRD's parallel port manager. So as of right now, as I QSY from 160m through 17m, my antennas follow automatically. That also works on 6m, though I found that the coax out to the RCS-8V and the switch had too much loss, so 6m is actually switched by a nice coax relay indoors. My 10/12/15m antenna is going to be a tougher nut to crack because I need to send +/- voltages up the coax to actuate that one, and that's not possible without a floating supply.

Of course, the simplicity of the control box is due to the fact that some software does the heavy lifting. I do NOT recommend copying and pasting from the box below. Rather, download my code here:

vert_switch_2_2.pde

This can be opened and uploaded to the Arduino using the software available at the Arduino website. Of course, it's just a text file. But it has been uploaded to my unit and tested. It's probably useful to play with some programming of simpler stuff first just to get a hang of catching errors, because unless you duplicate this project exactly you will have to change a few things. But I provide it for example (though ugly, perhaps) and because it's easier to modify than start from scratch in a lot of cases. But, for browsing through online, here's the code in a box, colored in as it will be in the Arduino environment:

/*Parallel port controllable matching network switch Arduino code by N3OX ... 
 *Version 2.2, 070709 0418Z, added RX LED output and TX inhibit
 */

/* We have to set up, or "declare" a bunch of variables first.
First, we name the three motor output pins that go to the MOSFET driver circuits.
*/
//****************************************
int redpin = 8;
int orgpin = 9;
int yelpin = 10;
//****************************************

/*Here are some other pins that do stuff... in my application, there's a LED
that lights up when the switch is moved to "half" positions for low band detuning.  In these positions
+5V is also applied to the rig's accesory port, which makes it impossible to produce RF, helping to protect my
preamp
*/
//****************************************
int rxled = 6; // initialize RX LED output
int txinh = 7; // Transmit inhibit output
//****************************************

/*The Arduino needs some INPUTS, too.
DI12 = RX switch input, pulled up to +5V
DI3 = Pin 2 DB25 = D0
DI4 = Pin 3 DB25 = D1
DI5 = Pin 4 DB25 = D2

The RX switch pin, #12 on the Arduino, is operated from auxiliary contacts on my TX/RX relay.
The three pins #3,4,5 on the Arduino have values set by the parallel port
*/

//****************************************
int inpin[] = {12, 3, 4, 5}; // moved rx switch to #12 to free up pin 2 (for future use of its interrupt for tx_gnd)
int bits[] = {0, 0, 0, 0};
//****************************************


//Here's an input for the limit switch, and some other variables that will hold its value, etc.
//****************************************
int limit = 11;
int lstate = 0;
int lcheck = 0;
//****************************************

//These variables keep track of what motor phase we just pulsed and where we are and where we're going in steps
//****************************************
int curphase = 1; // which step are we on?  red = 1, orange = 2, yellow = 3.  RYO is CW ROY is CCW

int curpos = 99; // what switch positition are we actually on
int stepcnt = 0; //  the difference between where we are and where we're going, signed 
//****************************************

//These variables are related to the front panel band switch potentiometer

//****************************************
int pot = 0;   // analog input pot input pin number
int potval = 0; // value for it
int potcheck = 0; // debounce check
//****************************************

/*These are variables for which band we should command the switch to and whether or not we're in
"RX" mode, with the switch at half position.
*/
//****************************************
int bincode = 0; //the binary number 0 through 7 that represents the band we're on
int rxcode = 0;  //whether or not we should half step to RX.  1 for no, 0 for yes (sorry)
//****************************************

/*  Switch contacts are, in steps away from zero, 

1: 12 
2: 23
3: 33
4: 43
5: 53
6: 63

*/


/* Here we tell the Ardino what's an input, what's an output, and whether or not we should "pull up" input pins to high level
We don't need to pull up the pins that get connected to the parallel port, because it can source voltage.  However, the 
RX Switch pin and the Limit Switch pin we do pull up so we don't need external resistors, just the switch pulling the 
voltage to ground
*/
//****************************************
void setup()
{
  pinMode(redpin, OUTPUT); //set up output pins
  pinMode(orgpin, OUTPUT);
  pinMode(yelpin, OUTPUT);
  pinMode(rxled,OUTPUT);
  pinMode(txinh,OUTPUT);
  pinMode(limit, INPUT);   //set up input pins
  for (int j=0; j<4; j++){
    pinMode(inpin[j],INPUT);
    //digitalWrite(inpin[j],HIGH);  //do not pull up pins 3,4,5 anymore, commented out
  }
  digitalWrite(inpin[0],HIGH); //pull up pin 12 (inpin[0]) for RX switch
  digitalWrite(limit,HIGH);    //pull up limit switch pin 11



}
//****************************************
//now we get down to doing something... 
void loop()
{

  while(curpos>70) {             // if current position not defined, run back to the limit switch, set position to zero


  lstate = digitalRead(limit); // read current state of limit switch
  delay(5);
  lcheck = digitalRead(limit); // and debounce check 10ms later

  if ((lstate == lcheck) && (lstate == 0)){    // if already at the limit, just set curpos = 0, right up against the limit switch
     curpos = 0; }
     else

     if ((lstate == lcheck) && (lstate == 1)){      // if not at limit, step counterclockwise till you find the limit switch
     curphase = stepCCW(curphase);
     }
  }

    delay(50); //wait a bit

    potval = analogRead(pot);  //read the value of the front panel bandswitch input pot

    if (potval<25){            //if pot is on "auto", read the digital pins instead of setting the band based on the pot
    for (int i=0;i<4;i++){
      bits[i] = read_debounce(inpin[i]);
      bincode = (bits[1]<<2) + (bits[2]<<1) + bits[3]; //  combine DI 3,4,5 into a single binary number for parallel port control 
      rxcode = bits[0];} } // check whether we're on "RX" or not
      else {rxcode = read_debounce(inpin[0]);  // now if we're NOT on auto, we need to do something else.  RX code is still the same pin

    if ((potval>25)&&(potval<75)) // but we set the "bincode" for the band using the voltage read from the pot instead!
      bincode = B010;
    if ((potval>150) && (potval<220))
      bincode = B011;
    if ((potval>270) && (potval<330))
      bincode = B100;
    if ((potval>380) && (potval<450))
      bincode = B101;
    if ((potval>510) && (potval<580))
      bincode = B110;
    if ((potval>650) && (potval<720))
      bincode = B111;
      }
    if (potval>770) {
      bincode = B000;}


    // So, now we move the switch.  If the "rxcode" hasn't been set to 0 by pressing the footswitch, we do this part:


  if (rxcode == 1) {  // 1 is "transmitting" position
    digitalWrite(rxled,LOW);
    digitalWrite(txinh,LOW);
    if (bincode == B000){
      curpos = moveswitch(curpos,2);}
    if (bincode == B010){
      curpos = moveswitch(curpos,12);}
    if (bincode == B011){
      curpos = moveswitch(curpos,23);}
    if (bincode == B100){
      curpos = moveswitch(curpos,33);}
    if (bincode == B101){
      curpos = moveswitch(curpos,43);}
    if (bincode == B110){
      curpos = moveswitch(curpos,53);}
    if (bincode == B111){
      curpos = moveswitch(curpos,63);}


  }
  //if RX pin is pulled down, so we're in RX mode, do this part instead.  The only difference is the commanded positions.
  if (rxcode == 0) {
    digitalWrite(rxled,HIGH);
    digitalWrite(txinh,HIGH);
     if (bincode == B000){
      curpos = moveswitch(curpos,2);}
    if (bincode == B010){
      curpos = moveswitch(curpos,17);}
    if (bincode == B011){
      curpos = moveswitch(curpos,28);}
    if (bincode == B100){
      curpos = moveswitch(curpos,38);}
    if (bincode == B101){
      curpos = moveswitch(curpos,48);}
    if (bincode == B110){
      curpos = moveswitch(curpos,58);}
    if (bincode == B111){
      curpos = moveswitch(curpos,68);}
  }



}

  //down here, we define some functions used in the code above:


  //read_debounce(pinno) reads the pin number passed in as pinno, waits 10ms, and reads it again to make sure it's settled down
  //*****************************
  int read_debounce(int pinno){
    int firstval = 0;
    int secondval = 1;
    while (firstval!=secondval){
    firstval = digitalRead(pinno);
    delay(10);
    secondval = digitalRead(pinno);}
    return firstval;


    }
 //*****************************

 //moveswitch(curp,desp) moves the switch.  It has two inputs, the current position and the desired position
 //*****************************
  int moveswitch(int curp, int desp) {


  int stepcnt = desp-curp;
  /* this calculates how far you have to go to the desired location, it can be positive or negative depending on
 which   way you need to go*/

    if (stepcnt>0){                      // if the location is CW from here, a positive number, 
      for(int j = stepcnt; j>0; j--){    // step downward, decrementing stepcnt until you reach zero
        curphase = stepCW(curphase);
    }
 return desp; }

    else

  if (stepcnt<0){
    for (int j = stepcnt; j<0; j++){    // if the location is CCW instead, a negative number
      curphase = stepCCW(curphase);     // step upward and move CCW until you reach zero
    }


  }
  return desp;  // this "returns" the desired position you told this function, which the main program then takes as the new "current position"
  }

/*This part is the hardest bit to modify
This is the part of the code that does a single step, and you have to tweak it to make your motor run right.
The basic plan is to take the *current phase* as an input .. the main loop keeps track of that,
and then energize the NEXT phase in the right sequence to step CCW.  It's a little complicated
because I found it useful to energize both current and next phase briefly and then "let go" of the 
current phase to make the motor run with reliable smooth power under different loads
*/
int stepCCW(int curphase){  // sequence ROY

 if (curphase == 1){           //if red(1), red steps to orange (2) 
 digitalWrite(redpin,HIGH);
 digitalWrite(orgpin,HIGH);
 delay(2);
 digitalWrite(redpin,LOW);
 delay(25);
 digitalWrite(orgpin,LOW);
 curphase = 2;
 return curphase;
 }
 else
 if (curphase == 2) {

 digitalWrite(orgpin,HIGH); // if orange (2), orange steps to yellow (3)
 digitalWrite(yelpin,HIGH);
 delay(2);
 digitalWrite(orgpin,LOW);
 delay(25);
 digitalWrite(yelpin,LOW);


 curphase = 3;
 return curphase;
 }
 else
 if (curphase == 3){         // if yellow (3) yellow steps to red (1)

 digitalWrite(yelpin,HIGH);
 digitalWrite(redpin,HIGH);
 delay(2);
 digitalWrite(yelpin,LOW);
 delay(25);
 digitalWrite(redpin,LOW);

 curphase = 1;
 return curphase;
 }
}

//this is the same as stepCCW, but in the other direction
 //*****************************
 int stepCW(int curphase){   // sequence RYO

 if (curphase == 1){           //if red (1),  red steps to yellow (3)
 digitalWrite(redpin,HIGH);
 digitalWrite(yelpin,HIGH);
 delay(2);
 digitalWrite(redpin,LOW);
 delay(25);
 digitalWrite(yelpin,LOW);
 curphase = 3;
 return curphase;
 }
 else
 if (curphase == 2) {    // if orange(2), orange steps to red (1)

 digitalWrite(orgpin,HIGH);
 digitalWrite(redpin,HIGH);
 delay(2);
 digitalWrite(orgpin,LOW);
 delay(25);
 digitalWrite(redpin,LOW);
 // yellow steps to orange

 curphase = 1;
 return curphase;
 }
 else
 if (curphase == 3){  // if yellow (3), yellow steps to orange (2)

 digitalWrite(yelpin,HIGH);
 digitalWrite(orgpin,HIGH);
 delay(2);
 digitalWrite(yelpin,LOW);
 delay(25);
 digitalWrite(orgpin,LOW);

 curphase = 2;
 return curphase;
 }

}

Hopefull the comments are sufficient. I will try to improve and expand them over time, but since I want the code to WORK, I have to edit comments, then upload to my switch, test it to make sure it works, and then publish. Otherwise I run a small risk of misplacing a "}" or a ";" somewhere and causing some problem. Usually the compiler catches them, but I have had some subtle issues that compile but make the stepper run in one direction forever. This can break things if you're not ready to cut power fast! When everything is on the bench, no problem. Now that the switch is outside, it's somewhat more difficult. Plus, at the moment, the USB connector for uploading to the switch is located inside the switch box. This was a poor design choice in terms of publishing updates, because I have to take the box out to program it. Eventually I intend on just adding a back panel switch to switch the single USB<->Serial adapter between the radio and an Arduino Pro I bought from SparkFun Electronics which has no USB on board. But I didn't do that yet.

That's about it for turning the switch with a stepper. While I had the system apart, though, I wanted to clean everything up and make it less bug prone, and it turned out I would have had to squeeze things in really tight if I just used the old outdoor enclosure, so I cleaned up the old sixty footer matching networks (update with 160m shunt coil: matching_networks_18m.pdf) and built a new enclosure.

The new matching arrangement.

Electrically, there aren't too many differences. Overall, I just cleaned the existing networks, and sprayed down the old coils that would see high voltage in high impedance circuits with electrical varnish to make them easier to clean in the future and to reduce possible leakage. There had been some previous additions and improvements to the circuits that were never documented, so I'll go over them here.

The 160m matching network.

The 160m matching network has been changed a bit. I installed a motor driven 2000pF vacuum variable capacitor (-j44 ohms) in series with the loading coil to allow me to continuously tune the antenna across the entire 160m band. Over my ground system, this doesn't really change the efficiency one bit. Over an excellent system, using "more coil than necessary" is not great, but the added resistance is negligible here. Since I have a capacitor at the bottom of the big coil, I had to switch to using a seperate shunt coil to ground to get a 50 ohm match. That can be seen in the right of the photo.

     
Switch with 30m and 80m networks mounted to it.

I don't actually talk on the upper bit of 75m, so I didn't bother with three networks to span the band. I still need to tweak them a little bit, but mostly I'm going to center on the DX bits of CW and SSB on 75/80m. The antenna is broad enough to be able to have some domestic QSOs if I want, and if I feel like going higher in the band I'll just use the shack tuner to "stretch" the bandwidth. This left me one extra position for something else... right now it's used for nothing. The new shunt coil for 160m does double duty as the 75m/80m shunt coil. I replaced the home-made capacitor in the 30m network with a small air variable. It turns out that in exactly the right foggy spring weather conditions some condensation can form in the plastic and copper capacitor and detune the antenna severely. The small horizontal coil down near the ground plane is the shunt coil for the 30m step up network. I tried to use the 160m/80m shunt coil there, but there's too much stuff hanging off of it to work on 30m without interaction, so I gave up and used a seperate coil. After all, it's just a little bit of wire.

The 40m network was just cleaned and varnished.

There was no change made to the 40m network aside from getting some spider and earwig guts out of it (the capacitor made a pretty good bug zapper even at the 100W level). But that brings us to the other modification. I was interested in trying to keep insects and spiders out entirely while still letting air in and out and water out.

Enclosure "attic vent."

The enclosure is a Roughneck storage container installed upside down. A thin sheet of aluminum is bolted to the storage container lid for an easy common ground plane, and the stepper motor wires are taped down to the aluminum with aluminum duct tape. The only place the stepper motor ground is common with the station ground is back inside the control box. That, plus the tape and common mode chokes were to try to keep the noise down, and some or all of it worked. There is very little motor noise when switching and no microcontroller noise when idle.

PowerPoles connect to the external world.

The new enclosure is much bigger in the horizontal dimensions than the trash can, giving me lots of room for everything with a lot of spare space to try new things. The container is painted with Rust-Oleum plastic paint. It didn't work as well on this plastic as on the trash can, but I think part of that was due to less than perfect surface prep. I may spend another $8 and try again. I want to repaint with textured green paint instead of gloss black anyway, but Home Depot was out. I did add some vents with window screen over them to keep things dry and clean inside. The vent two pictures above is in the top of the enclosure and has a little plastic awning to keep rain out. There are a couple of screened vents in the bottom of the container too, and the "lip" formed around the edge by the lid and molding process needed to be drilled in a number of places to keep water from pooling there.

Vent/drain hole in the bottom of the switch container.

And, even though everything is in a housing, I wanted to make absolutely sure that no water could pool in the switch junction box. I drilled a hole and bolted in a faucet washer screen to make sure air and water could pass at the bottom but creatures could not.

The project is not completely finished. I still want to add some extra functions. The nice thing about already having a microcontroller is that I can work on sequencing transmit/receive automatically to protect my preamp, etc. I still have to speed up the switch a little bit for that, and time will tell if that needs a stronger stepper motor. I also need to add MOSFET switches to my RCS-8V to allow the parallel port to control the antenna selector. That way I'll be able to use the station remotely but still have the antennas disconnected from the radios when I'm not using them, and I can switch between the vertical and other antennas remotely. Then the next station automation project is rotator control. I also want to figure out how to tune across 160m automatically and remotely, though that does depend a small amount on the local weather conditions. Even though I have motor control, the tuning settings for wet or snowy ground are different than those for dry ground, so I may have to actually use SWR feedback to do that, and that's a quite advanced project. But, it can probably be done with the existing microcontroller with analog input and a H-bridge chip to drive the motor.

That said, the project as built is a success and an improvement. It is nice to have my antenna follow me automatically as I bounce from band to band hunting DX. And it pretty much satisfies all the goals I had in mind. It runs on 12V and can be manually controlled from the front panel, so it remains useful even if I don't have mains power or if I don't want to turn the computer on. The only feedback needed is one digital switch so resistance changes in the wiring or ... uh... environment can't cause the switch to do funny things. And the RX mode detuning position works even better and more reliably than it did before. I've also found in the past that there are better and worse switch positions when I'm using my very nearby 20m/17m Moxon in terms of interaction between the vertical and beam. So I can have Ham Radio Deluxe set the vertical to those positions when I'm on 20m or 17m. On 15m and up, I just have the switch move to the "ground" position, which grounds the transmitter side of the switch and floats the antenna. I will probably add a solenoid outside the switching box in the future that heavily grounds the antenna wire. Best of all, I learned a bit about how to effectively use steppers, opening up a lot of future possibilities. I avoided them for a long time because of the need to use microcontroller control, but now that I've done it, I realize how much more you can do. The servo controller is still a simpler and satisfying hardware switch/tuning project, but the new stepper switch has a lot of advantages.

over here?
© 2005-2024 Daniel S. Zimmerman, N3OX