Skip to main content

Industrial Digital Twins

Connect live sensor data to 3D objects. A temperature sensor drives an object's emissive glow; a position sensor moves a crane arm; a pressure gauge scales a dial.

Status: Scaffolded + panel mounted. Needs MQTT bridge and RTDB rules deployed.

Architecture

Physical Sensor → MQTT Broker → Cloud Run Bridge → Firebase RTDB


sensors/{id}/latest


useSensorSubscriptions hook


useTwinStore.pushReading()


useSceneStore.updateObject()


Three.js re-render

Bindings

A TwinBinding maps a sensor reading to a scene object property:

FieldTypeDescription
objectIdstringThe scene object to drive
sensorIdstringThe sensor to subscribe to
propertyenumWhat to drive: position.y, rotation.x, material.emissiveIntensity, material.color, scale.x/y/z
mapping.inputMin/MaxnumberSensor value range
mapping.outputMin/Maxnumber/stringObject property range

Numeric properties are linearly interpolated. material.color interpolates RGB channels between two hex colors.

Getting Started

  1. Deploy RTDB rules: firebase deploy --only database
  2. Build an MQTT→RTDB bridge that writes to sensors/{id}/latest
  3. Open the TwinPanel in the right column
  4. Select an object, click "+" to add a binding
  5. Sensor readings flow automatically via the subscription hook