Home · Case studies · Chemical mixer control system
Case study · Lab software · Hungary

Real-time control system for lab chemical mixers

A custom recipe-driven control system for a chemical mixer: a touchscreen interface to design multi-step reactions, and a real-time software layer that safely translates them into live hardware commands.

Client
Confidential industrial partner
Industry
Chemical & laboratory equipment
What we built
Recipe-driven real-time control system for a chemical mixer
Service
Hardware integration · Full-stack development · System architecture

The challenge

Lab staff needed a way to design multi-step chemical mixing recipes — temperature curves, stirring speed, precise reagent dosing — on a touchscreen, and run them safely, without writing to the machine by hand.

The core technical challenge was live, byte-level two-way communication with real lab hardware — a heater, a stirring motor, dosing syringes, valves — over a serial connection, translating high-level, declarative recipes into low-level, imperative hardware commands in real time, without ever letting the machine enter an unsafe state.

The controller runs on a Raspberry Pi in a lab environment, often without a reliable internet connection, so the whole stack had to work fully offline, stay responsive on limited hardware, and recover automatically after a crash or power cycle — with the interface continuously syncing to the actual state of a running recipe rather than depending on a permanent connection.

The solution: a three-layer, safety-first control system

We built the system as three independent layers talking to each other over HTTP: a touchscreen-friendly Vue interface running in the Pi's own browser, a Node.js/Express backend that owns the business logic and recipe data, and a low-level Rust service that speaks the mixer's exact serial protocol.

This separation meant the safety-critical, byte-level hardware logic could be developed and tested completely independently of the user interface — including against a simulated "fake hardware" serial port during development, with no physical mixer required.

01

Recipe editor & live monitoring

A touchscreen-friendly SPA for building multi-stage recipes — heating, holding, cooling — with per-stage temperature, stirring speed and precise syringe dosing, a forecast graph before a run, and a live graph with real measurement points while the recipe is running, plus an immediate stop.

02

Recipe-to-hardware translation engine

A Node/Express backend that validates every change so the machine can never be pushed into an unsafe state, persists recipes and run history in SQLite, and runs a background process that continuously compares the running recipe's declared steps to the mixer's real status and pushes the right commands down.

03

Direct hardware & serial control

A Rust service that owns the serial connection to the mixer and exposes every hardware instruction as its own endpoint, translating JSON commands into the mixer's exact binary protocol byte by byte — with timeouts, error handling and an emergency stop built in.

Challenges and solutions

  • Real-time hardware sync: the protocol is modeled with Rust enums so every command can be reliably encoded and decoded, with the software waiting for the hardware's actual confirmation before considering a step complete, not just firing commands blindly.
  • Safety by design: the backend validates every recipe change against the mixer's current state, so it can never be commanded into a dangerous configuration, and a full stop is always one tap away.
  • Offline-first, self-healing deployment: the whole system runs on the Raspberry Pi itself with no internet dependency, supervised so that any component — frontend, backend or hardware layer — restarts automatically if it crashes, while the interface keeps polling the backend at a fixed interval to stay in sync with the actual run instead of relying on a permanent connection.

Got a similar hardware-software challenge?

Let's start with a conversation about the project you're working with, and how software can turn it into a safe, real-time controlled system.

Book a time →