An electronic device and method are disclosed, the electronic device including a variable detection module operable in a plurality of modes, each of the plurality of modes configuring the variable detection module to detect a different external signal; and a controller. The controller may implement the method, including operating the variable detection module in one of the plurality of operating modes, and executing a function of the electronic device in response to a signal detected by the variable detection module.