Athom Blog

The official blog by Athom, creators of Homey

The magic behind 433 and 868 MHz on Homey

Posted on August 7, 2016 in Behind the Magic

Introduction

Hi! I’m Reinier, and for the last one and a half years I’ve been working at Athom as Embedded Software Engineer. In this position I am responsible for the 433 and 868 MHz radios on Homey and the embedded Software to make them work, among other things. In this blog post I would like to give you more insight in what I’ve been doing, as well as provide a glimpse into the world of wireless communication on the 433 and 868 MHz bands. I will elaborate on the frequency bands, the communication methods on it, and the (design) choices that made Homey like it is. Let’s get going!

The use of 433 and 868 MHz

433 and 868 MHz enable Homey to communicate with numerous wireless devices from a broad range of different brands. Since the communication standards are relatively old there are many devices which use it, especially the more affordable devices. Well-known brands on 433 MHz technology include, KlikAanKlikUit, Somfy and LightwaveRF. 868 MHz features Alecto, Homematic and several security devices. Note that these are just a few the relatively well-known brands. There are TONS of wireless devices out there which use these technologies – from robot lawn mowers to fireplaces and TV mounts and much, much more!

Somfy and KaKu

Somfy and KlikAanKlikUit are examples of popular devices on 433 MHz

433MHz essentially is an frequency band that is used for communication in home appliances among other things. It has become quite popular as most countries in the world have freely allowed communication. This means devices may use the band without any restrictions or license fees. The only limitation is transmitting power, but the power limit is plenty for wireless transmission around the house. 868MHz is also free to use, but requires your device to keep communication to a minimum (it is only allowed to transmit a signal more than 1% of the time). This makes 868MHz more suited for alarm/security signals, since signals have a higher probability of getting through without being disrupted by other devices. This is a key difference compared to the unrestricted 433 band, where everyone can just ‘shout’ (i.e. transmit data) and thereby disturb other signals.

How 433Mhz and 868Mhz communication works

Communication on 433/868 works with radio frequency waves on those frequencies. These waves are transmitted and received by a radio transceiver with an antenna. On these bands, a couple of communication methods can be used, called radio modulations.

NRF 433 Transceiver

This Transceiver can send and receive data on 433 MHz. Geek Backers may recognise it from their sets!

The most commonly used radio modulations on 433 and 868MHz are ASK (Amplitude-Shift Key) and variations of FSK (Frequency-Shift Key) like BFSK or GFSK. Basically they define how data is transmitted: ASK uses differences in Amplitude (transmitting power) to create waves/data transmission. FSK uses slight differences in frequency instead. Nearly all 433/868 devices support just a single radio modulation. Often for controllers, this is ASK modulation for 433 and FSK modulation for 868 MHz. However, in order to enable Homey to work with as many devices as possible we have made sure that both radio modulations ar supported on both technologies.

Homeys Hardware for 433 and 868 MHz

In Homey, we use two CC1101 chips from Texas Instruments, one for 433 MHz and the other for 868 MHz. Although the chips are the same, each is calibrated differently to work best on their respective frequency.

Overview433

This overview already appeared in our last blog post. Now, we focus on the parts in the red rectangle

Each of the CC1101s has his own spring antenna. This is a gold-plated spiral/helix that stands straight up from our PCB. This antenna gives Homeys extraordinary range when controlling 433 and 868 devices. Since most other products use less efficient PCB antennas, we are often able to outrange other controllers by a considerable distance!

Spring Antennas on Homey

The tall upright spring antenna on the left is used for 433 MHz and the shorter antenna on the right is used for 868 MHz. The spring antenna laying on its side is used for Z-Wave, another wireless technology supported by Homey.

uC The other end of the CC1101s are connected to a dedicated microcontroller. This is not Homeys main CPU, but a sort of helper core. This core is specialised in real-time operations such as wireless communication.

Homeys implementation of 433MHz and 868Mhz communication

In the Texas Instruments radio chip, the radio waves are converted to block waves and vice versa. For instance, if there is an incoming message the CC1101 converts the incoming radio waves to block waves. After doing the conversion, the ‘message’ is transmitted to the microcontroller. Here we continue to further process the block waves into usable information.

logic analyzer

We use a Logic Analyser to see and analyse the block waves of a signal. The Microcontroller receives these same signals from the CC1101.

In the microcontroller, our proprietary embedded software converts the block waves to ‘flank changes’. Basically it translates a real-time signal to a definition, a description, of that signal. The Homey framework can interpret these definitions. Sending a message is essentially the same process performed backwards. When you want to control a 433/868MHz device, the Homey app you use (the Somfy app for example) holds a signal definition. This definition is used both for transmitting (controlling) and receiving information. You could think of the signal definition as the recipe book for the signals. This signal definition contains a radio configuration. It defines on what specific band within 433MHz (like 433.92 for KlikAanKlikUit or 433.42 in case of Somfy) or 868MHz Homey should send/listen. It also describes the patterns which construct a ‘1’ or a ‘0’, the building blocks of our digital domain.

This is an example of a signal definition in Homey. The Homey framework uses the signal definition whenever a signal is being sent or received. When sending, it generates flank changes based on the data and definition, or vice versa. The flank changes plus the configuration are sent to the microcontroller when transmitting a signal. The configuration then gets applied to the radio transmitter (the CC1101) and the microcontroller in turn starts generating block signals. This automatically broadcasts the radio waves, ready to be picked up by the addressed device on the other end.

Advantages of our approach

Unique about our solution is that we parse, recognise and define signals within the high-level Homey framework. This makes Homey incredibly versatile, because we don’t need to flash the microcontroller every time we add support for a new device. Instead, you can just install a new app to Homey. Eliminating the need to flash the microcontroller for each device means that definitions and apps can easily be added and updated while the microcontroller keeps functioning the same way. Next to that, it prevents the limited storage available on the microcontroller from filling up, which means you are free to keep adding on as many different devices as you please – in contrast to some other systems.

Challenges of our approach

Making such a generic sender on low level is an interesting, but relatively easy task. The microcontroller can ‘simply’ interpret the information from the app after which it creates and sends a signal. The real challenge, however, is listening. Because Homey supports all these different methods of communication, our microcontroller software is set up to be exceptionally generic. Because we want to accept so many different signals, it’s hard for the CC1101 and the microcontroller to distinguish what really is a signal, and what is not. Especially with ambient noise always being present on the used bands.

433 SDR

This (nearby) device signal is really strong at 433.9 MHz, but all the noise is also still visible

Of course, we don’t want to flood the Homey framework with every noise that comes in. That would take enormous amounts of unnecessary processing power. On the other hand, however, we do want to record every incoming signal for every possible device. This is a delicate balance to get right.

Creating a Universal Listener

This requires a truly unique configuration for our radio. A Universal Listener. Firstly, we use the CC1101’s ability to detect ‘real’ signals, (called ‘carrier sense’). We reconfigured this tool specifically for Homey’s universal purpose. When the CC1101 has discovered a possible signal, it alerts the microcontroller. The Microcontroller starts listening, and records the possible signal. The recorded signal is then analysed to determine if it’s a proper signal. First, the microcontroller normalises the signal to take out peaks. The controller looks at its properties to see if it can be interpreted as a signal. It takes into account length, flank changes and intervals. If the signal passes, the microcontroller creates a description of the signal. This description is send to the Homey framework. Homey then decides if the signal belongs to any of the definitions in the installed apps, and if so, notifies that app. The app can now perform the action (like setting a sensor value in Homey).

433 Listener Flow

The process of listening to a 433 MHz signal in Homey

It has taken us a lot of effort to make this universal listener/translator, as it needs to work on different bands with different radio modulations and needs to be able to ‘translate’ so many different signals. It is something we have been working on since the earliest stages of Homey’s development and it even continues to be tweaked and improved to this day. Thanks to the universal listener/translator the app framework used in Homey also became a possibility for 433 and 868 MHz devices, and it is the reason we can continually see new devices being supported by Homey!

Conclusion

By now how have hopefully gained a better understanding of what is going on with 433 and 868MHz processing under Homeys small spherical hood. Although 433/868Mhz are older wireless standards and by some considered to be pretty straightforward, it has been a major project to get them working in Homey the way we wanted. The result, however, is a system that can make the most of the 433 and 868MHz bands with a remarkable range of devices. Ultimately this means that virtually any device supporting these wireless standards can work with Homey!

Back