A SWR Analyser using a DDS-60. |
[ Home ]
I completed this project some 4 years ago in 2009 but never got around to documenting it. The only reason that I am doing so now is because the analyser developed a problem a few days ago. Only then did I realize that I didn't even have a schematic and my scribbled notes had long since disappeared, so the time had come to open the box and make some detailed notes.
The analyser uses a PC for the user interface and graphical display with software written in VB6. The PC communicates via RS232 with a box containing a PIC, a DDS60 daughterboard and a resistive SWR bridge. The PC tells the PIC what value to bit-bang into the DDS60 phase accumulator to generate a particular frequency. The PIC analogue to digital converters measure the SWR bridge forward and reverse voltages at that frequency and send them to the PC via RS232. This process is carried out at around 150 times per second to sweep the DDS60 over a selected frequency range.
A picture is worth a thousand words. The following screen shot shows the analyser sweeping through a frequency range of 1 to 30 MHz to measure the SWR of my TH3 Jr beam fed through a rather long length of RG58 cable. The X axis is the frequency in MHz while the Y axis is the SWR and effective impedance in Ohms. Looks like a pretty good match at 14, 21 and 28 MHz.

The analyser is not restricted to measuring antennas, any network can be connected to the test socket. Other examples would be matching stubs and LC filter networks. The main features are:
The analyser can also operate at a single frequency like a conventional SWR bridge. This doubles as a diagnostic mode where the communication between the PC / PIC and SWR bridge voltage levels are also shown.
This screen shot shows single frequency mode. A 100 ohm resistor is connected to the analyser socket and the SWR at 5 MHz is 2:1 as would be expected. It is displayed on the good old analogue meter too. The other displayed data can be very useful for problem diagnosis.

Below is a block diagram of the analyser. RS232 communication between the PC and PIC is plain text hexadecimal.
The PC calculates the required phase accumulator value for the DDS60 and sends it to the PIC as 8 hex characters (32 bits). The PIC adds control information which expands the data to a 40 bit word which is sent to the DDS daughterboard through its serial interface. The DDS will switch immediately to the selected frequency. The DDS RF output is applied to the SWR bridge.
The SWR bridge uses germanium diodes to rectify the forward and reverse RF signals. These are very non-linear at low voltage levels so the the first stage of the dc amplifier uses similar diodes in the feedback loop to linearize the levels. The second stage provides adjustable gain to allow calibration with peak levels of about 4 volts. These levels are input to the PIC AD converters. The raw output of the converters (a hex number in the range 0000 - 3FFF) is sent over the RS232 link to the PC as 8 hex characters. The PC translates the numbers to voltage readings in the range 0 to 5V. Note that the absolute values of the voltage readings are not of great importance. It is the ratio of the 2 readings which determines the SWR value.

Now for the actual schematic of the analyser. You can find a larger version of this schematic here.

At the time that I started development of this project, I had a piece of perfboard complete with a 16F877 and a MAX232 chip, a leftover from a previous project involved with GPS. I wanted a fast PIC and the 16F877 wouldn't leave me short of port pins so I adopted this as the basis for the design. If I were to build the analyser again, the smaller and cheaper 16F88 would probably be my choice.
The schematic is fairly self explanatory but there are a few things which require some explanation.
I power most of my projects from an external 12V 7AH battery for portability. When fully charged this can reach 13.8V which exceeds the maximum rating of the DDS60 AD8008 amplifier chip.This is the reason for the 3 silicon diodes in the supply lead to the DDS60.
The DDS60 has quite a high power consumption of the order of 100mA. After a while the DDS60 regulator and the AD9851 can reach finger burning temperatures. In this design the DDS60 supply is applied via a 5V reed relay. The PIC will disable this supply if it detects that no data has been received from the PC in the last few seconds.
The DC amplifiers use LM358's because I had them to hand. A better choice would have been a more modern rail to rail op-amp such as the LMC6482. The problem with the LM358 is that the output voltage can only reach within about 1.5V of the supply rail i.e 3.5V with a 5V power supply. We need a bit more headroom than this so the LM358's are powered by a separate regulator providing 6.5V.
I calibrated my unit by adjusting the gain of the amplifiers such that both gave an output of 4V with an open circuit on the analyser coax socket (infinite SWR). The accuracy and linearity of the instrument can be measured by attaching various metal film resistors to the test socket and checking the resulting SWR reading. Suitable resistor values are 17 Ohms 3:1 SWR, 25 Ohms 2:1 SWR, 50 Ohms 1:1 SWR, 100 Ohms 2:1 SWR, 150 Ohms 3:1 SWR, 500 Ohms 10:1 SWR
The PIC software was written in Oshon Basic which I have been using for a few years now. The source code is well commented but note that modifications and recompiling will be required if a PIC other than the 16F877 is used. The PC software is written in VB6.
Download the PIC16F877 Oshon Basic and HEX files (4 Kb)
Download the VB6 PC Sourcecode (103 Kb)