Decode routine for weather station WT440H or WT450H

Dependencies:   mbed

This piece of software decode Weahter station temperature and humidity freeware, by Lotfi BAGHLI, March, 2013

I hacked the TX WT440H, got 2 wires out (GND and DATA), http://www.upm-marketing.com/products/wd633+wt440h.html

I still want to get the data from a RX one (WS738) or a simple 433 MHz RX but signal pbs not yet solved In fact, from the builtin RX of the Weather station, it is ok, but from the external RX, the range is very small : 20 cm :-(

thanks to Jaakko Ala-Paavola, http://ala-paavola.fi/jaakko/doku.php?id=wt450h

for the protocol and decode routine

Connect 2 wires to the MBED : GND and Data Signal to p18

Temperature and Humidity are displayed on the Serial via USB of the MBED /media/uploads/lotfi_baghli/protocol_wt440.png

Committer:
lotfi_baghli
Date:
Sat Mar 30 10:30:38 2013 +0000
Revision:
2:5a073ef49b21
Parent:
1:a9798dd70dbf
Child:
3:cd558875d654
T1Interrupt + Serial

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lotfi_baghli 0:d9b6ce6032fc 1 #include "mbed.h"
lotfi_baghli 2:5a073ef49b21 2
lotfi_baghli 2:5a073ef49b21 3 DigitalOut myled(LED1);
lotfi_baghli 0:d9b6ce6032fc 4 DigitalOut led2(LED2);
lotfi_baghli 2:5a073ef49b21 5 DigitalIn Rx433(p20);
lotfi_baghli 2:5a073ef49b21 6 Serial pc(USBTX, USBRX);
lotfi_baghli 2:5a073ef49b21 7 Ticker T1;
lotfi_baghli 2:5a073ef49b21 8
lotfi_baghli 2:5a073ef49b21 9 unsigned int i;
lotfi_baghli 1:a9798dd70dbf 10
lotfi_baghli 2:5a073ef49b21 11 void T1Interrupt() {
lotfi_baghli 2:5a073ef49b21 12 //myled = 1- myled;
lotfi_baghli 2:5a073ef49b21 13 i++;
lotfi_baghli 2:5a073ef49b21 14 if ((i&1)==1) myled = 1;
lotfi_baghli 2:5a073ef49b21 15 else myled = 0;
lotfi_baghli 2:5a073ef49b21 16 }
lotfi_baghli 2:5a073ef49b21 17
lotfi_baghli 0:d9b6ce6032fc 18 int main() {
lotfi_baghli 2:5a073ef49b21 19 i=0;
lotfi_baghli 2:5a073ef49b21 20 pc.baud(115200);
lotfi_baghli 2:5a073ef49b21 21 // T1.attach_us(&T1Interrupt,500000); // setup T1 interrupt
lotfi_baghli 2:5a073ef49b21 22 T1.attach(&T1Interrupt,2.0); // setup T1 interrupt
lotfi_baghli 0:d9b6ce6032fc 23 while(1) {
lotfi_baghli 2:5a073ef49b21 24 led2 = !led2;
lotfi_baghli 2:5a073ef49b21 25 wait(0.5);
lotfi_baghli 2:5a073ef49b21 26
lotfi_baghli 2:5a073ef49b21 27 // i=(Rx433==1);
lotfi_baghli 2:5a073ef49b21 28 // pc.printf("rx= %d ", i);
lotfi_baghli 2:5a073ef49b21 29 pc.printf("%d", i);
lotfi_baghli 2:5a073ef49b21 30 // i++;
lotfi_baghli 0:d9b6ce6032fc 31 }
lotfi_baghli 2:5a073ef49b21 32 }