← back to work

Jordi Ozi IoT dashboard

A Raspberry Pi device controlled remotely from a small web dashboard.

Problem

Control physical hardware, an LED, a motor, an LCD display, from a browser, with a temperature sensor reporting back the other direction. Early coursework, but the first time I built a full loop between a web interface and real hardware.

Approach

A PHP/MySQL backend holds the device's desired state (LED on/off, motor direction, LCD text). A small JS frontend posts changes to that state. The Raspberry Pi runs a polling loop: post its current temperature reading, fetch the desired state, act on it, repeat.

Result

A working closed loop, flipping the LED on the dashboard changed it on the physical device within one poll cycle, same for motor direction and the LCD message, with temperature flowing back to the dashboard from the sensor.

What I'd do differently

Polling is the obvious weak point, a push-based approach (websockets or MQTT) would be more responsive and less wasteful than constant polling. There was also no authentication on the dashboard endpoints and a hardcoded database password in the original code, both fixed while preparing this for publishing, but worth naming directly: early projects like this are exactly where those habits get formed, and where they need catching.