This invention is an expendable container capable of measuring a residual
quantity of stored expendable. The expendable container comprising an
expendable tank configured to store the expendable and has a
piezoelectric element attached thereto; a detection signal generation
circuit configured to charge and discharge the piezoelectric element, and
generate a detection signal including cycle information, the cycle
information representing a cycle of an output voltage wave of the
piezoelectric element after the discharge; and a control module
configured to control the charge and the discharge of the piezoelectric
element by the detection signal generation circuit. The detection signal
generation circuit comprises: a comparator configured to compare a
voltage of the output voltage wave with a reference voltage for residual
quantity detection, and generate a pulse according to a result of the
comparison; and a signal generator configured to generate the detection
signal in response to the generated pulse. The control module is capable
of varying the reference voltage for residual quantity detection.