Electronic – RTC wake up circuit problems

microcontrollertransistors

I am building a project that uses a MCU to read data from various sensors every hour, and I'm aiming to use a RTC to wake it up.

The circuit uses two transistors that are controlled with the alarm flag of the RTC and a pin from the MCU respectively and when activated, both enable another transistor that powers up the MCU. It looks like this:
enter image description here

R3 is the load where the MCU would be.

This circuit works like this:

  1. The RTC activates the switch that powers the MCU
  2. The now powered MCU enables it's conroll pin to hold the switch open
  3. The MCU tells the RTC to toggle the alarm flag

The circuit works as it stands, I put a resistor in Vout and the voltage is stable. The problems come when i plug the MCU to Vout, because when I do it the voltage starts to tremble and go up and down a bit which causes the microcontroller to reset every 2 or 3 seconds.

Have you had any issues like that? how could I solve it?

Best Answer

The problem is probably a combination of:

  • a low base current at Q2.
  • a low current gain for Q2.
  • not enough capacitance on the output.

Let's say that Q1 and Q4 are working as hard as they can to drive R2 low. We then have, across R2: 5V - 0.6V (Q1/Q4 Vbe) - 0.6V (Q2 Vbe) = 3.8V. So it makes a current of 0.8mA. If we consider that it all comes from Q2's base (we ignore R10), and considering a typical Hfe gain of about 150 for Q2 (see datasheet) it means that you are not allowed to draw more than ~120mA before the output starts dropping dramatically (and this is using the typical current gain, but using the datasheet min Hfe of 40, that would make only about 30mA).

120mA on average is largely enough for most small MCUs. However, if you don't have enough bypass capacitance, the transient spikes at each clock cycle could reach this. And if you got unlucky and have a low current gain on Q2, the critical point is really close. Maybe you also have other loads in addition to the MCU itself (a few LEDs quickly adds up significant current).

The solution could be:

  • lowering R2 (has the drawback of consuming more power)
  • changing Q4 for a mosfet (nicer solution, but choose one with low gate threshold)
  • eventually adding more capacitance on the output (the relevance of this suggestion depends on what you currently have).

Also check what is your total load at the output, of course.