0
\$\begingroup\$

I have a microPC (the Jetson Nano, 10 W) that cannot handle a sudden power loss. However, the casing I need to design it for only has a latching switch for powering on and off. I need to design a circuit that will facilitate the powering of Jetson Nano (along with some power converters) and will keep powering it for about 30 seconds when the user switches off the system with the switch. This way the Nano will be able to read the switch and shut down in time.

To read the battery status I will be using a ATmega328PB and a small 1inch OLED. This MCU will come out of low power mode by a momentary "check battery" button. The system will be using a 99 Wh battery so a few milliamps of power are no problem. Is the schematic below a viable solution? Can I use analog components to completely power down the system?

schematic

simulate this circuit – Schematic created using CircuitLab

(battery display and button are not shown for clarity)

\$\endgroup\$
4
  • \$\begingroup\$ It appears that in your circuit, U1 and U2 remain powered off the battery. If that is the case, there is a MUCH simpler design - just make the switch control 5V for U2's GPIO and have U2 control a mosfet feeding U3 from U1... I would do something different that powers down the whole circuit though - stay tuned. \$\endgroup\$
    – Abel
    Oct 24 '20 at 19:15
  • \$\begingroup\$ IRF530 is a N-channel MOSFET. You can't use it like this at a "high side". \$\endgroup\$
    – NStorm
    Oct 24 '20 at 19:30
  • \$\begingroup\$ Do you need U2 to perform battery voltage measurements? \$\endgroup\$
    – anrieff
    Oct 24 '20 at 20:42
  • \$\begingroup\$ @anrieff not quite, however it does communicate with a sm-bus smart battery on button press to display current charge \$\endgroup\$
    – Ananas_hoi
    Oct 24 '20 at 22:40
3
+50
\$\begingroup\$

There are two issues with your schematic. You need a power P-channel MOSFET to switch the power to U4. You can command it with a small N-channel MOSFET (M2) like this:

schematic

simulate this circuit – Schematic created using CircuitLab

When M2 is off, M1 is also off (as R1 pulls its gate to source). R2 keeps M2 off for the brief period when the ATmega starts up at powerup. You may omit it if you want.

The second issue (credits to Abel, I didn't see it initially) is that the Vbatt voltage is too high for a MCU GPIO pin. You need to use a voltage divider to reduce it to ~5V. This needs to be true for the whole range of the battery voltage. E.g. target 5.2V when the battery is truly 100% charged, so when it's nearly depleted it still near 5V. I've used values for R3/R4 assuming 4-cell Li-Ion/Li-Poly. Hope this helps!

EDIT

As you indicate that battery voltage measurement is not done by the ATmega, I've redrawn the whole schematic to avoid the voltage divider, as it drains unnecessary power for no good:

schematic

simulate this circuit

The switch is wired to the MCU only. Use the weak pull-up functionality on your MCU at GPIO1 to sense the switch (or add an external pull-up to the 5V).

\$\endgroup\$
6
  • \$\begingroup\$ Isn't a FQP50N06 is a N-channel MOSFET? \$\endgroup\$
    – NStorm
    Oct 24 '20 at 19:26
  • 1
    \$\begingroup\$ whoops, corrected. It was listed as P-channel in CircuitLab. Swapped with FQP27P60. \$\endgroup\$
    – anrieff
    Oct 24 '20 at 19:59
  • \$\begingroup\$ On the switch voltage, since U1 is a 5V source, instead of a voltage divider, I'd put it between U1's 5V and U2's GPIO1. Voltage div might help detect low battery voltage, but costs current and components. \$\endgroup\$
    – Abel
    Oct 24 '20 at 20:31
  • \$\begingroup\$ Yes, you are correct. Depends on really whether OP needs battery voltage measurement (even if needed, the divider presented is not a good one, for range and ADC input impedance reasons) \$\endgroup\$
    – anrieff
    Oct 24 '20 at 20:42
  • \$\begingroup\$ Would it be better to use a linear regulator or a switching regulator for U1? In my belief a linear regulator is simpler and has smaller losses for a tiny current but it feels "bad" to use a linear regulator for an MCU. \$\endgroup\$
    – Ananas_hoi
    Oct 26 '20 at 12:02
1
\$\begingroup\$

To power down a whole circuit the logic needs to go something like:

  1. Switch feeds a GPIO signal (Sense), and also powers the circuit (through a diode).
  2. A power controller (U2) is powered on and activates a Parallel power pathway to the switch (M1).
  3. Switch is turned off - Parallel pathway remains active, but Sense is now off since diode prevents Parallel path from feeding it.
  4. Power controller times from Sense being detected off and shuts off the parallel pathway when it is appropriate

Additional Options: You can signal U3 to shutdown over another GPIO rather than timing it, or if your mini-computer has gpio capabilities, it can BE the power controller since they usually support a gpio (or even an led) going off once powered down. This is the answer to "Can I use analog components to completely power down the system?" - Yes as long as you allow the mini-computer itself to remain a digital component.

Note about schematic: (Internal) Pulldown assumed on Sense, and mosfet/diode need to be selected for your current requirements

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
2
  • \$\begingroup\$ I don't think that OP need to power down the whole circuit. In his last paragraph he states that "a few milliamps of power are no problem" so I guess that the MCU can be left powered on. \$\endgroup\$
    – NStorm
    Oct 24 '20 at 20:01
  • \$\begingroup\$ Thank you for this answer, provides another viable solution. Real advantage is the +/- zero power wasted when off. However due to the added complexity of also requiring the power to be displayed by U2 with a momentary button it's gotten a little bit too complicated. Will probably use this solution in future applications! \$\endgroup\$
    – Ananas_hoi
    Oct 26 '20 at 17:42
1
\$\begingroup\$
  1. You can't use an N-channel MOSFET like this, because source voltage will be higher than gate once it opens. You can either use a P-channel MOSFET and reverse the gate logic or put your N-channel MOSFET to a low side (switching the "ground path"). But as we don't know what lies behind the U4 and which type of convertor it is, I'd rather pick changing MOSFET to a P-channel.

  2. For a IRF530 5v gate voltage might be a little smaller than required causing a higher resistance on drain-source. Besides driving an M1 gate directly from Atmega IO pin might cause too much current on initial gate charging. You can limit it with additional small value resistor. But I suggest adding a small logic level MOSFET to drive the gate of M1 directly with Vbatt.

  3. Vbatt are too high to be directly applied to an Atmega pin. You have to use a voltage divider. Values I've picked are actually to be suited to use with ADC with internal 1.1V reference.

Something like this should work:

schematic

simulate this circuit – Schematic created using CircuitLab

EDIT: I've initially draw a schematics to use a low-side N-channel switch. But thinking that we don't know that U4 is and the current can flow through U3 ground path, I've changed it to P-channel base. It was anrieff answer which draw my attention to this.

\$\endgroup\$

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.