Laptop sometimes shuts down when out of power causing me to lose my unsaved files

26

4

Why does it do this? Most of the time my laptop just goes to sleep when it gets to 0% power. But sometimes it completely shuts down and I lose my unsaved files.

Is this a problem with my laptop? The battery runs out fast, so I'm not sure if it's related to that.

user615451

Posted 2016-07-09T23:27:48.077

Reputation: 285

19It is shutting down because it isn't plugged in – Ramhound – 2016-07-09T23:40:21.290

2Please edit your question to add exact details on what make and model of laptop this is. In general, if the laptop is running off of the battery and there is no backup power plugged in, it will shut down. – JakeGould – 2016-07-09T23:56:37.570

74I believe that the OP understands that the laptop cannot keep running past the point where it runs out of power / energy / capacity.  The question is:  Why does it do a hard shutdown, and not sleep, hibernate, or do some other sort of soft shutdown that saves state and allows the machine to be restarted / resumed when power is available again? – G-Man Says 'Reinstate Monica' – 2016-07-10T00:59:06.660

15@Ramhound: and "he lost the files because he didn't save them regularly" :-D. "the higher the truth the simpler it is" ;-) – Hastur – 2016-07-10T13:55:43.770

10How old is the laptop? How old is the laptop battery? Batteries lose capacity over time with each discharge/recharge cycle. If it's over a few years old, you might want to consider replacing the battery. And enabling auto-save in your word programs (or using programs that have autosave as an option). – WernerCD – 2016-07-10T16:18:08.813

6I had this issue with my old laptop when I bought a cheaper, non-genuine replacement battery. It would just go black when it should have still about 5% battery left. I don't think it's impossible that your battery reports to the system that it stil has some juice left but then suddenly fails to provide the required voltage. – kamilk – 2016-07-10T23:31:18.560

2Likely your battery is near end of life. – Daniel R Hicks – 2016-07-11T12:21:39.433

3May be the battery needs to recalibrated. – SAMPro – 2016-07-11T18:38:55.773

@kamilk I've seen this happen with genuine batteries from well-known brands as well. – None – 2016-07-13T10:44:45.843

May be, laptop requires electric power to run program? – ً ً – 2016-07-13T12:03:27.863

3Learn to save. As a programmer who grew up before personal computers had hardware memory protection, I reflexively hit ctrl-s every five seconds. – pipe – 2016-07-14T03:53:09.390

2

@pipe You are not alone dude. :) Once upon a time a simple a pointer error was able to freeze your system in a blink (it was enough Turbo Pascal): since then my ctrl-s involuntary reflex snaps after each sentence or modification even on a word processors.

– Hastur – 2016-07-14T10:32:18.670

I've got the ctrl-s reflex too. Comes from using Windows 3.1 and 95 which would randomly crash all over the place. :-) Oddly, despite the lack of protections in DOS, it was never an issue. DOS app crashes were incredibly rare. Probably because they were so simple. – Brian Knoblauch – 2016-07-14T14:53:08.327

I've recently retrained my CTRL-S muscle memory now that I work so much with Excel. – Dan Henderson – 2016-07-14T19:10:10.750

Answers

84

What's happening is probably either your computer going into sleep mode (rather than hibernation) and then running out of power, which causes things that are just in the working memory and not saved to disk to be lost, or else it's running out of power before it's managed to go into hibernation.

In either case you, go into the "power options" (you can just type that into the start menu) and edit the plan settings for the current plan you're using. Go to "Change advanced power settings" and find the "Battery" settings group. Change the "Critical battery level" and "Low battery level" to a higher value (I believe they default to 5 % and 10 %, try 10 % and 15 % respectively). Then make sure the "Critical battery action" is set to "hibernation". That should help with the problem.

khh

Posted 2016-07-09T23:27:48.077

Reputation: 811

17Either that or it's powering off whilst trying to hibernate, the OP said the battery runs out fast so it could be the case. I'd say it's time to either buy a new battery, a new Notebook or resolve to only use it when it's plugged in as well as increasing critical battery percent - just in case the plug gets kicked out. – Michael Stimson – 2016-07-11T03:53:50.933

10Even higher "low & critical battery levels" could get a few more uses out of a nearly useless battery, I've seen some old batteries seemingly go from 40% to nothing in a few minutes, hibernating at 30% or even 40% could be an option – Xen2050 – 2016-07-11T09:16:16.933

6Remember that the battery voltage meter needs to be calibrated occasionally in order to maintain accuracy. The circuitry in the battery itself prevents the voltage from dropping under a certain value and this is done by hard-cutting power. – Nathan Osman – 2016-07-11T20:23:34.703

2Yeah; I've raised the levels on my laptop too as a quick fix; my current battery is a bit old and it would drop from 25% to 0% in under 2 minutes. But I recalibrated the battery meter and that issue went away; it's just that it takes time to do it. Check your laptop manufacturer's available software too, e.g. my laptop (Lenovo) has a Lenovo tool to recalibrate where you basically just plug it in and wait overnight as it charges fully, disables charging then discharges fully, then reenables charging and recharges fully and builds a voltage profile. I think recalibrating is the real plan A. – Jason C – 2016-07-12T15:46:47.310

If the laptop's battery has a damaged cell this happens. The battery level looks fine until that one cell hits its limit. Then the whole thing drops. That's how it goes from 30% to 0% really, really quickly. – Zan Lynx – 2016-07-14T16:51:56.030

@ZanLynx I think something like that is going on with my tablet. When it's in sleep mode (the screen has been off for more than a few minutes) it can go 12 hours and not lose even 1% of its (reported) charge level. But when I'm actually using it, it can go from 100% to 4% in about an hour, and then when I plug it in, it throws out estimates like "11 minutes to full charge". – Dan Henderson – 2016-07-14T19:15:39.370

41

Understanding our battery

In summary: the gauges of the laptop power settings with the actual condition of your battery do not allow always to the the system to properly shut down.

  • What is happening?
    The system has not enough time to properly shut down all the services, save the files and dump the memory before the power level is too low.
    Alternatively, if the system is set to go in sleep mode and not in hibernation, the battery discharges without that the systems wakes up and dump itself in hibernation.
  • What's the cause?
    The battery discharge rate is not linear and constant in time, and it is not exactly the same for each cycle; it depends from the energy requests, the age of the battery, the external temperature, and the characteristics of the specific battery. If the battery is old, damaged, or used in challenging external condition it can abruptly be discharged. (See the further reading below).
  • Why only sometimes and not always?
    In a working laptop, the discharge depends from the requests. The requests of the system/programs in that critical moment can be so different to allow to the system sometimes to save all and sometimes not. Even the quantity of energy communicated by the battery can be different from the real one and the system can take time that it really doesn't have.

  • What else can it be?
    It can be the CPU/GPU temperature protection, if the temperature grows too much. There can be a spike of requests when the computer want to hibernate that increases the CPU temperature, the accesses to the disk. It can be a contributory cause for the abrupt discharge too, many requests more energy used, all at once.

How to patch this situation?

If the problem is that the hardware and software data are not matching, you should try to fix for first the hardware side. If it is not needed or possible, you can try to change in the software the data interpretation (patching the lecture of the discharge level in your system). In this optic you can even set different levels after which the system starts his hibernation:

  • You can recalibrate the battery gauge [4b], there are different methods and tools, search for one suitable for your laptop. Many vendors provide tools and procedure, e.g. for HP.[4HP]
  • You can change your settings, creating a power plan specific for the condition of your battery [4]; giving a look below to the Further readings section, you can have hints about how much you should to increase the minimum level, of you can proceed with trials and errors:

    Control Panel - Power Options - Power Plans - Change plan Settings -
    check the Advanced Settings for drain and usage settings [4c]

    Give it a look to the other answers [3],[3b] too.

  • Buy a new battery: sadly for an hardware irreparable failure, or simply age, you will be forced to.

Further readings

Simply speaking the battery is like a bottle of water, how fast it will be empty depends on its capacity, on how much water you take per minute, on the quantity of water the bottle leaks even without requests. In this analogy you can see how the water exit more faster from the bottle when it is almost empty then when it is almost full.

  • The discharge of a battery depends on many factors and differs from type to type, but, for what it is important here, presents a behaviour similar to the one of the picture below; note that when it starts to fall it falls fast:

    enter image description here
    Image from a blog [6]. In red the line below the one the battery can say (the system can assume) that it is fully discharged (and stops to work). The age, or the defects, can deviate the behaviour of the battery from the expected one; in particular it can be more abrupt the sliding on the right part of the graph.

    The voltage of the battery is related with the residual capacity and it is communicated to (read by) the system.
    enter image description here
    Image for another battery that shows the correlation between the Capacity on the horizontal*axis, and the voltage on the vertical one. Different colours for different temperatures. Note that I didn't expect that Windows or the battery are taking in account the different curve function of the temperature. So I expect that will work on a single curve, an average one, (so a not completely right one).

    Now if this is not accurate or if the systems for spikes in the requests needs more energy, it will not be able to properly shut down.


At the end of all this reading take a moment to smile on your problem because the most simple answers were:

  1. "It is shutting down because it isn't plugged in" Ramhound [1]
  2. "You lost the files because you didn't save them regularly" Hastur and J. de La Palice[2]

Hastur

Posted 2016-07-09T23:27:48.077

Reputation: 15 043

2

For further discussion on the particulars of LiPo and LiIon batteries, I recommend Why is there so much fear surrounding LiPo batteries? on [electronics.se].

– a CVn – 2016-07-10T19:23:19.700

1"How to patch this situation?" -> Also you can recalibrate the battery gauge, using some generic techniques or whatever tools the laptop manufacturer provides. This is often (but not always of course) helpful, and in any case is always a good idea before tweaking other variables. – Jason C – 2016-07-12T15:48:29.567

1@JasonC I was just convinced to add something by the SAMPro comment to the question and your comment gives me the kick to do it faster. :) Thanks. – Hastur – 2016-07-12T16:49:47.453

22

You should not be letting your battery get to 0% - at minimum it's killing whatever battery life you have left.

It sounds to me that your battery is well past its use-by date, and may simply not have enough juice left in it to reliably shut down the system when it runs out of power. If it can't finish suspending then of course it's going to power off suddenly (without completing a normal shut down) and you will likely lose unsaved work.

davidgo

Posted 2016-07-09T23:27:48.077

Reputation: 49 152

6"You should not be letting your battery get to 0%" This implies that the user should manually hibernate the laptop. Instead, the laptop itself should be taking care of this and the question is why it isn't. "At minimum its killing what battery life you have left." While fully draining a rechargable battery can damage it, modern rechargables have hardware to prevent such damage even if the OS displays 0%. You're spot on that it's probably a broken or old battery which isn't reporting correct power information to the OS. – Schwern – 2016-07-10T06:21:10.163

5Ehm... if the OS shows 0% it means that that is the calculated power. If you take out the cell it will likely still have a good 2.8-3V of potential (See comment from Schwerm on protective circuits and control electronics.). A battery is nowhere near empty when it is reported to be at 0% by any OS. The PC running on a battery of 0% means the calibration is off - that can have many reasons, from a bad implementation, to a bad battery etc. etc. – DetlevCM – 2016-07-10T13:00:14.577

@DetlevCM Right and proper, nonetheless davidgo spots that probably it is an old battery. Can you give me a feedback on the answer posted below (feel you free to edit). I was trying to include this concept in the answer, but I take the risk to make too heavy the answer or to simple... (and I have no good data).

– Hastur – 2016-07-10T13:52:05.887

7

It is impossible for the laptop to "go to sleep" when it has run out of power. Sleep requires power; just less than non-sleep.

The system could hibernate when power gets low, but if your battery is draining really quickly, it's probably deemed that not to be safe.

Most likely the PSU has simply cut out without any meaningful warning to the operating system.

Get a new battery, or leave your laptop plugged in instead of letting it get to 0% all the time.

Lightness Races with Monica

Posted 2016-07-09T23:27:48.077

Reputation: 3 006

5

@davidgo is spot on that it's probably a broken or old battery. You can check this with an app such as BatteryCare or BatteryInfoView. It will let you know its age, wear, number of cycles, and its designed max capacity vs its current max capacity. You can use that to decide if replacing the battery might be the solution.

Schwern

Posted 2016-07-09T23:27:48.077

Reputation: 1 978

1Are the battery's "Stats" (age, wear, cycles) stored by the battery, or only by the OS? Would be useful to see if a "new" battery really is new. Haven't heard of batteries saving that kind of info, but wouldn't be surprised – Xen2050 – 2016-07-11T09:13:37.290

@Xen2050 Macs store the info on the battery, including the date of manufacture. I assume Windows is the same given that these battery utilities offer the same information (I don't have a Windows laptop to verify). BatteryInfoView seems to provide a bit more than BatteryCare.

– Schwern – 2016-07-11T16:12:59.750

3

My anecdote/answer:

My brother had a laptop which was well over 8 years old with the original battery.

This laptop would charge up to 100% and if you unplug it then you had about 3 minutes to plug it back in.

As you can imagine the battery percentage probably dropped in chunks of at least 20%

If his power settings were set up to do something at 5/10/15% then you can bet these settings were never triggered since the laptop would go from 20% down to 0% in an instant and die without properly shutting down.

MonkeyZeus

Posted 2016-07-09T23:27:48.077

Reputation: 7 101

2

Like others said you might have a old battery. But it might also just be a wrong setting. You should be able to set at which battery level your systems shuts down/hibernates. On windows, the level when the pc hibernates is 5%, so if you use windows and your battery goes to 0%, the setting was changed!

If you use Windows, it is in the control panel > Power Options > Change Plan Settings > Change Advanced Power Settings. The default "critical battery level" is 5%. If your battery is weak, increase it to 10% or even more to allow the pc to hibernate.

This obviously won't fix a broken battery, but if your battery still has enough power to allow your pc to safely hibernate, it might be enough for you!

Josef says Reinstate Monica

Posted 2016-07-09T23:27:48.077

Reputation: 1 230

Right even if It should be tricky to find the right level. (see the curves in the other answer). It should be even a wrong communication between battery and OS. In many cases it is possible to recalibrate the battery too. Wonderful timing to answer (if it was only 5 years before ... :) ) – Hastur – 2016-07-14T12:12:40.590

2

Another potential issue is disk caching. Hard drives and operating systems use volatile caches. If the computer shuts down too quickly, even deliberately, and the caches are not committed, you will lose data.

Try disabling "Disk Write Caching" on your disk. Device Manager -> Disk Drives -> (Select your HDD/SSD) -> Policies -> Untick "Enable write caching on the device".

Shiv

Posted 2016-07-09T23:27:48.077

Reputation: 206

1

Have you been able to observe your computer as it ran out of power without hibernating? You don't give any information about your environment, but going into hibernation often requires some cooperation from active programs. A program that doesn't respond properly can prevent hibernation. Usually the OS might pop up a message telling you this happened, but you won't know if you're not there to see it before the system goes dark...

alexis

Posted 2016-07-09T23:27:48.077

Reputation: 492

1

The simple answer, probably a duplicate of other answers: Older batteries discharge faster when they are almost empty. When the battery is low enough that the PC needs to sleep, it is also ready to shutdown, so it just does that instead.

Replace the battery, the problem is just going to get worse.

Mike

Posted 2016-07-09T23:27:48.077

Reputation: 11

-1

Laptops doesn't go shutdown when battery level is below 5%.when if reaches its lowest point it goes to sleep mode to protect your data. Mean while in sleep mode it consumes some energy. If it is beyond the extreme level, it does shutdown and you may loose your unsaved data. There are multiple ways to recover your unsaved data depends on type of applications.

santhosh kumar

Posted 2016-07-09T23:27:48.077

Reputation: 1