RONALD REX C H
Back to ProjectsIndependent Full-Stack ECE Learning Platform · Next.js 16 + 169+ Passing Vitest Tests
CASE STUDY 04Educational Simulation · Full-Stack TypeScriptStage 3: Software Tested (169+ Vitest Tests Passing)

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/`).

01 · NEXT.JS 16 UI4 Virtual LabsGPIO 16-Pin MatrixPWM SVG OscilloscopeADC 8–16 Bit DialUART TX/RX Inspector02 · ZUSTAND 5State Storessimulator-store.tschallenge-store.tsCustom React Hooks03 · CORE SIMULATIONDeterministic Engineslib/simulator/*.tsGPIO · PWM · ADC · UARTPure State Validators12 Graded Lab Challenges04 · QA & HINTSVerified Stack169+ Vitest TestsSupabase Auth/DB/api/ai + FallbackEducational Sim Only
System architecture schematic rendered from verified repository modules.Responsive vector SVG

GPIO & Pull-Resistor Engine

lib/simulator/gpio.ts

16-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.ts

100 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.ts

8–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/ai

9600–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

EmbeddedLab OS Virtual Hardware Laboratory dashboard showing GPIO, PWM, ADC, and UART modules
Student dashboard overview tracking progress across the four virtual hardware laboratories.
EmbeddedLab OS PWM Pulse-Width Modulation workbench with SVG oscilloscope and channel inspector
PWM workbench computing period, high/low time, average voltage, and live oscilloscope waveform.
EmbeddedLab OS Analog-to-Digital Converter workbench with rotary voltmeter dial and quantization readout
ADC workbench illustrating reference scaling, LSB voltage size, and DEC/HEX/BIN quantization output.

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.

Connect

Start a technical conversation.

Open to Embedded Systems, Cloud/IoT, and Edge AI/TinyML internships, undergraduate research collaborations, and technical discussions in Chennai and internationally.

Location

Chennai, Tamil Nadu, India

Submissions are delivered via FormSubmit directly to ronaldrexch@gmail.com for inquiry replies only—never shared or tracked across external marketing lists.

Direct email: ronaldrexch@gmail.com