Posts Tagged SDR
A tiny handful of known-good-quality SMA terminators arrived from eBay:
They’re described as KDI Triangle T187GS SMA Female Terminator, 50Ω, 1W, 0-4GHz. A bit of searching suggests MCE (whoever they are) borged KDI quite a while ago (their website, last updated in 2003, has been lightly vandalized) and a datasheet won’t be forthcoming.
In any event, a NooElec NESDR Mini 2+ radio connected to a dual-band VHF-UHF antenna perched near a window shows this for a local FM station:
Zooming to 5 dB/div:
Installing the terminator at the end of an MCX-to-SMA adapter cable:
Haven’t a clue about those tiny little spikes with the terminator in place, but they don’t line up with any of the high-energy inputs and are, most likely, junk brewed up within the radio. That’s with the RF gain set to 49.6 dB and AGC turned off.
The hardware looks like this:
The MCX connector on the radio isn’t the most durable-looking thing I’ve ever seen, so strapping the adapter cable to the case seems like a Good Idea. You can get an NESDR radio with an SMA connector for about the same price, which I’d have done if were available a while ago.
The terminated input looks to be about -75 dBFS, about 15 dB below the between-station noise, and the carrier tops out around -25 dBFS, for a “dynamic range” of 50 dB. Oddly, that’s just about dead on the maximum dynamic range you can get from the 8 bit RTL2832U demodulator / ADC stuffed inside the NESDR: 8 bits × 6 dB/bit.
It is not obvious to me the signal from a randomly chosen (albeit powerful) FM station should exactly fill the receiver’s dynamic range, particularly without AGC riding herd on the RF gain. Some hardware tinkering seems in order.
The GNU Radio flow graph:
Further results from the SDR-based WWVB receiver:
Seven hours of mid-January RF, tight-zoomed in both frequency and amplitude, from 0350 to 1050 local:
The yellow line of the WWVB carrier comes out 2 ppm high, which means the local oscillator chain is 2 ppm low. We know the WWVB transmitter frequency is exactly 60.000 kHz, translated up by 125 MHz to the N3’s tuning range; you can, ahem, set your clock by it.
The blue band marks the loop antenna + preamp passaband, which isn’t quite centered around 60.000 kHz. Tweaking the mica compression caps just a bit tighter should remedy that situation.
Given that input, a very very tight bandpass filter should isolate the WWVB carrier and then it’s all a matter of fine tuning…
All the blocks for a WWVB receiver, lined up on the attic floor:
The dramatis personae:
- 40 turn loop antenna along the bottom
- 60 kHz tuned preamp
- Ham-It-Up 125 MHz mixer (DC power from 5 V wart, offscreen top)
- ThumbNet N3 SDR (DC power from the linear supply at the top)
- Raspberry Pi 3 with Raspbian, plus reset switch
- Waterfalls from GQRX, available in the Raspbian repositories
The headless Pi connects to the house WLAN through its built-in WiFi link, so I can run the whole mess from the Comfy Chair at my desk through Remmina / VNC.
Recording 24 hours of WWVB shows it works:
The wavy line along the left edge looks like a birdie formed by a local oscillator in the attic, because the frequency varies (inversely) with temperature. It’s probably a signal on the Pi board, rectified by some junction, and translated in-band by some Ham-It-Up harmonic. Whatever.
The other traces come out bar-straight, suggesting that the 0.5 ppm (presumably, per °C) temperature-compensated oscillators along the whole RF chain behave as they should.
There’s a slight frequency shift, on the order of a few parts-per-million, between the absolutely accurate WWVB carrier and the indicated display. Not a big deal.
The broad, albeit irregular, orange band down the middle shows the loop antenna / preamp bandwidth, which is on the order of 2 kHz at -3 dB and a few kilohertz more down to the noise level.
The broad horizontal gashes seem to come from the N3’s on-board hardware AGC reacting to signals far outside the waterfall. Various birdies appear & disappear, even in this limited view, so you can just imagine what’s happening off-screen; anything popping up within the SDR’s tuning range clobbers the gain, which becomes painfully visible when zoomed this far in along both frequency and amplitude. Turning AGC off should stabilize things; perhaps software can tweak the SDR gain based on a very narrowband filter around 60.000 kHz.
The upper half of the waterfall shows decent reception for most of the night. The bottom half shows there’s basically nothing goin’ down during the day, which is about what I’d expect based watching the Alpha Geek Clock for seven years.
In any event, another 24 hours with the AGC turned off looks better:
Various sources still clobber the receiver response, but it’s not quite so dramatic.
For unknown reasons, probably having to do with the unmitigated disaster of trying to get an SDRPlay radio working with GNU Radio (about which, more later), Unicode keyboard input stopped working. This is not to be tolerated, because engineering notation requires a lot of Greek letters.
Unicode support seems to be baked into the lowest levels of the Linux operating system, although it’s not clear to me whether it’s in X, QT, GTK, or somewhere else. Googling the obvious keywords was unavailing; evidently this feature never ever fails or, more likely, very few people use it to any extent.
Note that I already have the Compose key set up, but Compose sequences don’t include Greek letters.
After considerable flailing, I added the Simple Greek keyboard layout and defined the (otherwised unused) Menu key as the keyboard layout switcher. That’s a pretty big hammer for a rather small problem; I devoutly hope Unicode mysteriously starts working again.
For reference, the Greek keyboard layout looks like this:
I’d have put Ω on the W key, rather than V, but that’s just because so many fonts do exactly that.
The solid model became slightly taller than before, due to a serious tangle of wiring below the board, with a narrower flange that fits just as well in the benchtop gripper:
Tidy brass inserts epoxied in the corners replace the previous raw screw holes in the plastic:
The screws standing on their heads have washers epoxied in place, although that’s certainly not necessary; the dab of left-over epoxy called out for something. The screws got cut down to 7 mm after curing.
The preamp attaches to a lumpy circle of loop antenna hung from the rafters and returns reasonable results:
The OpenSCAD source code as a GitHub Gist:
Encouraged by the simulation, the 60 kHz preamp hardware sprawls over a phenolic proto board:
The inductors and resistors hanging off the screw terminals produce more-or-less the same impedance as the real loop antenna. The alligator clips connect a function generator to the secondary winding of a current transformer (used backwards), thus injecting a wee differential signal into the “antenna”.
The clump of parts in the lower left knock the 24 VDC wall wart down to 20 V and produce a 10 V virtual ground in the middle:
The LEDs give a cheerful indication that the power supplies have reported for duty, plus apply a minimum load to the LM317 while I was tinkering. The heatsink gets tolerably warm, so I should dial back or disconnect the LEDs to reduce the load.
The preamp hardware matches the simulated layout, with a few extra bits tossed in:
The weird values come from whatever 1% resistors and silver-mica caps emerged from the heap. The 27 V Zener diodes and 5 kΩ resistors may or may not protect the instrumentation amp inputs from lightning-induced transients.
Because the HP8591 analyzer’s tracking generator starts at 100 kHz, I fed the DDS function generator into the preamp, manually stepped the frequency in 250 Hz increments, and had the analyzer show the maximum response of 19 separate sweeps:
That was tedious and, no, it’s not a comb filter: the actual response skates across the peaks of all those bumps.
The marker shows the preamp bandwidth is 2 kHz, roughly what the simulation predicts; the extremely tight span of that plot makes it look a lot flatter that the usual presentation.
Tightening the span even more shows an unexpected effect:
Those sidebands at ±120 Hz (probably) come from power-line magnetic fields into the “antenna”, because the magnetic field strength depends on the absolute value of the voltage. If they came from the signal generator, they’d be at ±60 Hz: the waveform amplitude depends directly on the voltage.
Having just put a headless Raspberry Pi in the attic, the chip temperature is of some interest. Doing this in an SSH session comes in handy:
watch 'echo "scale=1 ; d = $(cat /sys/class/thermal/thermal_zone0/temp) / 1000 ; print d , \" °C\n\" " | bc' # blank line to ensure the underscore displays correctly
Raspbian doesn’t have the
bc calculator by default, so do that first.
For whatever it’s worth, the Pi starts out at 10 °C and warms over 60 °C under heavy load:
Every 2.0s: echo "scale=1 ; d = $(cat /sys/class/thermal/thermal_zone0/temp) / 1000 ; print d , \" °... Sat Jan 14 19:58:59 2017 61.7 °C
It ticks along in the mid 30s under light load.
You can run all that in one tab of a terminal window through VNC. If you’ve got that much GUI goin’ on, just add a thermal monitor in the panel and be done with it.