Compressor Motor,Universal Compressor Motor,High Grade Compressor Motor,Ip23 Compressor Motor Jiangsu Hengchi Motor Technology Co., Ltd , https://www.hcemotor.com
Control the power off I / O port, how to achieve complete power off
In a single-chip microcontroller application system, the I/O ports are commonly used to implement a self-shutdown function—essentially turning off the entire system. This is usually done by controlling an electronic switch via the microcontroller’s I/O port. However, when the microcontroller is powered down, the power supply to the system is cut off, and the I/O port must be in a low state at that moment to ensure complete shutdown.
But there's a problem here: when the electronic switch is turned off, due to the presence of power filter capacitors, the voltage in the microcontroller system doesn’t drop instantly to zero—it slowly decreases. At some point, the voltage may drop below the normal operating level, causing the microcontroller to enter a reset, program crash, or undefined state. At this stage, the I/O port might return to a high level, which could accidentally re-activate the electronic switch, preventing a full shutdown.
**Solution:**
Most microcontrollers have a minimum operating voltage that is lower than their normal operating voltage. We can take advantage of this difference to design a proper shutdown circuit. The turn-on voltage of the electronic switch should be higher than the microcontroller’s minimum operating voltage. That way, when the microcontroller is running normally, the control voltage is high enough to keep the switch on. But during power-off, as the voltage drops, the I/O port may no longer provide sufficient voltage to maintain the switch in the on state, ensuring a complete shutdown.

**When Off:**
When S1 is pressed, Q2 turns on. Once the MCU starts up, the POWER pin goes high, which turns on Q1 and keeps Q2 conducting.
**When On:**
1. **Software Shutdown:** The MCU’s POWER pin outputs a low signal, turning off Q1 and subsequently Q2, cutting off the power. This is often used for delayed shutdowns, such as in digital multimeters.
2. Pressing S1 sends a low signal through D3 to the MCU’s ON-OFF pin. After detecting this, the MCU initiates a software shutdown as described above.
D3 serves as a diode isolator to prevent the ON-OFF pin from being pulled low during power-off, which could otherwise cause Q2 to turn on unintentionally.
The POWER pin is the output voltage of the microcontroller. When it's low, it’s near 0V; when high, it matches the microcontroller’s supply voltage.
The ON-OFF pin is an input used by the MCU to detect the state of S1. If S1 isn’t used, this pin can be repurposed for other functions.