About This Project
The Basic Electronics Lab Simulator is an interactive, browser-based educational tool for learning analog electronics through real-time physics simulations — no downloads, no SPICE, no hardware required.
Diode I-V Characteristics
Shockley diode equation with configurable ideality factor n, saturation current I_S, and thermal voltage V_T. Zener breakdown modeled with exponential reverse-bias current.
- PN Junction & Zener modes
- Cursor hover readout (V, I)
- Temperature-dependent V_T
- Zener breakdown voltage control
Rectifier Circuits
Real-time dual-trace oscilloscope showing AC input vs rectified output. Half-wave uses single diode drop (0.7V). Full-wave bridge uses two diode drops (1.4V). Capacitor filter smoothing optional.
- Half-wave & Full-wave Bridge
- Dual-trace oscilloscope
- Ripple visualization
- Diode forward-voltage model
Clipper & Clamper
Clippers remove signal above/below threshold V_ref ± 0.7V. Clampers shift the DC level using capacitor charge retention. Square wave input for clamper demonstrates DC restoration.
- Positive/Negative/Double clipper
- Positive/Negative clamper
- DC reference voltage control
- Square or Sine wave input
BJT Characteristics
Input: I_B vs V_BE using Shockley model. Output: I_C vs V_CE family of curves with Early Effect (V_A), saturation region, and active/cutoff region shading. I_C = β·I_B(1 + V_CE/V_A).
- Input & Output characteristics
- Early Effect (V_A)
- Region shading (Sat/Active/Cutoff)
- Interactive cursor crosshairs
Op-Amp 741
Four configurations: Inverting (gain = −Rf/Rin), Non-Inverting (gain = 1+Rf/Rin), Integrator (V_out ∝ ∫V_in), Differentiator (V_out ∝ dV_in/dt). Output clamped to ±V_CC rails.
- 4 configurations
- ±V_CC rail clamping & saturation warning
- Sine, Square, Triangle inputs
- Phase shift (0°/180°/±90°) readout
555 Timer IC
Astable: f = 1.44/((R1+2R2)·C), V_cap oscillates between V_CC/3 and 2V_CC/3. Monostable: t_pulse = 1.1·R·C, V_cap rising exponential. Bistable: pure SR latch, no capacitor.
- Astable free-running oscillator
- Monostable one-shot pulse
- Bistable SR flip-flop
- V_CC/3 & 2V_CC/3 threshold lines
Component-based static site generation with zero client-side JS overhead. Each lab is a self-contained .astro page.
Global design tokens for consistent dark-mode colour palette, spacing, and typography across all labs.
requestAnimationFrame loop renders real-time waveforms at 60fps with glow shadows and anti-aliased traces.
All physics computed analytically per frame — no third-party simulation libraries. TypeScript for type safety.
Inline SVG circuit schematics drawn programmatically — switch per mode without loading external assets.
Inter for UI text and JetBrains Mono for numerical readouts, waveform labels, and formula display.
Every slider and button maps to a state object in TypeScript. Input events fire instantly — no debounce to avoid lag.
For each horizontal pixel on the canvas, the exact time t is computed, and the physics formula evaluated analytically — exponentials, integrals, and derivatives solved in closed form.
drawFrame() is called up to 60× per second. It clears the canvas, redraws the grid, threshold lines, both signal traces (with WebGL-style shadow glow), and the HUD overlay.
Each frame, tOffset increments by a small amount so the waveform scrolls left — simulating a real oscilloscope sweep. The scroll rate adapts so exactly 3 periods are always visible.
I_D = I_S × (exp(V_D / n·V_T) − 1) V_T = k_B × T / q ≈ 25.85 mV I_C = I_S×e^(V_BE/V_T) × (1+V_CE/V_A) V_out = max(V_in − V_D, 0) V_out = −(R_f / R_in) × V_in V_out = (1 + R_f/R_in) × V_in V_out = −(1/RC) ∫ V_in dt V_out = −RC × dV_in/dt f = 1.44 / ((R1 + 2×R2) × C) t_H = 0.693 × (R1 + R2) × C t_p = 1.1 × R × C V_clip = V_ref ± 0.7 V Ready to explore?
Choose any lab from the navigation sidebar or start with the Diode I-V characteristics.