Algorithms capable of accurately detecting inspiratory activity in respiratory muscles may serve to time the triggering of implantable pacemakers or mechanical ventilators, and thus, may improve the quality of life for many individuals requiring assisted ventilation by matching ventilation to physiological demands while minimizing interference with other behaviors (e.g., talking or swallowing). We are developing an algorithm to detect the timing (onset and duration) of inspiratory events from the electromyogram (EMG) signal. Even following paralysis of the phrenic nerves and diaphragm muscle, more upstream sites still contain neural activity that reflects the intrinsic inspiratory drive from the brain. Using these signals to control the onset of assisted inspirations would help match ventilation to physiological drive. As a platform to develop inspiration detection algorithms for testing of this concept, EMG signals of the diaphragm of rats during natural cycles of inspirations were analyzed. A state-machine was utilized for classification. Inspirations were detected with ∼98% accuracy in anesthetized and awake rats. Following detection of inspiratory events by the algorithm, ∼80% of the inspiratory burst durations still remained, allowing for treatments, such as functional electrical stimulation (FES), to induce muscle contractions for inspiration. Application of this algorithm with EMG signals of more upstream inspiratory muscles may prove useful in cases of bilateral diaphragm paralysis as a result of phrenic nerve injury or tetraplegia.