A control unit for controlling the operation of a nebulizer is provided that is configured to measure the impedance of an actuator in the nebulizer and to determine whether a nebulizing element in the nebulizer is positioned correctly with respect to the actuator on the basis of the measured impedance. Also provided is a nebulizer comprising a reservoir chamber for storing a liquid to be nebulized an actuator for vibrating liquid stored in the reservoir chamber and a control unit as described above.