Apparatus (20) is provided comprising a skin-application portion (40), configured to move across skin of a subject. At least one acoustic element (50) is coupled to the skin-application portion (40) and configured to be placed in acoustic contact with the skin, and configured to apply ultrasound energy to the skin. The apparatus (20) additionally comprises circuitry configured to generate a current responsive to motion of the skin-application portion (40) and a control unit (10), which is configured to receive the current, to determine, responsive thereto, whether the skin-application portion (40) is moving with respect to the skin, and to drive the acoustic element (50) to apply the ultrasound energy to the skin responsive to determining that the skin-application portion (40) is moving with respect to the skin. Other embodiments are also described.