PC remote control application

A project log for Handheld 3GHz Spectrum Analyzer

Includes RF detector up to 6GHz and a datalogger

roelhroelh 09/16/2014 at 18:370 Comments

The analyzer has a RS232 port, intended for remote control. So I created a PC application to control the spectrum analyzer. A simple protocol is used to communicate over this connection, at 38400 bps.

The following screenshot shows the PC application.

The measurement graphics are show in green. The data is written from left to right. The indicated white area is the separation between new and old data: data to the left of this area has just been written, and data to the right of this area is old and will soon be overwritten (so the white area moves from left to right).

The device finds the peak in the data, displays its level and frequency at (1), and displays the peak position as a red line. 

To find level and frequency of other points in the data, you can can move the blue marker with the two marker buttons at (5), and the level and frequency are displayed at the right side of the marker buttons. The marker buttons have a auto-repeat function.

Most important controls are:

(2) Center:   Step the center frequency up or down in 1/2-span steps

(3) Span:   Select the frequency difference (stop - start) from a series of fixed values.

(4) RBW:   Select the resolution bandwidth from a series of fixed values.

The values Center freq, Marker freq, Start and Stop freq can also be directly entered as a number. Just press the button at (6), the associated 'LED' will light up, the number buttons will be enabled and you can enter the number. The entered number will appear above the LEDs (not shown). Press ENTER when you're done.

If you enter start and stop frequency, the span will automatically be set to the difference between start and stop. Using one of the span buttons afterwards will let the span jump back to one of its normal fixed frequency values (1-2-5 sequence). After a span adjustment, the center frequency will stay the same.

All PC software functions are also available on the device itself (sometimes you need to press one or a few buttons more)

The PC software is based upon the Open Instrumentation Project. It is programmed in the script language Tcl/Tk. The use of Tcl means that the application will also work on Linux and on the Mac without any change (but I did not test that...).

I did not program in Tcl before, but the basic functions were not difficult to understand and quite easy to do, and my program is not complicated. Whenever you press a button, a simple code is sent to the analyzer, and the analyzer sends back what numbers and lines are to be displayed on the PC application.