System and method for diaphragmatic stimulation

System for diaphragmatic stimulation with: a programmable stimulation device for stimulating a diaphragm; a designed for detecting a tidal volume flow sensor; one designed for connection to the flow sensor and the programmable pacing device programmer; and wherein the programmable pacing device is programmed by the programmer to provide the diaphragm a stimulation waveform, which corresponds to a detected by the flow sensor normal tidal volume.