An electrically power assisted bicycle, comprising: an electric motor configured to generate an assist force assisting human power of a rider; a detachable battery configured to supply electric power to the electric motor ; and a headlight ; and an operation panel including a display device configured to display information, a power button configured to be usable to turn on or off the electrically power assisted bicycle, an illuminance sensor configured to output a signal in accordance with received light, and a microcontroller configured to control the headlight to be on or off; wherein: the power button and the illuminance sensor are located adjacent to each other on or in the operation panel ; and after a predetermined time period passes after the microcontroller is activated by the power button being pressed by the rider, the microcontroller is configured to start controlling the headlight to be on or off in accordance with the signal output by the illuminance sensor , wherein when the rider presses the power button in a state where the electrically power assisted bicycle is in a power-off state, a regulator starts operating and thus the electric power is supplied to the microcontroller from the detachable battery , the microcontroller supplied with the electric power from the detachable battery is configured to start an activation process, and upon starting the activation process, the microcontroller is configured to read a computer program stored on a ROM and is configured to develop the computer program in a RAM , the microcontroller is put into a state of accepting operations on assist force setting buttons , a switch button and a headlight button , thereby finishing the activation process, wherein the activated microcontroller is now capable of transmitting or receiving data to or from a control device or displaying various types of information on the display device , characterized in that the activated microcontroller is configured to start counting time, after the activation process is finished, by use of a counter and is configured to accumulate count values, the microcontroller is configured to determine whether or not the predetermined time period has passed from the start of the time count, upon starting the control on the headlight to be on or off, after the predetermined time period has passed from the start of the time count, the microcontroller is configured to receive an output signal from the illuminance sensor and is configured to start performing a process of determining whether or not to turn on the headlight in accordance with the output signal, the microcontroller is configured to turn on or off the headlight in accordance with the determination result, wherein when the output signal from the illuminance sensor is kept at an illuminance level higher than, or equal to, the predetermined level, the microcontroller directly performs a process of turning the headlight in an off state and wherein when the output signal from the illuminance sensor is kept at an illuminance level lower than the predetermined level, the microcontroller directly performs a process of turning the headlight in an on state, and while the electrically power assisted bicycle is in the power-on state, the process of determining whether or not to turn on the headlight is continued, and when the power button is pressed to turn off the electrically power assisted bicycle, the microcontroller is configured to be also turned off and the process is finished and immediately after the electrically power assisted bicycle is turned off, the headlight is in an off state. <EOS>