A method to deliver medication. The apparatus has an acoustic volume sensor that acoustically excites a reference volume and variable-volume chamber with an acoustic source and measures the acoustic response with microphones acoustically coupled to the reference and the variable-volume chamber. A disposable drug cassette is coupled to the acoustic volume sensor and includes a drug reservoir and valve. The method includes receiving a volume signal and inputs from a user input or a second sensor and controlling the valve based on these inputs.