The Big Picture: Who Can Knock on the Door?

A sleeping person wakes for some knocks and ignores others: a fire alarm, yes; a passing car, no. A sleeping PC is the same. Only certain wake events are allowed to wake it, and Windows lets you see and control the list.

This matters because a PC that wakes by itself in the night (or never sleeps) usually has a wake event or a power request you did not know about.

10.1 What Can Wake a Sleeping PC

Wake sourceWhere it comes fromCommon?
Power buttonThe motherboard, on standby powerAlways
Keyboard or mouseA USB or PS/2 deviceYes (allowed per device)
Lid openA sensor in the laptopYes
TimerA scheduled task or Windows maintenanceYes
NetworkWake-on-LAN magic packet, or other network patternsOn some PCs
USB devicesA phone, hub or other devicePossible
Bluetooth devicesA paired keyboard or mousePossible
OtherModem ring, a PCI Express wake signalRare

How it works inside: each wake-capable device uses standby power to watch for its event (Chapter 4's +5 V standby rail). When the event happens, the device raises a wake signal. The firmware and acpi.sys (Section 1) tell Windows which device woke the PC, using the _PRW data in the tables.

10.2 Wake-on-LAN

What it is: Wake-on-LAN (WoL) lets another computer switch a sleeping PC on across the network. The sending computer transmits a special message called a magic packet: a block of data that contains the target network card's MAC address (its hardware ID, Chapter 27) repeated many times. A network card on standby power listens for it. If the address matches, it wakes the PC.

Other PC / phone app                       Sleeping PC (standby power)
     |   magic packet (MAC repeated)          network card is listening
     |------------------------------------->  match -> WAKE SIGNAL
                                              PC wakes (S3/S4/S5)

What you need (all three):

RequirementWhere
The firmware allows itA setting such as "Wake on LAN" or "Power on by PCIe" in the BIOS/UEFI setup (Chapter 5)
The driver allows itDevice Manager → network adapter → Power Management tab → "Allow this device to wake the computer" (and, if wanted, "Only allow a magic packet to wake the computer")
The network carries the packetUsually the wired network (Ethernet); Wi-Fi support is rarer and varies (hedge)

Safety note: Wake-on-LAN has no password in its basic form, so it works only on trusted networks. If you do not use it, leaving it off is a good habit.

10.3 Wake Timers

What it is: A wake timer is a clock alarm set by a program or Windows to wake the PC at a given time.

Typical sources:

SourceExample
Task SchedulerA task with "Wake the computer to run this task" ticked (Chapter 12 and Chapter 15)
Windows maintenance / UpdateAutomatic maintenance at night; update installs may be scheduled to wake the PC (Chapter 35)
Alarms and backup programsApps that run a job at a set time

The power plan has a setting Allow wake timers (Section 7) with values like Enable, Disable, or Important wake timers only. If your PC wakes at the same time every night, a wake timer is the likely cause.

See them (read-only):

powercfg /waketimers

It lists active wake timers: which program set it and when it will fire, or says there are none. You may need to run it in an administrator window on some PCs (hedge).

10.4 Device-Initiated Wake (USB, Keyboard)

What it is: A device can wake the PC itself. For example, pressing a key on a USB keyboard sends activity on the USB port; the USB controller tells the system to wake.

DeviceTypical behaviour
KeyboardUsually allowed to wake the PC
MouseUsually allowed; a moving or jittery mouse (or a laser mouse on a vibrating desk) can wake it by accident
USB hub or phoneSometimes allowed; a connecting device can cause a wake
Bluetooth devicesPossible if the adapter allows it

Control it per device: Device Manager (Chapter 14) → open the device → Power Management tab → untick "Allow this device to wake the computer" (this is a setting change; for the lab, only look). USB selective suspend (Section 8) is separate: it lets idle ports doze, but it does not decide who may wake the PC.

10.5 Finding Out What Woke the PC (Read-Only Commands)

CommandWhat it showsNotes
powercfg /lastwakeWhat woke the PC the last timeMay show a device, a timer or a reason code; it can be unclear after a full shutdown
powercfg /devicequery wake_armedThe devices currently allowed to wake the PCA list of device names
powercfg /devicequery wake_programmableDevices whose wake setting can be changedLonger list
powercfg /waketimersActive wake timersSee 10.3
powercfg /requestsWhat is stopping sleep right nowSee Section 3.6; may need admin

All of these only read. They do not change anything.

A simple detective path:

PC woke by itself?
   |
   +--> powercfg /lastwake         (who/what woke it)
   +--> powercfg /waketimers       (a scheduled alarm?)
   +--> powercfg /devicequery wake_armed   (which devices may wake it)
   |
   v
Then fix the cause: untick a device's wake option, or turn off the
task's "wake the computer" option, or set Allow wake timers = Disable.

Summary

TermPlain meaning
Wake eventAnything allowed to wake a sleeping PC
Wake-on-LANA magic packet containing the NIC's MAC address wakes the PC
Magic packetThe special wake message
Wake timerA scheduled alarm that wakes the PC
"Allow this device to wake the computer"Device Manager's per-device wake switch
powercfg /lastwakeShows the last wake source
powercfg /devicequery wake_armedLists devices allowed to wake the PC
powercfg /waketimersLists active wake timers