Arduino & Hardware

  • First time wiring Modulino sensors — thermo, light, distance — over QWIIC cables. Plug-and-play until it isn't: learned to check begin() returns and sensor availability.
  • Arduino UNO Q architecture — Zephyr RT underneath, Python runtime on top. Not a typical Arduino. We learned to bridge C++ sketches with Python backends via Arduino_RouterBridge RPC calls.
  • Real-world constraint: no Bridge.put()/Bridge.get() — only provide()/call(). Forced us to rethink state sharing between sketch and Python.

SSH & Remote Work

  • SSH into the board itselfarduino@myboardname. The Arduino runs Linux. We edited files, installed packages, and debugged logs directly on the device.
  • SCP file transfers — pushed code from laptop to board without USB cables. Essential for rapid iteration during a 24-hour hackathon.
  • Systemd services — tried (and failed) to auto-start the Python server. Learned that App Lab manages its own lifecycle.

Low Latency & Edge Computing

  • Sub-100ms sensor loops — reading temp/humidity every 500ms over serial bridge. No cloud round-trip, no API keys, no rate limits.

The latency advantage of edge computing can be expressed as:

$$\Delta t_{\text{edge}} = t_{\text{read}} + t_{\text{process}} \ll t_{\text{cloud}} = t_{\text{read}} + t_{\text{network}} + t_{\text{server}} + t_{\text{response}}$$

Where $t_{\text{network}}$ alone often exceeds 100-500ms, making real-time actuation impossible.

  • Why edge matters — a park sensor can't wait 2 seconds for AWS. Decisions (actuator triggers, alerts) must be local. We felt the difference when toggling a virtual fan and seeing the temperature drop instantly on the graph.
  • Buffer architecture — kept 60 seconds of data in a circular buffer. Fast reads, no database, no latency spike.

The buffer sampling rate:

$$f_s = \frac{1}{T_s} = \frac{1}{1\text{s}} = 1\text{ Hz}$$

With buffer capacity $N = 60$, total observation window:

$$T_{\text{window}} = N \cdot T_s = 60 \cdot 1\text{s} = 60\text{s}$$

Digital Twin Simulation

  • One real, five virtual — our physical sensor in Ciutadella drove simulated data for Güell, Montjuïc, Laberint, Sagrada Família, Fòrum. Learned that "twin" doesn't mean identical — it means plausible divergence.
  • Actuator effects as state transforms — fan = $-2^\circ\text{C}$, AC = $-5^\circ\text{C}$ + $-5\%$ humidity. Simple math, powerful demonstration of cause-and-effect in urban systems.

The Digital Twin state update equation:

$$\mathbf{x}{t+1} = \mathbf{x}_t + \Delta\mathbf{x}{\text{actuator}} + \mathbf{w}_t$$

Where $\mathbf{x}t = [T, H, L, D]^\top$ is the state vector (temperature, humidity, light, distance), $\Delta\mathbf{x}{\text{actuator}}$ is the control input, and $\mathbf{w}_t \sim \mathcal{N}(0, \sigma^2)$ is simulated noise.

Frontend & Real-Time UI

  • Single-file dashboard — CSS and JS embedded in one index.html served by Arduino's WebUI. No build step, no framework bloat.
  • Chart.js streaming — 60-point rolling window, update('none') for zero animation lag. Learned to kill animations when data velocity matters.

What Inspired Us

  • Barcelona's heatwaves — 2023 broke records. Elderly people suffered in unshaded parks. We wanted to make that visible before it becomes deadly.
  • Arduino's "Greetings from Uno Q" example — showed us that a $50 board can run Python + serve web UIs. Democratized edge computing.
  • The Qualcomm/Edge Impulse pitch — "on-device inference." We didn't fully achieve it (no camera, no .eim running), but we built the socket it plugs into.

Built With

Share this project:

Updates