Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This method also works with wireless doorbells and other similar systems.
We're gonna need a RTL-SDR, which is basically a radio dongle and a cheap radio transmitter.
We will also need a microcontroller to interface with the transmitter, any Arduino would do it.
You can get one for less than 8$ on Ebay, a 433MHz radio transmitter for less than 1$ and any kind of arduino clone for less than 3$.
Let's start...
First you need to install the drivers for the RTL-SDR, the Arduino IDE if you don't already have it,
the Audacity Audio Analyser/Editor and finally a spectrum analyzer, you can use SDR# or GQRX in Windows and GQRX on linux.
To install the drivers on windows, you need to open Zadig (which comes with SDR# or GQRX) and select "Bulk-In, Interface" in the dropdown box and WinUSB in the Driver area,
then click "Replace Driver". On linux you just need to install the rtl-sdr package.
After this you will open your spectrum analyser, I'm using GQRX.
After you choose RTL2832U (aka RTL-SDR) for the device input, you will see this...
Now we need to find your keyfob working frequency, usually it's 433MHz or 310~315MHz. To do this you will need to navigate to these frequencies and look for something like this.
(obviously the signal will only show when the keyfob is pressed)
After you identify the signal, you need to be able to read it. Usually garagedoors (and other simple rf systems) use ASK/OOK modulation so we will choose AM for the demodulation mode.
This will demodulate the signal in an audio waveform. So what do we do? We go to the audio tab and record the signal. After this we will open it with Audacity. It will look like this.
Then we zoom in...
Now we just need to read the binary data that we see. How we do that?
The signal has some spikes as you can see, some of them are longer than the others, the longer ones represent 1 and the small ones represent 0. Like this.
Now we have the data that was sent. This binary code is the key, or in other words, the password... when the receiver listen this key, it will open the garagedoor.
So, how we send it?
To send this code, we will use an arduino with a 433MHz radio transmitter (if your signal has other frequency, you will need to use the correspondent model).
Let's code then!
First we need to install the RCSwitch library, this can be done be going to Sketch>Include Library>Add .ZIP Library and choosing one of the releases available on the github page.
Then the wiring...
(different arduino boards can have different wiring)
Now, the magic!
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
void setup() {
mySwitch.enableTransmit(10); // The PIN you're using to connect the transmitter
void loop() {
mySwitch.send("0011110000100"); // The code we found previously
To send it to your board, connect it via USB and go to the Tools Menu and select the Board, Processor and Clock (some board don't need to specify the clock) and finally, the COM port (if you don't know wich it is, try all of them).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment