0%
0%

Si5351 HF Antenna Analyzer

HF antenna analyzer using Si5351 as signal source, resistive swr bridge and ESP32 or Arduino as the brains

Similar projects worth following
The Si5351 is a few kHz to 200 MHz clock source controllable over i2c. A uC (ESP32 or Arduino) will scan the frequency range the connected antenna is designed for, and determine the swr using the resistive swr bridge. If an ESP32 is used, it will present a web page with the results, if an arduino is used the results of the sweep will be send back over serial.

The main reason for this project is to find the resonant frequency of loop antennas I'm intending to build for the 20m HAM band. This work is greatly inspired by the work of K6BEZ on a low cost antenna analyzer, a link to his slides can be found in the links section.

The basic idea is as follows:

1. Generate a continuous signal on the design frequency of the antenna (sine or square, both is fine)
2. Measure the voltage of the transmitted wave and the reflected wave, and calculate the standing wave ratio.
3. Repeat for frequencies around the design frequency, and plot the swr as a function of frequency.

The uC will set the frequency of the Si5351 via the i2c bus, and measure the voltage of both the waves on two separate analog inputs, via the swr bridge.

Wiring the ESP32 or the Arduino nano to the Si5351 requires 4 wires; power and gnd, and the i2c data and clock lines:

 i2c line ESP32 default pin Arduino default pin SDA D21 A4 SCL D22 A5

Both ESP32 and Arduino will be programmed using the Arduino IDE, so I can use a single code base. The difference is that the ESP32 will have the logic to do the frequency sweep and will generate the SWV(freq) plot, and in the Arduino case a PC side python script will send commands to the arduino to change the frequency and plot the resulting swr measurements.

The Si5351 library used is the Etherkit one, since it is much easier to use than the Adafruit one. The github repo will also contain some sketches to test the hardware, for example an i2c bus scanner to search for the Si5351 address and a minimal sketch to just set a frequency on the clock outputs.

Testing is done using an rtl-sdr to listen to the frequencies on the outputs, and using a sketch (ESP32) or PC side python script (Arduino) that will generate WSPR tones.

• SWR bridge

Today I built the SWR bridge on the breadboard, and adapted the arduino sketch to read the FWD and REV voltages on two analog pins.

The SWR bridge design is given in the following schema, and taken from an antenna analyzer build by the NJQRP club. A link to the article is given in the links section.

| chose this design solely because of its simplicity (only resistors, caps and diodes). The analyser in the article also uses an op amp to boost the signal on the FWD and REV ports, and to counter the low impedance on the A/D converter used in their design. In my case the input pins of the arduino have a high enough impedance and the signal should be significant enough to get at least some reading, so in this stage I'm omitting the op amp for simplicity.

The FWD and REV ports are connected to arduino pins A0 and A1 respectively, and the SWR value is calculated using SWR = (FWD+REV) / (FWD-REV).

The breadboard with the arduino, si5351 and swr bridge looks like this:

I know it will give horrible performance on such a board, but i just wanted to see if the concept works.

The swr_sweep.py script is also adapted in the repo, and when i sweep the 27-29MHz range the swr bridge is reporting a standing wave ratio between 3.5:1 and 4:1. Looks promising!

Next i have to find an antenna or so with a known resonance frequency, and test if this little contraption can find the sweet spot.

• First scripts in repo, frequency sweep working

So the code will live on github, see the link on the project main page.

There are 3 things as of now:

1. i2c bus scanner, to see if the si5351 can be found
2. a small frequency setting sketch, to see if the library works
3. A small sketch (si5351_antenna_analyser.ino) that accepts a new frequency over serial, with an accompanying python script that sweeps between 27 and 29 MHz.

The wiring is shown in above photo, which is really straightforward. The red/brown pair is power, the yellow/orange pair is i2c, and the green one is connected to clk1 to act as a rudimentary antenna. No passives required anywhere.

So the setup is working now, I can see a nice frequency sweep around 28MHz in GQRX. Next up is the resistive SWR bridge, and the necessary adjustments to the main sketch to push the resulting swr value over serial to the python script.

• All components arrived, ESP32 not playing ball

Over the last month all components arrived, notably an ESP32, arduino nano and of course the Si5351.

Initial testing hit a snag already, since I can't seem to get the Si5351 to work with the ESP32. The tests using the arduino are fine. This might be because the ESP32 is 3v3 and the Arduino 5v, but I don't have any means to test this hypothesis.

For now I'll focus on the arduino, next step is to write some Python to control the clock frequency using the PC, and create a repo on github to keep all the code and test scripts. After that the SWR bridge, which will probably the largest work block for me.

Share

Discussions

crun wrote 11/21/2018 at 04:40 point

These chips are square wave output. So 50% of the energy is in the harmonics, and at frequencies that are (probably) severely mismatched. i.e. you are very unlikely to get even vaguely meaningful SWR values this way. When the fundamental is perfectly matched, your swr is still going to tell you that 50% of the energy is being reflected (all the mismatched harmonics). For your special case of a loop, with its sharp resonance, you might still be able to find resonance. There are other ways for a loop . Also having phase detection really helps automatic antenna tuning.

Are you sure? yes | no

biemster wrote 11/21/2018 at 11:40 point

I've seen other antenna analyzers giving acceptable results with the si5351, and I know about the problem with harmonics of a square wave. But I just wanted to see if I could make it work too, isn't that what hackaday is about?

At the end of the day I don't care what the actual swr of a newly built antenna is initially, I just want it as a function of frequency so I can determine if I got the resonance right.

I know there are better ways to test and tune a loop, this way just seemed more fun to me.

Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates