Patent ID: 8239148

Claim:
A state switching device for switching states of an electronic device by detecting a battery voltage of the electronic device, the state switching device comprising: a voltage dividing circuit configured to detect the battery voltage and provide an output voltage in proportion to the battery voltage; and a detection unit comprising: a storage module configured to store detection cycle parameters, predetermined detection times and at least one reference voltage corresponding to at least one state of the electronic device respectively, the detection cycle parameters defining a normal time interval and an abnormal time interval; a voltage detection module working in a normal detection mode or an abnormal detection mode, the voltage detection module being configured to obtain and convert the output voltage to a digital detection voltage at the normal time intervals in the normal detection mode, and obtain and convert the output voltage to the digital detection voltage at the abnormal time intervals in the abnormal detection mode; a comparison module configured to respectively compare the digital detection voltage produced in the normal detection mode with a reference voltage corresponding to a current state of the electronic device and a predetermined number of digital detection voltages produced in the abnormal detection mode with the reference voltage corresponding to the current state of the electronic device to produce comparison results; and a control module configured to control the voltage detection module to enter the abnormal detection mode when the comparison result reflects that the detection voltage produced in the normal detection mode is lower than the reference voltage corresponding to the current state of the electronic device; and further configured to maintain the current state of the electronic device when a majority of comparison results reflect that the digital detection voltage produced in the abnormal detection mode is equal to or higher than the reference voltage corresponding to the current state of the electronic device.