Nowadays, many electronic devices, such as mobile phones, remote controls, Bluetooth headsets and other small devices, need a simple circuit to control the power on and off. Although this circuit looks inconspicuous, without it, the device may not be able to start normally or save power. Today we will take a look at how this common power-on circuit works.

1.Long-press power-on mechanism

When we want to turn on an electronic device, the most common operation is to press the power button. In the power-on circuit we introduced, this action has a more precise requirement - long press. Button SW1 is the trigger point of the entire power-on process. When we press it, the circuit starts to energize, just like opening a door to the energy world.

At this time, the microcontroller starts to play a role. It will monitor the time when the button is pressed in real time. Why monitor the time? This is to prevent misoperation. Imagine that if the device turns on with a light touch of the button, it will cause a lot of inconvenience in daily use. Therefore, only when the microcontroller detects that the button is pressed for a certain length of time, such as 3 seconds (this length can be adjusted according to the design requirements of the product), it will determine that this is a valid power-on command.

Once it is determined to be a valid power-on command, the microcontroller will set the POWER_IN network to a high level. At this time, through the synergy of various components in the circuit, the path that was originally in the off state is turned on. Taking the circuit in the figure as an example, the circuit structure composed of components such as Q3 will change due to the high level state of the POWER_IN network, so that the battery input can be supplied continuously and stably. In this way, it is equivalent to opening the channel of battery input, providing a stable power supply foundation for the normal startup and operation of various parts of the subsequent equipment, and the equipment can gradually enter the normal working state from the shutdown state.

2. Battery power monitoring

For electronic equipment powered by batteries, it is very important to understand the battery power status. In this startup circuit, the two resistors R26 and R27 form a voltage divider circuit, which are connected to the battery end.

The function of the voltage divider circuit is to convert the high voltage of the battery into a low voltage suitable for detection by the microcontroller according to a certain ratio. The microcontroller can obtain the voltage information of the battery in real time through this voltage divider circuit. This is like equipping the device with a monitoring device that can pay attention to the battery power status in real time.

The microcontroller judges the current battery power status based on the detected battery voltage and the pre-set algorithm. When the power is sufficient, the device can operate various functions normally without worrying about sudden power failure. When the battery level drops to a certain level, the MCU will issue a reminder, such as displaying a low-battery icon on the screen or sounding a warning. If the battery level drops further and approaches a dangerous value, the MCU may also automatically take some measures, such as reducing the performance of the device and shutting down some non-essential functions, to extend the battery life and avoid permanent damage to the battery due to over-discharge.

3.Multi-function multiplexing of buttons

In this power-on circuit, button SW1 has a dual mission: it is both the "key" to trigger the device startup and the "interactive entrance" for daily user operations. The subtlety of this multiplexing design is that the realization of the two functions does not interfere with each other, allowing hardware resources to be used efficiently.

From the perspective of circuit operation logic, when the device is in the off state, the long press signal triggered by pressing button SW1 will be recognized by the microcontroller as a power-on command. At this time, the microcontroller focuses on executing the power-on process, setting the POWER_IN network to a high level to ensure stable power supply from the battery input, so that the device can start smoothly. When the device enters the normal operating state, button SW1 "switches identity" and becomes a user button. By reconfiguring the pin detection logic, the microcontroller can identify different operating modes such as short press, long press, and rapid continuous press.

This multiplexing design not only saves hardware costs and avoids additional buttons occupying circuit board space, but also makes user operations more concise and intuitive. One button can complete the power-on and daily interaction, without the need for complex button combination memory, which greatly improves the ease of use and user experience of the device.

4. Automatic startup and charging when external power is connected

In many cases, we need to charge electronic devices, or hope that the device can work immediately when connected to an external power source. At this time, the VBUS terminal plays an important role.

When we connect an external power source through the VBUS terminal, the detection mechanism in the circuit will quickly sense the presence of the external power source. Even if the device is in the off state at this time, it will automatically start and enter the charging mode. The external power supply passes through the circuit, on the one hand, to provide the device with the power required for operation to ensure that the device can work normally; on the other hand, it will charge the battery and replenish the battery's energy.

This design is very convenient in actual use. For example, our mobile phone automatically shuts down when the battery runs out of power. When we plug in the charger, the mobile phone will automatically turn on and start charging, and we don't need to press the power button manually.

5. Shutdown operation process

In the shutdown operation, after the user presses the button SW1 for a long time, the microcontroller detects the signal and sets the POWER_IN network to a low level. At this time, components such as Q3 in the circuit are cut off due to the level change, cutting off the battery input path. As the power supply is terminated, the modules of the device gradually stop working, achieving a smooth shutdown. This design efficiently completes the shutdown process through simple level control, reflecting the simplicity and reliability of circuit design.