A method for monitoring input power to a motor controller of an electric motor (10; 100; 160), said method comprising: determining, with a processing device (176, U9), i.e. a microcontroller / microprocessor, an average input current to the motor (10; 100; 160) by performing integration on a voltage drop across a shunt resistor (162, R54) in series with the motor (10; 100; 160) with respect to time; measuring at least one voltage with a voltage sensing circuit; determining, with the processing device (176, U9), an average input voltage applied to the motor (10; 100; 160) based on the at least one measured voltage; multiplying the average input current by the average input voltage to determine an average input power; and setting a maximum power limit for the protection of the microcontroller / microprocessor (176, U9) for increased reliability based on the average input power, wherein the microcontroller / microprocessor (176, U9) is further protected with a clamping diode from voltage spikes; and wherein an average current detector arranged for measuring the input current consists of a two-stage operational amplifier, which comprises: - an integrator as a first stage, which includes a time constant determining resistor and capacitor, a gain setting resistor, two offset bias resistors (R78, R79), and high frequency noise filtering capacitors (C8, C34, C35), and two resistors (R8, R9) for coupling the voltage across the shunt resistor (162, R54) to the inputs (2, 3) of the integrator; and - an amplifier as a second stage, which includes two gain setting resistors (R58, R59), connected to the negative input terminal of the amplifier, and two loading resistors (R81, R63), connected to the output terminal of the amplifier, wherein an output terminal of the integrator is connected to the positive input terminal of the amplifier through an input balancing resistor; and wherein the voltage sensing circuit comprises a voltage divider formed by a plurality of resistors (R1, R2, R3, R4, R26), a coupling resistor and two bias resistors (R90, R91). determining, with a processing device (176, U9), i.e. a microcontroller / microprocessor, an average input current to the motor (10; 100; 160) by performing integration on a voltage drop across a shunt resistor (162, R54) in series with the motor (10; 100; 160) with respect to time; measuring at least one voltage with a voltage sensing circuit; determining, with the processing device (176, U9), an average input voltage applied to the motor (10; 100; 160) based on the at least one measured voltage; multiplying the average input current by the average input voltage to determine an average input power; and setting a maximum power limit for the protection of the microcontroller / microprocessor (176, U9) for increased reliability based on the average input power, wherein the microcontroller / microprocessor (176, U9) is further protected with a clamping diode from voltage spikes; and - an integrator as a first stage, which includes a time constant determining resistor and capacitor, a gain setting resistor, two offset bias resistors (R78, R79), and high frequency noise filtering capacitors (C8, C34, C35), and two resistors (R8, R9) for coupling the voltage across the shunt resistor (162, R54) to the inputs (2, 3) of the integrator; and - an amplifier as a second stage, which includes two gain setting resistors (R58, R59), connected to the negative input terminal of the amplifier, and two loading resistors (R81, R63), connected to the output terminal of the amplifier, wherein an output terminal of the integrator is connected to the positive input terminal of the amplifier through an input balancing resistor; and