Current, Power & ADC
Texas Instruments INA219 digital twin
26 V bidirectional high-side current, shunt and bus voltage monitor.
VendorTexas InstrumentsCurrent, Power & ADC
InterfaceI2C0x40–0x4F (default 0x40)
Record Status2026-11-21rev 287d49a4a (clean tree)
Driver oracle & capability record
Driver oracle PASS: 7/7 stages passed on nucleo-f767zi; generator 0.1.0+policy.12.
| Driver reference | libdriver/ina219 driver (commit 266a1ee32) (MIT) |
|---|---|
| Evidence standing | provisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples). |
| Datasheet accuracy basis | bus 1 LSB = 4 mV; shunt offset +/-200 uV (PGA /8) + 0.5 % current error + 10 uV LSB; current 0.5 % + 200 uV / 0.1 ohm (SBOS448G) |
| Negative control | stimulus outside the datasheet tolerance -> oracle FAIL |
| Published record | accuracy/driver-oracles-2026-11-21.json (SHA-256 dd20a19b84c9) |
Measured driver round-trip results
| Quantity | Measured | Expected | Error | Datasheet Tolerance |
|---|---|---|---|---|
BUS_mV | 5000 mV | 5000 mV | 0 mV | ±4 mV |
SHUNT_uV | 20000 uV | 20000 uV | 0 uV | ±310 uV |
CURRENT_mA | 199 mA | 200 mA | -1 mA | ±3 mA |
Key registers & reset values
| Address / Field | Register | Reset / Expected | Purpose |
|---|---|---|---|
0x00 | CONFIG | 0x399F | Bus range, PGA gain, ADC resolution and mode |
0x01 | SHUNT_V | 10 uV/LSB | Signed shunt voltage reading |
0x02 | BUS_V | 4 mV/LSB | Bus voltage plus CNVR and OVF flags |
0x04 / 0x05 | CURRENT / CALIB | 0x0000 | Scaled current register and calibration factor |
Attach with ct CLI
Shell - run firmware with INA219
# Run compiled firmware with INA219 attached on nucleo-f767zi
ct run --json --board nucleo-f767zi --device ina219 build/app.elf
# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/ina219.xml tests/ina219-fault.suite.yamlFault-injection test snippet (suite.yaml)
tests/ina219-fault.suite.yaml
version: 1
board: nucleo-f767zi
firmware: build/app.elf
tests:
- name: ina219-i2c-nack-and-bad-id
faults:
- at_ms: 30
bus: I2C1
kind: nack
address: 0x40
count: 2
- at_ms: 150
part: ina219
kind: register_override
register: 0x00
value: 0xFF
expect:
console_contains: "DRIVER_FAULT_DETECTED"
exit_code: 0