Some good info here, but quite a bit that I hope I can clarify a bit. Warning that this may get to be a long post. Please let me know if something doesn't sound right & I'll dig up references if need be. Always happy to stand corrected.
First, it's important to note that there are two separate controls of breathing at the brain level...(1) voluntary (this is you attempting to hold your breath, actively think about breathing, etc.) which is controlled by the cerebral cortex; and (2) automatic (the usual daily grind of "breathe in-breathe out" that most of us thankfully don't have to think about) which is controlled by the brainstem (pons/medulla).
I bring this up first, because the extremes of pCO2 rising & pO2 falling ("shallow water blackout") are the products of voluntary breathing (i.e., breath-holding) to the "breaking point" - i.e., when you just can't hold it anymore.
Now, as to the USUAL regulation of breathing. Breathing is controlled by the brainstem, which is influenced by chemical & nonchemical stimuli. Let's just stick w/ the chemical, because that's what we're mostly interested in. The chemical signals that lead to increased ventilation are: (1) rise in blood pCO2 (this is the DISSOLVED CO2 in the blood stream); (2) rise in blood or CSF H+ concentration (i.e., reduced pH); and (3) reduction in blood pO2 (dissolved O2).
Blood pH, pCO2, and pO2 are sensed by clusters of cells at the branching of the carotid arteries & at the root of the aorta. The
primary overall driving force is the dissolved CO2 in the blood. This has been shown in studies of carotid chemoreceptor denervation, that essentially abolishes the ventilatory response to pH & pO2, but leaves the response to pCO2 intact (only 30-35% affected). Obviously, pCO2 is influencing other systems...which I'll get to in a second.
Interestingly, the carotid & aortic chemoreceptors are NOT affected by anemia, as the blood flow to these receptors is so incredibly large they actually get all their oxygen needs from the dissolved oxygen in the blood; they don't rely on hemoglobin-bound oxygen at all, and therefore don't respond to it
Now, Larry pointed out that the bicarbonate buffer system is the primary system in the body for dealing with CO2 & attempting to keep pH stable. In short, CO2 + water combined to form bicarbonate (HCO3-) & a hydrogen ion (H+). Bicarbonate, however, has no impact on ventilatory drive. Hydrogen ion does have some impact on the chemoreceptors, but this is actually separate from the effect of dissolved pCO2.
Dissolved pCO2 can rapidly cross the blood-brain barrier, diffusing into the interstitial fluid of the brain & the cerebrospinal fluid (CSF). H+ & HCO3- in the blood, however, cannot cross this barrier. pCO2 in the CSF then combines with water once again, and it is the resultant new H+ ion formed that has a profound effect on the medullary chemoreceptors. In fact, in experimental models where the pCO2 of the CSF was varied while holding H+ constant, there was little effect on ventilation. Any change of the H+ concentration, however, profoundly affected ventilatory drive.
To address pO2 briefly.... pO2 can fall to the point of stimulating ventilation, but this usually occurs at a level < 60mmHg, which is quite low (especially at depth!). There is actually increased firing of the chemoreceptors when pO2 falls < 100mmHg, but ventilation is not stimulated until < 60mmHg for reasons that I'd be happy to explain if anyone actually wants more.
Bottom line, however, is that none of this really matters all that much at depth, since CO2 is simply the metabolic waste product of aerobic metabolism; so, your production of CO2 at depth is the same as it would be on the surface should you do the same amount of work. Since CO2 is so rapidly diffusable, you just blow it off at depth, just as you do on the surface. If CO2 was in your breathing mix, it's a whole different story....in that case, when partial pressure of inhaled CO2 approaches that of the partial pressure of alveolar CO2, elimination becomes difficult & you are left with CO2 blackout. As long as CO2 isn't in your breathing mix, depth should not affect your breathing.
So, corrections (as I see them) to the previous posts are: (1) there aren't "CO2 sensors" in the lungs; (2) the "relative" amount of CO2 doesn't matter; (3) while the majority of CO2 is actually circulated in the form of bicarbonate, it
is actually dissolved CO2 (& hydrogen ion) that have the impact on ventilation.
Jim