Home > Code, 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.