The invention relates to a device and method for measuring the quantity of an agricultural product comprising at least one ultrasonic transducer device configured to measure the height of the agricultural product with respect to a ground. At least two ultrasonic transducers configured to allow the orientation or slope of the ground to be calculated, such that the at least three transducers can be at arbitrary orientations with respect to the ground when the device is in motion.