Control over ventilation is regulated by nervous system input from neurons called ventilation centers in the medulla oblongata, which causes regular contraction of the respiratory muscles. These neurons contain chemoreceptors that are sensitive to CO2 concentration in the blood and monitor pH in order to maintain homeostasis. These neurons can control ventilation and breathing through the cerebrum and make it more or less rapid depending on the relative levels of carbon dioxide (waste gas).
Extended periods of hypo or hyperventilation would lead to increase carbon dioxide levels and eventually a medulla override. Mostly ventilation is driven by CO2 concentration. Not until, O2 levels fall very low does hypoxia drive ventilator response.
See Nervous System