Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example files for cheap 433MHz RF sensors #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added imagintronix_opus/Imagintronix_Opus_1.sr
Binary file not shown.
Binary file added imagintronix_opus/Imagintronix_Opus_2.sr
Binary file not shown.
Binary file added imagintronix_opus/Imagintronix_Opus_3.sr
Binary file not shown.
77 changes: 77 additions & 0 deletions imagintronix_opus/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
-------------------------------------------------------------------------------
RF / Imagintronix/Opus
-------------------------------------------------------------------------------

This is a set of example captures of RF communication of a cheap 433.92 MHz Soil sensor

This model was called Imagintronix XH300TX, but the protocol was referenced as "imagintronix/Opus" on various sites
https://shop.domo-supply.com/en/sensors/884-imagintronix-additional-moisture-sensor.html


Data received with a 433MHz receiver WL101-341.


Logic analyzer setup
--------------------

The logic analyzer used was a LHT00SU1.

Probe
-------------------------------------
1 D7 Output Pin DO

Timings:
- 1: 0.550 ms
- 0: 1.350 ms
- pause: 0.9 ms

Probably it should be possible to modify those timing values / invert the signal.

Resources:
- https://forum.fhem.de/index.php/topic,25546.120.html
- https://forum.pilight.org/showthread.php?tid=1641

I'm still trying to figure out the exact protocol, according to the pilight.org thread it's:

nibble hex description
0 f preamble; always F hex
1 f preamble; always F hex
2 5 TX type; always 5 hex
3 addr TX address / sensor ( 5,6 or 7); only three possible
4 s_rh_h soil moisture high nibble
5 s_rh_l soil moisture low nibble
6 t_h temperature high nibble
7 t_l temperature low nibble
8 security_h security code; always F hex
9 security_l security code; always F hex
10 checksum_h checksum = 2:3 +4:5+6:7+8:9
11 checksum_l checksum = 2:3 +4:5+6:7+8:9

but that seems not to match completely, also it's not clear to me yet how the temperature is encoded.

ch humidity temp?
11111111 0101 01 10 00000101 00111000 1111 1111 1001 0010 freezer1
11111111 0101 01 10 00000101 00100100 1111 1111 0111 1110 freezer2
11111111 0101 01 10 00000101 00011101 1111 1111 0111 0111 freezer3
11111111 0101 01 10 00000101 00011010 1111 1111 0111 0100 freezer4
11111111 0101 01 10 00000101 01000101 1111 1111 1001 1111 low bat (no effect?)
11111111 0101 01 10 00000101 01000100 1111 1111 1001 1110 low bat (no effect?)
11111111 0101 01 11 00000101 01000001 1111 1111 1001 1100 ohne feuchtigkeit, raumtemp., address 3
11111111 0101 01 01 00000101 01000010 1111 1111 1001 1011 ohne feuchtigkeit, raumtemp., address 1
11111111 0101 01 11 00000101 01000010 1111 1111 1001 1101 ohne feuchtigkeit, raumtemp., address 3
11111111 0101 01 10 00000101 01000010 1111 1111 1001 1100 ohne feuchtigkeit, raumtemp., address 2
11111111 0101 01 10 00000101 01000011 1111 1111 1001 1101 ohne feuchtigkeit, raumtemp., address 2, ohne reset
11111111 0101 01 10 01100011 01000010 1111 1111 1111 1010 water, raumtemp., address 2, ohne reset

from https://forum.fhem.de/index.php/topic,25546.120.html
11111111 0101 01 10 01010011 01000100 1111 1111 1110 1100
channel:
VALUE 2
humidity:
VALUE 83
state:
VALUE T: 28 H: 83
temperature:
VALUE 28


Binary file added imagintronix_opus/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 110 additions & 0 deletions xt200/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
-------------------------------------------------------------------------------
RF / XT200
-------------------------------------------------------------------------------

This is a set of example captures of RF communication of cheap 433.92 MHz thermometers.

I used a "Digoo R8S", but there are plenty others with a same encoding.
https://www.banggood.com/Digoo-DG-R8S-433MHz-Wireless-Digital-Hygrometer-Thermometer-Weather-Station-Remote-Sensor-p-1139603.html


Data received with a 433MHz receiver WL101-341.


Logic analyzer setup
--------------------

The logic analyzer used was a LHT00SU1.

Probe
-------------------------------------
1 D0 Output Pin DO


The protocol is as follows:
- Fixed high time of 500us
- Low time 8ms was start
- Low time 4ms was a 1 bit
- Low time 2ms was a 0 bit
- Frame was 36bits repeated 7 times

Probably it should be possible to modify those timing values.

Resources:
- https://www.avrfreaks.net/forum/chinese-433mhz-temperature-sensor-protocol
- https://rayshobby.net/reverse-engineer-wireless-temperature-humidity-rain-sensors-part-1/

Converting the acutal data into temperatures differs between various models, for the Digoo R8S, the following code works fine on an Atmega:


/*
* needed resolution:
* 0,1 ms - 4 ms
*
* long interval: 4ms -> 78
* short interval: 2ms -> 39
* pause: 0,6ms -> 14 (9-14)
*
* 20Mhz with 1024er Prescaler (TCCR0B: CA02 and CS00)
* 19.53125 Kilohertz
*
* -> 0.0512 ms per clock
*
* -> Bereich: 0.0512 - 13,1 ms
*/

#define LEN0 39 //length of a 0 pulse
#define LEN1 78 //length of a 1 pulse
#define TOL 10 //length tolerance
#define PAUSE 14
#define PAUSETOL 3
volatile uint8_t bits[MAXBITS];
volatile uint8_t bitpos=0;

ISR (PCINT2_vect) {
cli();
TCCR0B = 0; // stop timer
uint8_t count = TCNT0;
uint8_t store = 0, bit = 0;

if(!(PIND & 1<<PD6)) { // pin not set
if(!(count < (PAUSE + PAUSETOL) && count > (PAUSE - PAUSETOL))) // no valid pause
{
bitpos=0;
}
} else {
if( (count>(LEN1-TOL) && count<(LEN1+TOL))) {
bit = 1;
store = 1;
} else if (count>(LEN0-TOL) && count<(LEN0+TOL)) {
bit = 0;
store = 1;
} else {
bitpos=0;
}
}

if(store) {
bits[bitpos++]=bit;
if(bitpos==37) {
if(bits[0]==1 && bits[1]==0 && bits[2]==0 && bits[3]==1) {
uint8_t i,j,hum=0,chan=1,bat=0,id=0;
uint16_t temp=0;
uint8_t buf[7];

for(i=1,j=0;i<9;i++)
hum+=bits[36-i]<<j++;
for(i=9,j=0;i<13;i++)
temp+=bits[36-i]<<j++;
for(i=13,j=4;i<17;i++)
temp+=bits[36-i]<<j++;
for(i=17,j=8;i<21;i++)
temp+=bits[36-i]<<j++;
for(i=21,j=0;i<23;i++)
chan+=bits[36-i]<<j++;
for(i=24,j=0;i<25;i++)
bat+=bits[36-i]<<j++;
for(i=25,j=0;i<33;i++)
id+=bits[36-i]<<j++;

[...]
Binary file added xt200/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added xt200/xt200_1.sr
Binary file not shown.
Binary file added xt200/xt200_2.sr
Binary file not shown.
Binary file added xt200/xt200_incl_noise.sr
Binary file not shown.