I am using a battery-powered boron lte device, putting the boron into “ultra low power” sleep mode, and I am trying to sense a float switch changing state and send an alarm based on the state change from 1 to 0.
The problem I am running into is that it does not trigger reliably. My float switch is wired to be NO and then after rotation, it is NC. My code holds the input high in sleep mode, but when I rotate my switch to NC it does not pull to ground, it remains at 3.3v.
Also, in my setup, I am using the adafruit feather breakout and have a 10K resistor between the EN and BAT pin. Please help.
There is no reason why this type of interrupt can’t be implemented reliably. Couple things that might help us see what the issue is:
When you share code (and that is the right thing to do), try pasting into a code block that you start and stop with three eclipses (under the tilde), it will make it easier to see your code. The block will look like this:
Code Block
Can you say a bit more about the electrical circuity for your switch? Is it being “debounced”, does it have a pull-down resistor or is it floating?
It is wired just like your diagram. I believe the problem is in my sleep code. I have the same exact setup working reliably without letting the boron sleep.
I’m not sure what happens when you exceed the limit, but the maximum sleep duration on Gen 3 including the Boron is around 24 days. You’ll need to shorten the maximum sleep duration.
After cold boot, it’s possible that the time will not be synchronized yet. The delay(1000) in setup() is close to providing enough time, but it’s not guaranteed. You should wait for Time.isValid() before using Time.now().