Introduction
In many previous posts I have examined the use of the RTL-SDR with GNU Radio and on RaspberryPi4 (Ref.1/5). The combination makes an inexpensive, simple and rugged platform for the reception of a variety of signals. Figure 1 shows a typical implementation. The RTL-SDR is used to receive a Marine Weather signal at 162.4MHz on GNU Radio. An embedded Python Block can be designed to interface the GNU Radio schematic to communicate with the RPi GPIO. This is extremely useful and can be applied in many ways. A typical example would be to have a threshold circuit to trigger a LED when a signal of a given power or more is received.
GNU Radio Schematic Marine VHF Rx Threshold Detector
Figure 2 shows a GNU Radio schematic for the reception of Marine VHF weather on 162.4MHz. After the LPF, an RMS block evaluates the overall signal amplitude. A Threshold block is setup so that when tuned off frequency say at 160.4MHz, the output is “0” as in Figure 3. When tuned on frequency of 162.4MHz the output is “1” as in Figure 4. This logical block can then be used to feed the embedded Python to GPIO block.
Embedded Python Block
In order for GNU Radio to communicate with the RPi GPIO, we have to write an embedded Python Block. Ref.6 is an excellent overview on how to do this by Wylie Standage-Beir. Ref.7 is from the GNU Radio Wiki for creating your first block. Basically I used the standard code written in the default GNU Radio Embedded Block and made some simple changes. The standard block multiplies the input by a constant. I removed the constant, removed the output, set the input to float32 and used the RPI.GPIO library.
GNURadio Companion Basics Course:
https://clarktelecommunications.thinkific.com/courses/gnuradio_basics
Please send your comments, questions and suggestions to:
contact:
References
#1. – “RTL-SDR for Marine GMDSS/DSC on RaspberryPi4”
https://jeremyclark.ca/wp/telecom/rtl-sdr-for-marine-gmdss-dsc-on-raspberrypi4/
#2. – “RTL-SDR for RF Signal Capture in GNU Radio”
https://jeremyclark.ca/wp/telecom/rtl-sdr-for-rf-signal-capture-in-gnu-radio/
#3. – “RTL-SDR for VHF Air Band AM on GNU Radio”
https://jeremyclark.ca/wp/telecom/rtl-sdr-for-vhf-air-band-am-on-gnu-radio/
#4. – “RTL-SDR for SSB on GNU Radio”
https://jeremyclark.ca/wp/telecom/rtl-sdr-for-ssb-on-gnu-radio/
#5. – “RTL-SDR for AM on GNU Radio”
https://jeremyclark.ca/wp/telecom/rtl-sdr-for-am-on-gnu-radio/
#6. – “Writing GNU Radio Blocks”
https://www.youtube.com/watch?v=CnJObODsx0I
#7. – “Creating Your First Block”
https://wiki.gnuradio.org/index.php?title=Creating_Your_First_Block