Arduino RF remote control without codes


I'm developing a project with an rf remote control. I have an universal 4-button remote control, an 433MHZ emitter and receiver board. On my project, I need the remote control to have 1 different code in each button.

I was able to correctly use the rf receiver and to see received codes on serial monitor. However my remote control doesnt have any code memorized and I was able to copy only one code from another remote (that I assigned to button A).

Is there any way of assign codes to the other 3 buttons without other remote? Perhaps with the emitter board?

Thank you

Receiver code:

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
mySwitch.enableReceive(0); // Receiver on interrupt 0 => that is pin #2

void loop() {
if (mySwitch.available()) {

Serial.print("Received ");
Serial.print( mySwitch.getReceivedValue() );
Serial.print(" / ");
Serial.print( mySwitch.getReceivedBitlength() );
Serial.print("bit ");
Serial.print("Protocol: ");
Serial.println( mySwitch.getReceivedProtocol() );


The documentation for the universal remote control has instructions to get the control to memorize the codes for the other buttons.

Hi @Paul_KD7HB,
I believe you misunderstoodmy question, th eproblem isn't how to assign codes from other remotes. The problem is I dont have other remotes to copy from. Can I use the RF emitter? if so how?

Your post unfortunately does not make much sense. For example, please explain what this sentence means, and the steps you took to accomplish the task.

What code? What remote?

Do you mean that you want the arduino to execute different code based on which one of the four buttons you press ? (in case you have an RF module that toggles pins depending on the key pressed)
If that is the case then you could write a code that works like this :

void loop ()
    if (pin0 == HIGH)
        //execute this part of the code
    if (pin1 == HIGH)
       // execute that part of the code

Or you want the arduino to identify the code being transmitted and execute a code based on that ?

It would be a good idea to tell us which RF remote module and key fob you use.

Hi, thanks for your answer. I just want to memorize codes on my remote control like this as I dont have other remote controller to copy the button codes.

I want to use the rc transmitter like this to send codes to my remote controller but can't understand how to do it.


I am not sure i understand. Do you want to make the arduino copy the codes transmitted so that you can later pass pass them to blank programmable keyfobs ?

If this is the one you have, then i think that it is not possible to read the code transmitted from the keyfob. This is merely used so that your arduino can sense the corresponding pins going high and low when a key on the fob is pressed, and then run code accordingly like the one i suggested above.

The receiver I show can receive data from my remote controller. thats not the point.

The receiver will receive the code from my remote control buttons. The problem is that my remote control doesnt have any code memorized on his buttons.

How can I memorize codes to the buttons with the transmitter?

What happens if you memorize that one code you have to all buttons? Do you get the same output from the receiver regardless of the button pressed?

I do not understand what you try to do.

is it supposed to have code memorized ?

The remote control (keyfob) is supposed to transmitt a code when a key is pressed.
If it has 4 buttons then it can transmitt 4 different codes depending on the key pressed. Yes ?
If on the other hand you have a remote controll that shifts its code every other press (based on a built in algorithm) then you will have a receiver that will do the exact same code shifting (based on the same algorithm) to be able to understand the code transmitted.
Or you may have a blank transmitter that needs to be programmed before it can transmit something.
For example
For my garage door i bought a 3 button blank keyfob that transmitts (rolling) code. When i bought it, it was blank. I had to put it into "learning" mode to pass the codes transmitted from my original keyfob for each button separately. do i make sense ?

The OP has a "universal" key fob that is designed to memorize the existing codes from an existing fob. The OP does not have the other fob to act as master in order to program the new fob.
I guess I don't see how all this got started as the documentation for a universal fob clearly states how to program the remaining keys and the OP has chosen to ignore the instructions.

1 Like

@rainyshadow yes, same code on different buttons produce the same output.

The next image shows the output received from the remote controller respectivelly button A and C with the same code...

@HellasT are you familliar with IR remotes? each button has a default code. I want to do the same but with RF remote. Most likely there is a way. I will find it. @Paul_KD7HB thanks for the help.

If i understand correctly, you was able to copy the code from original keyfob button A to the new keyfob button A but you no longer have the original keyfob.

You must have the codes for the rest of the buttons of the original keyfob stored somewhere before you try to figure out a way to transmitt them to the new keyfob. Is that the case ?

Also are you sure that your original keyfob is not of the "rolling code" type ? Because if it is, then a "snap shot" of its transmitted code will help very little i think.

@HellasT imagine I want to have an RF remote controller wih 4 buttons made with an arduino, 4 push buttons and a transmitter. This arduino remote controller should work as a clone of the original remote controller. Can you help me with the code of this transmitter? thanks

For someone ho might have the same question, I succedded with the following code

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

int i;

void setup() {

  // Transmitter is connected to Arduino Pin #10  

  // Optional set pulse length.
  // Optional set protocol (default is 1, will work for most outlets)


void loop() {
  i = 0;

  while (i < 10)  {
    mySwitch.send(6249743, 24); //buttonA
    //mySwitch.send(6249742, 24); //buttonB
    //mySwitch.send(6249741, 24); //buttonC
    //mySwitch.send(6249740, 24); //buttonD


This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.