Water level code

  • I wanted to pick your brains on this issue.

    What I have is a domoticz/mysensors setup. I have a garden with the moisture sensor and relay node combined. What this does is measure soil moisture and trigger a small pump in a tank to run. On the side of this tank I have put 4 bolts through it into the water. One at 25% down from top, one at 50% down from top, one right above top of pump (submerged pump), and one at very bottom.

    The bolt at the bottom is the ground and I apply power to the top 3 bolts 1 at a time to check for water levels. This way I can be alerted of needed tank refill and write logic to not run the pump if the water level is too low.

    Could anyone help me form some code to make these bolts into a useful mysensor node? I don't need the combo relay/soil sensor I have already combined those sketches. I would simply like tto add the bolts to register on or off and transmit as a recognizable sensor to domoticz.

    I am betting this is really simple, but I am learning everyday. I am working towards being able to build my own custom mysensor node.

  • I'm seeing possibly using an s_door setup to be just like a door open closed switch. This could be useful. I would like for it to not show up as a door however in domoticz

    edit: just saw s_binary

  • Plugin Developer

    @punter9 I do not know about domoticz. But you can use S_WATER as sensor type and V_VOLUME as data type and you can send 25%, 50%, 100%.. based on the level of the bolt that you placed.

  • I was wanting to do something like this as well. Are you using some sort of op-amp or transistor amplifier in the circuit, or just the bolts and wires to the micro?

    Please share your hardware info.

    I think @jkandasa has the right idea for the mySensors portion.

  • Plugin Developer

    @brianc1969 Here is the sketch I'm using with MyController.org Controller

  • I am using straight bolts. I am still working through issues however combining multiple binary switches (bolts), 2 moisture sensors, and a relay.