Decoding data of Oregon Scientific radio frequency sensors by the example of THN128 sensor

 

Wireless weather sensors have many known advantages. Ordinary they are used with autonomic weather stations. Communication is based on internal protocol which is not publishing by manufacturers. This article describes how to decode radio-frequency (RF) packets from Oregon Scientific sensors and use them in your own applications (home automation task, weather monitoring etc).

 

Example is given for THN128 OS sensor that I used but searching minds can apply the obtained information for other sensors.

 

First of all we need a hardware that is compatible with OS sensors. Almost all known for me OS sensors working with ASK modulation type at 433.92 MHz frequency.

 

Laipac Technology, Inc makes RLP434A receiver that is excellent suitable for our task.

 

Next, we need to log the received signal to have the ability to decode it. If you have not an expensive digital oscilloscope you can use your PC soundcard with some sound editor (Sound Forge for example). Just plug the output of RF receiver module via resistive divider to Line-In of your sound card and capture RF packets (they are sending approx. in 30 seconds).

 

When all described above are done you are ready for decoding procedure.

 

Let’s take for example a real captured datagram shown on Figure.1.

 

Figure 1.

 

As we can see the THN128 RF packet consists of following parts:

-         Preamble (this part consist no useful information and used for  RF receiver tuning);

-         Synchronization bits;

-         Three information’s bytes;

-         One byte of CRC;

The bytes are sending in reverse order and they are coded in a Manchester-type manner. I think that explanations given at Figure 1 are well enough for understanding that.

 

Next step is determination of what the information each bit is carry on.

First of all let’s write the received bits in a normal binary mode. So we have:

            - Byte #1:  00100011;

- Byte #2:  01110000;

- Byte #3:  00000001;

- Byte #4 (CRC): 10010100.

Table 1 gives a detailed description of bits representations.

 

Byte #1

7

6

5

4

3

2

1

0

0

0

1

0

0

0

1

1

CH b1

CH b0

-

-

-

-

-

-

 

Byte #2

7

6

5

4

3

2

1

0

0

1

1

1

0

0

0

0

TH2 b3

TH2 b2

TH2 b1

TH2 b0

TH3 b3

TH3 b2

TH3 b1

TH3 b0

 

Byte #3

7

6

5

4

3

2

1

0

0

0

0

0

0

0

0

1

BAT

H

SIGN

-

TH1 b3

TH1 b2

TH1 b1

TH1 b0

 

CH  – Channel number 0 is 1st  channel, 1 is 2nd channel and 2 is 3d channel used to send information.

TH1 – First digit of temperature represented in a BCD mode.

TH2 – Second digit of temperature represented in a BCD mode.

TH3 – Third digit of temperature (after decimal point) represented in a BCD mode.

BAT – Sensor battery status bit 0-good, 1- battery need a replacement;

H – Unknown bit when equal to 1 the receiver MTR102 shows HH.H values (may be used for sensor failure indications);

SIGN – The sign of temperature, 0 – positive temperature, 1- negative temperature.

 

So following by described above information we can determinate that RF packet shown at Fig. 1 is represent next information:

 

Sensor THN128 uses channel #1.

Temperature is +17.0 degrees of Celsius.

Battery status is good.

 

At last step we need to find out how CRC is calculated.

It’s easy to see that CRC byte is just the algebraic sum of three information bytes (CRC=Byte1+Byte2+byte3). Overflowed bits are escaped.

 

I hope that this article will very useful for those who want to use OS RF sensors in your own hobby projects. If this article, by chance, will help you to earn a millions then not hesitate to send me some percents J

 

© Alexander Yerezeyev

17/01/2008

 

http://alyer.frihost.net

e-mail:

Home

© Alexander Yerezeyev, 2008.
Last modified: 02.02.2008 15:37:31 -0600.
статистика áâ â¨á⨪