Home Blog Blog Details

Auto Power Off Circuit for Microcontrollers

January 02 2025
Ampheo 17

Inquiry

Global electronic component supplier AMPHEO PTY LTD: Rich inventory for one-stop shopping. Inquire easily, and receive fast, customized solutions and quotes.

QUICK RFQ
ADD TO RFQ LIST
An auto power-off circuit for microcontrollers is designed to reduce power consumption by cutting off power after the microcontroller finishes its task.

An auto power-off circuit for microcontrollers is designed to reduce power consumption by cutting off power after the microcontroller finishes its task. This is especially useful in battery-powered devices, IoT applications, and energy-efficient designs.

Below is an explanation of a simple auto power-off circuit using a P-Channel MOSFET and a push-button switch.


🛠️ Components Required:

  1. P-Channel MOSFET (e.g., IRF9540, AO3401, or similar)
  2. NPN Transistor (e.g., 2N2222 or BC547)
  3. Push-button switch
  4. Resistors (10kΩ, 1kΩ)
  5. Microcontroller (e.g., Arduino, ESP8266)
  6. Capacitor (Optional, for debounce)

Circuit Description:

  1. Power Control (P-Channel MOSFET):

    • The P-Channel MOSFET acts as a power switch, controlling the supply to the microcontroller.
    • Its Source (S) is connected to the positive power supply (e.g., Vcc or battery).
    • Its Drain (D) is connected to the microcontroller's Vcc pin.
  2. Push-Button:

    • A momentary push-button switch is connected between the Gate (G) of the MOSFET and ground, allowing initial power-on.
  3. Microcontroller Pin (AUTO_OFF Pin):

    • One of the microcontroller's GPIO pins is used to hold the MOSFET gate low to keep the system powered after the button is released.
  4. NPN Transistor (Optional, for Isolation):

    • The NPN transistor ensures the GPIO pin can reliably pull the gate of the MOSFET low.

🔄 Operation:

  1. Power-On Phase:

    • Pressing the push-button pulls the Gate of the MOSFET to Ground, turning it ON.
    • The microcontroller starts running.
  2. Sustain Phase:

    • The microcontroller immediately sets its AUTO_OFF GPIO pin to LOW, keeping the MOSFET ON even after the button is released.
  3. Power-Off Phase:

    • When the microcontroller completes its task, it sets the AUTO_OFF GPIO pin to HIGH (or floating).
    • The MOSFET gate voltage rises, turning it OFF and cutting power to the microcontroller.

📊 Schematic Diagram:

Here’s a basic textual representation:

yaml
 
Vcc
|
MOSFET (P-Ch)
| Gate <-- NPN Transistor + GPIO Pin
| |
PushButton |
| |
MCU ---- GPIO Pin (AUTO_OFF)
|
GND
  • Source → Vcc
  • Drain → Microcontroller Vcc
  • Gate → Pull-up Resistor + Connected to NPN transistor & GPIO

📝 Example Code (Arduino):

cpp
 
const int AUTO_OFF = 7; // GPIO Pin for AUTO-OFF control
 
void setup() {
pinMode(AUTO_OFF, OUTPUT);
digitalWrite(AUTO_OFF, LOW); // Keep MOSFET ON
}
 
void loop() {
// Your main program here
 
delay(5000); // Simulate task duration
 
// Power off after task completion
digitalWrite(AUTO_OFF, HIGH);
}

Advantages:

  • Very low power consumption in the OFF state.
  • Simple and reliable design.
  • Suitable for battery-powered systems.
Ampheo