Finalize the sensor.