Circuits

Will this LED fry, what is the ripple and how hot does the MOSFET get?

You ask

Will a blue LED on 5 V with a 47 ohm resistor fry?

Wobbl runs

Terminal
$ wobbl circuit led --set supply=5V --set resistor=47 --set led=blue

Checks

  • passhand calculation
  • passpower balance
  • infooperating limits

36.9 mA

LED current

FAILSThe LED fries: 36.9 mA through it, above its 30 mA rating (1.2x).

LED current
36.9 mA
Rating
30 mA
Resistor power
63.9 mW
Confidence
high

Suggested fix

  • Use a 91 ohm resistor
summary.txt
summary.txt
FAILS. The LED fries: 36.9 mA through it, above its 30 mA rating (1.2x). Confidence: high. passed hand calculation, power balanceLED current: 36.9 mArating: 30 mAresistor power: 63.9 mWLED power: 120 mW Checks:  [pass] hand calculation: diode equation solved by hand gives 36.9 mA, ngspice 36.9 mA (5.4e-05% apart); the quick estimate (Vs - Vf)/R is 38.3 mA  [pass] power balance: supply gives 184 mW = resistor 63.9 mW + LED 120 mW (5.4e-08% apart)  [info] operating limits: LED 36.9 mA of 30 mA; resistor 63.9 mW of 250 mW Assumptions:  - blue LED modeled with the diode equation: 3.2 V at 20 mA, ideality 2.7, series resistance 1.5 ohm.  - Resistor 47 ohm exact, rated 0.25 W.  - Room temperature, steady DC. Suggested fixes:  - Use a 91 ohm resistor: Gives about 19.8 mA; it dissipates 35.6 mW, so a 0.25 W part is enough.Report: report.html

Open the full report

You ask

What is the ripple on this 12 V to 5 V buck at 2 A?

Wobbl runs

Terminal
$ wobbl circuit buck --set vin=12 --set vout=5 --set current=2 \  --set frequency=500k --set inductor=10u --set capacitor=22u \  --set max_ripple=0.05

Checks

  • passhand calculation
  • passsteady state
  • passtime step convergence
Simulated waveform. Output ripple 8.56 mV peak to peak on 5.07 V (within the 50 mV limit), inductor ripple 0.604 A, peak 2.33 A.

OKOutput ripple 8.56 mV peak to peak on 5.07 V (within the 50 mV limit); inductor ripple 0.604 A, peak 2.33 A.

Ripple
8.56 mV
Output
5.07 V
Inductor ripple
0.604 A
Confidence
high
summary.txt
summary.txt
OK. Output ripple 8.56 mV peak to peak on 5.07 V (within the 50 mV limit); inductor ripple 0.604 A, peak 2.33 A. Confidence: high. passed hand calculation, steady state, time step convergenceripple: 8.56 mVoutput: 5.07 Vinductor ripple: 0.604 Aduty: 43.7% Checks:  [pass] hand calculation: ideal waveform math (triangular inductor ripple dI = 0.583 A through C and ESR) gives 7.95 mV; ngspice 8.56 mV and 0.604 A (8% apart; the math ignores switch and diode drops)  [pass] steady state: average output moved 0.0069% between the last two 20 cycle windows  [pass] time step convergence: output ripple 0.00856 with the normal step, 0.00856 with half the step (0.0022% apart) Assumptions:  - Open loop at the steady state duty cycle 43.7%; real controllers add their own ripple and transients.  - Switch on resistance 0.05 ohm, Schottky catch diode.  - Capacitor ESR 10 mohm, no ESL. Images: waveform: images/waveform.pngReport: report.html

Open the full report

You ask

How hot does this MOSFET get switching 15 A at 20 kHz in a 50 C box?

Wobbl runs

Terminal
$ wobbl circuit mosfet --set current=15 --set rds_on=8m \  --set frequency=20k --set theta_ja=40 --set ambient=50

Checks

  • passhand calculation
  • passthermal loop

110 C

Junction

OKJunction reaches about 110 C (1.51 W: 1.37 W conduction, 0.144 W switching) with 40 C/W to 50 C air; limit 150 C.

Junction
110 C
Limit
150 C
Loss
1.51 W
Confidence
high
summary.txt
summary.txt
OK. Junction reaches about 110 C (1.51 W: 1.37 W conduction, 0.144 W switching) with 40 C/W to 50 C air; limit 150 C. Confidence: high. passed hand calculation, thermal loopjunction: 110 Climit: 150 Closs: 1.51 Wtheta JA: 40 C/W Checks:  [pass] hand calculation: conduction loss I_rms^2 R = 0.903 W; ngspice average of V x I = 0.903 W (0.00079% apart)  [pass] thermal loop: junction settles at 110 C after the on resistance warms up (12.1 mohm hot) Assumptions:  - On resistance 8 mohm at 25 C rising 0.6% per C.  - Switching loss from 40 ns edges: 0.5 V I (tr + tf) f.  - Junction to air 40 C/W (datasheet, no heatsink unless included).Report: report.html

Open the full report

About this example

These are three everyday circuit questions, each answered with ngspice and checked against the textbook answer computed independently.

Question Answer Checks
Will a blue LED on 5 V with a 47 ohm resistor fry? Yes, 36.9 mA goes through a 30 mA LED, and Wobbl suggests 91 ohm for about 20 mA the diode equation by hand gives 36.9 mA and ngspice 36.9 mA, and the supply’s power equals the resistor’s plus the LED’s
What is the ripple on a 12 V to 5 V buck at 2 A, 500 kHz, 10 uH, 22 uF? 8.56 mV peak to peak with 0.60 A of inductor ripple, within a 50 mV limit the ideal triangular ripple math gives 7.95 mV, 8% apart because of the switch and diode drops, the output reached steady state, and the ripple is the same at half the time step
How hot does a MOSFET get switching 15 A at 20 kHz in a 50 C box with 40 C/W to air? About 110 C at the junction from 1.51 W, under the 150 C limit with margin the conduction loss I_rms^2 R matches the simulated V x I to 0.001%, and the junction temperature is iterated with the on resistance rising 0.6% per C

Each folder (led/, buck/, mosfet/) holds report.html, summary.txt, outcome.json, the netlist Wobbl generated, and a waveform plot where the analysis is in time.

Run it yourself

Terminal
$ git clone https://github.com/sohan-bhat/wobbl$ cd wobbl/examples/circuits && ./run.sh

The part, the script and every output are in examples/circuits on GitHub.