Control CoTech Remote Switch With Arduino (433Mhz)




Introduction: Control CoTech Remote Switch With Arduino (433Mhz)

A short while ago I bought 3 Co/Tech 51058x10 remote switches and a 50027 remote from Clas Ohlson in Norway. They use the AM 433mhz band to communicate. I wanted to control them with an Arduino, and after googling and reading a long time, I couldn't find that anyone have connected that specific brand to an Arduino before me.

You need:

Co/Tech remote switches:,-fj...

433Mhz reciever and transmitter:

Ardunino board (I'v used the Nano)

Step 1: Setup and Wiring

The receiver im using has 4 pins and the transmitter has 3. Connect them to the arduino as in the pictures. Each with 5v, ground and a data pin.

It is important that the datapin of the receiver is connected to pin D2 or D3 of the Arduino because it has to be connected to a interrupt-pin. The transmitter can be connected to another digital pin if you want, but you then have to alter the code of course.

Step 2: Research

Since none had connected to this Co/tech model before me I did not know how it communicated. By opening the remote gave me the model nr. 50027.01B FLF-130105

A big help: (Special to wex_storm and windkh)

A good library makes every makers life easier. The one that worked the best with my unit was RCSwitch by sui77. (Arduino lib to operate 433/315Mhz devices like power outlet sockets.)

I also used some code from an example in this lib:

Step 3: The Coding

To control the switch we need it to think that the remote is beeing used by coping its remotes codes and transmitting them on demand from the arduino.

The first thing you do is to start the example in the RCSwitch lib "ReceiveDemo_Advanced.ino" and upload it to the arduino. Watch out for the confusing pin naming as the library uses the nr for the interrupt-pin and not the digital pin nr.

mySwitch.enableReceive(0); // Receiver on "interrupt 0" => that is digital pin 2 and "interrupt 1" => D3.

Now start the serial window and press one of the buttons on the Co/Tech remote.

You should get something like this:

Decimal: 11001351 (24Bit) Binary: 101001111101111000000111 Tri-State: not applicable PulseLength: 517 microseconds Protocol: 5

Raw data: 7200,1004,528,504,1048,980,336,1176,356,1176,352,1180,1108,412,356,1172,364,1168,356,1160,1176,1124,412,336,1180,1116,440,328,1188,340,1228,1060,416,1160,380,1160,1108,464,1068,436,328,1232,1060,412,1116,440,1088,428,3024,

This means that the Arduino is reading the reciever. The mots interesting thing is the binary code. This remote sends a 24 bit code. This may differ from different units.

1010 0111110111100000 0111
^ ^ ^ ^ ------------------------ ^ ^ ^ ^
The first 4 digit is the "name" of the remote. The last 4 is the the name of the button that is pushed. The 16 nr in between is a random code.

If you press the same button again it will show the same four nr (1010) in the start and the same four nr (0111) in the end. The 16 nr i between will probably change. Each button on the remote can send 4 different 24bit binary codes.

To save time and make it easier to collect all the "secret codes". I'v used the code from the flamingoreader.ino example in the FlamingoSwitch lib and change it to work with RCSwitch. It makes it alot easier to scan for all the binary codes from the remote control, and then you can copy and paste them to a text file for storage. (Download the the RecieverDemo_Scan.ino file and add it to the RCSwitch example folder)

Upload the RecieverDemo_Scan.ino file to the Ardunino and press one of the buttons on the remote until you see "Scan complete".

Counter: 0 Code: 11446759 Code: 0xAEA9E7 Bin: 101011101010100111100111

Counter: 1 Code: 11001351 Code: 0xA7DE07 Bin: 101001111101111000000111

Counter: 2 Code: 11092535 Code: 0xA94237 Bin: 101010010100001000110111

Counter: 3 Code: 11340023 Code: 0xAD08F7 Bin: 101011010000100011110111

Scan complete.

We now have all the binary codes for this button. Now do the same for all the buttons and save them in a text file for later.

Step 4: Controlling the Socket With the Arduino

To pair the remote to the switch press the button on the switch for 3 seconds and it will start blinking. Now press the ON button on the remote that you want to use for controlling the switch. They now should be paired. You probably could pair with the Arduino by making a sketch that does the same.

Now find your recorded binary code from earlyer. Download the code rfTest.ino and edit it to fit your needs. Change the binaries in the code to your specific remote and button.

The RCSwitch said that the remote used a "Protocol: 5", but in testing that failed and protocol 4 worked better.


The pulseLength can be changed. I found that 400 work ok, but you can try tweeking it.


The switch needs at least two of the four 24 bit binary from each button on the remote to react.

Serial.println("Turn on with Button A"); // testing show that not all the codes are neeeded. But atleast 2 per button





Now upload the sketch and it should work.The switch turns off and on again every 5000ms.

PS: I had some problem with the "OFF" codes when powering the arduino with the pc to usb. Connecting the Arduino to a external power source solved the problem. Maybe its the noise from the usb connection thats jamming the transmitter. I don't now yet.

Step 5: Thanks for Reading

Hope this guide helped you.

I'm no pro and if there is any mistakes please comment and tell me.

Best regards Øyvind Haga

Be the First to Share


    • Halloween Contest

      Halloween Contest
    • 3D Printed Student Design Challenge

      3D Printed Student Design Challenge
    • Pumpkins & Gourds Speed Challenge

      Pumpkins & Gourds Speed Challenge



    6 months ago

    Just tested these instructions and they work fine. However: When pairing the transmitter and receiver we only use the ON-button at the transmitter. After pairing, the receiver seems to know what code represent the OFF-button without having paired that button. So the "random code" must contain some logic to separate valid ON-codes from valid OFF-codes and probably isn't that random. Also when pairing we only give one of the four "random codes", the receiver seems to know the other three valid ON-codes based on the first one. Any idea to provide the algorithm(s) that calculate these legal codes or is that buried deep in the chipset?


    1 year ago

    Thankyou but I am a bit puzzled by the wiring of the sender with the Arduino.
    DATA is the left pin, VCC the middle and GND the right one.
    You connect the left pin to Arduino 5V, and the VCC to Arduino D2. GND=GND is fine.
    Is this perhaps a mistake ?


    2 years ago

    Wish I would have found this sooner, finally got it to work. You're my hero! Takker og bukker.


    3 years ago

    Thanks a lot. It works perfectly fine and your instructable is very easy to understand. Just awesome. Tusen takk


    Reply 3 years ago



    4 years ago

    Hi, Øyvind. :)

    I'm usually quite skeptical with products by Clas Ohlson. Since you have used this for a couple of months now, how do you feel about the products?

    I've considered buying the dimmer actuator ( to dim the lights up in the morning for smooth wake-up ;) Do you think that is possible? Do you reckon I would need the TellStick as well?

    The pricing of these products is extremely low compared to Xcomfort and Elko Wireless.


    Reply 4 years ago

    I havnt used the product so much. I only hacked them for fun. If you want to control the dimmer with a homemade soution I think cotech is okey and cheap product. If you want a easy and stable solutions I think tellstick is the best anf cheap way. The more expencive solutions are safer and harder to hack.


    4 years ago

    I have some 433MHz units like these and you also have to pair them
    to the remote in a similar way, but if power is lost, so is the pairing
    and you have to set them up again - which is not ideal for an IoT setup
    where you want confidence that the units are still remotely accessible
    after a power cut.

    Can anyone tell me whether the CoTech units
    remember their pairing if power is removed (permanently or for a period
    of time?). Plan B is to use some other units that have rotary switches
    to set them up so you always know how they are configured.



    Reply 4 years ago

    My cotech remembers after loss of power on both socket and remote.


    5 years ago

    Thanks! could you share some other button binary codes? I have a 1 channel remote control, which I could clone, but I need some more channels to complete my project. I can normally generate the ON binary code, but the OFF has to be aligned with the new ON created and it does not seem to be to I can not turn OFF the PN code I have created. :)




    Reply 5 years ago

    I dont understand what you want. The binary code is different from every Remote and button. This so that you can have more then on remote in the house ☺


    5 years ago

    Congratulations on your first instructable! Very nicely done!