Does this project spark your interest?

Become a member to follow this project and don't miss any updates


Handheld 3GHz Spectrum Analyzer

Includes RF detector up to 6GHz and a datalogger

Similar projects worth following
This is a handheld spectrum analyzer that works up to 3 GHz. All basic functions that you would expect on a spectrum analyzer are available. No external PC or other computer is needed.

The user interface is a backlit graphic LCD. The lowest section of the LCD displays the menu (function of the control buttons).

The most important connectivity aspect is, that the device can be used to check or debug wireless connectivity of other systems. But also a wired serial connection is provided for remote operation (half duplex RS232). An application for PC, Linux and MAC is developed, that enables remote control of the analyzer.

For Openness, many things will be public, such as schematics, complete parts list, pcb artwork, and firmware source code.

See my 2-minute video on YouTube:

And the 5-minute video:

  • System diagram

  • Internal operation of the spectrum analyzer

The analyzer has the classic structure with a local oscillator, mixer and IF system. The Si4012 is used as local oscillator, it generates up to 960 MHz and has a two-wire control interface. The mixer is a Maxim 2680. The Si4431 is tuned to the IF frequency (with selectable bandwidth) and provides a logarithmic signal strength indication.

The Si4431 can be tuned to 960 MHz maximum, this would give a maximum receive frequency of 960+960 = 1920 MHz. But we can also use the 3rd harmonic of the oscillator, this theoretically gives a maximum receive frequency of 3840 MHz.

For a given receive frequency, mirror frequencies are suppressed in firmware by using two or more combinations of LO and IF frequency. The wanted frequency will be present in all combinations, mirror frequencies are only present in a single combination.

The sweep time is set automatically by the firmware, as a function of the SPAN and the RBW.

  • Other functions

Several wireless communication systems use short pulses, that might be hard to detect on a spectrum analyzer. To detect these, the analyzer has a ADL5519 power detector that works up to 6 GHz. The power detector is sampled at 20KHz, so it will detect short pulses without the need to be tuned to a certain frequency. It also has the ability to measure the frequency of the pulses (under most circumstances with 100MHz resolution), this is described in one of the project logs. The input is switched between the spectrum analyzer and the power detector with a AS186-302 switch chip.

Every 10 seconds, the maximum output level of the power detector and the detected frequency are written to a micro-SD card. A realtime clock is present to provide date and time stamps to the logfile. The logfile is readable on the device itself, but can also be read with excel (CSV format). Every new day, a new directory is created for this day and a new logfile is created. Every month, a new directory is created for this month that contains the directories of the days.

The micro-SD card can also be used to upgrade the internal firmware. 

The output of the power detector can be directed to the internal speaker, so you can hear the wireless communication pulses. The sound is generated by the DAC output of the microcontroller, with the same 20KHz sample rate. Volume control is done in the firmware. Sound can be output through a 3.5mm jack. The second channel of this 3.5mm jack can be used as analog input, or as a half duplex RS232 communication port.

A microphone is available. I want to be able to record spoken comments (and store this on the SD card) while measuring, but the firmware for this sound recorder is not yet working.

The device is powered by two AA batteries, or two NiMH cells. An adapter can be connected to charge the NiMH cells.

  • low-frequency electric and magnetic fields

Many people have health problems due to exposure to RF radiation (see These people can also be sensitive to low-frequency electric and magnetic fields. For this reason, the device can also measure these low-frequency fields. The waveform is displayed on the screen, and can be output at the speaker. 20KHz sampling is used. Every 10 seconds, the measured value is written to the logfile. The same functions are available for the analog input (AC value is measured, DC value could also be measured).

  • User interface

Only the most important user-interface functions are mentioned in this section.

After switching ON, you can choose between the following modes:

  • SCAN (Spectrum analyzer)
  • RF (Power detector)
  • ELEC (electric field)
  • MAGN (magnetic field)
  • MENU (Utility functions: inspect SD card, set time and date)

The spectrum analyzer mode displays the following values:

  • In PK (peak freq) mode: measured level and frequency of the detected peak
  • In CF (center freq) mode: level and frequency at center frequency
  • Start and Stop frequencies, Span, RBW (Resolution bandwidth)
  • Graphic presentation of the spectrum
  • Battery condition...
Read more »

  • 1 × Si4012 Transmitter used as local oscillator
  • 1 × MAX2680 Mixer
  • 1 × ADL5519 Logarithmic RF detector
  • 2 × AG201-63 RF amplifier
  • 1 × AS186-302LF RF switch
  • 1 × ATXMEGA192 Microcontroller
  • 1 × NCP2890 Audio ICs / Audio Amplifiers
  • 1 × MT41T81S Realtime clock
  • 1 × DOGM128-6 LCD display
  • 1 × LP2980-3.3 Voltage regulator

View all 11 components

  • Proto 2 PCB impression

    roelh09/28/2014 at 15:35 0 comments

    The PCB was designed in Orcad. 

    In the following screenshot images, the top layer is blue, the bottom layer red. Both layers have  ground planes with several traces in it. For better visibility, the ground planes are displayed as a shaded area. (The ground planes have several adjacent sections. The borders between sections look like a normal trace, but they are not !). Note that a shield can be soldered at the RF section.

    Upper section:

    Middle section:

    Lower section:

    And here is a photograph of the new pcb:

    The assembly of this new pcb is almost finished.

  • Documentation upload

    roelh09/21/2014 at 19:37 0 comments

    Today I added links to the (updated) documentation.

    It documents the new proto-2 version schematics and pcb (with SAW filter). It also has the newest firmware version (V55) that communicates with the PC application, programmed in Tcl (latest version, 6, provided).

    It has pcb Gerber files and assembly drawings. The new BOM includes placement coordinates for the components. 

    These docs should be enough to duplicate the project !

  • Low cost version

    roelh09/18/2014 at 21:07 0 comments

    Several people asked if they can buy the analyzer as a pcb or kit.

    I think with more than 270 components, this will be relative expensive and/or quite difficult to assemble. I also think that for most people, the spectrum analyzer itself is the most important, and they don’t need the other features.


    To make it interesting for a lot of people, the following needs to be done:

    - The cost should be low. So it should be a kit.

    - It will only be a spectrum analyzer

    - The kit should have no more than approx. 60 components to make it easy to build.

    - SMD components should not have a very fine pitch

    - The ATXMEGA should come pre-programmed, so an AVRISP2 programmer is not needed.

    My plan is, to make a 'bare bones' version, and offer it as a kit. But the full version with all options will also be available, perhaps only as complete device.


    The bare-bones kit will contain:

    - pcb with the programmed ATXMEGA

    - All spectrum analyzer components

    - The Si4431 (that is difficult to mount) on a pre-assembled small pcb

    - connectors: SMA input, 3.5mm RS232 half duplex, connector for 5V power adapter

    - on/off button (or .perhaps only a reset button)

    - NO lcd and no control buttons. Operation by the PC application.

    The price of the bare bones version should be below USD 100, I think.


    The following components can then be mounted as an option:

    - LCD with backlight, and control buttons (enables operation without PC)

    - micro-SD card connector, real time clock

    - battery circuits, step-up converter, charging circuit.

    - Enclosure

    - Firmware updates by SD-card (no programmer needed).


    The barebones version will require a redesign of the pcb, aimed for easy assembly. For instance, the MBT3946 fine-pitch dual-transistors should be replaced by SOT23 single transistor types. Only a few types of resistors and capacitors should be used. The ATXMEGA has 0.8 mm pitch, that is not very difficult to mount. (It was deliberately chosen for this, I don't like soldering big 0.5mm pitched parts). The Si4012 is a 0.5mm part, but has only 10 pins, si it can be mounted without too much trouble.

    It will, however, not be possible to have the barebones design ready before the next judging round of THP...

  • PC remote control application

    roelh09/16/2014 at 18:37 0 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.

  • Source code

    roelh08/20/2014 at 20:36 0 comments

    Today, I got a mail from Hackaday, telling that I should also put my sourcecode on the project page.

    I am afraid that the sourcecode is not an easy read. It is based on software from older projects, and it should be cleaned up. I think you can tell from the code that I did quite a lot of assembly coding in the past...  

    This evening, I translated several dutch comments to English. The real spectrum-analyzer work is in 'sa.c'.

  • Bill of materials

    roelh08/19/2014 at 19:30 0 comments

    I added the BOM (Bill of materials) to the links. This will not be the final BOM. I added it as a Google speadsheet document. 

    Later this week, the 4 or 5 most difficult parts will be placed on my new pcb (by someone who has the equipment to do that). After that, I will mount the other parts myself.

    There are 273 parts at the moment, quite a lot.

    I could sell pcb's with all parts mounted when there are enough people who want one  (and at least the hardware is final). The pcb could be delivered tested and calibrated.

    I could also sell the housing with all holes laser-cut. That reminds me... enclosure and mechanical parts are not yet in the BOM.

  • More about the firmware

    roelh08/17/2014 at 21:02 0 comments

    The Si4431 and Si4012 each have a private serial connection to the ATXMEGA, it is also not shared with other devices. This gives the possibility to easily move their code from a 'main loop' to an interrupt routine, if this should be needed. An ATXMEGA has plenty SPI and other serial connections, that makes this easy. At the moment, interrupts are not used in this section.

    The firmware divides the total frequency span in a certain number of pixels (100 for this display).

    It then depends on the selected bandwidth (RBW) how many measurements will be done for each pixel. The Si4431 can be set to a RBW between 2.5 and 600 KHz. This does not mean that this is the spacing between the measurements, a certain overlap is needed. The measurement that gives the highest value will be taken as the value for this pixel.

    At a certain frequency, measurements with low bandwidth do take more time, but the difference in time is quite small (not as big as the bandwidth difference would suggest).

    Note that in peak detect mode, the detected peak will record the frequency of the highest measurement within the highest pixel, so the frequency resolution of the peak measurement is much better than just one pixel.

    • To determine the LO and IF frequency, the following is used:

    For RF up to 600 MHz, IF is set to (RF +250MHz) and LO is 250 MHz, so the input RF frequency is LO - IF (fundamental mixing).

    For RF between 600 and 1700MHz, IF is set to (RF/2 - 40MHz), and LO is (RF/2 + 40MHz), so the input RF frequency is LO + IF (fundamental mixing).

    Above 1700 MHz, 3rd harmonic mixing is used. IF is set to (RF/4 - 60MHz). LO is (RF/4 + 20MHz), so the input RF frequency is (3*LO) + IF.

    For each frequency, a second measurement is done, with the LO 40MHz higher (and IF adjusted to give the same RF). The lowest value of both measurements is taken. This will suppress mirror frequencies. For 3rd harmonic mixing it also will suppress fundamental mix results, and for fundamental mixing it will suppress results from higher harmonic mixing.

    When the spectrum is crowded, this will not always give the desired result, and a control should be added to change this 40MHz distance.

    Of course, the above system to derive LO and IF frequencies will have to change when the SAW filter is going to be used.

  • System diagram

    roelh08/16/2014 at 13:43 0 comments

    There were some more things that I had do to comply with the prize regulations:

    - make the entry official So I did.

    - add a system diagram. I added this to the 'details' section today.

    - have at least four project logs

    The system diagram was made with Excel. You can easily draw boxes around your cells, and your boxes will align nicely. It is also easy to change the size of your boxes to make the text fit. It also lets you use arrows. At the end, I make a screenshot (gridlines off) and let Paint convert it to a graphical format.

    In this project log I will explain some sections that have not been discussed in the 'details' section.

    • frequency measurement with the RF power detector

    The RF power detector chip has 2 identical channels. The input signal is split in two branches: The first branch passes a high pass filter and then goes to the first detector channel. The second branch passes a low pass filter and goes to the second detector channel.

    The filters are not very steep. The outputs of the filters will have an amplitude ratio that is dependent on the input frequency, so the input frequency can be recovered by taking the difference of the two outputs of the logarithmic RF detector. Of course, this principle does only work if only a single frequency is present (or if other frequencies are much lower in amplitude).

    The firmware uses the output difference to calculate the frequency. It uses a table with calibration points, that is determined for each device individually, and stored in a separate flash section of the controller.

    This frequency measurement is also supposed to work for short RF pulses. Therefore, the outputs of the RF detector are routed to the two different ADC's, and the ADC's will sample the signal at exactly the same moment.

    The RF detector is not very sensitive, it needs at least -60 dBm, whereas the spectrum analyzer will be able to detect signals as low as -110dB.

    • On/Off button

    The on/off button is a momentary switch, that will set the electronic power switch in the ON position when pressed.

    When you want to switch the device off, you press the on/off button again. This will NOT directly cause the power switch to switch off. But the firmware will notice that you pressed the button, it will wait until you release the button, and will then close the logfile and switch the power off. The firmware can also switch the power off if the battery voltage becomes too low.

    The electronic power switch is placed after the step-up converter. By placing it at this position, a voltage drop over the power switch will give us less efficiency loss then if it was placed before the step-up converter. Note that when the power is off, the transistor of the step-up converter is also off, and the step-up converter does not consume any current because its control circuits are powered by one of the linear regulators.

  • First project log

    roelh08/15/2014 at 18:06 0 comments

    A new pcb version, that I did receive from the pcb service today, has small design changes and corrects several small errors, and will also have a SAW filter that can be switched into the IF path. The filter is wide enough (around 5 MHz) that still two RF-IF combinations can be used for mirror suppression (if not wide enough for a certain situation, the SAW can be bypassed). The intention is that the SAW filter can give better selectivity.

    The SAW filter can hopefully also filter the false response of the Si4431 away (at about 1.9 MHz next to a peak, it has a second peak that is 30dB lower than the main one).

    The firmware still requires much work. Changes must be done for the SAW filter. It might be good to have a few options for the mirror suppression system. I also want to be able to use stored settings. Some logging would also be nice.

    The sound recorder is not working yet, I could not reach a good write throughput to the micro-SD card. On a new card it was good, but it seems that as soon as there are other things on the card, write rate drops to around 3 kByte/second. I use a rather slow cpu speed (4 MHz), but I don’t think this is the problem, because I can playback music files at 22050 Hz sample frequency (and they sound very good). I use the famous FATFS from ChaN, and two 1.5KB buffers. Perhaps someone has an advice ?

    The sound recorder might also store the screen contents, and show this screen contents when the sound is played back.

    When using the device to debug wireless communication, it will be possible to decode the communication in the Si4431 (it has several functions for that) and show the (decoded) contents on the screen (perhaps in a scrollable window). The Si4431 can also transfer the raw FSK or OOK data to the processor.

    The frequency of the spectrum analyzer is quite precise, because the Si4431 derives its frequency from a crystal. The Si4012 oscillator has no crystal, but we could measure its output with the Si4431 and then adjust the frequency of the Si4012 if it deviates. The devices do have some phase noise, that might be problematic in some cases. If we assume an IF around 315 MHz (the intended SWA filter frequency), then the phase noise of the Si4012 will be the most prevalent (at high frequencies and in 3rd harmonic mode). We could add a small add-on pcb with a higher quality oscillator if the phase noise is a problem.

View all 9 project logs

Enjoy this project?



Zachary Kahn wrote 11/12/2014 at 16:05 point
Would this be usable to analyze 1MHz - 1000MHz? I want to also possibly use this for cable tv and over the air tv signal readings. With a coaxial input or adapter this could be utilized for more than WIFI.

Form factor for me is not essential. 12in H X 5in W (30.48cm X 12.7cm) would also work and allow for a larger display.

  Are you sure? yes | no

Chris wrote 09/18/2014 at 01:05 point
I'd love either a board or a fully assembled unit... any idea on a ballpark of the pricing?

  Are you sure? yes | no

Noam Rathaus wrote 09/16/2014 at 15:01 point
What is the estimated cost of this item?

  Are you sure? yes | no

roelh wrote 09/16/2014 at 20:43 point
Hi Noam, I plan to have 2 selling items, SMD mounted pcb and full device. I want to have the pcb SMT-assembled by a professional well-equipped company. As soon as it is clear how much that will cost, I will put the price here on my page.

  Are you sure? yes | no

Bart van der Wee wrote 09/01/2014 at 21:04 point
Thank you Roel - this looks like a handy little gadget - if you need help with Dutch->English I may be able to help, just ask.
I would also be interested in building one of these, are you planning on selling kitsets or ready-made items?

  Are you sure? yes | no

roelh wrote 09/16/2014 at 20:35 point
Hi Bart, thank you for your offer for translation.... It was mainly a problem because of the deadline for THP at that time... nearly all program comments are translated now.

I plan to sell:
1) pcbs with all SMD mounted, tested and calibrated,
2) complete device

  Are you sure? yes | no

Similar Projects