Page 1 of 1

Project: Trigger GPIO via SDR Received Signal

Posted: Fri Jan 22, 2021 4:02 pm
by clarksbrother
Greetings All!

First, thanks in advance to anyone here who can lend guidance/advice. Working on a project with the following goals:

- Detect a signal on a predefined frequency (VHF / AM).
- If the signal is above a predefined SNR ratio, trigger voltage (3.3) on one of the GPIO pins for as long as the signal is present (and then turn off when the signal is below that threshold)
- Rinse wash, repeat.

Long story short, using the voltage to trigger an industrial PLC relay to turn on/off lighting.
Currently using a Raspberry Pi 3+ B and a Nooelec SDR module.

In my head I kinda just assumed one of the common SDR software packages might allow you to trigger one of the GPIO pins but have yet to find anything. Would appreciate any insight anyone may have on how I might accomplish this.

Re: Project: Trigger GPIO via SDR Received Signal

Posted: Fri Jan 22, 2021 9:56 pm
by ckoval7
You could modify the python output of a gnuradio flow graph to use the gpio library.

You'd just have to figure out the right place to put lines of code similar to this:

Code: Select all

gpio_error = None
    import RPi.GPIO as GPIO
    control_pins = (16,)
    GPIO.setup(control_pins, GPIO.OUT)
except ModuleNotFoundError as e:
    gpio_error = e
    print("Cannot import GPIO. Maybe not on a pi?")
 #Turn pin on
 GPIO.output(control_pins, (GPIO.HIGH,))
 #Turn Pin off
 GPIO.output(control_pins, (GPIO.LOW,))