1
\$\begingroup\$

I'm using a DS3231 in conjunction with two IRLZ44N MOSFETs to switch power to a MCU when the alarm on the DS3231 triggers. The alarm on the DS3231 pulls the SQW/INT pin to ground and turns on the MCU using the IRLZ44N FETs. When the MCU resets the alarm on the DS3231, the power is killed to the MCU.

I'm using this to turn on an arduino or an ESP32 at a precise time, schedule the next wakeup time, and then shut down. I don't anticipate pulling more than 1A with my projects that would use this circuit (probably less than 1A).

I want to be able to use this circuit with 3.3v and 5v MCUs. I've tested with both 3.3v and 5v and it seems to function fine. The datasheet for the IRLZ44N looks like it supports both voltages for controlling the gates on the FETs.

I'm a beginner and I would really appreciate feedback on this circuit. Hopefully I'm not way off!

Here are my questions:

  1. Is this design reasonable? Or are there better solutions? Any glaring issues?
  2. Are the IRLZ44N MOSFETs a good choice for this application?
  3. Are my 100k pullup resistors reasonable values?
  4. Is this is a common pattern to convert something being pulled to ground into switching something else on. Does this sort of thing have a name?

Here is my schematic:

DS3231 alarm as switch

\$\endgroup\$
1
\$\begingroup\$

This is a less than desirable design to be switching the GND line of the MCU subsystem. A far more suitable design would switch on the VCC of the MCU section and keep all the GND reference connections tied together.

Switching of the Vcc in the situation shown for a 3V setup could also be a bit simpler in that the job could be done with just one P-channel MOSFET. The P-channel MOSFET would need its GATE pulled to GND to turn it on and that is just what the RTC chip does on the SQW/INT pin.

\$\endgroup\$
9
  • 1
    \$\begingroup\$ The reason ground switching is awkward here is that at least the I2C signals out of the MCU will still present a current flow path through the MCU, via the DS3231 to battery negative. This may cause you some issues during the MCU power up and power down. If you really want to take this approach you should consider how to isolate the pins. But the PFET solution described above is the right one. \$\endgroup\$ – Robin Iddon May 31 '20 at 8:20
  • \$\begingroup\$ Can you recommend a P-channel MOSFET part (keeping in mind that I want to use it for both 3.3v and 5v applications)? Is there any concern about voltage drop if I switch VCC instead of ground? \$\endgroup\$ – kr4sh May 31 '20 at 12:44
  • \$\begingroup\$ The 5V application with a P-FET will be fine as long as you operate the RTC also off of 5V. If you try to use a P-FET to switch 5V whilst leaving the RTC on 3V then the gate to source resistor that you put on the P-FET will pull the SQW/INT open drain pin to 5V and that would not be good for the RTC chip. Good thing for you is that your selected DS3231 can operate on 3V or 5V according to the data sheet. \$\endgroup\$ – Michael Karas May 31 '20 at 12:54
  • \$\begingroup\$ Yeah I would power the DS3231 with the same 3.3v or 5v as the MCU (not planning to mix voltages). Any recommendation on a P-FET part? I have a FQP27P06 kicking around that I could try (the data sheet looks like it will work with 5 an 3.3v — interpreting this is a bit challenging for me though). Curious if you think this is an acceptable part for this task. Also interested to know if you recommend another P-FET based on your experience. Thanks so much! \$\endgroup\$ – kr4sh May 31 '20 at 13:00
  • \$\begingroup\$ Switching GND would have just as much voltage drop as switching the VCC given the same load current and similar switching FETs. Selection of a proper P-FET with low RdsOn will ensure very low VCC drop. For operation you need to have a P-FET that gets fully turned on when the RTC pulls its GATE to GND. So for 3V operation this suggests that you need a logic level P-FET. I did some checking and finding P-FETs with logic level operation at low RdsOn does not turn up much. It may be simpler to just use a PNP transistor to switch the VCC. It will certainly cost less. \$\endgroup\$ – Michael Karas May 31 '20 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.