That summer after freshman year, my buddy Fu and I dove headfirst into the National Electronic Design Competition. That year happened to be a “national contest year,” where top provincial winners advanced further. Though we didn’t make the final cut for the national round, those 4 days and 3 nights were truly unforgettable.

The bad-looking system in the end (already carefully placed for this photo)

Requirements

The sleep-deprived engineering students were asked to pick one from a set of problems A~K. Our problem H asks us to build a frequency response analyzer. The test unit should be able to send the measurement over a cable or wirelessly. Here are some of the details.

{width:60%}

Basic

  1. Design and build a signal source. Output frequency range: 1 MHz – 40 MHz; step size: 1 MHz, with an automatic scanning function; when the load resistance is 600 Ω, the output peak‑to‑peak voltage should be adjustable between 5 mV and 100 mV.
  2. Design and build an amplifier. Required input impedance: 600 Ω; bandwidth: 1 MHz – 40 MHz; gain: 40 dB, continuously adjustable from 0 dB to 40 dB; when the load resistance is 600 Ω, the output peak‑to‑peak voltage should be 1 V with no obvious waveform distortion.
ComponentsSpecificationsParameters
Signal GeneratorOutput frequency1-40MHz
Step of automatic sweep1MHz
Output amplitude (at 600 Ω)5-100mV
AmplifierInput impedance600Ω
Bandwidth1-40MHz
Output amplitude (at 600 Ω)1V peak

Advanced

  1. When the supply voltage is +5 V, the amplifier is required to deliver an output with an RMS voltage of 1 V into a 600 Ω load, with no obvious waveform distortion.
  2. As shown in Figure 2, the frequency information from the signal source and the output signal from the amplifier are connected to an amplitude–frequency characteristic test device via a 1.5 m long twisted pair (one wire for signal transmission and one for ground). The amplitude–frequency characteristic test device completes the testing of the amplifier’s output signal and displays the amplitude–frequency characteristics on an oscilloscope.

3. As shown in Figure 3, a Wi‑Fi router is used to set up a local area network. The frequency information from the signal source and the output signal information from the amplifier are connected to a laptop computer. The laptop displays the amplitude–frequency characteristics in the form of a curve.

Our solutions

Signal generator

The MCU in our hands is an STM32F103. It is the main controller, with a 4x4 keypad and an OLED screen as user interface. As for signal generation, we have following options.

  1. MCU + AD9854 for signal synthesis and automatic frequency sweeping. AD9854 is a frequency synthesizer with DDS (direct digital synthesis) technology. It is powerful, with a system clock of up to 300 MHz and a maximum sine‑wave output of 150 MHz.
  2. MCU + FPGA + DAC. Use the NCO (Numerically Controlled Oscillator) on a FPGA for signal synthesis. The FPGA we have has a very high main frequency and great flexibility, capable of generating a 1~40 MHz sine wave with adjustable amplitude and sweep capability.

We prefer the dedicated solution. Besides it’s not harder programming the driver for AD9854. Thus option 1 is picked.

Variable‑gain amplifier (VGA)

The signal passes through an amplifier, which should be prepared by the teams as well.

  1. A digitally controlled VGA, such as LMH6518. These devices usually has a gain adjustment step as, for example, 2 dB, which does not meet the requirement for continuously adjustable gain.
  2. A linear-in-dB VGA, such as AD8367. It has a bandwidth of 500 MHz, operates with a single power supply, and offers a continuously adjustable gain range from –2.5 dB to 42.5 dB.
  3. A linear in V/V VGA, such as VCA824. It has a bandwidth of 320 MHz, operates with a single 5V power supply.

We used a cascade of two VCA824 voltage‑controlled gain amplifiers so that we can manually adjust the gain by screwing the variable resistor. A preceding OPA690 is used to meet the impedance requirements. It’s a unity-gain stable, voltage-feedback operational amplifier.

{width:80%}

RF detector

  1. Use a diode detector. Simple design. But inevitably, diode detectors can have distortion, voltage drop under certain temperature and frequency.
  2. Use an AD8361 RMS detector. It operates on a single supply, has a frequency response up to 2.5 GHz, and uses a dual‑squared closed‑loop comparator conversion technique. It outputs a DC voltage proportional to the RMS value of the input signal, allowing the microcontroller to calculate the input signal’s RMS value accurately.

We went with option 2.

Wired channel

Due to the tight schedule, we proceeded directly with the wireless solution. However, we did test the wired‑channel solution shortly before submitting our project. We had planned two methods for communication over the 1.5 m wire.

  1. Use an adder to directly merge the high‑frequency signal (analog) output from the amplifier and the frequency information signal (digital) from the signal source. Transmit them together over the twisted pair. At the output end, extract and restore the high‑frequency signal and frequency information separately.

  2. Feed the high‑frequency output signal (analog) from the amplifier through the detector circuit to obtain a DC signal, then sample this DC signal with an A/D converter. At the same time, feed the frequency information from the signal source to the same microcontroller. The microcontroller converts these two signals into digital data and transmits them over the twisted pair. At the output end, the frequency characteristic testing device receives and processes the signals.

Such high‑frequency sine waves are easily disturbed in twisted‑pair transmission, degrading the signal‑to‑noise ratio.

However, we were unsure whether option 2 was a valid workaround or simply a misunderstanding of the rule’s restrictions, so we chose not to demonstrate its functionality during the evaluation.

Wireless transmission

{width:50%}
The response displayed on the oscilloscope

The frequency‑response data is transmitted transparently via serial on an ESP‑32, and is received and plotted by specially developed PC software and an Android app.

An ESP‑32 is used to establish a TCP server, allowing other devices on the local network to access it. The ESP‑32, produced by Espressif, is a powerful IoT module and can also function as a standalone microcontroller. Setting up a TCP server also enables simultaneous access from both PC client software and a mobile app.

D-Day

Turned out that bringing tools with you is crucial in scenarios like the evaluation day. After lying in the storage for about a week, a lot of teams found that the mounts of SMA connectors magically became cold solder joints. Luckily I always kept a soldering iron with me (nerdy acts warning).

Packing all stuff 10 mins before submission
Desperately need to embrace a more minimalist design aesthetic
The arena
Smartphones are not allowed in the stadium. We made to bring one with us only because we have a display function on Android phone for final evaluation

Amusingly, when I searched for the project online, I stumbled upon what appears to be an electronics design studio repackaging our entire report—and even charging 10 SGD for our source code.

Guess someone on the committee decided our abandoned spaghetti code deserved a second life—a true act of digital philanthropy.

Thanks to their… enthusiasm, I didn’t even need our original report to jot this post down.