Electronic – How do laptops seamlessly switch from AC wall power to battery

batteriesbattery-chargingcomputerspower supply

So this is probably a rather simple question but electrical circuits are not my forte. I have been curious about how devices, specifically a laptop, can seamlessly switch between AC wall power (plugged in) and battery power?

This has been on my mind after doing some research on Lithium ion batteries and their lifespan in laptops. Some folks say that when plugged in, the laptop is using power through the battery and simply constantly charging it between that 90% and 100% range as it goes. Now this seems rather detrimental for the lifespan of the battery, so I can't imagine that most laptops are actually doing this. In my mind the simplest solution is just running completely on the AC wall power and leaving the battery alone when it is fully charged. So the question lies in how does the laptop switch from using AC wall power to using the battery, without shutting down for that split second when you unplug the machine from the wall power adapter?

My expertise is in the software realm, so I am rather ignorant on how the actual electrical engineering works in these cases. My simple guess was that a capacitor(s) supplies the power during that short time when switching between power sources. So, could anyone please explain how this actually works? Feel free to be as technical as you'd like. I have an engineering mindset, so I find the low level details interesting.

Thanks! Also, if this is a duplicate question, feel free to close or remove it and link the answered thread. I did some searching and didn't come across a similar enough thread.

Best Answer

So the question lies in how does the laptop switch from using AC wall power to using the battery, without shutting down for that split second when you unplug the machine from the wall power adapter?

Short answer: very fast controls.

There are many ways of implementing this functionality, but on modern (circa 2020) motherboards this is done by means of a dedicated charger IC that controls when power should come from the AC wall power or from the battery by connecting/disconnecting the battery by means of a MOSFET between the battery and the rest of the motherboard. ISL9238 Example Schematic

The example schematic above comes from the ISL9238 datasheet. This IC measures the AC input voltage (which is DC by the time it arrives to this IC) and if present, uses that input to power the motherboard + charge the battery. Otherwise the IC switches to powering the system from the battery only, and the switching occurs within a few microseconds.

During that small n-microsecond window the decoupling capacitors on the board hold enough charge to power the motherboard. And should these capacitors, for some reason, be not enough to power the motherboard during the switching period, the body-diode of the series MOSFET will conduct until the IC fully switches on the MOSFET.

There are other operating modes available from this IC (such as battery supplemental mode), but that's outside the scope of this question.

There's a whole world of charger ICs out there that do this: the ISL9238 is just one of them. Checkout Digikey's Battery Chargers section if you're curious to learn more.

Related Topic