This project started when I tried to replace a damaged gate opener. I was going to replace the 10 dip switch with microcontroller pins. While working on that, I came across rpitx.
rpitx is a general radio frequency transmitter for Raspberry Pi which doesn't require any other hardware unless filter to avoid intererence. It can handle frequencies from 5 KHz up to 1500 MHz.
Since the gate remote transmits at 300 MHz, rpitx was an ideal solution. In addition to the Raspberry Pi Zero W and the micro-SD card, I used RTL-SDR receiver to record the signal once I pressed the button on the gate remote. Zooming in using Universal Radio Hacker we can see the dip switch code.
Soldered an antenna to GPIO 4 (Pin 7 of the GPIO header). The length of the antenna is just under 25 cm.
I used Raspberry Pi OS Lite on Raspberry Pi Zero W to replay the recorded signal which has been saved in record.iq. A bash script has been created to autorun as soon as Raspberry Pi Zero W starts.
#!/bin/bash
while :
do
sudo /usr/bin/sendiq -s 250000 -f 300e6 -t u8 -i /home/pi/rpitx/record.iq
done
Finally, made the OS read-only to avoid micro-SD card corruption due to improper shutdown.
While waiting for the gate to open, I decided to find a better solution. Waiting 40 seconds for anything is unacceptable.
That's when I decided to dig up my XIAO RP2040 that Seeed Studio sent me a while back. I did have to add CC1101 Transceiver to replace rpitx functionality.
Working with any RP2040 board, not just XIAO; can be challenging. So is working with CC1101 libraries. I ended up using SmartRC-CC1101-Driver-Lib because it requires less settings. Only one line in my code needs to be updated.
// Remote code
String Dip = "0101011010";
Also, had to change SPI pins in %USERPROFILE%\.platformio\packages\framework-arduino-mbed\variants\RASPBERRY_PI_PICO\pins_arduino.h because there is no working board for XIAO RP2040 in PlatformIO.
Instead of adding a battery to the final product, I decided to use a USB cable for power. Finally, trimmed the product to make it fit inside a Kinder Egg toy capsule which I acquired legally overseas.
Comments