TFA Spring Weather Station Sensor Protocol Reverse Engineering

Not so long ago, TFA released a pretty nice TFA Spring weather station with a 30.3206.02 temperature-humidity sensor. If you want to use the sensor in your own developments, for example, in a homemade watch / weather station, this article can help.

image


Since the weather station is relatively new, and Google does not give results on the search for the protocol of this sensor, we connect the 433 MHz receiver to the oscilloscope, the oscilloscope to the computer and begin to study the protocol.

It can be seen from the oscilloscope that the sensor transmits 12 identical packets every 50 seconds, separated by wider clock pulses, which are clearly visible on the waveform:

image

image

Sync pulses ~ 1700 uSec, pulse repetition period ~ 700 uSec.
Information is transmitted by duty cycle - a short pulse means 0, long 1.

image

In different packets, the duty cycle varies (but the data pulse period is constant ~ 700 uSec), therefore, for stable decoding it is useful to take the first 8 bits of the packet, take the average pulse duration, and assume that if within one packet the pulse is shorter - it is 0, longer - 1 .

The data packets are separated by 4 wider sync. The parcel is closed by 2 clock pulses followed by a long period of silence. It’s hard to say about the beginning, because the first pulses are smeared by the receiver AGC.

We are armed with a utility written in C # for analyzing waveforms, the data from the sensor is displayed on the original weather station, and we are looking for patterns for different temperature / humidity measurements.

The result is the following data arrangement in identical packets of 40 bit each:

image

At the end of the packet, the checksum is apparently transmitted, but guessing the algorithm for computing it is problematic. Therefore, if 3 or more identical packets of 12 are received, we consider that the received information is correct. By the number of identical packets it is also possible to evaluate the quality of signal reception - the more identical packets in a packet, the better.

After we’ve figured out the decoding algorithm more or less, we implement it on the STM32F429I Discovery debug board. This is followed by a debug period in the struggle for signal reception quality.

image

If you compare the last photo with the first, you can see that everything turned out, we really got the correct temperature / humidity from the sensor. The exchange protocol for an honestly purchased sensor is no longer a mystery, and the sensor may find additional application in homemade weather stations or smart home logging systems.

The sources for decoding the sensor protocol are laid out here , in fact, everything is a little more complicated than described in the publication.

The result of this work may be useful to owners of this sensor / weather station who want to expand standard capabilities, for example, by putting a weather station of their own design in the next room, without duplicating external sensors. It should be noted that the sensor is the most time-consuming part for repetition, mainly because of the sealed housing - it is easier to buy ready-made than to do it yourself.

PS The temperature / humidity sensor is a development of TFA Dostmann, therefore the study of the protocol is limited to the scope of a hobby and completely excludes any commercial use.

Also popular now: