Initialising the digital twin...
Initialising the digital twin...
Hardware
An ESP32 brain, a 16-bit converter, a reference electrode and a handful of industrial probes. Built to read a living cell without disturbing it, and to act on it only when it is safe.

Signal chain
Sensors feed a precision converter, the ESP32 talks to the twin, and every action returns to the cell through a safety gate. Values are live.
Tap any block. Highlighted wires show where its signal goes.
+0.210 V vs SHE (3 M KCl) through a buffer amplifier
The most important smart sensor. It separates bacterial problems from cathode problems, which is what lets the AI name the cause.
Precision
A cell with 0.7 V open circuit and 1.3 kΩ internal resistance peaks at about 94 µW, 0.27 mA and 0.35 V. The electronics must resolve microamps and millivolts, so two popular parts had to go.
Noise is 50 times the whole cell current, and it draws 10 mA itself.
Nonlinear, with a dead zone that swallows a starving cell.
Too coarse to see the MPPT's small steps.
Resolves 11,200 steps at a typical 0.35 V operating point.
Shorter bars are better. The blue tick marks 0.35 V, the cell's working voltage.
Bill of materials
The corrected list from the research. Every part answers a specific measurement or control problem.
240 MHz · Wi-Fi · MQTT
Sends data to the digital twin and runs the safety rules locally. Its own ADC is never used for measurement.
16-bit · 31.25 µV/step
Reads cell voltage and the reference electrode. Current is computed as V divided by the known external resistance.
10 Ω to 100 kΩ · relays
The load the MPPT moves and the sweep for polarisation curves. A digital pot tops out at 1 mA.
+0.210 V vs SHE · buffered
Measures the anode alone, so a bacterial problem is never confused with a cathode problem.
±0.5 °C · 1-Wire
Temperature for the biology and for compensating pH and conductivity.
±0.1 pH · 24/7
Industrial probe built for continuous immersion, output safe for 3.3 V logic.
EC · K = 1
Conductivity sets the ohmic loss; its drift reveals salt and fouling.
DO · 0 to 20 mg/L
Oxygen at the cathode, or a leak into the anode.
mA side · I²C
Measures what the boost converter actually delivers to the LED.
1 to 50 F · cold start
Stores microwatts and releases them in useful bursts.
feed · buffer · heat
The hands of the AI: feed rate, bicarbonate dose and temperature.
Firmware
The cell's dynamics are slow, so the controller is too. Perturb and observe steps every 5 to 15 minutes; faster makes the system oscillate.
The AI suggests. The firmware decides if it is safe.
// Runs on the ESP32. The network cannot override it.
bool safeToApply(const Action& a, const Readings& r) {
if (a.lowersResistance && r.V < 0.10) return false; // reversal risk
if (r.pH < 6.5 && !a.dosesBuffer) return false; // buffer first
if (r.T > 40.0 && a.heats) return false; // never heat a hot cell
if (a.majorChanges > 1) return false; // one lever per cycle
if (a.pumpRate > MAX_PUMP) return false; // washout guard
log(a, r); // every decision explained
return true;
}mqtts://twin/biovolt-01/telemetry
{ "id": "biovolt-01", "t": 0, "v": 0.28263, "i_mA": 0.9601, "e_an": -0.2131, "ph": 7, "ph_q": "ok", "temp": 30, "do_an": 0.02, "r_ohm": 200, "r_ext": 280, "conf": 100 }
Values stream from the simulated cell running in this browser.
Calibration
Step the load from 10 kΩ down to 10 Ω, wait for steady state, record V and I. The slope gives Rint; the shape gives the cathode i₀ and the bacterial jmax.
Open the circuit for a moment. The instant jump in voltage equals I × Rohm, which tracks fouling in real time.
A two-hour lab test corrects the twin's estimate of food in the chamber and gives the true coulombic efficiency.
An extended Kalman filter slowly re-fits qmax, Ks and decay so the twin stays true to this particular cell.
The prototype
Every part above has a twin inside this website. Break it in the monitor, size it in the calculation lab, then wire the real one with confidence.
