The invention relates to a sensor (1) and a method for measuring pressure, variation in sound pressure, a magnetic field, acceleration, vibration, or the composition of a gas. The sensor (1) comprises an ultrasound transmitter (2), and a cavity (4) arranged in connection with it. According to the invention, the sensor (1) comprises a passive sensor element (3, 3') located at the opposite end of the cavity (4) to the ultrasound transmitter (2), the distance of which from the ultrasound transmitter (2) is selected in such a way that the resonance condition is met at the ultrasound frequency used, the ultrasound transmitter (2) comprises a light-construction diaphragm oscillator (9), which is thus well connected to the surrounding medium, and the sensor includes means for measuring the interaction between the ultrasound transmitter (2) and the cavity (4).