A detachable cap for measuring usage of an inhaler includes a hollow receiving portion adapted to removably receive the inhaler. A vent is formed in a roof portion of the cap to allow airflow through the cap to the inhaler. An extension portion is provided for containing electronic components including an electronic circuit provided in the extension portion the electronic circuit including a controller coupled to a storage device and a power source. A pressure sensor is provided adjacent to the vent the pressure sensor communicatively coupled to the controller and adapted to detect an air pressure within the cap. The controller is programmed to calculate an air flow rate through the cap based on the detected air pressure and to store the calculated air flow rate in the storage device.