Pages: 1 [2] 3 4 5   Go Down
Author Topic: 433 MHz RF - Temperature and humidity sensor  (Read 18320 times)
0 Members and 1 Guest are viewing this topic.
Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I might try on desktop PC, but I dont want to burn it so I have to be sure that those resistors are ok.

The yellow data wire is going straight to RF-transmitter module (it has a visible antenna also).
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I might try on desktop PC, but I dont want to burn it so I have to be sure that those resistors are ok.

The yellow data wire is going straight to RF-transmitter module (it has a visible antenna also).
For a 5V input the 39K/10K you refer to gives a 1.02V output that should be okay. If you prefer to be cautious then try a 48K/10K that will drop the output to about 0.86V

Sounds like the yellow data wire may be a place to tap in, depends how smart the transmitter is as to if the data is raw transmitter on/off or a micro interface. Can you measure voltage when the unit transmits to be sure voltage is 0-5V range.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried to wire in to the transmitter - it sends same sound as the RF reciever gets, just much more quiet.
I'll be trying to pin to it now as it gives lower voltage. I couldnt get voltage divider to work, i get very noisy sound.
I managed to record one "test" button before my ears exploded ;-)) it's in attachment.

If you somehow manage to get code working for it (so i can harvest data from sensor), we might start debugging.
http://dl.dropbox.com/u/619007/rf_oneread.wav - but it sounds corrupted near the one below.
Yep, managed to get few "normal" reads without the "transmit" button. It seems like it's send every minute.
https://dl.dropbox.com/u/619007/few_reads_around24c_23wh_ch2.zip
temperature (i couldnt see the lcd while holding cable) was around 24.xC, humidity 23% and it was sent on second channel (and sensor have 1-2-3 CH option).
I didnt cut or modify the file - it's straight from audacity.

I hope it helps to get the "header" pulse for sketch...

I played it back slowed down few times - it sounds liek it sends 6 "pulses" every time. So it's like 6 (same?) messages for weather station, very near to each other.
« Last Edit: January 31, 2013, 11:50:05 pm by andriej » Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You have managed to record some very clean signals. Do you have a receiver connected to your arduino or did you capture from the transmitter?
I have tidied up the wav file by splitting the 3x bursts you captured onto separate tracks and removing the long silences. I have attached the audacity project file so you can look at it. To have any real chance of decoding the data you really need to note the precise temperature/humidity of each sample you capture and try to capture over a large range of values.
The transmitter is repeating the data readings 6 times per burst transmission. Below is what one reading may decode to (I say may because the 0/1 bits may need inverting)
Code:
Sync 000101011110011 000011101101001000100100010 End
Sync 000101011110011 001011101101000000100100001 End
Sync 000101011110011 100011101101001000100101001 End
The first 15 bits are the same for all readings but may contain a channel number. You can confirm this by capturing data with the switch set to different channels.

* few_reads_around24c_23wh_ch2.zip (246.4 KB - downloaded 15 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I did it very simple way - one channel of jack [line-in] was held by yellow (DATA) cable. Other one was GND near battery.
I've used 2xRCA->stereo jack cable.

Hopefully I'll record some more (I have problems with sticking the wires to RCAs ;-)) and get readings also for CH1 and CH3 to see what's the difference.
At this point, with the pattern above - is it possible to modify your code to get the 0 and 1's from Serial with Arduino?
It'd be much easier to note down values of Temp. and Hum. using a notepad and ctrl-c ctrl-v. :-) Even from a fridge etc.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After a bit of messing about I managed to capture your wav samples to logic level so I could play them back to test the modified code. Attached is the modified sketch to suit your transmission timebase that reads in the 42 bits but displays them as 64 bit data. I have also attached the logic level files that you can load and view with Scanalogic-2 software from here http://www.ikalogic.com/ikalogic-products/scanalogic-2/ You don't need the analyser hardware to view the files.

* WeatherRF2.ino (5.89 KB - downloaded 24 times.)
* Unknown01.sst (4.4 KB - downloaded 6 times.)
* Unknown02.sst (4.46 KB - downloaded 7 times.)
* Unknown03.sst (4.45 KB - downloaded 6 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the code! It works and output i present below is exactly copy-paste from it!
Now it's much easier to get probes.

Here's the easy-to-read Google Doc version https://docs.google.com/document/d/121ZH3omAZsdhFi3GSB-YdnasMjIQSGIcaS7QW6KsACA/edit?usp=sharing of what I already manage to get to know about the sensor.
I already see the channel bits (000-1, 001-2, 010-3).


I have to wire up antenna to the reciever so I get all the signals (I had to get the transmitter close to arduino to get all readings one by one).
Those with "???" are not-quite-sure about temperature values, all other ones are written from LCD. Those with "(no force)" came from transmitter as it was sending data WITHOUT me pushing the button.
Code:
TT RH
5.7*C 94%  0000000000000000000000000101011101011011001001011110010110011110 ???
7,1*C 93%  0000000000000000000000000101011101010011010001011101010110011000
7,3*C 92%  0000000000000000000000000101011101010111010001011100010110010110
7,3*C 92%  0000000000000000000000000101011101010111010001011100010110010110
8.1*C 91%  0000000000000000000000000101011110010101010101011011010110010001
9.0*C 90%  0000000000000000000000000101011110010101010101011011010100011001 ???
9.0*C 90%  0000000000000000000000000101011110010110011001011010010110011000
9.2*C 88%  0000000000000000000000000101011110011001011001011000010110010110
10.3*C 85% 0000000000000000000000000101011110011110011101010101010100010001
10.6*C 85% 0000000000000000000000000101011110010010100001010101010110011010
10.9*C 84% 0000000000000000000000000101011110011001100001010100010110010000
11.8*C 83% 0000000000000000000000000101011110011000100101010011010110011100
11.9*C 83% 0000000000000000000000000101011110011011100101010011010110010110
12.2*C 81% 0000000000000000000000000101011110010000101001010001010110010101
12.6*C 79% 0000000000000000000000000101011110010110101001011111010010010010
13.2*C 75% 0000000000000000000000000101011110010001101101011011010010010110
13.4*C 75% 0000000000000000000000000101011110010110101101011011010010010111
13.7*C 75% 0000000000000000000000000101011110011010101101011011010000010001 (no force)
13.9*C 75% 0000000000000000000000000101011110011110101101011011010010010010
14.2*C 75% 0000000000000000000000000101011110010011110001011011010000011100 (no force)
14.4*C 75% 0000000000000000000000000101011110010111110001011011010010011111
14.6*C 75% 0000000000000000000000000101011110011011110001011011010010010001
14.6*C 75% 0000000000000000000000000101011110011011110001011011010000011001 (no force)
14.8*C 75% 0000000000000000000000000101011110011111110001011011010010011010
15.1*C 73% 0000000000000000000000000101011110010100110101011010010010010010 ???
15.3*C 73% 0000000000000000000000000101011110010111110101011001010010010111
16.2*C 67% 0000000000000000000000000101011110010111111001010011010010010101
16.6*C 64% 0000000000000000000000000101011110011111111001010000010000010111 (no force)
16.9*C 66% 0000000000000000000000000101011110010101111101010010010000010110 (no force)
17.2*C 65% 0000000000000000000000000101011110011010111101010001010000011101
17.4*C 64% 0000000000000000000000000101011110011110111101010000010000010011 (no force)
17.6*C 63% 0000000000000000000000000101011110010000000001101111001100010001
17.7*C 61% 0000000000000000000000000101011110010011000001101101001110011001
17.9*C 60% 0000000000000000000000000101011110010111000001101100001100011111
CH 1 -----------
18.0*C 58% 0000000000000000000000000101011110001000000001101010001110010100
18.2*C 58% 0000000000000000000000000101011110001100000001101010001100010111
CH 3 -----------
18.4*C 59% 0000000000000000000000000101011110101111000001101011001110010111
18.6*C 57% 0000000000000000000000000101011110100010000101101001001110010111
18.7*C 56% 0000000000000000000000000101011110100101000101101000001110010011

CH 2 -----------
19.0*C 56% 0000000000000000000000000101011110011010000101101000001110011010
19.2*C 56% 0000000000000000000000000101011110011101000101101000001110011011
19.2*C 56% 0000000000000000000000000101011110011101000101101000001100010011
19.3*C 56% 0000000000000000000000000101011110010000001001101000001110010101
19.5*C 55% 0000000000000000000000000101011110010011001001100111001100010001
19.7*C 55% 0000000000000000000000000101011110010110001001100111001110010100
19.8*C 54% 0000000000000000000000000101011110011000001001100110001110010011
19.9*C 55% 0000000000000000000000000101011110011010001001100111001110011010
20.0*C 55% 0000000000000000000000000101011110011100001001100111001110011101
20.1*C 54% 0000000000000000000000000101011110011110001001100110001110010100
20.1*C 54% 0000000000000000000000000101011110011110001001100110001110010100

I see some pattern, but can't decode it successfully yet.
What are those 'leading' zeroes?

Few more - next to each other and forced-nonforced readings from CH2.
Code:
20.1*C 47% 0000000000000000000000000101011110011101001001101111001010010110
20.1*C 47% 0000000000000000000000000101011110011101001001101111001000011110
20.1*C 48% 0000000000000000000000000101011110011110001001100000001100010001
 (no force)
20.2*C 48% 0000000000000000000000000101011110011111001001100000001110011111
20.2*C 47% 0000000000000000000000000101011110010000001101101111001010011100

Here are the CH1-2-3 differencies. The temperature changed slightly but it's possible to see where it happened in binary code.
Code:
20.0*c 44% 0000000000000000000000000101011110011100001001101100001000010111 CH2
20.0*C 44% 0000000000000000000000000101011110001100001001101100001000011101 CH1
20.1*C 44% 0000000000000000000000000101011110101110001001101100001010011110 CH3
and also other one - better to see:
Code:
20.5*C 44% [pulse] 101011110000101001101101100001010010100 CH1
20.5*C 44% [pulse] 101011110010101001101101100001010011110 CH2
20.5*C 44% [pulse] 101011110100101001101101100001010010011 CH3

I also tried to change battery to older one (to see the battery indicator) and I'm afraid I cant understand anything now...
Look at the pulse difference:
Code:
BATTERY + OLD NI-MH accu BATTERY [station DOESNT show this as a 'weak battery']
0000000000000000000000000010111110010010001101100111001000001010
USED BATTERY
0000000000000000000000001010110100011100001101100101001010001010
ONE USED AND ONE GOOD BATTERY
0000000000000000000000001111010100010111010001100100001010001011
AND BACK TO GOOD BATTERY (pair which I used for all measures)
0000000000000000000000001010010000011100010001100011001010000110
Another update.
Sensor and application has been on for hour or so, I didn't write down values.
These are the one printed - it looks like every column changes.
The last value is around 22.3*C 29%.
Code:
0000000000000000000000001010010000011100010001100011001010000110
0000000000000000000000001010010000011100010001100011001010000110
0000000000000000000000001010010000011100010001100011001010000110
0000000000000000000000001010010000011100010001100011001010000110
0000000000000000000000001010010000011100010001100011001010000110
0000000000000000000000001010010000011100010001100011001000001110
0000000000000000000000001010010000011100010001100001001000000100
0000000000000000000000001010010000011100010001100001001000000100
0000000000000000000000001010010000011100010001100001001000000100
0000000000000000000000001010010000011100010001100001001000000100
0000000000000000000000001010010000011100010001100000001000000001
0000000000000000000000001010010000011100010001100000001000000001
0000000000000000000000001010010000011101010001101111000100000100
0000000000000000000000001010010000011101010001101111000100000100
0000000000000000000000001010010000011101010001101111000100000100
0000000000000000000000001010010000011101010001101111000100000100
0000000000000000000000001010010000011110010001101110000100001011
0000000000000000000000001010010010011110010001101110000100000100
0000000000000000000000001010010010011110010001101110000100000100
0000000000000000000000001010010010011110010001101110000100000100
0000000000000000000000001010010010010000010101101110000100000100
0000000000000000000000001010010010010000010101101110000100000100
0000000000000000000000001010010010010000010101101111000100000001
0000000000000000000000001010010010010000010101101110000100000100
0000000000000000000000001010010010010000010101101110000100000100
0000000000000000000000001010010010010000010101101110000100000100
0000000000000000000000001010010010010001010101101110000100000010
0000000000000000000000001010010010010010010101101110000100001000
0000000000000000000000001010010010010010010101101110000100001000
0000000000000000000000001010010010010010010101101110000100001000
0000000000000000000000001010010010010010010101101110000100001000
0000000000000000000000001010010010010011010101101110000100001110
0000000000000000000000001010010010010100010101101101000100000000
0000000000000000000000001010010010010110010101101101000100001100
« Last Edit: February 03, 2013, 10:56:50 pm by andriej » Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What are those 'leading' zeroes?
You transmitter sends 42 bits but the subroutine to display the data as binary only does 32 chunks so 2x 32 bit chunks displays 64 bits with leading zero's instead of just 42 bits.

Code:
                        TX                LLLLHHHH
Temp   RH% -Preamble- ??CH                Humidity
 7,1*C 93% 0001010111 0101 0011 0100 0101 11010101 10011000
Humidity is stored as low/high order nibbles. In the example above take the first 4 bits and tack them on the end of the next 4 bits. 11010101 becomes 01011101 that is 93 decimal. Not done temperature yet but it look like it's also split into nibbles.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, Riva, I'm amazed of the knownledge you get here. I wouldn't manage to get that never, probably.
As I've written on google docs - temperatures may be in fahrenheit.
Sensor, after changing batteries, views temp. as F degrees. I have to push button on the back to switch to celsius - the data sent by transmitter doesn't change by that.

I also see about that you also used 'preamble' - do you know why would it change when changing batteries?
Usually I see the battery-indicator in the transmission as a "high"/"low".
Maybe it was too late for me (and I was tired) but there are more changes in bits than one-two in preamble part.
Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I also see about that you also used 'preamble' - do you know why would it change when changing batteries?
The transmitter will probably generate a random number when first powered on (or batteries changed) and this will become all/part of the preamble.
Code:
                        TX LLLL MMMM HHHH LLLLHHHH
Temp   RH% -Preamble- ??CH Temperature- Humidity
 7,1*C 93% 0001010111 0101 001101000101 11010101 10011000
Looks like temperature is transmitted as 12 bits in 3x nibbles ranging from low to high nibbles. A fixed offset of 900 is applied to the temperature value so 0 degrees F = 900 and each degree F change is 10 decimal. In the example 001101000101 becomes 010101000011 that is 1347 decimal.
1347-900 = 447
447/10 = 44.7
44.7F = 7.1C
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The transmitter will probably generate a random number when first powered on (or batteries changed) and this will become all/part of the preamble.

I'm not sure about this, because - how its possible to sensor to generate the same number again when putting back 'normal' batteries?
As you can see from here (and I don't know if I cut the lead 'zeroes' properly) - we have the same preamble after tries with 3 other sets of batteries.
Compare: "starting point" and "typical setup" - preamble is the same.
Code:
0001010111 01010011010001011101010110011000 - your preamble (7,1, RH93%)
0010100100 00011100010001100000001000000001 - starting point
0000101111 10010010001101100111001000001010 - battery + old ni-mh
0010101101 00011100001101100101001010001010 - used battery (1 GOOD, 1 'used')
0011110101 00010111010001100100001010001011 - used battery (1 GOOD, 1 nimh used)
0010100100 00011100010001100011001010000110 - typical setup (2AA varta batt.) (same as "starting point")

Great job with the temperature - as I see the biggest problem will be the code. :-)
« Last Edit: February 04, 2013, 06:49:27 am by andriej » Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
Temp*C RH% -Preamble- BC CH Temperature- Humidity --CRC?--
                      BB CC LLLLMMMMHHHH LLLLHHHH
 7,1*C 93% 0001010111 01 01 001101000101 11010101 10011000
I still wonder if first 8/10 bits are random number used as device ID
BC looks like 2 bit battery condition
CH is channel number from switch position?
Have not figured out the CRC yet but that's what I assume it is.
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I still wonder if first 8/10 bits are random number used as device ID
BC looks like 2 bit battery condition
CH is channel number from switch position?
Have not figured out the CRC yet but that's what I assume it is.

CH is indeed 3 position switch behind the sensor. Currently I use it on CH2 because on CH1 there's some sensor near used by neighbour and i got 2 readings (but can't reach them lately).
The device ID - look at the google document here: https://docs.google.com/document/d/121ZH3omAZsdhFi3GSB-YdnasMjIQSGIcaS7QW6KsACA/edit
I've marked yellow the moment, that (what you assume BC is) changes.
Batteries didn't change by that moment, the only thing that changed was the sensor was held by me in hand and I was pushing "transmit" button all the time to get near-readings every fewteen seconds.

The other thing is, that on the most of the readings on that document i cut out all leading 'zeroes' which i assume was a mistake now.
But all the same readings are in post above here - i'll paste them back there.
« Last Edit: February 04, 2013, 07:54:07 am by andriej » Logged

Norfolk UK
Offline Offline
Edison Member
*
Karma: 52
Posts: 2214
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

CH is indeed 3 position switch behind the sensor. Currently I use it on CH2 because on CH1 there's some sensor near used by neighbour and i got 2 readings (but can't reach them lately).
The device ID - look at the google document here: https://docs.google.com/document/d/121ZH3omAZsdhFi3GSB-YdnasMjIQSGIcaS7QW6KsACA/edit
I've marked yellow the moment, that (what you assume BC is) changes.
Batteries didn't change by that moment, the only thing that changed was the sensor was held by me in hand and I was pushing "transmit" button all the time to get near-readings every fewteen seconds.
Cold temperatures degrade the battery output. You did not change the batteries but the temperature is steadily climbing and the batteries power output with it. This is probably why the BC condition changed like this.

The other thing is, that on the most of the readings on that document i cut out all leading 'zeroes' which i assume was a mistake now.
The data packet looks to be 40 or 42 bits long (see image) so as long as your keep 42 bit there is no problem trimming off the leading zeros
But all the same readings are in post above here - i'll paste them back there.


* 42Bits.png (64.68 KB, 1266x869 - viewed 33 times.)
Logged

Handle every stressful situation like a dog. If you can't eat it or hump it. Piss on it and walk away.

Poland
Offline Offline
Newbie
*
Karma: 0
Posts: 44
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've reedited the google document now to get easier group-readings (and see the battery easier):
https://docs.google.com/document/d/121ZH3omAZsdhFi3GSB-YdnasMjIQSGIcaS7QW6KsACA/edit?usp=sharing
I don't know if its possible (or used ever before), but maybe the battery sensor reading is 3 bits left of CH?

So, by:
5,7*C it was outside: 101 - dec: 5 (out of 10?)
inside, got a little warmer:
110 - dec: 6 (out of 10?)
later readings all are 6/10 (batteries are outside for 2-3 months already, and it is winter now)
then i started manipulating with batteries and other reading:
100 - dec: 4 (weaker battery, got a little stronger last read)
and after all the mess i threw sensor outside again and the last read noticed is:
010 - dec: 2 which messes all my theory... (or maybe it's 10 - 2/10? so battery is 8/10...)

Edit:
Also, about CRC.
Assuming it's again LLLLHHHH, the only values I see on LLLL are:
Code:
0000 - dec: 0
0001 - dec: 1
1000 - dec: 8
1001 - dec: 9
« Last Edit: February 04, 2013, 08:47:52 am by andriej » Logged

Pages: 1 [2] 3 4 5   Go Up
Jump to: