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:
Fri Mar 29 18:10:53 2013 +0000
Revision:
0:d9b6ce6032fc
Child:
1:a9798dd70dbf
T1 ISR

Who changed what in which revision?

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