While searching through eBay listings I came across a step attenuator that was listed aa 0-50 dB in 10 dB steps attenuator, and good for DC to 18 GHz. It was recently priced so I decided to spring for it. When it arrived I started to research the origin. It turned out to be from an old HP 8555 spectrum analyzer. Most likely a unit no longer working, but the attenuator was advertised as tested. I found a users/service manual that described the operation and the voltages needed to activate the solenoids. It looked to be simple as it was using 12V solenoids. The attenuator has three solenoids that are used to enable/disable 3 different attenuators in series. After putting the attenuator on the test bench I confirmed that all 3 was working and providing 10, 20 and 40 dB attenuation respectively. So the range is 0-70 dB and not as the specs for the HP 8555 analyzer listed (0-50 db). In the spectrum analyzer the attenuator is placed between the N connector on the front panel and the mixer and can handle +33 dBm or 2W maximum. Good for many microwave applications.
With the information about how the attenuator is operated and the knowledge that all 3 stages was working as expected I started designing the control unit. The first step was to decide how to generate the voltage needed for each of the three solenoids. In order to engage the solenoid the two terminals needed a +12V pulse for 150 ms and in order to switch it back the polarization of the pulse should change ro -12V for 150 ms. This can be achieved with an H-bridge. This is basically 4 transistors configured to have 2 inputs and two outputs. This will allow a positive voltage when the input is high and low and a negative output when the inputs are low and high. In addition there would be no voltage across the outputs if both inputs are low. H-bridges are commonly known to drive DC motors, allowing them to turn in both directions depending on the voltage being positive or negative. Amazon is selling a package of 4 H-bridge modules based on the L298N chip for just $10. It would not make sense to try to build one from scratch at those prices. The module provides 5V input logic and 12V output, exactly what's needed to use an Arduino Nano as the controller.
With the parts ordered I designed a 3D printed enclosure that could be glued on to the side of the attenuator, covering the terminals for the solenoids and providing push buttons to change the attenuation up and down and a display to show the current value. Since the solenoids are latching it's possible to connect the power, set the desired attenuation and then disconnect the power. That way there will be no noise from the Arduino board while the attenuator is in use. I also made the code to set the default attenuation to 70 dB when the unit is powered up. This is needed to set the highest attenuation but also because it's not possible to read the current value/state of the each attenuator. Bringing them to a default value makes sense.
The finished attenuator and control box all assembled.
The inside of the control unit showing the two H-bridge boards on the left and the Arduino Nano on the right. I placed the Arduino nano on an breakout board that allow for 12V power input and easy access to the pins needed to control the H-bridges and the two input buttons.
And finally the unit with power applied. The small display is a 128*32 pixel OLED display with a I2C interface. When power is applied it will show my call sign and then set the attenuator to 70 dB.
Here are links to the Arduino sketch and the 3D stl file.