Control unit for a vehicle, the vehicle comprising: - at least one primary drive for actuation by a rider; - a power-train for driving a wheel of the vehicle, whereby the powertrain comprises a gear unit with a gear control for changing the gear ratios of the gear unit, the gear unit comprising gears and a gear control unit, whereby the gear control unit comprises a shifter, with which a change of gear ratio of the gear unit is manually selectable; - an electric motor for supporting the primary drive by providing torque; - whereby the control unit is constructed for controlling the torque provided by the electric motor and for reducing the torque provided by the electric motor during a change of the gear ratio, when a torque being provided by the primary drive is below a first threshold value, wherein the control unit comprises a Bowden cable for actuating the gears, the Bowden cable having an inner cable and a housing and a measurement circuit for measuring a movement of the inner cable, the measurement circuit being provided for outputting a signal for indicating a coming gear change if a movement of the inner cable is measured, an optical sensor for determining a movement of the inner cable, the optical sensor comprising - a sleeve that interrupts the housing, such that a part of the inner cable runs within the sleeve, the part of the inner cable that runs within the sleeve comprising an attachment that is fixed to the inner cable, - a light beam sender and a light beam receiver that are provided in the sleeve, both being in fixed positions relative to the sleeve, the attachment comprising dents and elevations, which are provided between the dents, such that a diameter of the attachment changes several times in a longitudinal direction of the attachment, wherein the light beam receiver receives light from the light beam sender if there is a dent between the light beam sender and the light beam receiver, and wherein the light beam receiver does not receive light from the light beam sender if there is an elevation between the light beam sender and the light beam receiver. - at least one primary drive for actuation by a rider; - a power-train for driving a wheel of the vehicle, whereby the powertrain comprises a gear unit with a gear control for changing the gear ratios of the gear unit, the gear unit comprising gears and a gear control unit, whereby the gear control unit comprises a shifter, with which a change of gear ratio of the gear unit is manually selectable; - an electric motor for supporting the primary drive by providing torque; - whereby the control unit is constructed for controlling the torque provided by the electric motor and for reducing the torque provided by the electric motor during a change of the gear ratio, when a torque being provided by the primary drive is below a first threshold value, wherein the control unit comprises a Bowden cable for actuating the gears, the Bowden cable having an inner cable and a housing and a measurement circuit for measuring a movement of the inner cable, the measurement circuit being provided for outputting a signal for indicating a coming gear change if a movement of the inner cable is measured, an optical sensor for determining a movement of the inner cable, the optical sensor comprising - a sleeve that interrupts the housing, such that a part of the inner cable runs within the sleeve, the part of the inner cable that runs within the sleeve comprising an attachment that is fixed to the inner cable, - a light beam sender and a light beam receiver that are provided in the sleeve, both being in fixed positions relative to the sleeve, the attachment comprising dents and elevations, which are provided between the dents, such that a diameter of the attachment changes several times in a longitudinal direction of the attachment, wherein the light beam receiver receives light from the light beam sender if there is a dent between the light beam sender and the light beam receiver, and wherein the light beam receiver does not receive light from the light beam sender if there is an elevation between the light beam sender and the light beam receiver.