Designing an LNA/Bandpass Filter Evaluation PCB

Image for post
Image for post

Just thought I’d scribble a few notes down from a small PCB I designed last month. This will be a touch less “polished” than my usual writing, I’m just getting some thoughts out.

A few months back, I dug out my software defined radio out to poke at some old ideas. I’ve always been interested in narrow band radio for digital modes, and P25 has piqued my interest. I looked up the frequencies that my city uses, and scanned around to look at them out of curiosity. I even managed to listen to a few with DSD+.

I’d always assumed P25 was still 4FSK, but it looks like they’ve moved to a hybrid system of QPSK for the control tower, and CPM for the handsets. I had some fun trying to write a little GNU Radio script to lock onto the QPSK channel and had some success… but the spectrum was super noisy, and my receiver had issues locking on phase.

So instead of designing a better receiver, I decided I needed to design a little PCB with an LNA and bandpass filter.

So excessive. So unnecessary. But I was possessed by the urge to send something to OSH Park, and rebuild my capability for assembling SMT PCBs at home. About $250 and a month later, I had assembled my PCB and tested it.

If you follow the Hack-a-Day blog, you’ll know that it features a good variety of wonderful engineering content. Last year, I watched Ted Yapo give an amazing talk about how he designed an open source multi-GHz sampling oscilloscope, and used it to calculate the parameters for 50 ohm coplanar waveguides (CPWG) using OSH Park’s PCBs.

I copied his parameters down for my little PCB design, and set to Digikey to look for simple LNA’s and bandpass filters. The search process for parts could warrant a blog post in and of itself, but I forgot to take notes during that process. Whoops!

I settled on the HMC374 as my LNA, and a bandpass filter manufactured by Taiyo Yuden. Both of these parts are 50 ohm terminated, which makes the design a piece of cake. No matching circuitry needed, just slap the parts together. The HMC374 had a helpful reference design included, and I used that as the groundwork for my schematics. (I even stole their idea for a “thru cal” reference!)

I designed the board all in one go. Took about three hours on a weekend, perhaps? I was tempted to sleep on it for a night, but I knew that if I did, the project would die. I finished the design as quickly as possible, and shot it off to OSH Park. Some features I added were a barrel jack and micro USB connector to allow for multiple power sources, and a few ESD diodes to protect the input and output.

Image for post
Image for post

Ted helpfully chimed in with some suggestions! One thing he mentioned was to remove the thermals on the ground pads for the SMA connector. In his experience, he said, it made for a smoother transition between cable and PCB. He also suggested bringing the center pad all the way to the PCB’s edge. I’ll definitely update that for my next revision! (I ended up having to trim the ground plane away as well… it would have shorted the center pin! If you follow the RF trace across to the gray pad, you can see a little fleck of gold at the end. Oops!)

The last thing I figured I’d do was max out the current through my red LED. There’s some good articles on how obnoxiously bright LEDs are, and… well. I figured, why not? (If you want to know, 150 mcd hurts to look at. Holy beans, that’s bright.)

My parts filtered in over the next few weeks. I ordered cheap SMA connectors off eBay, since they’re rather expensive on Digikey in quantities of 10. The quality of the eBay SMA connectors is probably wretched, but it doesn’t have to be wonderful for what I’m doing. (This isn’t going to space!)

I also picked up a digital microscope, a TS-100 soldering iron, a NanoVNA, and a generic brand hot air tool. The ceramic bandpass filter is pretty tiny, and I didn’t think I’d be able to use the iron to solder it. Of the things that I should have ordered — but didn’t — were a flux pen, kapton tape, and desoldering wick. (How could I have forgotten? More eBay orders!)

I didn’t realize the soldering iron shipped without a power supply! I had several lying around though, so it wasn’t too much of an ordeal to get up and running. Frustratingly, I found out the TS-100 iron used a 5.5x2.5mm barrel jack, instead of the much more popular 5.5x2.1mm. (D’oh, another eBay order!)

Image for post
Image for post

During assembly, I remembered how wonderful soldermask is. I had specified no solder mask along the RF traces when I designed the board. I’m sure I could have gotten away with it, but I’ve read that the mask affects the regularity (and repeatability) of the CPWG impedance. But my goodness… with a 6 mil gap, there’s not much room for error.

Image for post
Image for post
Look at that ugly solder blob.

The kapton tape hadn’t come in yet, and I was itching to assemble the board and test it out. Life has been so busy, I feared that if I didn’t get it done right away, something would rush in and distract me. Needless to say, I made plenty of shorts. (I’ve been spoiled by using a stereo microscope. While the digital microscope was so much more comfortable to use… goodness, I miss depth perception!) Some flux, hot air, and desoldering wick solved my shorts… but it sure made the PCB look ugly!

Image for post
Image for post
Now, with 100% fewer shorts!

The last part to assemble was the SMA connectors. As I put them on, I realized the stock footprint from KiCAD was for a different part. No worries, they’d still solder on with a little effort. Much to my horror, though, I realized they were RP-SMA — the bane of an RF engineer’s existence.

Why, oh why, must there be another standard? According to Wikipedia, they were designed to prevent consumers from connecting non-standard hardware to WiFi devices. Maybe that would have worked in 1999… but seeing as it’s 2020, it just means I need a ludicrous amount of adapters and gender/polarity changers. (Rats! Back to eBay!)

With the board assembled, I did one last check with the multimeter to make sure I hadn’t shorted the CPWG anywhere. Satisfied, I plugged it in, checked voltages, and hooked it up to the NanoVNA.

And then took it right back off. Crud! How much power does the NanoVNA’s reference signal have? And what’s the maximum input power?

Google wasn’t too helpful… but from what I found, the NanoVNA output somewhere between -9 to -13 dBm. I checked the helpful silkscreen reminder that I left myself… +15 dBm was the max power the board could receive, and it would boost the signal by another +15 dBm. I couldn’t find the maximum input level for the NanoVNA, and although +5 dBm isn’t too much, I didn’t want to cook my new tool on the first test. Fortunately, I had a 30 dB attenuator lying around in my parts drawer. It puts me down into the NanoVNA’s noise floor, but it guarantees I won’t blow anything up.

With the VNA quickly recalibrated, I threw the board back on, and made a measurement. (I could have extended the measurement all the way to 1.5 GHz, but I was sorta shotgunning this, and didn’t realize the VNA went all the way up that far. I set the stop frequency to 1 GHz, and left it there for the measurement.)

Image for post
Image for post
Forgive the wretched labels on this graph.

Well, that’s definitely the lower half of a bandpass filter! I was a touch confused that the gain was negative. Assuming the reference level is now -30 dB, the passband sure looks like it has about +15 dB of gain, so the PCB passes the smoke test… but I could have sworn I used the attenuator for the thru-cal. Either I don’t understand something… or I made a mistake in calibration. Either way, good enough for me. On it goes to the radio!

I popped open GQRX for a terribly scientific test. My plan was to tune into my city’s P25 repeaters, make a measurement with the board, and then remake the same measurement without the board to see if there was any noticeable difference.

I won’t lie — initially I didn’t notice much of a difference between the test with the board and the test without. The distance from the signal’s peak to the closest noise floor was about the same. I figured I’d call it quits and do some trouble shooting later, but then I came back the next day. I figured it might help to max out the FFT averaging, and see if that made some difference. When I did, the results leapt right out at me.

Image for post
Image for post
Without the LNA
Image for post
Image for post
With LNA

The blue regions indicate where known radio signals lie. (Ignore the red line, that was just a marker I forgot to remove.) As you can see, the biggest difference is that the noise floor is much less… tempestuous. Granted, I maxed out the FFT averaging — but that exposed a hidden pattern without the LNA that I hadn’t been able to see previously. Additionally, the spurs (likely intermodulation products) are much less pronounced.

One last test that I figured was worth looking at was a full band scan using QSpectrumAnalyzer. Settings were chosen fairly arbitrarily, and I’ve plotted out the max-hold.

It’s… kinda hard to explain why it makes sense to use the max hold. You don’t really want to look at the instantaneous value of the FFT… there’s too much change, especially when signals come and go. The max hold “builds up” over time, as large signals set a new “high water mark”. This would make a lot of sense if I had a uniform noise source that occupies all frequencies at a consistent power level… but I don’t. It doesn’t let me spec out the filter very well, but it does let me see the loudest interfering signals, and see how much they get attenuated.

Image for post
Image for post
Image for post
Image for post

After 1.2 GHz, the spectrum is nearly empty, except for perhaps my WiFi router flooding the antenna — and even that has been knocked down quite a bit. You can also see the big chunk of… whatever it is at 300 MHz has been knocked down, along with the FM broadcast band.

If I had more time, I suppose I’d try a bit more of a scientific test… but for right now, this is good enough for me to say “this works well enough, hooray!”

Ugh. I hate shotgunning stuff. It feels like there’s a ton of interesting little things to investigate and study about this design. Amplifier stability? Can I have the NanoVNA correct for my 30 dB attenuator? What is responsible for those spurs? Can I filter out the powerful 2.4 GHz signals that seem to be interfering the most? What if I add a little tuning network for the antenna?

I probably could have saved a little money by making more cautious eBay purchases… but I think all in all, I only spent about $20 more in parts and shipping. How much longer would I have needed to look to iron out those details? Would it have been worth saving $20? I love saving money, but I reckon if I tried to save that Andrew Jackson, the project would have never happened. Bike shedding, much?

In the end, this was still more satisfying to complete than frustrating. I spent a touch more on tools than I anticipated, but it’s not like they go bad, or anything. Hopefully I’ll have enough time to experiment with it soon, and it won’t wind up in the bottom of my parts drawer. If you think you could use a copy of this PCB, send me a DM on Twitter, and I’ll mail you one!

GitHub Repository

  • Total Tool Costs: $305.99
  • Component Cost: $49.88
  • PCB Cost: $22.15
  • Total Board Cost: $24.01 / PCB
  • Parts Search: 1 hour
  • PCB Design: 3 hours
  • Tool Shopping: 2 hours
  • PCB Assembly: 2 hours
  • Testing: 2 hours
  • Writeup: 1 hour
  • Total: ~12 hours

Written by

Tim builds circuit boards in Virginia Beach, and enjoys writing about current events, history, theology, and philosophy.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store