The present invention introduces a method for controlling the power of an electric vaporizer, i.e. an electronic cigarette. In the method, the resistance of the heating unit of the vaporizer is measured. The system includes a controller and a memory, 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 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.