← Multi-Sensor Environmental Monitoring System

Virtual Zynq board

Original firmware and dashboardSimulated sensors and FPGA logic

The board's processor code runs here unmodified, compiled to WebAssembly: sensor drivers, data hub, analysis and the Bluetooth protocol. Around it, the sensors and FPGA logic are simulated, and the project's own web dashboard connects to it over a virtual Bluetooth serial port.

The firmware only touches hardware through register reads and writes, so those calls are answered by this page. The formaldehyde and particulate IPs follow the project's Verilog; the DHT11 and OLED IPs, whose Verilog is not in the project files, are modelled from how the drivers use them. Time runs at real speed unless you change it.

The board

t = 0.0 s
Formaldehyde · ZE08-CH2O
Particulates · ZH03B
Temperature · DHT11

Inside the FPGA

Processor and dashboard

Data hub from the firmware's JSON status

ReadingValueQualityLevel

Bluetooth link dashboard not connected

Debug console (xil_printf) every second

The project's dashboard, unchanged (Chinese interface). Press 连接蓝牙串口 (connect) to open the virtual Bluetooth port; reports then arrive every 8 s. The command buttons and the question box work too.

What running it showed

  1. Unplugged sensors keep looking fresh

    The formaldehyde IP latches its valid bit after the first good frame, and the particulate path reads its registers without a valid bit (the IP's valid flag is a 10 ns pulse). Both registers hold the last value, so the processor re-reads it every 500 ms as if it were new and the 5-second STALE rule never fires. Only the DHT11, whose driver clears a done bit, goes STALE, and temperature is not part of the overall alarm.

  2. Long commands lose bytes

    The AXI UARTLite holds 16 received bytes, and the firmware empties it once per 100 ms loop. At 9600 baud a burst fills 16 bytes in 17 ms, so a longer command, or the dashboard's own MODE JSON + GET JSON on connect (21 bytes), can lose its tail. Whether it does depends on where the burst falls relative to the poll; here that point is random.

  3. Formaldehyde units

    The IP outputs the ZE08's concentration in ppb. The driver stores that number as µg/m³ and divides it by 1.23 to get “ppb”, so the dashboard's µg/m³ values are the ppb reading, about 19 % below the true µg/m³, and the 80/160 thresholds are compared against ppb. The OLED, which labels the same number ppb, is right.

What is original and what is modelled

  • Original, unchanged: the processor sources (env_monitor.c, env_analysis.c, bt_protocol.c, hc05_bluetooth.c, the sensor and UART drivers, display_interface.c), compiled with Zig's clang for WebAssembly; and the dashboard's index.html, app.js and styles.css.
  • Replaced: the Xilinx BSP headers (small stubs with the same constants), main() (the page calls the same loop every 100 ms), the AXI UARTLite (a virtual one with the IP's 16-byte FIFO), navigator.serial inside the dashboard, and api_server.py's answer, reproduced without an AI key.
  • Ported from Verilog: the ZE08 and ZH03B frame parsers and the register views of both IPs, including the latched formaldehyde valid bit and the one-clock particulate status pulses.
  • Modelled: the sensors (one frame per second, the modules' active-upload rate), the DHT11 IP (a reading every 2 s) and the OLED (drawn after the photo of the real screen). Base addresses come from the block design.