La Crosse sensors
As described last year, I own a La Crosse Weather Station to which I added several additional (TX2 & TX3) sensors.
Trouble is, as the technology is phased out in favor of a 868Mhz based one, these sensors are harder to come by and are also a bit pricey.
Unexpectedly, I noticed a news about a firmware update of the RFXtrx433E from RFXCom talking about a well known chinese online shop's version of a sensor. Indeed, I was able to become the owner of a "433MHz Wireless Weather Station Digital Thermometer Humidity Sensor" for the very lucky price of US$8.88 all included.
These sensors are apparently compatible with the Alecto WS1700 ones. The protocol was decoded and published on the Pilight wiki and forums.
It looked simple enough so I decided to modify my Arduino/Digispark script in order to decode it as well.
Yet there was a catch! La Crosse TX3 protocol uses a variation of pulses on the high level with timing on the low level being almost identical (and ignored by my decoder's implementation).
For the WS1700... it's the opposite! Hence only a succession of 37 identical 500µS pulses was the only thing seen.
Also, the signal finishes by a "very long" (~9200µS) Low and, as usual with this kind of device, the whole sequence is repeated several times.
As an example, the pulses are like this :
H540 L1890 <-- detect H540 L3780 <-- detect H540 L1890 <-- detect H540 L3780 <-- detect H540 L3780 <-- detect H540 L3780 <-- detect H540 L3780 <-- detect H540 L3780 <-- detect [...] H540 L3780 H540 L9180 <-- synchronise (and again) H540 L1890 <-- check H540 L3780 <-- check H540 L1890 <-- check H540 L3780 <-- check H540 L3780 <-- read [...] H540 L9180 <-- validate (and again) H540 L1890 [...]
If we detect at least 8 continous short high pulses, then we know it's not a TX3 sensor but probably a Alecto compatible one and therefore from now on only low pulses will be read.
The strategy is then to wait for very long pulse, read the full signal, checking the header (~1900µS ~3800µS ~1900µS ~3800µS), and at last validating with the last pulse which should be again a very long one.
The new algorithm is represented in the following flowchart:
The Id, which is randomly generated when inserting new batteries -- same as TX3 -- is ignored... I will assume that nobody else has a compatible sensors around and use the channel number instead.
Channel (there is a physical switch to select it) is coded 00=CH1, 01=CH2, 02=CH3. This will be my sensor ID because it is fixed. But to avoid any clash, I add 1001 so CH1=1001, CH2=1002, CH3=1003.
Battery will be reported as OK or KO.
There is a small button at the back of the sensor to force the emission. Apart for tests, it is not that useful and we can ignore the bit reporting this.
Temperature is in 10th of degrees Celcius so value is divided by 10. Negative values are taken care of as well.
Humidity is straight out the signal received except if not read properly (0%).
Code, now compatible with Lacrose TX2/3/4 & Alecto WS1700, can be used on Digispark/Arduino. See the github repository: https://github.com/guillier/la_crosse_sensors