Home > Code, Hardware, Mods > Convert cheap 433Mhz sensors to KaKu/CoCo with an Arduino convertor

Convert cheap 433Mhz sensors to KaKu/CoCo with an Arduino convertor

August 24th, 2014 Leave a comment Go to comments

In the past 1,5 year I have been playing a bit with Home Automation (or Domotics / Domotica) systems. I initially bought the HomeWizard, but was pretty disappointed in it. When the HomeWizard domotica system was introduced I expected a lot of it, sadly enough it has not been as great as I hoped and I am currently moving over to another system.  One of the things that annoyed me of the HomeWizard is the inability to add other sensors to the setup which were not part of the supported hardware (which is pretty limited). I moved to the HomeWizard from a different (alarm) system which contained a lot of 433Mhz sensors which I could not hook up to the HomeWizard. Because I did not want to throw all these sensors away I built a middle-ware system with an Arduino and some code which can convert the non-supported codes in to HomeWizard supported codes (KaKu / CoCo style codes). The middle-ware receives a code and then translates that to a code which can be understood by the HomeWizard. Initially designed for usage with HomeWizard this same approach also worked with HomeSeer, Domotiga and Domoticz, which all did not support my sensors directly (most of them because of the usage of the RFXCOM).

The approach described is shown in the overview below (the numbers used are just examples).

Overview

This post contains the schematic, code and all the info you need to build your own middle-ware. The described approach will work on the incompatible 433Mhz sensors of other (cheap) alarm systems, but also for ELRO remotes and probably a lot of other systems. It has been tested with the following devices:

TestedDevices

From left to right:

  1. Nameless motion sensor with  BX R433A and Semic CS5211DGO IBAU1K380BN chip
  2. Nameless button switch with  BX R433A and LP801B  APN03535 chip
  3. Nameless door sensor with BX R433A and Semic CS5211AGP ICAU1K3T11J chip
  4. Nameless remote with BX R433A and Semic CS5211AGP IBAU4K3807K chip
  5. ELRO AB440R (433.92Mhz) Remote
  6. Nameless 433Mhz smoke detector (not shown)

Arduino schematic

The hardware used for the middle-ware is a standard Arduino (or cheap alternative such as this), with an Arduino shield and a basic 433Mhz transmitter/receiver set. Any basic 433Mhz receiver and transmitter can be used for this, such as this pair on DealExtreme. The receiver module is the longer board of the two, the transmitter is the small one. The shield can of course also be replaced with a small breadboard, if that is what you prefer.

The following picture shows the setup of the Arduino and the 433Mhz sensors (green, receiver at the top, transmitter at the bottom), the red wires are the 5V wires, the black wires the GND wires and the blue wires the DATA wires. The antenna positions on the 433Mhz boards I used are shown by the A’s.

Shield_v4s

To extend the reach of the 433Mhz transmitter and receiver I added two antennas to the setup, made out of 16,7cm copper wire. I reinforced the antennas with the plastic part of cotton swabs (q-tips / wattenstaafjes (Dutch)) and some heat-shrink tubes, which worked out pretty well. The finished product can be seen below.

Middle-Ware2s

Code

The simplest code to run on the Arduino can be found below. This code makes use of two very nice Arduino libraries written by Randy Simons, it actually leans fully on those libraries and only links them together. Feel free to do whatever you want with the code below, only keep in mind the license of the libraries used. Any fixes or additions to the code are of course welcome, so please let me know if you have any.

 

This code sends out the same code it received, it is only converted to the other protocol. That way any 433Mhz device it picks up will be forwarded. This is the easiest way to add multiple 433 Mhz sensors to your setup. However, you can also choose to use the more advanced code below, which enables you to define your own codes and only forwards the codes it knows. This might be a solution you want when there is a lot of interference from other devices you do not want to have added to your system. This code below also has a debug option which shows you which 433Mhz codes are seen by the Arduino, which might be helpful to find the codes for all your devices.

 

 

Debug output

The debug option (int debug = 1;), from the code above gives the following debug information on the COM port:

debug

 

Add to HomeWizard

Since the middle-ware is now sending out KaKu/CoCo codes that the HomeWizard can understand we can add them to the HomeWizard. Since we use a very simple protocol here we can at this moment only add the sensors as ‘Doorbells’, but that should not limit you in using the sensors.

AddSensor

 

 

 Add to Domoticz

When the Arduino middle-ware is being used the sensors will start showing up in Domoticz when the RFXCOM picks them up, they are shown as using protocol Lighting 2, AC.

ScreenShot_Domoticz

When linked they will also show up in the log file (in this example they are linked to an event which sends out notifications using NMA).

 

Two way communication

After writing this How-To I decided to make a new version which could do two way communication. Which means you can use the Home Automation system to control your cheap 433Mhz receivers (such as ELRO power adapters) as well. This has been successfully tested on ELRO AB440SC (433.92Mhz) Wireless Switch Units.

The Arduino schematic for this Two-Way version is shown below, because the Arduino interupts 0 & 1 are on digital pins 2 & 3 we need to move the sender to digital pin 4. We hook up the same receiver to both PIN 2 and PIN 3 (both of the middle pins in the receiver are DATA).

Shield_v4

The code for this version:

 

I hope this approach might be of use to someone. Please let me know if you have additions, remarks or comments. As last I would like to thank Randy Simons for his great library which enabled me to create this in a fairly simple way.

 

  1. Marc Spoorendonk
    December 3rd, 2014 at 09:06 | #1

    Thijs, I’m looking into hooking up some RF door sensors to a Raspberry Pi connected to OpenHAB. I’m having trouble finding info on the events which I can capture with this. I’d like to capture both a door-open and door-close event in order to reliably determine the door state. This would require the sensor to send two different codes (one for open and a different one for close). Do you know if there are any sensors that do this? Or do they only send a door-open event (as this is the only relevant event for for alarm systems).

  2. Thice
    December 8th, 2014 at 16:01 | #2

    Hi Marc, the KaKu (CoCo) door sensors do this. The cheaper sensors in general only send a ‘break’ event, which can happen when the door opens or closes. Info can be found here: http://www.klikaanklikuit.nl/home/
    However, KaKu is a bit more expensive.

  3. deennoo
    February 12th, 2015 at 22:30 | #3

    Is there a way to use another sending protocole ?

  4. Thice
    February 27th, 2015 at 15:23 | #4

    @deennoo
    Depends on what kind of protocol you want, as long as it is 433Mhz and there is a module for it you can. However if it is a different frequency you will need different hardware. And if there is no module for your protocol you will need to write it yourself.

  5. Tom
    April 16th, 2015 at 09:44 | #5

    Thijs, sould it be possible to control my blinds with it? They are a NICE 433.92mhz remote with build-in engine receiver. I’m using a homewizard but the homewizard doesn’t support the NICE, only Somfy.
    I’m not a smart elecro-guy, but i would give it a try.

  6. Tom
    April 20th, 2015 at 20:18 | #6

    Love the idea. Could it be possible to use this setting to control my screens? They are NICE remote 433.92mhz.
    I’m using a Homewizard, but because the screens are not Somfy I would have to buy 3 ASUN-650’s to control the screens.
    If the arduino setup could work, this costs me 1/3 of the price.

  7. Diana
    May 5th, 2015 at 19:33 | #7

    Thanks for the tutorial
    I have one question:
    Do you still use RFXCOM
    Or connect the Arduino shield directly to the pi which runs domoticz

  8. Thice
    May 13th, 2015 at 10:01 | #8

    @Tom
    You could check if the arduino can see the remote signals, if it can it can be done.

  9. Thice
    May 13th, 2015 at 10:01 | #9

    @Diana
    At the moment I indeed still use the RFXCOM, mainly because I did not want to start coding on Domoticz yet, but you should be able to do it without it.

  10. Gus Norman
    June 18th, 2015 at 10:43 | #10

    Hi Thice,
    I’m very interested in your work, and built the middle-ware. I now would like to add it to domoticz. So, several questions : How can I do that ? Just plug the arduino’s USB to the raspberry ? Will domoticz recongnize it ? Or is there an other thing to do ?
    Anyway, thanks a lot for this tutorial,
    Regards, Gus

  11. Thice
    June 26th, 2015 at 12:13 | #11

    @Gus Norman
    At this time it works as a stand alone middleware communicating to the RFXCOM, however, with some coding you should be able to hook it up by USB.

  1. August 29th, 2014 at 16:54 | #1