The present invention introduces a method for controlling the power of an electric vaporizer (100), i.e. an electronic cigarette. In the method, the resistance of the heating unit (104) of the vaporizer (100) is measured. The system includes a controller (200) and a memory (202), and the latter comprises a table where values of resistances and their corresponding default voltage or power values are stored. Additionally, minimum and maximum limit values of the voltages or powers may be stored. Based on the measured resistance, a suitable power or voltage value is determined. The power source is set to feed the heating element (106) according to the selection. The user may however set the voltage or power input smaller or larger through the input means, comprising button(s) and a screen, despite the resistance value, but set limit values are not allowed to be exceeded.