1 ... Mark's answer is correct but may not fully answer your question.
The following provides a formula for calculating R2 for a given Vbattery.
- R2 = (Vb - 2.5) x R2 / 2.5
See below for details.
2 ... The circuit as shown is "dangerous" because it takes advantage of a "shortcoming" of the 2N7000 MOSFET which is not present in all MOSFETS.
Substitution of a FET with a lower turn on gate voltage (Vth or Vgs_th) may lead to an alarm that is always on or that draws some current at all times.
Unlike a bipolar transistor or MOSFET the TL431's Cathode (positive terminal) is NOT pulled to or even near ground voltage when the device is on. A typical specification sheet advises that anode voltage of a TL431 will fall to approximately no lower than it's gate voltage of 2.5V when turned on. In practice the voltage may be almost a diode drop below this (about 1.9V) but no data sheet ever advises this and it cannot be relied on.
With 2.5V applied to its gate a 2N7000 MOSFET is turned off. Typically 3V is required to cause it to conduct somewhat and 4V or more is needed for reasonable conduction.
Datasheet: http://bit.ly/DS_2N7000
The TL431 changes from non conducting to conducting when its gate is raised to or above its internal reference voltage of 2.5 Volt.
Vb (Vbattery) is divided by RA & R2 and applied to the gate.
OR when the gate is JUST at the trip point
- R2 = (Vb - 2.5) x R2 / 2.5
The writer has nominated 6V as the low battery point for 2 cells and at 9 volts when 3 cells are used. The "best" trip point depends somewhat on loading. Heavily loaded cells have a lower loaded voltage for a given state of discharge. I would personally suggest a slightly higher trip point unless cells are heavily loaded if maximum cell life is desired.
Sensibility check:
Plug the available data into the above formula to see if it gives his answers.
R1 = 2.49k, Vb = 6V,
He has chosen the next highest standard value of 3.57k .
So results are the same. QED.
Note that the required tolerances are somewhat less than implied by the precision of the resistors used.