1. Technical Field
Embodiments of the present disclosure generally relate to control devices and methods, and more particularly to a device and method for controlling power switches to be switched on or off.
2. Description of Related Art
Currently, energy-saving and emission-reduction are advocated. For example, a person who is the last out of the office needs to turn off the lights and other devices. If the person forgets, much electricity can be wasted.
In general, the data “module,” as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, for example, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as an EPROM. It will be appreciated that modules may comprised connected logic units, such as gates and flip-flops, and may comprise programmable units, such as programmable gate arrays or processors. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of computer-readable medium or other computer storage device.
In the exemplary embodiment, the room has at least one entry/exit door 11 leading to an exterior of the room (two doors 11 are shown in
The sensors 110, are configured to monitor an area near the door 11 where a user of the door 11 must pass through. As such, the sensors 110 can sense the body heat of any user passing through the doorway, and further, depending on the order the sensors 110 detect body heat can determine whether the person is entering or exiting the room.
Upon the condition that the first sensor (such as A or C) and the second sensor (such as B or D) senses a person gets through the door 11, a first record of the person is generated by the first sensor, and a second record of the person is generated by the second sensor. The determination module 100 obtains the first record and the second record, and determines whether the person enters or exits the room by comparing a record time of the first record with that of the second record.
In one example, if the second sensor senses the person before the first sensor, the determination module 100 determines that the person enters the room. In another embodiment, if the first sensor senses the person before the second sensor, the determination module 100 determines that the person exits the room.
Upon the condition that the person enters the room, a count of the counter 102 is incremented by one. If the count is changed to one from zero, the transmission module 104 may send a power-on command to the control chip 12 to switch the power switch 2 on, to turn on the electronic device 3.
Upon the condition that the person exits the room, the count of the counter 102 is decremented by one. If the count value is changed to zero from one, the transmission module 104 may send a power-off command to the control chip 12 to switch the power switch 2 off, to turn off the electronic device 3.
Once a person gets through the door 11, in block S01, the first sensor and the second sensor sense the person. When the person is sensed, the first sensor generates a first record of the person, and the second sensor generates a second record of the person.
In block S02, the determination module 100 obtains the first record and the second record, and determines which sensor senses the person earlier by comparing a record time of the first record with that of the second record, to determine whether the person enters or exits the room. If the first sensor senses the person before the second sensor, the flow goes to block S10. If the second sensor senses the person before the first sensor, the flow goes to block S20.
In block S10, the determination module 100 determines that the person exits the room. In block S12, a count of the counter 102 is decremented by one. In block S14, the counter 102 determines whether the count equals zero. If the count does not equal to zero, the flow ends. If the count equals zero, in block S16, the transmission module 104 sends a power-off command to the control chip 12 to switch off the power switch 2, to turn off the electronic device 3.
In block S20, the determination module 100 determines that the person enters the room. In block S22, the count of the counter 102 is incremented by one. In block S24, the counter 102 determines whether the count is changed to one from zero. That is, the counter 102 determines whether the count equals one. If the count is not changed to one from zero, the flow ends. If the count is changed to one from zero, in block S26, the transmission module 104 sends a power-on command to the control chip 12 to switch on the power switch 2, to turn on the electronic device 3.
Although certain inventive embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201010261281.8 | Aug 2010 | CN | national |