Decode 433 MHz signals w/ Arduino & 433 MHz Receiver

Today I’ll be showing you how to read 433 MHz codes. This tutorial was made to complement the Voice Controlling project which needed 433 MHz Unit Code Values to control the wireless switches. Since I’ll be getting my own apartment, a lot more 433 MHz RF home automation tutorials will probably soon come up! If you want to know how to read 433 MHz codes using a Raspberry Pi, go to this post!

Hardware Requirements

  • Any Arduino(I used an Arduino Nano clone)
  • 433 MHz receiver(Any type of 433 Mhz receiver should work, but for this tutorial I used a 4 pin variant)
  • A breadboard
  • Some jumper wires
  • A 433 MHz transmitter(I used a 4 channel 433 MHz transmitter Remote)

Connecting the 433 MHz Receiver

receiver

As you can see in the picture, my 433 MHz Receiver actually has two Data-pins. Why it has two pins I don’t exactly know, but a possibility is it is used to easily connect two output-sources, or two different Arduinos. In this project however we will only need to use one of the pins. I used the one closest to the GND-pin.

Arduino Pin  433 MHz Receiver Pins
GND GND
5V VCC
Digital Pin 2 (D2) Data

It’s important to know that if you are using an Arduino Leonardo, you should be connecting the Data pin to Digital Pin 3(not Digital Pin 2!).
Because we will be using “interrupt 0”, the Digital Pin you should connect is actually different between different Arduino models. If you are not using an Uno, Nano or MegaGo to to this site to check out which Digital Pin you should use.
Most people will be using Digital Pin 2 in this project however.

This is how it looks like connected to my Arduino Nano

IMG_0783

Getting the RCSwitch Library installed

To make the 433 MHz receiver to work with your Arduino, you need to download a library called RCSwitch.
You can download RCSwitch directly from their official repo:
https://code.google.com/p/rc-switch/downloads/list

After you’ve downloaded it, you should have a zip-file. You need to extract it, and move the extracted folder to your Arduino libraries folder.

If you don’t know where the Arduino libraries folder is, open up the Arduino Software and go to File –> Preferences. If you are on a Mac, it’s Arduino –> Preferences.

Here you should see the Sketchbook location.

Screen-Shot-2014-06-18-at-09.29.56In my case my libraries folder is in /Users/Prince/Workspaces/Arduino/Arduino_Training.
Now to clarify, I should move the extracted RCSwitch folder to:
/Users/Prince/Workspaces/Arduino/Arduino_Training/libraries

To finish up the library installation, exit and reopen the Arduino Software, and now you’ve successfully installed the library!

Uploading the code

The code we will be using to read the 433 MHz RF codes is actually located in the library as example code. To open up the code in the Arduino Software, press the “Open”-button, then press: libraries –> RCSwitch –> ReceiveDemo_Simple

ReceiveDemo_SimpleNow the code should appear in the textfield. Now connect your Arduino to your computer and upload the code!

Reading 433 MHz Codes

I used a simple 4 channel 433 MHz Remote to send some example codes to my receiver.

remote

Open up Serial Monitor, and set the right bottom list to “9600 baud”. When you then press the buttons on your 433 MHz transmitter remote, the received 433 MHz RF codes should then be printed!

serialmonitor433mhzreceivedNow in my case you see values ranging around 16738081- 16738088.

So this is how you read 433 MHz codes using an Arduino & 433 MHz receiver!

If you have any questions feel free to ask me by using the Contact page or by commenting below.

Prince

A second year computer engineering student at Malmö University in Sweden just having some fun with this blog. Computer Engineering and Mobile IT: Bachelor of Science in engineering

You may also like...

54 Responses

  1. Laurent says:

    Thanks for sharing, I have exactly the same receier and the same remote. But in my case remote is blank I mean no buttons are programmed, what did you use to insert code in it ??

    thanks.

    • Prince says:

      If you have the same remote, then the codes should be preprogrammed. Did you install a battery into the remote?

  2. yannick t says:

    Hi, i need to use the servo library with a 433mhz rf and i cant mix the virtualwire and servo librairies because they both user timer1… can i use this library with the servo? Is the interupt 0 or 1 as someting related to the timer1… im new to arduino and the web is hard place to find help with arduino, lot of old stuff out there. Thx if someone can help me

  3. ed says:

    Very interesting. However there a re a number of 433 MHz transmitters that leave no trace on ReceiveDemoSimple. I guess there just are some codes it doesnt recognise, but then also doesnt recognise them as ‘not recognised’:-)
    I have one or two transmitters in which e.g. th eON button leaves no trace on the program output while the OFF button does

  4. Fernando says:

    Hi Ed, how did you manage to fix this? The same is happenig to me!

  5. Michel says:

    Hi, thank you for this very intersting tutorial 🙂
    Having no success in decoding 433 signals with a Pi, I ordered and just receive an arduino Nano.
    I installed the library so th I can see it and include it and compile ReceiveDemo_simple with no errors.
    I use the same 4 pins receiver and (look) exactely the same “4 channel 433 MHz Remote” as on the photo.
    Nothing comes out the monitor 🙁
    The Nano is working fine with the simple ‘Blink’ program.

    My question :
    Do you think It should word with my version of the Nano which is ehanced (ArtMega328) ?
    Are the clocks th same ? (I’ll try to find this answer on the net 😉

  6. Michel says:

    … However the receiver shows zeros ans ones with an osciloscope nicely organized when pressing the remote button…

  7. Michel says:

    OK.
    I finally have made myself a working sketch for Arduino that reads 433MHz codes in a fairly reliable way :
    http://mgrigaut.free.fr/arduino/MyReceive_Jolly2.ino

    • Ed says:

      Michel, that is a great piece of code. I had to alter the pulse cutoff a bit from 900 to 600uS but then it worked fine.
      Just a question: my results is as follows:
      Found Header : 27 bits word
      001000000000000000000000001 => 1000001
      Found Header : 27 bits word
      001000000000000000000000001 => 1000001
      I dont see immediately how you translate the 27 bit code into the 7 bit code?

      • Ed says:

        solved. it was pure coincidence it was all zero’s and 1’s . The number on the right is the hexadecimal number

    • Tino says:

      Hi.
      Your code works for me.
      But how do I know, what code the remote has? Finally it looks like that:

      Init : Start decoding
      10001
      1
      61
      1
      5
      107
      1
      5
      101121
      3

    • buzz says:

      what does your code do?

      • serkan says:

        I have the similar result. What is the decoded result(code)? where do we start to read (between what numbers)? Thanks.

    • Romeo Mulaudzi says:

      i used this code and it works but it just keeps printing out numbers. whether I press a button or not I just keep getting a bunch of numbers

  8. Ed says:

    This method will work in most cases. However the sniffer program sometimes has problems understanding the code that is being sent by a remote and then you need some more digging.
    Remember that a lot of Remotes adhere to protocols that are known and you might be able to find it on internet or judt make it up from say the switches on your dvice

  9. Ricardo says:

    Doesn’t work… no reading of “even garbage”… is there any regulation on the Receiver ? Garage Remote control is the same of your picture…

  10. Reto says:

    Cool, works with one of my 433-Remote-Controls (like yours). Does it mean I could also connect stuff like this? http://goo.gl/46NlJW – but how can I tell the Arduino to act when the sensor is active – I mean how can I “decode” the lines in a way Arduino knows it’s from this device and not from another?

  11. carbonyle says:

    looks like there is 4 hardcoded codes for the remote many many secure 😀

  12. Jaap says:

    I have unzipped to ARDUINO/Libraries/rc-switch-master
    but then the Arduino IDE complains about the name format the minus signs had to be removed ?

    then when compiling the error

    ReceiveDemo_Simple.pde:7:22: fatal error: RCSwitch.h: No such file or directory
    compilation terminated.
    came up

    Arduino is nice but the handling of libraries is to hard to understand for me

    these libraries have to be on a very special location ?
    a library is just a text file that is inserted at compiling time ?
    so i do not understand why I always end up whit the above error
    this is higher physics to me…

    • cata says:

      use the latest release instead of the master-branch
      and name the rc-library folder just “rc-switch”
      use a board like “arduino uno” or “arduino nano”
      some boards are very special in handling interrupts, therefor they are not supported by all libraries
      for example rc-switch does not support attiny at the moment

  13. Gilberto says:

    hello
    How I use a 375MHZ control?

  14. Jernej says:

    Hello 🙂

    I have the same receiver and the same 4 channel remote. And when I try to read the values from remote, I get just one value. I can read just one channel. And that’s the button c. Do you know what could be the reason for that ?

  15. Deepanys says:

    Hi, can i plote these recived frequency in transmitter module if i can plz send codes for that….

  16. David says:

    Thanks for the concise walkthrough. Worked a treat for me.

  17. Michael says:

    Thanks for this information, worked like a charm!

  18. Ye Nyi says:

    thanks a lot, very useful to me, cheer

  19. John says:

    The other buttons are not programmed, you can do it this way:

    How to Program:

    1. Press the two top buttons until the LED flashes – it takes around 3 seconds.

    2. Place the cloner remote and the original remote close together/side by side so that they are touching.

    3. Press a button on your original remote in the same time and one of the buttons on the clone remote and hold until the LED on the clone remote flashes steadily. (The Blue LED will first flash 3 times quick, then stops for a second, then flashes steadily for successful cloning).

    4. Now programming is successful! If you want to program more buttons just repeat steps 2 > 4. It’s that easy! To reset the remote simply start again with step 1.

    What I would like to know: How can I programm the buttons with my own code using an Arduino?

  20. Kalaivanan says:

    Its is possible to receive 315MHZ signal on 433MHZ Receiver?

  21. berry says:

    MULTIPLE TRANSMITTERS (3pc) 1 RECEIVER (caps cause easier to find for others, just in case)

    I have a setup with 3 arduino’s, each equiped with a 433mhz transmitter and an LDR. The LDR triggers the sending of data and stops again after a 4s delay.

    Then there is one arduino with a 433mhz receiver and a midi shield.

    Once a transmitter is triggered it sends data to the receiver and the receiver triggers a MIDI command to a MIDI interface (Atm i use MIDI for troubleshooting but eventually it will trigger a command on a MIDI device.)

    The codes are running on all devices and i get signal from each transmitter. Except when I turn on all of the transmitters. I have tried sending bigger numbers that are more spread from eachother and i tried giving each a different protocol number.

    Still no succes. Next up is giving each a different PWM/pulselength.

    All the transmitters and the receiver have an antenna and the arduino in use are Uno’s

    Would really appreciate the insight or nudge in the right direction.

    Hope someone has a solution 🙂

    • berry says:

      I found out why it wasnt working.

      I was using an if else statement that would send a trigger if a message from the transmitter was received. for instance:

      mySwitch.send(5396, 24);

      In the demo sketch of RCSwitch.h the else command contains the line mySwitch.send(0,24);

      This made hat all the transmitter were constantly sending a zero. I canceled these lines of code and everything is working now! 🙂

      hooraay!

  22. Chris says:

    RC Switch library works well with my arduino with 2 of my remotes but Not with a 3rd one. All are 433 MHz. Any idea why? Thanks

    • berry says:

      for me it was that they were all sending a mySwitch(0,24); command. That caused interference and no response from the receiver. In my case. Check my solution ^ if want my code, let me knwo

  23. Gilson says:

    Como faço para comandar 04 leds via RF 433Mhz com arduino ao pressionar e soltar botão ?

  24. Zaid says:

    HI
    is it possible to interface 3 transmitter each on different Arduino , with one receiver .. \\

    I was thinking of implementing 3 transmitter with 3 receiver with different frequencies but idont find any module that comes with tunable feature …. so if any one could help please help ^_^

  25. hugo says:

    is it somehow possible to code this cloning remote from arduino? I don’t have a remote to copy from.

    • Markus says:

      Hi hugo,

      yes it is. I did it yesterday. You can do it with the transmitter from XY-MK-5V or all other 433 MHZ transmitter. Method how to teach your remote depends on your model. But you can try it like this.

      Press the buttons “A” and “B” or “1” and “2” together until the led ist flashing for a few times. Then leave the “B”-Button and in the next step you push the “B”-Button again for three times (slowly). Then leave the “A”-Button, too. No you have cleared all Codes of the remote control.

      Step 2:
      Send the signal wich you want to send continually with the transmitter from the Arduino. Hold the remote control very close to the antenna from the transmitter. Then press this Button on your remote control which you like to teach until the LED is flashing for approx. 3 times. Then the LED stops for a while and after this the LED is flashing continuously. At least you can leave the button from your remote control.

      This is the scheme of my remote control. I think the scheme is very often the same. Maybe you have to play with the times.

  26. Markus says:

    Hey guys,

    I have another Problem. I can´t receive no signals with my receiver XY-MK-5V in combination with my Arduino uno. I tied the rc_switch and the VirtualWire library. I can´t receive anything. Then I tried the sketch from Michel. Unfortunately nothing happened. The next idea was to connect the data – Pin with the analog Pin A0 form my Arduino. And want to display the Value on the serial Monitor. The value of the INPUT is always alternating along 430. When I press a button on my remote control nothing is changing.
    So my first question is. Why doesn’t work my receiver? In so many chats and tutorials it is so simple to receive such a signal. And I tried so many ways and nothing, absolutely nothing is happening.

    It would be so great if somebody could help me.

    Thanks a lot.

  27. bikar says:

    graet article

  28. CAPTB says:

    Hi there,
    Thank you for a great article.
    Reading through it I have managed to set up rcswitch on an Arduino Mega and wants to decode a signal from a remote to control some rf sockets from the Arduino.

    When decoding the signal it has slight variations even if I press the same button. This is also what you describe when you write: “Now in my case you see values ranging around 16738081- 16738088”.

    My question is: why does the signal vary and how do you know which variation to chose to transmit from the arduino? I thought the signal would always be the same when the same button is pressed.

    Note: the remote has channals A-E. For each channal there is an on/off button.

  29. dierickx says:

    Hi,

    i am very interested by this article.
    i have at home a hot (for winter time) or cool (summer time) system.
    Each rooms has a remote control (with a zone number)

    Do you think i will be able to catch the RF Signals “on” or “off” from one RF remote to be able to reproduce it with pi ?

    I heard that some remote control use rolling codes that can’t be reproduce with pi.
    Do you know how can i know if my remote use rolling code or not ?

    Thanks for your help.

  30. Addison says:

    How to use decoded value (1937316) to send , thanks
    mySwitch.send(“111011000111110100100”);

  31. ken says:

    Thanks for this, your code has been the only one to show any sign of life for my Aleko gate opener remote. One problem is if I use debug I see lots of 433 information. When I press my remote in debug and normal all i see is one digit or maybe three no “header found”. i think it is something in the Code timing. What could i adjust?

  32. In this tutorial I ll show you how to use an Arduino to decode signals from RF remotes, and re-send them to remotely control some mains switches and a garage door.

  33. Ariel R. says:

    Hi How I can reproduce a 3 secs press remote control button with code ? Should I use a for loop and mySwitch.send method inside the loop ? Tx.

  34. OKAN TEL says:

    what’s the meaning of protocol ?

  35. VioletJuicy says:

    I often visit your blog and have noticed that you don’t update it often. More
    frequent updates will give your website higher rank & authority in google.
    I know that writing content takes a lot of time, but you
    can always help yourself with miftolo’s tools which will shorten the time of creating an article to a few seconds.

  36. Malith says:

    Can i use nodemcu esp8266 ?

  37. Adam says:

    Thank you very much!

  1. 08/10/2015

    […] the simple radio protocol that those el-cheapo 432 MHz sockets use? We’ve seen our fair share of projects. (And an Arduino library.) Why? Because they’re cheap and because it’s easy. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.