XIAO ESP32S3 wake up on low voltage

Hi everyone,

I’m using an active low hall effect sensor to wake up a XIAO ESP32S3 from deep sleep. The hall effect sensor has a built-in pull-up resistor that outputs ~3V when no magnetic field is present and 0V when a magnetic field is present. I want to wake up the XIAO on a low voltage. When I connect the D1 pin to the hall effect sensor output pin, the voltage across it drops to ~0.4V, causing the XIAO to wake up constantly. I tried to enable the internal pull-up resistor on D1, which works when not in deep sleep but drops to 0V when the ESP32S3 enters deep sleep.

Is this behaviour of the pull-up resistor normal? I’ve also been looking for an active high hall effect sensor but couldn’t find any. Any suggestions would be appreciated.

Hi, just something else I observed.

When I connect the hall effect sensor output pin to D1 and do not enable it as the wake-up pin, the voltage drop does not occur; it remains at a high voltage. However, as soon as I enable D1 as the wake-up pin and connect it to the hall effect sensor output pin, the voltage drops to ~0.4V.

esp_sleep_enable_ext0_wakeup(GPIO_NUM_2,0); //1 = High, 0 = Low

Hi there,
so , I see this.

• Modem-sleep mode – The CPU is operational, and the clock speed can be reduced. The wireless
connections can be configured to remain active as RF circuits are periodically switched on when required.

• Light-sleep mode – The CPU and part of peripheral are powered down. The RTC peripherals, as well as the ULP coprocessor can be woken up periodically by the timer. The chip can be woken up via all wake up mechanisms: MAC, host, RTC timer, or external interrupts. Wireless connections can remain active. Some groups of peripherals can be optionally shut down.

• Deep-sleep mode – Only the ULP coprocessor, RTC memory, and RTC peripherals are powered up.
Wireless connection data is stored in RTC memory.

Given that, You need to use the RTC GPIO, its acting correctly… DeepSleep is shutting down the power for the Pull-UP resistor.
Check out the Technical manual Page 572’ish and readup on how it works for the S3.
It will work the way you expect when you use the RTC GPIO thats on or active in Deep Sleep.

GL :slight_smile: PJ
Note: with this wake up source, you can only use pins that are RTC GPIOs.

Is this thing Updating?
Broken Forum or what ? Time for maintenance :slight_smile: or what ?
GL :slight_smile: PJ
Looks ok , NOW …
Disregard… As you were.

Thank you for your answer.

The pin I’m using is a RTC GPIO pin, the D1/A1 pin of the XIAO ESP32S3 is the GPIO pin 2 of the ESP32S3 chip. It does wake my XIAO from deep sleep.

The issue I’m facing is when I configure this pin as an external wake up pin and connect it to the Vout of the hall effect sensor, the ~3V at the Vout gets pulled down to 0.4V, which is deemed as a low signal, therefore constantly waking my XIAO up. This does not happen if I don’t configure it as an external wake up pin.

I thought of 3 solutions: 1. Getting a active high hall effect sensor. 2. Adding a pull up resistor. 3. Adding a P channel MOSFET.

  1. I can’t find any active high hall effect sensor from digikey or element14, they are all active low.

  2. Adding a 10k ohms resistor at the Vout pin of the hall effect sensor does work. When I connect D1 to it, it gets pulled to ~2.8V. But since I’m doing a battery powered project, this also substantially increase the power consumption to ~0.3mA when my XIAO is in deep sleep.

  3. I’m now using a P-MOSFET. I’ve connected the Vout pin of the hall effect sensor to its gate, and its source and drain to the 3.3V pin of the XIAO and D1. Because the hall effect sensor has a built-in pull up resistor, Vout is pulled up to ~3V when no magnet is around. This inverted the logic of the hall effect sensor. I can now wake up my XIAO on HIGH voltage and it consumes around 20uA when my XIAO is in deep sleep.

I’m not too sure whether this P-MOSFET strategy is a permanent fix. Any suggestions or explanations of XIAO’s behaviour is much appreciated!

Hi there,
No weak Pull up or Pull down Resistor on that RTC GPIO, try GPIO0 it does.(correction that would be the boot button, Nevermind :stuck_out_tongue_closed_eyes:)
Check out the technical reference Guide , If i recall It states to use you own Pull-Up resistor.
GL :slight_smile: PJ :v:

After further review :grin: Switch it to EXT1 and use the BITmask corresponding to your switch GPIO
looks to work.

I tried LOW wake up.
With GPIO1 (pin D0) and GPIO3 (pin D2), I could wake up at LOW without an external pull-up resistor. GPIO2 (pin D1) and GPIO4 (pin D3) required an external pull-up resistor.
I read the documentation but could not find a clear reason.

1 Like

Hi there,
Yea its’ almost a footnote in the tech references, refers to a chart that shows only a Weak Pull-Up or Down is on D0 for boot mode flash control. All others require External.
I’ll find it and post it up.
GL :slight_smile: PJ :v:

2.2.1 Restrictions for GPIOs and RTC_GPIOs
All IO pins of the ESP32 have GPIO and some have RTC_GPIO pin functions. However, these IO pins are
multifunctional and can be configured for different purposes based on the requirements. Some IOs have
restrictions for usage. It is essential to consider their multiplexed nature and the limitations when using these
IO pins.
In Table 2-1 Pin Overview some pin functions are highlighted, specically:
• GPIO – Input only pins, output is not supported due to lack of pull-up/pull-down resistors.
• GPIO – allocated for communication with in-package flash/PSRAM and NOT recommended for other
uses. For details, see Section 2.5 Pin Mapping Between Chip and Flash/PSRAM.
• GPIO – have one of the following important functions:
– Strapping pins – need to be at certain logic levels at startup. See Section 2.4 Strapping Pins.
– JTAG interface – often used for debugging.
– UART interface – often used for debugging.
See also Appendix A.1 – Notes on ESP32 Pin Lists.

and this,
"4.7 Pad Hold Feature
Each IO pad (including the RTC pads) has an individual hold function controlled by a RTC register. When the pad
is set to hold, the state is latched at that moment and will not change no matter how the internal signals change
or how the IO_MUX configuration or GPIO configuration is modified. Users can use the hold function for the pads
to retain the pad state through a core reset triggered by watchdog time-out or Deep-sleep events.
• For digital pads, to maintain the pad’s input/output status in Deep-sleep mode, you can set
REG_DG_PAD_FORCE_UNHOLD to 0 before powering down.
For RTC pads, the input and output values are controlled by the corresponding bits of register
RTC_CNTL_HOLD_FORCE_REG, and you can set it to 1 to hold the value or set it to 0 to unhold the value.
• For digital pads, to disable the hold function after the chip is woken up, you can set REG_DG_PAD_FORCE_UNHOLD
to 1. To maintain the hold function of the pad, you can change the corresponding bit in the register by setting

1 Like