I need to build a wireless trigger to close a swinging gate on a trap for deer. I plan to use a 4G GSM module for a Raspberry Pi. The gate is spring loaded and needs a pin pulled out of a stop to let the gate close. The plan is to call the cellular phone number and let the call operate the solenoid. The gate is monitored with a 4G trail camera, so I can monitor whether the gate closing is successful.
Is there a 4G HAT that fits over the Raspberry Pi? Can I operate the solenoid by adding a relay that is operated by the Raspberry Pi? How does the 4G cellular module output a successful call?
We can certainly help with picking parts!
As for the relay, there are certainly HATs for Pis that manage all the nasty stuff like driving the coil and managing kickback, and also power the Pi if needed, take a look:
That will fit nicely on top of a 4G HAT:
According to Waveshare, GPIO 4, the relay pin, is used to control flight mode, but only when a jumper is connected, which is great, just don’t add the jumper:
As for interpreting the input from your phone, all the info is on the wiki page for this product
It looks like both calls and texts result in a message on the serial feed, so you’ll just have to inspect each line coming from the module in your code, and search for strings like RING or SM
Let me know if you have any followup questions
Will the Power + Relay HAT work on a Raspberry Pi 4?
Yep, that info is in my original reply, they share power (fine), and don’t share GPIO 4 if you disconnect the jumper to the “Flight” pin (fine)