b-parasite icon indicating copy to clipboard operation
b-parasite copied to clipboard

Add pushbutton to design

Open JoelWise opened this issue 2 years ago • 7 comments

I think it would be useful to have a hardware de-bounced pushbutton added to the design. There appears to be room above the coin cell battery.

One idea is to have the sensor broadcast an additional data-point of 'dry set point'. When you press/hold the button the current moisture level is published. Then you could use this in automations to know when the plant needs to be watered. Or you could use this value in the sensor code and publish a binary true/false when the current moisture level falls below the set point.

JoelWise avatar Apr 28 '22 18:04 JoelWise

I'm not sure what advantage this would have over a software based solution. There seemed to be some discussion about this in #21 and it might be worth revisiting this. My take is that the sensor shouldn't also be a user interface device, rather the orchestration should have this built in. The device running as the MQTT broker could just as easily serve the channel that lets you know when a specific sensor is out of range. On the other hand, having the ability to interact with the sensor would potentially be useful for calibration purposes, but I'm still a bit reluctant to suggest this given the limitations it imposes on the hardware's waterproofing and potentially the battery life.

drspangle avatar Apr 28 '22 18:04 drspangle

For a device who's primary function is to monitor moisture levels I think it's a big win to make it easier to set dry points. I already do this in software through home assistant but I can't help but notice how much time it takes to enable such a basic feature.

Of course it would be optional to even install the pushbutton just like the light sensor. And impact to battery level is zilch if you set the GPIO as a wake-up interrupt.

JoelWise avatar Apr 28 '22 18:04 JoelWise

I think this totally makes sense if the button can be protected against moisture intrusion, but that might make the case more complex. Do you know of any waterproof/resistant SMT buttons?

drspangle avatar Apr 28 '22 20:04 drspangle

Capacitive touch sensing pad but it would be hard to use if you use a case. Or a small reed switch activated by strong magnet.

Though, I think a normal push button would be fine for most applications! Not everyone expects their sensors to make it through a hurricane. :)

JoelWise avatar Apr 28 '22 21:04 JoelWise

The problem with ordinary pushbuttons is that if they start to intermittently short when they get wet, even a debouncing circuit or software debouncing will not be effective to prevent false buttonpresses and that can cause serious problems if the button does something important like setting calibration modes and things of that sort. I do like the idea of the reed switch a lot.

How do you envision the dry set point would work?

drspangle avatar Apr 28 '22 21:04 drspangle

That makes sense. It's pretty simple to add some pads for an optional button and you could design the footprint to be compatible with more than one button type (push, reed, capacitive). And the button could be disabled altogether during compile if someone is that worried about false presses. I know this adds even more complexity to the project so it's OK if doesn't happen! I'm not doing the work after all!

For me, I imagine a press and hold (5 seconds?) then the system would record the current moisture value and maybe blink the led (5 times) as feedback that it worked. This value could be exposed in broadcast with the other real time temp/hum/lux/moisture data. Every broadcast would share the set dry point even if it hasn't been changed since last broadcast. Then this value could be used as an entity in home assistant to trigger automations if the real time moisture level falls below the dry set point. You could also do this comparison in the probe software itself and have a true/false bit in the broadcast that represents Needs Watering. Aaaannd home assistant blueprints could make setting up the automations even easier. :)

JoelWise avatar Apr 28 '22 21:04 JoelWise

I think it's a neat idea. I'm not sure there are any pins broken out that we could add a switch to, but I get the impression that this could potentially be a useful addition.

drspangle avatar May 01 '22 17:05 drspangle