← All projects
Case studyGroup of Electrical Engineering of Paris (GeePs) · November 2026

Microwave Gas Sensor Design with a Custom RF PCB and ESP32 Firmware

Isometric CAD render of the VectorUSB readout PCB, with gold RF connectors and the ESP32-S3 module

Microwave gas-sensing goal

During my internship at the Group of Electrical Engineering of Paris (GeePs), I worked on a microwave sensor for gas detection. The idea was to turn a change in the gas around the sensor into a shift in frequency that I could measure.

The sensing element is a complementary split-ring resonator (CSRR), a pattern of narrow slots cut into copper. As a microwave signal travels along a nearby trace, the slots interact most strongly with it at a particular frequency. Less signal gets through at that frequency, so it shows up as a dip on the transmission graph.

We planned to put a thin film of zinc oxide near the slots. If the gas changes the film’s electrical properties, the dip can move. I needed to know where to put the film and how to find the dip reliably before we could test that idea.

CSRR design and simulation

I modeled the CSRR4 V2 design in Ansys HFSS to choose where a zinc oxide sensing film could interact most strongly with the signal. The two views show the same resonator from above.

Etched slots in copper

The pale yellow areas are copper. The white paths are slots where copper has been removed. The blue marker points to one of those slots.

Top-down model of CSRR4 V2, showing white interleaved slots cut out of the pale yellow copper

Simulated electric field

Red and orange show stronger fields than yellow and green. The blue marker shows a strong region near a slot edge, where a sensing film could have more effect.

HFSS electric-field map of CSRR4 V2, with stronger red regions near the left and lower slot edges

Simulated resonance at 2.9114 GHz

Simulated transmission and reflection for CSRR4 V2, with a transmission minimum at 2.9114 GHz
HFSS sweep for CSRR4 V2 on the 0.508 mm substrate. The simulated transmission minimum is −24.36 dB.

The blue curve shows how much signal passed through the sensor at each simulated frequency. I’d compare the frequency of its dip before and after exposing the film to gas.

I also checked how easily that dip could move before adding the film. Holding the copper pattern fixed and changing the substrate thickness from 0.508 to 0.813 mm moved the simulated dip about 3.9 MHz lower. That gave me a reason to compare the same sensor before and after exposure, with a baseline for each one.

Compare substrate thickness and slot shape
Comparison of simulated transmission for the same slot geometry on 0.508 and 0.813 millimeter substrates
HFSS thickness comparison with the CSRR4 V2 slot pattern held fixed.
HFSS model of a different CSRR with fewer and wider interdigitated fingers
CSRR 6 on a 0.508 mm substrate. I also varied the slot pattern by using fewer, wider fingers and leaving the corners intact.

VectorUSB signal chain

We finished the sensor design ahead of schedule, so my supervisor asked me to develop the instrument that would read it. The readout had originally been scoped as a master’s degree project. I took it on while I was still in my bachelor’s program.

At each frequency, VectorUSB sends a signal to the sensor. It compares how much reflects back and how much gets through with the signal it sent. Repeating this over a range of frequencies gives me a trace where I can find and compare the dips.

ExcitationRF synthesizerSends a test signal out of Port 1.
Device under testResonatorChanges the signal received at Port 2.
DownconversionMixer + local oscillatorMoves the received signal down to 12 kHz.
AcquisitionDigitizer + ESP32-S3Samples the tone and sends data to the host.

Converting microwave signals to 12 kHz

One MAX2871 sets the frequency applied to the resonator. A second MAX2871 follows with a controlled offset and drives the local oscillator input of the ADL5801 mixer. Their difference is a 12 kHz intermediate frequency (IF), so I can filter and digitize each reading with the same circuit across the sweep.

A 24.576 MHz oscillator gives both synthesizers and the PCM1860 digitizer a common frequency reference.

Measuring reflection and transmission

One receiver switches between samples of the outgoing, reflected and transmitted signals. S11 is the reflected signal divided by the outgoing signal. S21 is the transmitted signal divided by the outgoing signal. Both retain amplitude and phase, so I can compare the shape of the response as well as the position of the dip.

Prototype measurement targets

Programmed RF sweep
1.427–5.95 GHz
Acquisition
12 kHz IF at 48 kS/s
Measurement output
S11 and S21, magnitude and phase

Four-layer PCB layout

The layout had to carry microwave signals to the mixer and give the digitizer a quiet path for the 12 kHz tone. I placed both RF connectors on one edge so the sensor cables would be easy to reach at the bench. USB-C enters from the side, and the ESP32-S3 antenna extends over the opposite edge. The RF parts are close to the SMA connectors, while the switching supplies sit by the USB-C input.

Isometric CAD render of the assembled VectorUSB PCB

VectorUSB B1-R8. Drag to rotate. Use + and − to zoom, or click the board and scroll. Choose Top to follow individual traces.
Top view of the PCB with the RF stimulus, local oscillator and reference routes highlighted
Selected RF and reference nets from the released PCB layout.

RF routing and reference paths

  • Local oscillator pair
  • Stimulus and receiver
  • Switched reference

The teal routes carry the outgoing test signal and the selected signal back to the receiver. The blue pair carries the local oscillator to the mixer. The amber path lets the receiver switch to an internal reference.

Copper layers and RF ground

On the top layer, you can follow the high-frequency signals from the connectors to the RF chips. Switch to the first inner layer to see the ground directly below those traces. At these frequencies, a nearby, continuous return path matters as much as the signal trace.

Front copper of the VectorUSB PCB, viewed from above
Actual KiCad copper export. Each layer uses the same view from above.

Front copper

Most RF routing stays on the component side. The top copper also carries component breakouts, local power connections and ground stitching.

Interference checks

The same board carries microwave signals, switching power and the much slower tone going into the digitizer. I checked where those paths came close enough to couple into each other.

Top view of the PCB highlighting selected ground stitching vias, the clock and the power conversion area
Layout features used in the interference review. The marks show physical locations.
  • Ground stitching
  • Clock
  • Switching power stages

I used ground vias along the RF runs to stitch the surface ground to the planes below. I also checked the switching supplies and clock paths for ways their signals could couple into the receiver.

The short, matched analog traces from the mixer to the digitizer carry the 12 kHz tone. To check pickup there, I’ll inject a known signal and look for new tones as the clock, mixer and RF source come on.

The 6 GHz field model helped compare layouts. The board-scale run ended before reaching its residual-energy target. Isolation still needs bench measurements with the LO and RF stimulus enabled in stages.

What the RF models covered

I extracted 46 routed nets and modeled passive transfer through 6 GHz. The transmission-line sweep varied dielectric thickness and permittivity around the nominal stackup. A separate time-domain model screened local field coupling and compared revisions. The first boards will be needed to check connector launches, active device behavior and isolation at the SMA reference planes.

Thermal modeling and warm-up drift

Even with the sensor held fixed, the reading can change as the oscillators and receiver warm up. I modeled the enclosure to decide where to check temperatures and how much airflow might matter.

Top view of the PCB highlighting heat sources and temperature check locations
The overlay shows modeled heat-source locations and where to check temperatures during bring-up.
  • RF and power conversion stages
  • Controller and radio

I modeled the board, enclosed air and enclosure shell as a thermal resistance network. In a roughly 6 W load case at 40 °C ambient, the model put local enclosure air at 59–65 °C across the airflow cases. The higher result came from restricting airflow.

That range gives me a reason to check airflow as well as package temperature. I’ll use a direct connection between the ports to see how gain and phase drift as the electronics warm up.

ESP32 measurement firmware

The board gives the ESP32 a signal to sample. The firmware still has to wait for the synthesizers to lock and the switch to settle, then decide whether the samples are good enough to report. I wrote the acquisition sequence around those checks.

  1. Tune and lockSet each RF source and confirm it has locked to the new frequency.
  2. Switch and settleMute during switching and discard settling samples.
  3. DemodulateCalculate the 12 kHz tone’s amplitude and phase.
  4. Validate and reportCheck the reference and send the result with diagnostic data.

ADC capture and 12 kHz demodulation

The firmware reads the PCM1860 over I²S using DMA. At 48 kS/s, four samples span a 12 kHz cycle. The demodulator accumulates them with repeating +I, +Q, −I, −Q weights. The sample index stays continuous across buffers so the software preserves phase, including when a capture starts partway through a cycle.

The controller checks for sample gaps, clipping, and an incident reference that is too weak or moves too far in phase. A failed check can invalidate a frequency point. The host receives a status code and the raw amplitude and phase data to help explain why.

Reference correction and calibration

One receiver takes five windows per point. It reads the incident signal, then reflection, then incident again, then transmission, then incident a third time. The two incident windows around each reading let the firmware interpolate the reference amplitude and phase at the time of that reading, before it forms S11 and S21.

I also built a startup check for drift between sweeps. Once I record a baseline using a direct connection between the two ports, the firmware can use the internal path to refresh the transmission correction. The raw complex data stays available for plotting and external calibration.

Startup sequencing and regression testing

A regression test reproduced a failure in which Wi-Fi restarted while the fan was coming up under a low-current USB profile, aborting startup acquisition. I changed the startup sequence to defer radio restarts until the measurement subsystem releases control. The test reproduced the failure on the earlier code and passed with the fix.

I built the B1 firmware candidate with ESP-IDF and ran 126 Python tests, 19 C test suites with sanitizers, and five JavaScript checks.

Bench validation plan

I checked the PCB against the schematic and the assembly models against the pads before ordering fabrication. When the boards arrive, I’ll work from known electrical signals toward the actual sensor.

Check power, clocks and acquisition

I’ll check the rails and startup current, confirm the synthesizers lock, then inject a 12 kHz tone to verify that the digitizer and firmware recover its amplitude and phase.

Measure a reference connection

I’ll connect the two ports directly for a baseline and repeat the sweep with a known attenuator. That gives me a way to check loss, compression, receiver noise and warm-up drift.

Compare the resonator with a lab VNA

I’ll compare VectorUSB’s trace with a lab vector network analyzer on the same resonator. Once the dip repeats reliably, the gas test can compare shifts at known concentrations.

Fabrication ordered

The assembled boards will establish measured bandwidth, noise floor, isolation and repeatability.