-
• #2
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"});
-
• #4
Both green and brown are ground?
You should be able to just connect between the 3V and GND pins on Espruino, and then use pin D1 or D2?
You may not need
pinMode(meterPin,"input_pullup")
- try first without it and see.
Hi @Gordon,
1) I would like a Magnetventil to be controlled through Puck. In general if a certain voltage is passed to the device it is opened, if there is no, it is closed.
My question is, suppose you have all needed from additional elements standpoint, on which pins should I connect the device and how from code standpoint will be able to open/close it ?
2) I would like to receive impulses from impulse water meter. In general you give some power the device and on certain quantity of water you receive an impulse.
My question is, how could I power such an external device, on which pins should I connect the device and how from code standpoint will be triggered once I have an impulse (change in the voltage i guess) ?
Thank you.