• Hmm, it's very tricky to extract what is from the sensor when there is all the noise :(

    Looking at the protocol description there seem to be at least 12 '1' pulses beforehand, so I guess it's worth looking for the data right after those.

    I guess ideally you'd actually open up the transmitter and connect a wire to it, then you could check everything was working without the noise, and could then work on cutting out the noise once you knew it actually worked.

    If you don't want to do that, one other thing is to make the receiver code much more strict about the length of signals it accepts (it should be 1/342 = 2.92ms and 0.5/342 = 1.46ms)

    var data = "";
    var last = 0;
    function onEdge(e) {  
      var d = 1000*(e.time-e.lastTime);
      if (d>1.3 && d<1.6) {
        if (e.state) data+=last;
      } else if (d>2.7 && d<3.1) {
        data+=last^=1;
      } else {
        if (data.length>8) console.log(data);
        data = "";
        last = 1;
      }  
    }
    setWatch(onEdge, B15, { edge:"both", repeat:true });
    

    Hopefully that'll output much less information...

About

Avatar for Gordon @Gordon started