EmbeddedLab OS
Browser-Based Virtual Embedded Systems Laboratory
Role: Creator & Lead Developer
- Core Laboratories
- 4 Labs · 12 Challenges
- GPIO, PWM, ADC, UART
- Automated Coverage
- 169+ Vitest Passing
- Pure state & engine unit tests
- ADC Modes Modeled
- 8 / 10 / 12 / 16-bit
- Selectable 1.8V / 3.3V / 5.0V Vref
- Runtime Boundary
- 100% Client-Side Sim
- Not QEMU CPU or SPICE solver
01 · Problem Definition & Objectives
Engineering Problem
Undergraduate students learning GPIO, timers, ADC quantization, and asynchronous UART frequently face limited oscilloscope/hardware availability, fragile breadboard wiring errors, and invisible internal register transitions.
Intended Outcomes
- Provide four deterministic browser laboratories covering GPIO (16-pin matrix), PWM (carrier frequency & duty oscilloscope), 8–16 bit SAR ADC quantization, and UART framing/baud mismatch diagnostics.
- Validate student solutions via pure mathematical state validators backed by automated Vitest regression suites.
- Deliver optional contextual concept hints with offline deterministic fallback when no AI API key is configured.
02 · System Architecture
Architecture & Signal Flow
Next.js 16 App Router, TypeScript, React 19, Zustand 5, Tailwind CSS 4, and Supabase application running deterministic client-side peripheral engines (`lib/simulator/{gpio,pwm,adc,uart}.ts`) and 12 pure state validators (`lib/challenges/`).
GPIO & Pull-Resistor Engine
lib/simulator/gpio.ts16-pin matrix (PA0..PB7), HIGH/LOW/FLOATING states, ~40 kOhm INPUT_PULLUP/PULLDOWN.
Stage 3: Tested in Vitest
PWM Waveform & Duty Analyzer
lib/simulator/pwm.ts100 Hz – 10 kHz carrier, dynamic SVG oscilloscope, t_high and V_avg calculations.
Stage 3: Tested in Vitest
SAR ADC Quantizer & Gauge
lib/simulator/adc.ts8–16 bit resolution, reference scaling, DEC/HEX/BIN readout, LSB size & saturation.
Stage 3: Tested in Vitest
UART Frame & AI Tutor
lib/simulator/uart.ts + /api/ai9600–115200 bps TX/RX frame check, Gemini 2.5 Flash hints + deterministic offline fallback.
Stage 3: Tested in Vitest + Live App
03 · Implementation & Design Rationale
Technical Implementation Details
- Four Peripheral Engines (`lib/simulator/`): Models GPIO HIGH/LOW/FLOATING + ~40 kOhm pull resistors, PWM period/duty/average voltage SVG oscilloscope, 8/10/12/16-bit ADC quantization with selectable Vref (1.8 V / 3.3 V / 5.0 V), and UART baud/parity frame inspection.
- Pure State Validators: 12 structured challenges (3 per lab) graded strictly against immutable `MicrocontrollerState` snapshots with zero DOM coupling.
- Hybrid AI & Offline Assistance (`/api/ai`): Rate-limited, input-sanitized endpoint powered by Gemini 2.5 Flash with automatic offline deterministic fallback.
Key Engineering Decisions
- Separated pure mathematical peripheral engines (`lib/simulator/`) and Zustand stores cleanly from React visualizers so 169+ Vitest tests execute deterministically without browser overhead.
- Scoped explicitly as an educational virtual simulation rather than an instruction-set CPU core emulator (e.g., QEMU) or transistor-level SPICE circuit solver.
04 · Verified Individual Contributions
My Direct Engineering Work
- Built deterministic peripheral simulators for GPIO, PWM, SAR ADC, and UART workflows
- Engineered automated peripheral, challenge, store, AI security, and privacy tests (169+ passing Vitest unit tests)
- Deployed interactive educational app with Next.js, TypeScript, React, Zustand, Tailwind CSS, and Supabase
Technical Challenges
- Keeping register-level peripheral equations consistent between interactive controls (sliders, switches, baud selectors) and challenge snapshots
- Communicating clear pedagogical boundaries so students understand this models peripheral behavior rather than physical silicon timing noise
05 · Verified Outcomes & Future Scope
Verified Results & Demonstrations
- 169+ passing Vitest unit tests across simulator engines, 12 challenge validators, Zustand stores, AI sanitizer bounds, and Supabase helpers.
- Live web application deployed at `embeddedlab-os.vercel.app` with CI verification.
Authentic Project Visuals



Proposed Future Scope (Not Yet Implemented)
- Expand interactive peripheral coverage (e.g., deeper I2C/SPI timing bus analyzers and instructor cohort assignments) beyond the core 4-lab MVP.
- Maintain strict separation from claims of SPICE-level electrical or real silicon instruction-cycle accuracy.