Source code coming soon. The GitHub repository is private for now and opens to everyone very soon.
BetterSPICE Beta 0.8.0 Join the beta Download soon
Part VIII  Lists and dataReferenceContentsIndex
54

Example circuits

BetterSPICE ships 715 example circuits in 40 categories. Each opens running, with probes on the signals worth watching and a description that says what to try. This chapter is a path through 47 of them. The in-app browser (E) has every one and searches them all.

The example browser.
Figure 54.1The example browser.

54.1The example browser

The example browser
Key or gestureWhat it does
TypeSearches names, descriptions and categories.
Up / DownMoves through the list.
Left / RightChanges category, when not searching.
Enter or clickOpens the example in a new tab.
Shift+Enter or Shift-clickOpens it in a new tab too. The browser says so. Nothing is replaced, so no unsaved work is lost.
EscCloses the browser.

While you search, the browser shows the number of results and each category's match count. The Examples menu has one entry per category, and the library search lists matching examples too. The desktop reads the examples folder next to the app, or the folder in BSPICE_EXAMPLES.

54.2Start here

Start here
ExampleWhat it teaches
Voltage divider with load
basics/voltage-divider.bsc
Read a net voltage, and see a load pull a divider down.
RC charge and discharge
basics/rc-charge.bsc
One time constant on the scope: 63 % after τ.
RC low-pass, 1.6 kHz
filters/rc-low-pass.bsc
The Quick start circuit: a corner frequency you can check by hand.
LED with series resistor
basics/led-current-limit.bsc
Sliders: change R and watch the LED current follow.
RLC series resonance
basics/rlc-series-resonance.bsc
Resonance: the capacitor voltage is Q times the input.
LC tank ringing
basics/lc-tank.bsc
Initial conditions (ic) and a ringing that decays.

54.3Measure with the analyses

Measure with the analyses
ExampleWhat it teaches
Sallen-Key low-pass, 1 kHz Butterworth
filters/sallen-key-low-pass.bsc
AC sweep: a second-order slope of −40 dB per decade.
Sallen-Key high-pass, 100 Hz
filters/active-high-pass.bsc
AC sweep and the margins strip on an active filter.
Common-emitter amplifier (2N3904)
transistor-amplifiers/common-emitter.bsc
Operating point of a biased stage, then its gain.
CMOS inverter and its transfer curve
logic-families/cmos-inverter-transfer.bsc
DC sweep: a transfer curve.
Wien-bridge oscillator with diode amplitude control
oscillators/wien-bridge.bsc
FFT of an oscillator and its harmonics.
Series RLC step response: overdamped, critical, underdamped
basics/rlc-damping-comparison.bsc
Three damping cases side by side, the idea behind a parameter step.
Noise of a common-emitter amplifier
transistor-amplifiers/common-emitter-noise.bsc
The Noise tab: which part adds the noise of an amplifier stage.
Poles and zeros of a Sallen-Key low-pass
filters/sallen-key-poles-zeros.bsc
The Pole-zero tab: the poles of a second-order filter with their Q.
Loop gain of an op-amp driving a capacitive load
op-amp-circuits/opamp-capacitive-load-loop-gain.bsc
The Loop gain tab: the phase margin of an op-amp that drives a capacitor.

54.4Power

Power
ExampleWhat it teaches
Mains transformer, bridge and reservoir cap
diode-circuits/bridge-rectifier-transformer.bsc
Ripple on a reservoir capacitor, measured with Show stats.
Op-amp series regulator (LM317 principle)
linear-regulators/opamp-series-regulator.bsc
Tutorial 3: a regulation loop, then a vendor op-amp model.
LDO load-transient response
linear-regulators/ldo-load-transient.bsc
A load step: the dip and recovery of an LDO.
Buck converter, 12 V to 5 V, 1 A
switching-converters/buck-12v-to-5v.bsc
A buck converter: inductor ripple and start-up.
Synchronous buck with dead time
switching-converters/sync-buck.bsc
Dead time in a synchronous buck.
Boost converter, 5 V to 12 V
switching-converters/boost-5v-to-12v.bsc
A boost converter and its output ripple.
Buck converter IC 12 V → 3.3 V with a load step
power-management/buck-ic-12v-to-3v3-load-step.bsc
A buck IC block with a load step.
TVS diode clamping a surge on a 24 V line
protection/tvs-surge-clamp.bsc
A TVS clamping a surge: peak voltage and current.

54.5Analog signal

Analog signal
ExampleWhat it teaches
Inverting amplifier, gain −10
op-amp-circuits/inverting-amplifier.bsc
Gain set by two resistors.
Integrator: square in, triangle out
op-amp-circuits/integrator.bsc
Square in, triangle out.
Difference amplifier rejects common-mode hum
op-amp-circuits/difference-amplifier.bsc
Common-mode rejection.
Photodiode transimpedance amplifier
sensors/photodiode-tia.bsc
A transimpedance amplifier.
Low-side current sense amplifier
sensors/low-side-current-sense.bsc
Current sensing with a shunt and an amplifier.
LM386 audio amplifier into an 8 Ω speaker
audio/lm386-audio-amp.bsc
An audio amplifier into a speaker.

54.6Digital and mixed signal

Digital and mixed signal
ExampleWhat it teaches
4-bit binary counter with LEDs
digital-and-mixed/binary-counter-leds.bsc
The logic analyzer on a counter.
555 astable, 690 Hz LED blinker
oscillators/555-astable.bsc
A 555 blinker: duty cycle with Show stats.
PWM from a comparator and a triangle wave
digital-and-mixed/comparator-pwm.bsc
PWM from a comparator and a triangle wave.
State machine traffic light with pedestrian button
mixed-signal/fsm-traffic-light.bsc
A programmable state machine block.
Digital PI voltage loop for a buck converter
digital-control/digital-pi-buck.bsc
A control block closing a buck converter loop.
MCU blink (MCU language)
digital-control/mcu-blink.bsc
The smallest MCU program: an LED toggled every 500 ms.
MCU pot to PWM fan speed
digital-control/mcu-pot-pwm-fan.bsc
ADC to PWM: a pot sets a fan speed.
MCU writes text to an I2C OLED
digital-control/mcu-i2c-oled.bsc
An MCU writes text to an I2C OLED. Delete a pull-up to see the warning.
Two MCUs on a CAN bus
digital-control/mcu-can-two-nodes.bsc
Two MCUs on a CAN bus with transceivers. The Logic tab opens with the CAN frames decoded.
4-digit 7-segment display with multiplexing
displays/seven-segment-4-digit-multiplex.bsc
A four-digit display scanned digit by digit.
JK flip-flop from a D flip-flop and gates
latches-and-flip-flops/jk-flip-flop.bsc
A JK flip-flop: hold, set, reset and toggle.
PLL locking a VCO to 10× the reference
mixed-signal/pll-lock.bsc
A PLL locking: watch the control voltage settle.

54.7Lines, motors and interfaces

Lines, motors and interfaces
ExampleWhat it teaches
Open-ended line: the step doubles
transmission-lines/tline-open-end.bsc
A reflection: the step doubles at an open end.
Series termination of a fast driver
transmission-lines/tline-series-termination.bsc
Series termination of a fast driver.
H-bridge driver with PWM speed and direction
motors/h-bridge-speed-direction-ramp.bsc
An H-bridge with PWM speed and direction.
Relay driver with flyback diode
electromechanical/relay-driver-flyback.bsc
A relay coil and its flyback diode.
I2C bus: open-drain lines, pull-ups and rise time
interface/i2c-bus-pull-ups-rise-time.bsc
I2C pull-ups and rise time.
RS-485 half-duplex link
interface/rs485-link.bsc
An RS-485 link.

54.8Every category

Basics (15), Filters (37), Diode circuits (29), Charge pumps (5), Switching converters (23), Linear regulators (17), Op-amp circuits (72), Oscillators (22), Transistor amplifiers (36), Power and drives (21), Digital and mixed (11), Digital control (21), Sensors (29), Transmission lines (20), Batteries and charging (13), Electromechanical (19), Mixed-signal (6), Power management (13), Protection (19), Interface (20), Timing (6), Displays (9), Audio (11), RF (12), Combinational logic (22), Latches and flip-flops (15), Counters and registers (22), State machines (11), Logic families (16), Data converters (15), PLL and clocking (8), Control systems (12), Motors (7), LED drivers (7), Hobby circuits (9), Discrete switching regulators (25), Gate-level logic (24), Discrete data converters (18), Transformers (10), Vendor-chip regulators (8).