HYPERx54/circadian-lighting-simulator
0
Patient-Centric Adaptive Circadian Lighting Simulator (3D Space)
An interactive, web-based 3D simulation prototype demonstrating the FSM and FPGA logic for the Patient-Centric Adaptive Circadian Lighting System (VIT ICSCST 2026 Paper ID: 1466).
🏥 Features
- Interactive 3D Hospital Room Viewport:
- Model of patient bed, resting patient figure, ceiling lighting fixtures, and vital signs monitor.
- 360-degree Orbit Camera Controls (left-click drag to rotate, scroll wheel to zoom).
- Dynamic PointLight tinting based on Finite State Machine (FSM) PWM duty cycles.
- Window streaming natural DirectionalLight daylight and shadow maps mapping to the Ambient ADC Light Sensor.
- Clinical and Behavioral Profile Database:
- Live switching between 16 Clinical profiles (Adult, child, elderly, migraine, ICU, SAD, depression, etc.) and 16 Behavioral profiles (shift worker, emergency mode, energy saver, custom overrides, etc.).
- High-Fidelity Signal Processing Waveforms:
- Real-time calculations of Red, Green, and Blue duty cycles.
- Dynamic Math Formula updates using the inverse ambient light equation: $$\text{PWM} = \text{Base\Spectral\Power} \times \frac{255 - \text{Ambient}}{256}$$
- Responsive oscilloscope canvas displaying the pulse width modulation (PWM) square-wave pulse trains.
- ModelSim Simulator Testbench Emulator:
- Monospace terminal console simulating compile targets, hardware stimulations, and functional test sequences matching Verilog testbench outputs.
- Dynamic Charts:
- Chart.js plots tracking 24-hour circadian duty cycles and inverse ambient dimming curves.
- Verilog HDL Source Code Explorer:
- Monospace code explorer with syntax highlight previews for
lighting_fsm_no_ml.v,rtc_interface.v,profile_selector.v,ambient_light.v, andtb_lighting_fsm.v.
🛠️ File Structure
The space serves the following static assets:
index.html: Defines the layout, controls, and diagnostics panel.styles.css: Implements the serenity cream and hunter green design tokens.simulation.js: Orchestrates the Three.js 3D WebGL render loop, Chart.js datasets, Verilog repository, and FSM math.
🚀 Running Locally
If you clone this Space repository:
- Simply double-click
index.htmlin your file explorer to launch the prototype directly in any modern web browser. - No local servers, packages, or background scripts are required—it is 100% CORS-safe and portable.
