How does the rebreather know when to add Diluent or O2 to the loop?
A fully closed curcuit rebreather has O2 sensors and electronics which monitor the sensors to control the addition of Oxygen. As the pO2 drops below the set point a solenoid fires which injects O2 into the breathing loop. There is typically a set of three sensors which are polled with various schemes to be sure of maintaining the correct Oxygen partial pressure. Diluent is added as a function of loop volume, as you go deeper more is added to maintain the loop volume, on most units, if the counter-lung bottoms out, a mechanical valve is pressed to release more diluent into the counter lung loop.