11 min read

Emilio Carrión

How I Built a Digital Twin of València (and Why I Don't Know If It's Art or Engineering)

During Fallas I built València Respira: a real-time visual installation with eleven layers of live data. This article covers the technical and design decisions behind the piece, and what I learned building something that doesn't fit into any category.

architecturesoftware designcareer

I've been wanting to write this for days and couldn't find the angle. Because this isn't an article about software architecture. Or open data. Or digital art. It's about all three at once, and I'm not sure in what order to put them.

I'll try in the most honest way I can: by recounting the decisions I made and why.

It All Started with a Fallas Dashboard

Nit del Foc 2026. I'm at home, I open València's open data portal out of curiosity, and I discover there are acoustic sensors measuring noise in real time, geolocated Fallas monuments, and live traffic. Within a few hours I throw together a dashboard with Leaflet and Chart.js. I post it on LinkedIn, it gets good traction, and I should have left it there.

But I got hooked.

I started exploring what else the portal had. And what I found surprised me: real-time air quality, 200,000 geolocated trees, Valenbisi stations, over 1,100 bus stops, irrigation channels, the coastline drawn in OpenStreetMap. And when you cross that with the Open-Meteo API (wind, temperature, weather) and with business and public facility data from OpenStreetMap, you have a complete picture of an entire city updated every few minutes.

And nobody was doing anything with it. At least, nothing beyond a CSV.

So I made a decision I can't quite justify rationally: I decided to build something that wasn't useful. Not a dashboard. Not an analytics tool. Something that would simply show the city as it is, in real time, and be beautiful to contemplate.

Why a Dark Background (and Why It Matters)

The first decision was aesthetic, and it conditioned everything else.

A dark background makes any point of light stand out. It's the difference between looking at a city from an airplane during the day (everything blends together) and at night (every streetlight, every car, every lit window is a data point). The piece's metaphor is exactly that: a nocturnal portrait of València where data are the points of light.

But the background isn't static black. It changes with the actual time of day and the real temperature. At dawn it's darker. At noon, slightly lighter. When it's cold, the tone shifts toward deep blue. When it's warm, a warm tint appears. It's a two-pixel-wide vertical gradient that stretches to fill the screen and recalculates every minute.

And someone will say: "that's a detail nobody notices." Exactly. If you notice it, it's done wrong. Atmosphere should be felt, not seen.

Eleven Layers and an Order That Isn't Random

The piece has eleven data layers. But they don't all appear at once. They reveal themselves one by one, with a radial light effect expanding from the center of the screen. And the order is deliberate.

First come the water and the sea. That's the base geography. The stone and water that define where València is. Light particles flow through the irrigation channels as if they were real water, and others float over the Mediterranean like moonlight reflections.

Four seconds later, traffic appears. It's the first "living" layer, the one that tells the viewer this isn't a static map. Cyan pulses if it's flowing, amber if it's dense, red if it's congested. Each pulse travels along the actual road segment at a speed proportional to the traffic state. If there's congestion, they move slowly. If it's flowing, they go fast.

Another four seconds and the human layers arrive: Valenbisi, EMT, businesses, public facilities. It's the city's nervous system. 5,000 bars and shops blinking at their own rhythm (hospitality glows brighter at night, shops during the day). Hospitals and schools pulse slowly, like a steady heartbeat.

And finally, the trees. 200,000 green points with halos that appear on top of everything else. Life over infrastructure.

That sequence (stone, movement, people, nature) isn't decorative. It's narrative. It's the story of how a city is built, told in 16 seconds.

The Breathing: Data Turned into Metaphor

The entire piece breathes. The cadastral blocks expand and contract in a cycle whose speed depends on the real air quality at that moment.

When the air is clean, the cycle is quick and light (about 3 seconds). When there's pollution, it becomes slow and heavy (up to 7 seconds). The amplitude changes too: more pollution, more expansion, as if the city were straining to breathe.

It's not an aesthetic decision. It's information design disguised as poetry. Anyone who watches the piece for a minute can feel whether the air is clean or not, without reading a number or looking at a chart. And if you open it at 8 AM during rush hour traffic and then at 3 AM, the difference is palpable.

That said, I won't pretend this came to me on the first try. The first version had the breathing at a fixed rhythm. It looked nice but felt empty. Connecting it to real air quality data is what turned it into something that actually meant something.

The Businesses Have Personality (and a Clock)

Of the eleven layers, the business layer was the hardest to calibrate. There are more than 5,000 points (bars, restaurants, cafés, shops), each with OpenStreetMap data. And the challenge was making sure they didn't look like a uniform cloud of orange dots.

The solution was to give each business its own blinking cycle. Each one has a random phase and a different speed. But on top of that, bars and restaurants glow brighter at night (multiplied by a nighttime curve) and shops glow brighter during the day (daytime curve). The result is that if you leave the piece open, you see how the commercial light pattern changes with the hours. Not because you tell the piece "it's nighttime now," but because real-time data modulates the brightness.

It's the human warmth of the city. And I think it's the layer that most distinguishes València Respira from a conventional data visualization.

Three Performance Tiers (or Why I'm a Systems Engineer)

This is where the Staff Engineer in me couldn't resist.

The piece renders hundreds of thousands of points at 60 fps. On a powerful laptop with Chrome, that works fine. On a three-year-old iPhone SE, it doesn't. And if the piece is an installation meant for any screen, it has to work on any device.

So I implemented three performance tiers that are detected automatically: how many cores the device has, whether it's touch-enabled, whether the screen is small, whether the user has "reduce motion" enabled in accessibility settings. Based on that, the piece adjusts the number of wind particles, rain particles, stars, the bloom effect, and the parallax.

On "high" tier you get 200 wind particles and full bloom. On "low," 60 particles and no bloom. The piece is still the same. It's just lighter.

And someone will say: "that's overengineering for an art project." Maybe. But it's also exactly what I do at work: design systems that work for everyone, not just the ideal case. If a museum visitor opens the piece on their phone while in the gallery and it runs at 12 fps, the experience is broken. That's not acceptable, not in a warehouse and not in a museum.

The Invisible Things That Hold Everything Together

There are three systems you can't see but without which the piece would feel dead.

The first is wind. Particles that flow in the direction of València's real wind, each with its own angular deviation. When the levante blows, the entire piece moves westward. It's not decorative. It's weather information you feel without reading it.

The second is weather. If it's raining in València, it rains in the piece. Particles tilted by the wind. If there's fog, a subtle veil covers everything. If there's a storm, lightning briefly illuminates the city every 3-8 seconds. When I implemented this and tested it on an actual rainy day, it was the first time I felt the piece truly "lived."

The third is the idle Lissajous. When no one touches the screen for 15 seconds, the camera starts moving on its own following a Lissajous curve. A smooth, organic movement that ensures the piece is never still. I designed this specifically for a museum context: someone walks by without touching it, and the piece keeps breathing, moving, alive.

The Invisible Refresh

Traffic data updates every 3 minutes. Valenbisi every 10. Weather every 10. Air quality every 10. But you can't just reload the data and repaint everything at once, because the viewer would see a flicker.

So each refresh does a cross-fade: the layer fades out, new data loads, and it fades back in. It's a transition of less than a second that nobody notices. But if you remove it, the piece feels unstable. It's the same thing we do in production with deploys: the user shouldn't realize that something changed underneath.

I also implemented a fallback: if the internet connection drops, the piece keeps showing the last loaded data and recovers on its own when the connection returns. It doesn't show an error. It doesn't break. It degrades gracefully, like any well-designed system.

The Engineer That Doesn't Switch Off

That cross-fade was only possible because of something I did almost without thinking: separating data loading, processing, and rendering into three independent layers.

The first version of the piece worked, but each layer mixed everything in the same function: it fetched data from the API, projected it to map coordinates, and painted it on screen. All together. In a prototype that's fine, but the moment you want to update data without making the piece flicker, you need those responsibilities separated. You can't fade out the rendering if it's coupled to data loading.

So I refactored the entire piece with the same pattern I'd use in any production system: fetch, process, present. Three layers, each unaware of the others. And while I was at it, I grouped all the state (which was dozens of loose variables) into objects by subsystem: geographic data, weather, camera, interaction, debug.

I won't pretend it was an artistic decision. It was pure engineering instinct. But it turns out that the same pattern that makes a warehouse system maintainable is what lets a piece of art breathe without breaking. I don't know if that says something profound or simply that I've been doing this for too many years.

What I Learned About My City

I didn't expect this, but building València Respira has taught me things about València I didn't know.

That the irrigation channels surround the old town like arteries. That there are neighborhoods with thousands of trees and neighborhoods with almost none. That at 3 AM traffic nearly disappears entirely but the downtown Valenbisi stations are still active. That on levante days the entire piece moves westward and feels different.

I've lived here for years and I'd never seen the city like this. I suppose that's the beauty of data: it doesn't tell you anything new, but it forces you to look at what was always there.

I Don't Know If It's Art

I'll be honest: I don't know.

What I do know is that it's not a dashboard, it's not a map, and it's not an analytics tool. It's something you contemplate. That changes over time. That reacts to the real world. That never repeats itself.

I'm nearly through a PhD researching digital twins. The formal definition is "a digital representation of a physical system that updates with real-time data." València Respira fits that definition perfectly. But it also fits the definition of an art installation: a site-specific, living work, designed for a physical space.

Maybe it's both. Maybe the distinction doesn't matter.

What does matter to me is that it forced me out of my comfort zone for the first time in a long while. To make decisions that aren't measured in latency or throughput but in whether something feels right when you look at it. And for a systems engineer, that's new and somewhat uncomfortable territory.

The piece is already live at respira.emiliocarrion.com. It's designed to be projected in a dark space, but it works on any screen. If you open it now and open it again in ten minutes, something will have changed. Because the city doesn't stop.

And the piece breathes with it.

Question for you: Have you ever built something that didn't fit your usual definition of "work"? I'd love to hear how it went.

Newsletter Content

This content was first sent to my newsletter

Every week I send exclusive reflections, resources, and deep analysis on software engineering, technical leadership, and career development. Don't miss the next one.

Join over 5,000 engineers who already receive exclusive content every week

Emilio Carrión
About the author

Emilio Carrión

Staff Engineer at Mercadona Tech. I help engineers think about product and build systems that scale. Obsessed with evolutionary architecture and high-performance teams.