Current on input/lines line in deep-sleep?

papadeltasierra
Posts: 28
Joined: Thu Nov 03, 2022 1:57 pm

Current on input/lines line in deep-sleep?

Postby papadeltasierra » Sun Nov 20, 2022 12:30 pm

I am creating a battery driven project that I want to use minimal power so most of the time I am intending to deep-sleep the main processor and use the ULP to monitor an input line based on a second timer. My first "design" is:
1. Input line pulled up to 3.3V using 10kOhm
2. Input is also corrected to ground via switch
3. ULP powers up periodically and checks line status.
So question:
1. Is the 10kOhm going to leaking current when the ULP and main processor are sleeping? My understanding is that in deep-sleep the ESP32 uses about 15micro-Amps but this would be dwarfed if the input line were pulling 330micro-Amps all the time.

Alternatively could I do something like this?
1. Input line pulled to ground using 10kOhm
2. Input line connected to an output line via switch
3. ULP puts output high and then text input line
Would this make the input and output lines dormant and use no current when the ULP is sleeping?

Thanks for any pointers or suggestions.

boarchuz
Posts: 600
Joined: Tue Aug 21, 2018 5:28 am

Re: Current on input/lines line in deep-sleep?

Postby boarchuz » Mon Nov 21, 2022 2:31 am

1. Only when the switch is closed.

2. Yes, but it probably doesn't need to be that complicated. Assuming the pin has an internal pullup (ie. <GPIO_NUM_34) then you only need that one pin and no external resistor. The ULP would enable the internal pullup, read pin level, then disable pullup.

papadeltasierra
Posts: 28
Joined: Thu Nov 03, 2022 1:57 pm

Re: Current on input/lines line in deep-sleep?

Postby papadeltasierra » Mon Nov 21, 2022 9:03 am

@boarchuz Excellent - thanks for the suggestion of "pullUp/check/turn off pullUp"; sounds like exactly what I want.

My earlier idea, where you said the power would only leak if the switch were closed, is a non-starter as the switch is closed about 10% of the time. The project is to monitor a rotating dial numbered 0-9 where "0" has a magnet on it - a gas meter. It's my attempt to use just an ESP32 to do the job of this clever idea, https://github.com/francescovannini/espmeter, where I want to use the ULP to effectively replace the Tiny13.

Who is online

Users browsing this forum: No registered users and 73 guests