How can I programmatically stop a notebook battery from charging

I honestly don't know, but I'd have a look at the APM or ACPI APIs.

Other than that, the only option I can think of right now is a USB controlled robotic arm that ejects the battery when you need to stop charging, but that's probably not what you are looking for, and borders on the complicator's glove in terms of level of over-engineering. :)


I think it's impossible, because you have need some API for battery or battery charger.

And this API can provide to you manufacturer of notebook and battery or battery charger support this.