RTC GPIO output level in deep sleep mode

Railgun
Posts: 2
Joined: Fri Apr 20, 2018 8:56 am

RTC GPIO output level in deep sleep mode

Postby Railgun » Fri Apr 20, 2018 8:58 am

Dear ESP32 users,

I have a question related to the ESP32 deep sleep mode and the RTC GPIO pins. I'm setting up a watering system for outdoor planters, with an ESP32 as the system's command. I want it to last for a few weeks on a single 1Ah lipo, so I need to put the ESP32 in deep sleep mode most of the time. The watering system is commanded using a 4-module relay (https://www.aliexpress.com/item/12V-4-C ... 78055.html, I think 3.3v should work even though it's nominally 5v). It's normally closed, which means if I want my watering system to be off during deep sleep, I need to send a high signal permanently. Now, I know that during deep sleep setup, esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON) keeps the RTC GPIO awake, but I'd like to know how to set these pins as high-level outputs (if possible while not eating through my battery too much).

If I recall correctly, gpio_pullup_en(gpio_num) will set these pins to high, but pullups are for input states only, correct ? However, since a high level means the current won't flow through the relay module's diode, maybe it doesn't matter ?
If I set the corresponding pins to high before deep sleep and then start the deep sleep mode, will they remember these states, or do I need a coprocessor routine to enable then again ?

And thank you for the large amount of I was able to get just reading this forum :).

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: RTC GPIO output level in deep sleep mode

Postby WiFive » Sun Apr 22, 2018 11:16 am

http://esp-idf.readthedocs.io/en/latest ... gpio_num_t

But you probably should be using latching relays or latching solenoid valves

Railgun
Posts: 2
Joined: Fri Apr 20, 2018 8:56 am

Re: RTC GPIO output level in deep sleep mode

Postby Railgun » Mon Apr 23, 2018 11:57 am

Thanks, that's exactly what I needed. That was easier than I expected, too.

Unfortunately, most IoT relay modules are of the normally-closed kind, but with a bit of appropriate software it works fine. :D

Who is online

Users browsing this forum: CseaTec, Google [Bot], hape65 and 108 guests