Wakeup Pin Minimum Voltage

What is the minimum voltage required on PIN 1 for an external Wakeup to occur?

High = .7Vcc = .73.3 = ~2.3V
Low = .3Vcc = .33.3 = ~1V

Quoting @beardedinventor

Are the values correct with the enumeration for hardware.wakereason()?
When I apply high voltage (3.3V, 5V) to PIN 1, it returns a reason of ‘4’ in my wakeup handler. However WAKEREASON_PIN1 has a value of ‘3’.

That doesn’t seem right. Are you sure there’s not new squirrel waiting for it at boot?

As a test I insert 5V (Vin) into Pin 1, which calls the wakeup handler. This should work right? I tried a cold boot as well, and now I get a reason of ‘0’ (WAKEREASON_POWER_ON), not ‘4’.

wakeup <- hardware.pin1;
wakeup.configure(DIGITAL_IN_WAKEUP, wakeup_handler);

//wakeup handler
function wakeup_handler()
server.log("wakeup event handler: " + hardware.wakereason() );

I think that 3.6 or 3.7V is the max you want to put into a pin…not that that has anything to do with your wakereason…

Just for safety, moved from 5V to ~3.3 V (3V3 Pin) into Pin 1 for test. Although like you said, it has nothing to do why I am getting this wakereason wrong value.

Ah, this explains it!

You are not sleeping. hardware.wakereason() is only set when you wake from sleep via a pin1 event.

If you just install a pin change handler (as you are doing) then there is no wakeup reason - you’ll just see whatever wakereason the code started with, which is either power on, or new squirrel if you hit run when the imp was online.

When you actually sleep, with imp.deepsleepfor or server.sleepfor, then the wakereason will be set as expected. Any handler you install will not be called from this first transition because it happened when the imp was asleep.