Math Bridge: GPIO Fan Driver Current Chain

← Back to Electronics and Circuits
Math BridgeElectronicsStruggle-friendly runway

How does a GPIO command a 300 mA fan safely?

Carry load current through drive, loss, and sensing checks.

Eddie, the electronics guideEddie guides
The one targetSeparate a logic command from the load-current path.
The chapter case300 mA fan, 12 mA GPIO, β=100 BJT estimate, 22 mΩ MOSFET, and LM35 ADC.
What it buys youA first-pass switch and threshold ledger before parts are qualified.

A field team faces an unresolved physical question: How does a GPIO command a 300 mA fan safely? They must answer it before changing fan current on the real device. Predict the direction first.

See the relationship before changing it

The figure reads from left to right. The blue card is fan current. The middle card applies this page's relationship. The green card is gpio overload ratio. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This added model holds every other chapter fixture fixed, so the numeric fixture does not switch without explanation.

Fan current changes gpio overload ratio An input card leads through the page relationship to the gpio overload ratio result. SET INPUT ONE CONTROL APPLY RULE predict calculate check units READ RESULT
Walk the arrows. The control varies the power path while preserving the sensing contract, making clear which values belong to load selection and which belong to temperature measurement.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline for fan current is 300.

  2. 2

    Name the relationship. GPIO ratio=300/12=25.0x Ib=300/100=3.00 mA Rb=(3.3-0.7)/0.003=867 ohm PMOSFET=(0.300)²(0.022)=1.98 mW ADC thresholds: 30°C→372, 28°C→347, gap=25 counts

  3. 3

    Substitute the chapter fixture. Set fan current to 300. The page ledger gives gpio overload ratio as 25.00 times.

  4. 4

    Read the result. Keep times beside the value. Use it only inside the technical boundary on this page.

Predict, then change fan current

Try Predict the direction of gpio overload ratio. Move one control, calculate, then check your prediction.

300
Chapter baseline
GPIO overload ratio

Observe The control varies the power path while preserving the sensing contract, making clear which values belong to load selection and which belong to temperature measurement. Reset the control to 300 and compare gpio overload ratio.

Explain Only fan current moves here. The other chapter fixtures remain fixed.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only fan current moves. Field effects named in the page's technical boundary stay fixed.

1. Start with the physical story

The GPIO supplies information and a small drive current. The transistor controls a separate path that carries fan current. A BJT needs base drive; a MOSFET dissipates channel loss. Separately, the ADC turns LM35 voltage into the counts that command on/off thresholds.

Eddie: The fan current never becomes safe by wishing the GPIO stronger. It needs a rated switch, supply path, and protection.

2. Name every algebra move

1

Compare current limitsDivide load current by 12 mA.

2

Estimate BJT driveIb=Ic/β, then Rb=(3.3−0.7)/Ib.

3

Estimate MOSFET heatP=I²RDS(on).

4

Cross-check relay currentI=12 V/400 Ω.

5

Map temperature to codesUse 10 mV/°C and a 12-bit 3.3 V ADC.

3. Reproduce the chapter case

GPIO ratio=300/12=25.0×
Ib=300/100=3.00 mA
Rb=(3.3−0.7)/0.003=867 Ω
PMOSFET=(0.300)²(0.022)=1.98 mW
ADC thresholds: 30°C→372, 28°C→347, gap=25 counts

The calculations explain the chapter's approximate 820 Ω standard BJT resistor and tiny nominal MOSFET conduction loss, but neither number alone selects the switch.

4. Try one real input

TryMove fan current from light load toward stall and predict drive and heat.

Fan current
GPIO overload ratio
BJT base current
BJT base resistor
MOSFET channel loss
Relay coil current
ADC step
LM35 step
Fan-on code
Fan-off code
Hysteresis gap

ObserveLoad ratio and base current rise linearly; the base-resistor estimate falls; MOSFET conduction loss rises with current squared. ADC thresholds stay fixed.

ExplainThe control varies the power path while preserving the sensing contract, making clear which values belong to load selection and which belong to temperature measurement.

Technical boundaries.

This ledger uses nominal DC values and a forced-gain estimate, not a transistor qualification.

Switch
Check stall/inrush, SOA, VGS drive, saturation, gain spread, switching loss, and thermal derating.
Load path
Supply sag, wiring, flyback protection, EMI, connector, and fuse ratings matter.
Sensing
ADC calibration, attenuation, reference error, LM35 accuracy, noise, and hysteresis timing matter.

Correct, not complete: this ledger does not qualify a transistor, relay, fan path, or temperature controller.

5. Use the result in the design

Design for stall current and switching transients, choose a logic-level switch with thermal margin and protection, then calibrate the LM35/ADC path and verify hysteresis under noise.

6. Record the evidence state

Record fan running/stall current, supply sag, GPIO drive, switch part/temperature/loss, protection waveform, ADC calibration, sensor error/noise, threshold counts, and measured switching behaviour.

7. Check yourself

Why is the 300 mA fan not a direct GPIO load?
Answer: It needs 25 times the chapter's 12 mA GPIO limit even before stall current.
Why does MOSFET loss rise faster than current?
Answer: The nominal conduction model is P=I²R, so doubling current quadruples loss.
Does the 867 Ω estimate qualify a 2N2222?
Answer: No. Real saturation drive, gain spread, GPIO current, stall current, SOA, and heat must be checked.
Honesty boundary.

The arithmetic reproduces the chapter's 300 mA fan, β=100, 22 mΩ MOSFET, 400 Ω relay, and 30°C/28°C ADC examples.

Switch
Check stall/inrush, SOA, VGS drive, saturation, gain spread, switching loss, and thermal derating.
Load path
Supply sag, wiring, flyback protection, EMI, connector, and fuse ratings matter.
Sensing
ADC calibration, attenuation, reference error, LM35 accuracy, noise, and hysteresis timing matter.

Correct, not complete: this ledger does not qualify a transistor, relay, fan path, or temperature controller.