Dispensing systems for a ventilator circuit having a ventilator flow circuit with a normal inhalation flow path with a heat and moisture exchanger (HME), a flow sensor in communication with the ventilator circuit, an automated drug dispensing system with an actuator and a pressurized canister residing upstream of the HME, a bypass inhalation flow path residing downstream of the pressurized canister, and at least one electromechanical valve residing in the inhalation flow path to selectively open the valve which can be normally closed to define a closed bypass path. At least one controller opens the at least one electromechanical valve to open the bypass inhalation flow path and close the normal inhalation flow path through the HME only when the flow sensor indicates air flow is in an inhalation direction. Once the valve is open, the actuator dispenses medication through the bypass inhalation flow path to the patient.