Question PC won't go to sleep on UPS battery power

May 6, 2024
2
0
10
My PC is connected to an offline UPS. I can't put my PC into sleep mode when the UPS is providing battery power. The display goes out and then comes back to the lockscreen. It also wakes up from sleep when mains power goes out and the UPS switches to battery. Running powercfg /device_query wake_armed reveals that only keyboard and mouse are allowed to wake up the PC. I went to Device Manager> Keyboard>Power Management and unticked "allow this device to wake up the computer". Strangely, this solved the issue - PC doesn't wake up during power outage and I can put it to sleep even when the UPS is on battery power. But now I can't use my keyboard to wake up my PC. Is there a better solution? What's going on here?

Notes:
  • The UPS is a very basic one - just provides power, makes noise and probably has horrible modified sine wave output.
  • There's no USB connection between my PC and the UPS.
  • Disabling mouse wake up didn't solve the issue, but disabling keyboard wake up did.
 
Something is likely being too "smart?". Most UPS you see people have are what are called strandby UPS. These detect a outage and then switch over to battery. This is extremely short time and most equipment has capacitors that are mostly used to filter the power but they also act as a small battery.

When you are running in sleep mode on most pc the power supply is pretty much off. It is still providing the 5v standby power which it does even if you shut the machine down. This is the power that the USB device are using. My guess is the power supply does not have enough charge in the capacitor to not drop the USB power but it might be enough for the motherboard. The keyboard when it get a interrupt in the power may in effect push a key as it comes online.

Maybe a different keyboard would not do it but it is not likely a option to replace your keyboard for this issue.

The real solution is expensive and called a online/double conversion UPS. These pretty much always run on the batteries so there is not even a tiny outage.

I suspect you are just going to have to tolerate this issue.
 
  • Like
Reactions: theintel
Something is likely being too "smart?". Most UPS you see people have are what are called strandby UPS. These detect a outage and then switch over to battery. This is extremely short time and most equipment has capacitors that are mostly used to filter the power but they also act as a small battery.

When you are running in sleep mode on most pc the power supply is pretty much off. It is still providing the 5v standby power which it does even if you shut the machine down. This is the power that the USB device are using. My guess is the power supply does not have enough charge in the capacitor to not drop the USB power but it might be enough for the motherboard. The keyboard when it get a interrupt in the power may in effect push a key as it comes online.

Maybe a different keyboard would not do it but it is not likely a option to replace your keyboard for this issue.

The real solution is expensive and called a online/double conversion UPS. These pretty much always run on the batteries so there is not even a tiny outage.

I suspect you are just going to have to tolerate this issue.
Thanks for the explainer. I learned a lot from this. Now I understand why the GPU power LED stays on even after shutting down the PC. If I understand correctly - during brief power outage, the PSU isn't providing enough power over USB and the keyboard is briefly losing power and causing a keystroke afterwards. But why does my PC refuse to sleep when the UPS is providing battery power? A post that I read (https://superuser.com/a/634510/756382) is hinting that voltage fluctuations in USB 5V during momentary power loss can appear as an input signal to the PC. If that's the case, is it possible that my UPS' battery is not providing enough consistent power for the PSU to maintain a stable USB 5V?
 
What I tend to do with my machines is use the sleep option so I don't lose all the open apps and screen layouts. After the machines goes into sleep mode I turn the power off with the switch. This is mostly because I am not going to use the machine for while. You still have to push the power button to start the machine but it boots as thought you woke it from sleep.

Not sure why it works this way but this is one of the cases where I think windows is being smart.