Week 14
Interface & Application Programming
ASSIGNMENT
Write an application for the embedded board that interfaces a user with an input and/or output device. Document the design process, tools used, and the final working interface.
TOOLS
VS Code · HTML · CSS · JavaScript · ESP32 · MPU-6050 · GitLab Pages
Personal and Group Assignment
This week's personal assignment was to Write an application for the embedded board that you made. that interfaces a user with an input and/or output device(s)
Group Assignment
Here's the link to our group assignment of this week.
The Concept
Krypto Support — A web app for IVDD monitoring
For this week's assignment I built the interface for my final project: a web application called Krypto Support that monitors the movement and activity of my dog Krypto, who has been diagnosed with Intervertebral Disc Disease (IVDD). The app connects wirelessly via WiFi to an ESP32 microcontroller with an MPU-6050 IMU sensor, reads real-time motion data, and presents it in a dashboard designed for both the dog's owner and the veterinarian treating the condition.
The input device is the MPU-6050 IMU sensor — it captures acceleration and orientation data from Krypto's body. The embedded board is an ESP32 (and ultimately the XIAO ESP32-C6 in the final wearable), which processes the sensor data and serves it over WiFi. The application is the web dashboard that visualizes the data, detects impacts, tracks activity vs rest time, and generates a daily medical report that can be shared with the vet.
Why a web app?
A web app built with plain HTML, CSS and JavaScript requires no installation, runs on any device — iPhone, Android, laptop — and can be published instantly through GitLab Pages. For a wearable that needs to be accessed by both the dog's owner and a veterinarian in different locations, this is the most practical choice.
The ESP32 acts as a web server: it connects to the local WiFi network and exposes two
endpoints — /datos
for the live sensor JSON and /reset
to clear the daily counters. The dashboard polls these endpoints every second using
the browser's Fetch API, with no backend or cloud service required.
My Process
00. Visual Design — Canva Template
Before writing any code, I designed the visual identity of the app in Canva. This included defining the color palette, the logo concept, the layout of the main screens, and which metrics I wanted to show. Having a clear reference from the start made the coding process much faster — I wasn't making design decisions in code, I was translating decisions already made visually.
The identity is built around Krypto's personality: the yellow ring references his characteristic collar, the green background his energy, and the blue is the primary brand color carried through all interactive elements. The font is bold and uppercase to give the app a strong, confident character.
Brand identity & color palette
The four brand colors defined in Canva: yellow #ffde59, blue #0d31e2, cream #f6f3e2, and green #89c518. Each color has a specific role across the interface.
Screen layout template
The splash screen and dashboard layout sketched in Canva, showing the logo placement, metric cards, and the LOG IN button pinned to the bottom of the screen.
| Color | Hex | Role in the interface |
|---|---|---|
| Yellow | #ffde59 | Logo ring, impact markers in the chart, accent on buttons |
| Blue | #0d31e2 | Primary brand color — header bar, pitch bar, LOG IN button, section titles |
| Cream | #f6f3e2 | App background — warm, non-clinical feel for a pet health app |
| Green | #89c518 | Active state indicator, roll bar, download PDF button |
00b. Finding the ESP32 IP — I2C Scanner
Before connecting the dashboard to the ESP32, the sensor connection needs to be verified
and the board's IP address retrieved. This I2C scanner sketch confirms the MPU-6050 is
correctly wired and detected at address 0x68,
then the WiFi firmware prints the assigned IP to the Serial Monitor so it can be entered
in the dashboard's connection field.
I2C Scanner — verify MPU-6050 is detected
Upload this sketch first to confirm the sensor is wired correctly before uploading the full firmware. Open Serial Monitor at 115200 baud and press the EN/RST button — you should see Dispositivo encontrado en 0x68.
Full firmware — WiFi server + MPU-6050 + complementary filter
This is the complete firmware uploaded to the ESP32. After uploading, open Serial Monitor at 115200 baud — the board prints its IP address once connected to WiFi. Enter that IP in the dashboard to start receiving live data.
01. Building the Interface — VS Code
With the visual reference ready, I built the full interface in VS Code as a single
index.html file
containing HTML, CSS and JavaScript. The app has four screens managed by a simple
show/hide system: the splash screen, the login/registration screen, and the main dashboard.
No framework was used — plain HTML and vanilla JS keep the file self-contained and
deployable anywhere without a build step.
The logo image was embedded directly into the HTML as a base64-encoded PNG, so the app works as a single file with no external assets. The Live Server extension in VS Code allowed me to preview changes instantly in the browser as I edited the code.
- 1Created a folder
krypto-dashboard/and opened it in VS Code - 2Installed the Live Server extension by Ritwick Dey for real-time browser preview
- 3Built the splash screen with the Krypto logo and LOG IN button
- 4Added the login/register screen with user and pet profile forms
- 5Built the dashboard with metric cards, orientation bars, acceleration chart and report generator
- 6Added jsPDF library to generate downloadable PDF reports for the veterinarian
- 7Embedded the Krypto logo as base64 so the entire app lives in one file
VS Code with Live Server
The index.html open in VS Code with the Live Server preview running in Chrome. Changes to the code reflect immediately in the browser without manual refresh.
Splash screen
The opening screen with the Krypto logo, app name in bold uppercase blue, and the LOG IN button anchored to the bottom of the screen — matching the Canva template exactly.
ESP32 firmware — sending data over WiFi
The ESP32 connects to the local WiFi network and exposes two HTTP endpoints. The dashboard fetches /datos every second to get the live sensor JSON.
Dashboard JavaScript — fetching and rendering data
The dashboard polls the ESP32 every second using the Fetch API and updates all UI elements — metric cards, orientation bars, and the acceleration chart — without reloading the page.
App features
The finished app has four screens: a splash screen, a login/registration screen where
the owner enters their details and the pet's profile (name, breed, age, weight, and photo),
the main dashboard with live metrics, and a PDF report generator. User data is saved
in localStorage so
the app remembers the session and skips directly to the dashboard on subsequent visits.
The PDF report is generated client-side using jsPDF — no server needed. It includes the pet profile, daily metrics, a clinical analysis section with color-coded alerts, and a footer with the Fab Academy project credit.
01b. Full Web App — index.html
The complete web application lives in a single index.html file.
It contains the HTML structure, all CSS styling, and the JavaScript logic for fetching
sensor data, updating the UI, and generating the PDF report. The Krypto logo is embedded
as a base64 PNG so the file is fully self-contained — no external assets needed.
index.html — structure overview
The app is organized into three screens managed by a show/hide system. Only one screen is visible at a time. The goTo(id) function handles all transitions.
JavaScript — screen navigation & session management
JavaScript — real-time chart with Canvas API
The acceleration history chart is drawn frame by frame using the HTML Canvas API. Impact events above 2.5g are highlighted as yellow dots with a blue outline.
JavaScript — PDF report with jsPDF
The PDF is generated entirely client-side using the jsPDF library. It includes the pet profile pulled from localStorage, the day's metrics, and a color-coded clinical analysis section.
02. The Interface
The dashboard is designed for mobile-first use — the dog's owner checks it from their phone while Krypto is wearing the sensor. The layout follows the brand identity defined in Canva: cream background, blue header bar, yellow accents, and bold uppercase typography.
Login / Registration
Two-tab screen: existing users log in with email and password, new users register their profile and their pet's details including a photo.
Live dashboard
Four metric cards showing impacts, active time, rest time, and average posture angle. Orientation bars update in real time from the IMU data.
PDF report
One-tap report generation with the pet profile, daily metrics, and a clinical analysis section with automatic alerts for elevated impacts or abnormal posture.
| Metric | Source | Clinical relevance for IVDD |
|---|---|---|
| Impacts (>2.5g) | Accelerometer magnitude spike | High-impact events stress the intervertebral discs directly |
| Active time | Movement threshold on accel mag | Tracks whether the dog is respecting prescribed rest periods |
| Rest time | Near-zero acceleration | Confirms recovery time after episodes or surgery |
| Posture angle | Pitch average (complementary filter) | Sustained abnormal angles may indicate postural compensation due to pain |
03. Publishing — GitLab Pages
Once the interface was complete and tested locally with Live Server, I published it through GitLab Pages so it can be accessed from any device — not just the development computer. The repository already existed as part of the Fab Academy GitLab instance, so publishing only required adding a pipeline configuration file.
- 1Pushed
index.htmlto thekrypto-supportrepository on GitLab - 2Added a
.gitlab-ci.ymlpipeline file via the Pipeline Editor - 3The pipeline ran automatically, copying the file into a
public/folder and deploying it - 4Opened the published URL on iPhone Safari and tested the connection to the ESP32
- 5Added to iPhone home screen as a PWA — it installs like a native app with no App Store
GitLab pipeline — green
The CI/CD pipeline completed successfully. The green checkmark confirms the site was deployed and is live at the GitLab Pages URL.
Connected on iPhone
The app open in Safari on iPhone, connected to the ESP32 on the same WiFi network. The dashboard shows live data from the MPU-6050 sensor.
PWA — installing as a native app
The app includes the necessary meta tags for iOS to treat it as a Progressive Web App. From Safari, tapping Share → Add to Home Screen installs it with the Krypto logo as the icon and opens it without the browser chrome — it looks and feels like a native app. No App Store, no Xcode, no developer account required.
The one constraint is that the ESP32 connection only works when the phone is on the same WiFi network as the sensor. The login, profile, and PDF report features work from anywhere since they run entirely in the browser using localStorage.
04. Demo — App in action
The following video shows the full workflow: the ESP32 connected to the MPU-6050, the dashboard loading on iPhone, the live metrics updating as the sensor moves, and the PDF report being generated and downloaded.
ESP32 sending data
Serial Monitor showing the IP address assigned to the ESP32 after connecting to WiFi. This IP is entered in the dashboard to start the live feed.
Live data on iPhone
The dashboard open on iPhone Safari, connected to the ESP32. The metric cards and orientation bars update every second as the sensor moves.