2
\$\begingroup\$

Due to limitations in my compact PCB design, I can not draw a wire from VCC pin to DS3231 to power it up. But I can connect DS3231's Vcc pin to a GPIO pin of ESP32 (WROOM Module). Since according to datasheet, DS3231's max power consumption is below 1mA and ESP32 GPIO pins in source mode can supply up to 40mA, is it OK to power DS3231 from ESP32's GPIO pin?

DS3231: enter image description here

ESP32-S3:

enter image description here

\$\endgroup\$
9
  • 2
    \$\begingroup\$ I would think that you would want an RTC to be powered continuously. A GPIO pin can only be turned on after the MCU boots, and it will be turned off if a reset (or certain types of sleep) occurs. \$\endgroup\$ Commented Jun 1 at 14:44
  • 1
    \$\begingroup\$ Seems reasonable from current perspective. Decoupling capacitors in the DS3231 Vcc may call for a resistor in series to limit the inrush current. \$\endgroup\$ Commented Jun 1 at 14:45
  • \$\begingroup\$ Is the DS3231 VBAT pin used, or will the RTC only be powered by the VCC pin connected to a ESP32 GPIO pin? \$\endgroup\$ Commented Jun 1 at 14:51
  • \$\begingroup\$ Why use an external RTC at all? What's wrong with the ESP32's internal RTC? \$\endgroup\$ Commented Jun 1 at 14:52
  • \$\begingroup\$ @DaveTweed Thanks for your comment. Rest of the time 2032 battery takes care of it... \$\endgroup\$ Commented Jun 1 at 15:07

1 Answer 1

1
\$\begingroup\$

Yes, this is perfectly fine (at least electrically), and you have checked the necessary conditions:

  • Can it deliver enough current, with margin?
  • Is the worst case voltage drop on the output enough to drive the IC?

This is not uncommon when you have low-current sensors that you may want to disable in sleep-mode. Just turn the GPIO off.

The only problem is to ensure correct startup when the MCU is powered on — how the GPIO is initialized etc. You may want a weak pull-down to ground depending on your power budget.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.