You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Ahh, by Magnetventil, you mean 'solenoid valve'?

    You'd probably find that this is exactly what you're after: https://makezine.com/projects/use-puck-js-automate-your-gardening-tasks/

    Do you have a link to the impulse water meter you're considering getting?

    If the water meter is basically just a switch (with 2 wires), then you could connect one wire to GND, and the other wire to any free data pin on Puck.js.

    Then it's just a matter of:

    var meterPin = D1; // or whatever pin
    pinMode(meterPin,"input_pullup"); // this makes the pin a `1` unless the switch is on
    setWatch(function() {
      console.log("Impulse!");
    }, meterPin, {repeat:true,edge:"falling"});
    
About

Avatar for Gordon @Gordon started