Connecting a Radio-Window-Shutter-Contact to KNX with RFM12B, mbed and freebus


I'm trying to connect a cheap Radio-Window-Shutter-Contact to my KNX-Installation in my home.


The Radio contact can be found here for example:


The installation-bus in my home is a KNX-System and uses some self-made components from

I read the signals from the radio-contact with a Radio-module "RFM12B" from HopeRF(

All these components are not too expensive and this is a way to expand my KNX-wire-bus to places where I have no knx-wires (windows for example)

On the knx-side (freebus) one can use any freebus-controller-board with the RS-Interface-Software

What / How the radio-shutter sends..

The shutter sends the actual status of the contact on every change and then every 10 minutes (only when open). Every Message is repeated for about 20seconds. The Message contains:

  • a counter-number 1 Byte (increased with every message)
  • a device-ID (3 Bytes)
  • the status of the magnet contact
  • the status of the battery
  • a crc (2 Bytes)

For an example message see the section below.

7E 0D 20 00 21 77 41 67 15 CRC: 6715 OK
Counter: 0D
 Dev-ID: 00 21 77
Window : OPEN

Status as of 11.1.2011:

  • RFM12B connected to mbed via SPI
  • preliminary software can read and understand the signal from the radio-shutter


The RFM12B is on the front-right side. In the back right side there is a RFM22B module which I failed to get to read the radio-signals (the lcd, rotary-encoder and DS1820 are for testing only)


  • create a class for the radio-shutter which uses the rfm12b class - Done
  • connect and communicate with the freebus-rs-interface (serial) - Done
  • find a way to configure the group-addresses being sent to knx - Done


Here is the Software for decoding the signals and printing the results to the pc:

Import programeth_comfort_test

Programm for decoding radio-signals sent by a ETH-Window-Shutter-Contact, received with a RFM12B-module

And here the program to receive the signals from ETH and send to knx via a freebus-rs-interface:

Import programeth_comfort_freebus

Program for decoding radio-signals sent by a ETH-Window-Shutter-Contact, received with a RFM12B-module. The messages are sent to KNX via a freebus rs-interface. Details see


Connection on the freebus-Controller:


  • Pin4 TXD (yellow)
  • Pin5 RXD (green)
  • Pin6 GND (black)

Connection freebus-rs on the mbed-side


  • Pin9 TXD (green)
  • Pin10 RXD (yellow)
  • GND GND (black)

Connection of RFM12B


  • p11 mosi
  • p12 miso
  • p13 sclk
  • p14 cs
  • p18 rxdata

Connection of LCD-Display TextLCD::LCD16x2(optional)

  • p30 rs
  • p29 e
  • p28 d0
  • p27 d1
  • p26 d2
  • p25 d3

Configuration-file: knx.cfg


# Configuration file for knx on mbed

# Format:
# ETH-Device-ID=knx-Group address
# ETH-Device-ID: 3 Byte HEX in Uppercase
# knx-Group address: 01/01/01
# example:
# 0026D1=3/0/2


Which says: The ETH-Device 002177 sends a on/off message to the KNX-Group-address 3/0/1

My test-configuration:


  • green KNX-bus-wire from my house-installation system comes from the right hand side
  • connected to a 8-Out relais-Module (as I had only this for testing)
  • connected to the freebus controller (with the 8 red leds on the bottom side) - here runs the freebus rs-interface software
  • and this connected via the grey cable to serial-interface of mbed
  • connected via air with the ETH-Comfort Radio-Window-Shutter-Contact :-)

A message shown on the lcd


and :-))))) I can switch on and off the light in my room! A lot of work for replacing a traditional light-switch :-)

6 comments on Connecting a Radio-Window-Shutter-Contact to KNX with RFM12B, mbed and freebus:

01 Mar 2011

I'm trying to get a RFM12B talking to a mbed as well...any chance you could share your code or library that you use to communicate with it? I'm trying to port the JeeLabs RFM12B library to mbed now but its slow going.


02 Mar 2011

Hi Tim!

Yes I'll publish my pre-pre-beta-code for the rfm12b. But be aware, that it is a special version , where all the decoding is done by the mbed-controller and not by the rfm12b. This is because the used Radio-Window-Shutter-contact sends with a varying bitrate and bit-lenght. Details see the discussion on (in german)

Regards Charly

15 Mar 2011



24 Nov 2014


12 Jan 2015

Hi! Sorry, but I missed your post!

I stopped working with the RFM12B and changed to RFM22 and actually am using another module ( for !MAX-Wireless-Devices (by ELV . So I have no actual infos. But what protocol do you mean? KNX-protocol (wire) is very popular - should be available on the net The protocol for the wireless devices is another story but everything I know about it is mentioned on this page.


12 Nov 2015

Can I get some more details concerning the pin connection of the RFM12B. Especially is there a resistor from DATA/nFSS to Vdd and what means the pin rxdata in the code.


Please log in to post comments.