A sleep timer for changing a power state of a device includes a detector, a memory, a sleep interval setting unit, a timer, and a power unit. The detector detects interactions between a user and an active device. The memory is linked to the detector and stores the historical user interaction data. Based on the historical user interaction data, the sleep interval setting unit adjusts the sleep timer's sleep interval. The timer determines a power changing point in time based on the sleep interval. At the power state changing point in time, the power unit initiates a power state change.