WKP Pin and Rising Edge

I have a Grove water sensor hooked up to my Photon and all is well, but I'd like to be able to power this with batteries instead of USB. To be able to do that I want to get the power consumption down as much as possible which would mean I would need to use the deep sleep mode. I've read that the WKP pin will trigger on a rising edge signal. Here is a description of the water sensor (Grove - Water Sensor | Seeed Studio Wiki):

The sensor traces have a weak pull-up resistor of 1 MΩ. The resistor will pull the sensor trace value high until a drop of water shorts the sensor trace to the grounded trace

If the trace value is high until it shorts then would I still be able to use the WKP pin to wake up the Photon when it detects water?

Thanks

If you are trying to wake only when water is detected (using the WKP pin), then you cannot hook this sensor up to the Photon without external circuitry. I believe you would need an “inverting buffer with a schmitt trigger” to accomplish what you want. This might work: http://www.ti.com/lit/ds/symlink/sn74aup1t158.pdf. It was the only device with the quoted search terms on Mouser. But just about any inverting buffer would work.

You can’t leave the WKP pin in a HIGH state when you put it into deep sleep; that’s why I suggest an inverting buffer. Also, the sensor description suggests you can use an analog read which indicates the sensor output isn’t a solid HIGH or LOW but rather can float somewhere in between those logic states if there’s not a lot of water; which is why I suggest a schmitt trigger which will “flatten” the output into HIGH or LOW only.

1 Like

@ninjatill I’ll give it a shot. Thanks for the help.