New 433Mhz sensors

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.

Chance

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.

433MHz Wireless Weather Station Digital Thermometer Humidity Sensor

Protocol

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.

Pulses

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:

Flowchart

Reporting

Code

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

    It is a question of WAF!

    Not everything in The Project is wireless, the Gas and Electricity sensors are (at least for the moment) wired, the Internet connection and, last but not least, the power supply, are too.

    This is where the WAF (i.e. Wife acceptance factor) enters. Wikipedia has an extensive explanation about the concept. (Actually, it could also have been called Valentine Acceptance Factor on this day!)

    We are not talking about expensive stuff (it's build rather on the cheap, isn't it?) here but having to cope with bizarre (and wired) apparatus in the flat.

    The best way I found, on top of having a very accepting and forgiving spouse, was to enlist her and use her newly acquired illumination skills to decorate the wooden box.

    Wooden box decorated

    RTC with DS3231 and Raspberry Pi's I2C Bug?

    When a Raspberry Pi -- which doesn't have a hardware clock -- boots, the time can be set thanks to NTP. It usually works well enough to be totally transparent.

    Trouble usually starts if there is a power cut. By the time the Raspberry is up and running, the modem-router is usually still booting/synchronising with the ISP and no clock is set. Programmes start using the Epoch, i.e. 1st of January 1970!

    The best hardware workaround is certainly to use an external clock like "real" computers. Maxim's DS1307 has been a reference for years but is both 5V and not reputed for its accuracy.

    Raspberry Pi's I²C being in 3.3V, I tried to use a cheap RTC Clock using a DS3231 also from Maxim.

    There are loads of webpages explaining how to setup Linux to use this hardware clock and if at first everything worked fine, I then started to notice some problems.

    DS3231 + AT24C02

    Symptoms

    With Raspbian, the main problem was that after a while, I couldn't SSH to the server anymore. The Raspberry being headless, it wasn't easy to guess what was going on but it turned out this behaviour was the result of the disappearance of the root directory.

    And this was itself caused by an I/O error on the SD Card. It seems that the 2 main reasons for this to happen are:

    • Problem with the power supply
    • Faulty (or incompatible) SD Card

    The power supply was bought from RS with the first Raspberry and is rated 1.5A. Swapping with the second one (from Farnell this time) rated 2A didn't change anything. I then decided to use the other SD Card with a brand new Arch Linux on it.

    At first, no failure but then 2 problems also showed up:

    • Loads of log lines related to mmcblk or
    • An extremely slow Raspberry Pi with an non-explicable high load (~ 6)

    Solution?

    I was a bit lost but I found a forum message which gave me a very important clue:

    Second: disconnected the Dallas RTC DS3231, as it was pulling the 3.3v line too low, along with the DHT22 sensor.

    Another test

    Since I use a Level Shifter (3.3V/5V) on the I²C bus, it was very easy to move the DS3231 IC to the 5V side and try this theory. Unfortunately, this didn't make any difference.

    Reason?

    My best guess would be that the DS3231 or the AT24C02 EEPROM on the same module trigger the (in)famous Raspberry Pi I²C Hardware bug.

    Since I removed the module, the Raspberry Pi is no longer slow and load is now ~0.05.

    Software workaround

    With Arch Linux, I now force the application to start only when the network setup has completed (this includes proper NTP initialisation) by adding in the [Unit] section the following lines:

    After=network-online.target
    Wants=network-online.target
    

    Jeelabs weblog is back...

    I was very pleased when I discovered last month that Jean-Claude Wippler was thinking about restarting his blog. I was an avid reader of his adventures in the world of Electronics, Home Automation, Computing, etc...

    And if I still haven't experimented with the Jeenodes, I could one day find myself in need of the RF variant to use with 868Mhz IT+ sensors, etc...

    I was also glad to find PCA9635 already mounted as the chip only exists in SMD form. At the time, I was experimenting with RGB LEDs and debating PCA9635 vs WS2811.

    If I can't compete with Mr Wippler in terms of knowledge, skills, style and lab hardware, his blog was certainly one of the sources of inspiration for mine.

    Long live http://jeelabs.org/!

    « Page 5 / 8 »