Ada Audits the Circuit Budget

Ada re-derives this chapter’s own numbers step by step, at full precision

foundations
math-foundations
calculation-audit
electronics
beginner
Ada ADA · CALCULATION AUDIT

Ada Audits the Circuit Budget

The chapter works a real gas-sensor circuit: a voltage divider that must stay under 3.3 V, an LED resistor of 120 ohms, and a duty-cycled node that a 2000 mAh cell runs for about 19.5 hours — while an MQ-135 heater dominates power at 71%. A circuit formula is useful only when the units close. This audit keeps voltage, current, power, and time in one ledger across the whole circuit budget.

Companion to the chapter Electricity in Real IoT Circuits — every number here comes from that chapter.

A circuit formula is useful only when the units close. Before trusting a divider, LED resistor, or battery-life claim, keep voltage, current, power, and time in the same ledger.

Check Arithmetic from this chapter Design implication
Divider over-voltage check 5 V x 2.2 / (1.0 + 2.2) = 3.4375 V, so the first 1 kOhm + 2.2 kOhm trial rounds to 3.44 V. That is about 0.14 V above a 3.3 V input, so the warning is real.
Adjusted divider 5 V x 2.2 / (1.5 + 2.2) = 2.97297 V; 5 V / 3.7 kOhm = 1.351 mA. The adjusted ratio protects the input but still burns about 1.35 mA continuously.
Battery-scale divider Scaling to 15 kOhm + 22 kOhm keeps the ratio; 5 V / 37 kOhm = 0.135 mA = 135 uA. Higher values save current, but the chapter's loading rule must still be checked against ADC input impedance.
DHT22 interface 5 V x 3.3 / 5.1 = 3.235 V; 5 V / 5.1 kOhm = 0.980 mA; 5 V x 0.000980 A = 4.90 mW. The example lands inside the 3.3 V range and makes the standby power cost explicit.
LED resistor -- separate 5 V example (5 V - 2 V) / 0.020 A = 150 Ohm. With 220 Ohm, I = 3 V / 220 Ohm = 13.6 mA and P = I^2R = 0.0409 W. This is the chapter's earlier general-purpose LED calculation on a 5 V rail -- not the MQ-135 sensor node's own LED below. The standard 220 Ohm option is dimmer, cooler, and still comfortably under a 1/8 W resistor rating.
MQ-135 sensor-node LED (KVL) 3.3 V - 2.1 V = 1.2 V across the resistor; 1.2 V / 0.010 A = 120 Ohm. P = I^2R = (0.010 A)^2 x 120 Ohm = 0.012 W. This is the gas-sensor node's own LED loop on its 3.3 V rail -- the 120 Ohm result the header cites, comfortably under a 1/8 W resistor rating.
Duty-cycle power lab -- separate ESP32+DHT22+LoRa example Active time = 0.1 s + 2 s + 0.5 s = 2.6 s; 2.6 / 300 = 0.008667 = 0.867%. Component averages sum to about 1.641 mA. This is a different lab from the chapter with no MQ-135 heater. 2000 mAh / 1.641 mA = 1218.8 h = 50.8 days, which supports the chapter's own 51-day estimate for that scenario -- not the gas-sensor node's runtime below.
MQ-135 sensor-node KCL rail current Two pull-ups: 2 x (3.3 V / 4.7 kOhm) = 1.404 mA. Rail total: 80 + 1 + 10 + 1.404 = 92.404 mA. The 92.4 mA regulator load is the 3.3 V rail only; the 5 V heater is a separate power term.
MQ-135 sensor-node heater dominance and runtime Power total = 264 + 3.3 + 33 + 4.6 + 750 = 1054.9 mW; 750 / 1054.9 = 71.1%; 7.4 Wh / 1.0549 W = 7.02 h. Heater at 30/300 duty gives 75 mW, so 7.4 Wh / (0.3049 W + 0.075 W) = 19.5 h if other loads stay active. The physics says heater duty-cycling helps, but the system only reaches longer runtimes -- the 2000 mAh / 19.5 h the header cites -- when the microcontroller and sensors also sleep.

Use this audit as a unit ledger. Change any resistor, duty cycle, sensor current, or battery derating assumption, and the runtime claim must be recalculated from the measured values.

Every number above is taken from the chapter’s own material and re-derived step by step.