Skip to the content
PCBKitNew board
4 layers300 × 200 mmPrototype, the printed circuit board in 3D

Replacement engine control unit for a 25 kVA Kirloskar diesel genset — engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm, 12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.

Size
300 × 200 mm
Copper layers
4
Thickness
1.6 mm
Parts
434
Nets
285
Pads
1,420
Tracks, vias
5,769, 1,586
Pours
91
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
13 Sep 2026
Updated
20 Oct 2026

Overview

Prototype is an open-source printed circuit board by mohan4220, from the mohan4220/ecu25kva repository on GitHub. It is a 4-layer board of 300 × 200 mm with 434 parts on 285 nets, routed with 5,769 tracks and 1,586 vias.

It is built around the TCAN1042HGVDRQ1, AUIRS2181STR and INA592ID, with the TPS7B4253QDDARQ1, BAV199-QR and 2N7002BK among its other parts. Its parts include 131 resistors, 111 capacitors, 45 diodes, 37 transistors and 25 ICs.

Main components

12

README

README.md

Genset ECU

Replacement engine control unit for a 25 kVA Kirloskar diesel genset — engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm, 12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.

Start here

docs/pdf/ECU-Bible.pdf — everything, in reading order, in one 328-page file. Cover, handoff, field handbook, sensor reference, circuit reference, the specification, the decisions log, all twelve research memos, the plan. Bookmarked, so the PDF reader's outline pane is the table of contents.

Resuming work, or moving to another machine? docs/HANDOFF.md — setup, what is verified, what is open, and the traps that already cost a session each. docs/decisions-log.md — every design fork put to the owner, with the options and the reasoning.

Prefer the browser? Three of those are live HTML: the handbook, the circuit reference and the sensor reference.

What's in here

PathWhat it is
docs/pdf/Every document as PDF — one file each, plus the combined bible
docs/handbook/index.htmlThe handbook: machine, 94-pin interface, the circuits in narrative, how a runaway gets stopped
docs/handbook/circuits.htmlCircuit reference — all 17 blocks, each with schematic, reasoning, simulated result and model limits
docs/handbook/sensors.htmlSensor reference — every sensor, what it measures, how it's read, what the data drives
docs/superpowers/specs/The reconciled specification — the binding source of truth
refs/The OEM wiring diagram, the DSE4522 configuration, machine photographs, and the extracted pinout
docs/research/Twelve research memos: engine ID, GCU, connector, injector, MCU, standards, BOM, inspection brief, sensor front-ends, injector turn-off, supervisor, driver architecture
sim/Twenty-four SPICE circuits that run and check themselves
hw/The ten schematic-sheet generators, the symbol/footprint generators and the netlist gate

Rebuilding the PDFs

bash
.venv/bin/python docs/build_pdf.py

Markdown documents are converted and printed; the handbook pages are printed as they stand, from a temporary copy with the print rules injected — the source HTML is never edited, so a PDF cannot drift from the page it came from.

Needs Chrome or Chromium on PATH (it is the renderer — the only engine here that handles the handbook's inline SVG schematics and CSS custom properties), plus markdown and pypdf:

bash
.venv/bin/pip install markdown pypdf

Page rules live in docs/print.css.

Running the circuit simulations

bash
.venv/bin/python sim/run_sim.py              # every block
.venv/bin/python sim/run_sim.py injector     # blocks matching "injector"

Each check is a claim about the circuit, so a red line means the design is wrong, not the simulator. All 26 blocks currently pass (on ngspice 42 — see docs/HANDOFF.md §2).

The netlists are plain SPICE — they also open directly in KiCad's built-in simulator (Tools → Simulator), LTspice, or standalone ngspice. See sim/README.md.

If .venv is missing, rebuild it:

bash
python3 -m venv .venv && .venv/bin/pip install PySpice numpy schemdraw markdown pypdf

Running the firmware on the PC

bash
make -C firmware/sim test                    # unit tests of the C core and the bootloader
.venv/bin/python firmware/sim/run_sil.py     # the 16 engine scenarios
.venv/bin/python firmware/sim/run_sil.py runaway   # scenarios matching "runaway"
.venv/bin/python firmware/sim/test_service.py      # the service tool end to end

The service tool reads and writes the end-of-line record and flashes the application, over USB, CAN channel 2 or the simulator (firmware guide §16). key.bin holds the 16 bytes of SEC_SECRET:

bash
T=firmware/tools/ecu_service.py
.venv/bin/python $T --link sim --secret key.bin info
.venv/bin/python $T --link usb:/dev/tty.usbmodem1 --secret key.bin eol-read
.venv/bin/python $T --link can:socketcan:can0 --secret key.bin flash app.bin \
    --sw-ver 0x00010002 --hw-min 0x0100 --hw-max 0x01FF

The simulator runs the same firmware live or from scripts, traced in a browser, on Windows, macOS or Linux with nothing to install (guide simulator/README.md):

bash
cd simulator && cargo run --release -p ecusim                 # the browser UI
cd simulator && cargo run --release -p ecusim -- run 'scenarios/sil/*.seq'

The C core in firmware/core/ touches no hardware. The simulator drives it with a model of the engine, generator and fuel rail. See decisions log §11, and §12 for the fault memory, event log, counters and trip recorder.

Preparing the PCB

The board is generated, then routed by hand in KiCad 10 (guide: docs/layout-guide.md). KP is KiCad's own Python:

bash
KP=/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/3.9/bin/python3
.venv/bin/python hw/test_schlib.py       # schematic regeneration keeps its UUIDs
.venv/bin/python hw/test_pcb_rules.py   # rules: widths, classes, regions, every power net classed
$KP hw/gen_pcb.py --selftest            # the generator's own checks, on a temp copy
$KP hw/gen_pcb.py                       # build hw/ecu25kva.kicad_pcb; on a routed board, rules only
.venv/bin/python hw/check_pcb.py        # footprints, nets, classes, widths, DRC

The outline, holes and J1001 are placeholders until the old ECU is measured: HOUSING and REGIONS in hw/pcb_rules.py.

The prototype board

A bench board that can be built now: the full production circuit with an STM32G474, screw terminals instead of the Bosch connector, 300 × 200 mm. Everything is in prototype/ (decisions log §15; bring-up guide prototype/docs/bring-up.md). Routing needs Java and Freerouting 2.4.1:

bash
export PATH=/Applications/KiCad/KiCad.app/Contents/MacOS:$PATH
export KICAD_SYMBOL_DIR=~/opt/kicad7-libs/kicad-symbols-7.0.11   # the symbols hw/ was drawn with
.venv/bin/python prototype/gen_prototype.py     # schematic: production sheets + mcu_stm32 + lab_io
.venv/bin/python prototype/check_prototype.py   # netlist gate, no open items
$KP prototype/gen_board.py setup                # fetch Freerouting, check its SHA-256
$KP prototype/gen_board.py route                # place, power pours, Freerouting (about 2 h)
$KP prototype/gen_board.py finish               # route what Freerouting left, rip-up, tidy
$KP prototype/gen_board.py sync                 # after a schematic change: rename, add new parts
$KP prototype/gen_board.py rip_thin             # tracks too thin for TRACK_AMPS out; then finish
$KP prototype/gen_board.py widen                # tracks up to 0.2 mm, TRACK_AMPS nets to their IPC width
$KP prototype/gen_board.py fab                  # prototype/fab/: Gerbers, drill, positions, BOM
.venv/bin/python prototype/test_prototype.py    # every prototype check

Where the project stands

Phase 1 is complete: twelve research memos, 25 verified circuit blocks covering the whole power chain, both sensor front-end topologies, the speed input, the injector boost rail and its reservoir, both actuator drivers and the CAN termination — and a specification carrying the corrections that simulation forced, including one front-end that could not have worked as originally specified.

Simulation has now caught a design error in roughly a third of the blocks written. The ones worth knowing about: the discrete input was impossible as a divider rather than merely mis-valued; the battery divider would have destroyed an ADC pin; the MCU decoupling peaked thirty times over target against the regulator's own output inductance; and the EMI filter handed back 12 dB at the exact frequency it most needed to hold.

Four unknowns closed on 18 September, from photographs of the machine and one manufacturer's manual — and three of the four closed against an inference this project had made. The engine is 3GK550ETA 4SR1, not the model memo 01 derived. The panel controller is a DSE4522, not the KG640C the OEM diagram shows. The connector is Bosch 1 928 405 192 / 194, code C. And the controller has no speed pickup, which memo 02 got right about the wrong device.

That cost the project its safety argument. The DSE4522 takes engine speed from our ECU over CAN, so its overspeed trip is not independent of the thing it protects against. Spec §3 is rewritten and the standalone overspeed trip module reverts from recommended to mandatory.

U12 now stands alone as the load-bearing unknown. Every protective action the controller can take ends by de-energising one fuel relay; whether its contacts remove supply from the ECU and fuel system, or merely signal a hung ECU, decides whether any independent protection exists. Memo 08 is the printed checklist for that measurement.

Three things deserve reading before anything gets built. Memo 06 on the CPCB IV+ position — and the machine's type approval is now a specific certificate, ARAI/MoEF/DGTA/IGES4/KOEL-P25/2825/24. The single-source flag on the MC33816 injector driver in Memo 07. And §3's closing note: no air-intake shutoff exists anywhere in this design, which means nothing here can stop a diesel running away on its own lubricating oil.

Parts

434
QtyValueFootprintReferences
27100nFCapacitor_SMD:C_0603_1608MetricC103, C105, C205, C212, C213, C215, C216, C218, C219, C406, C418, C419, C501, C503, C605, C607 +11
2010kResistor_SMD:R_0603_1608MetricR207, R301, R302, R307, R309, R403, R409, R509, R602, R605, R620, R803, R806, R809, R813, R817 +4
201kResistor_SMD:R_0603_1608MetricR310, R311, R410, R411, R412, R413, R508, R603, R606, R609, R610, R611, R612, R613, R614, R615 +4
17BAV199-QPackage_TO_SOT_SMD:SOT-23D104, D601, D602, D603, D604, D605, D606, D607, D608, D702, D703, D704, D801, D802, D803, D804 +1
141uF 25VCapacitor_SMD:C_0805_2012MetricC106, C409, C410, C411, C412, C413, C414, C415, C416, C502, C504, C505, C506, C507
1222nFCapacitor_SMD:C_0603_1608MetricC208, C209, C601, C602, C603, C604, C606, C608, C610, C612, C615, C705
12470RResistor_SMD:R_2010_5025MetricR419, R420, R422, R423, R425, R426, R427, R502, R503, R504, R505, R506
102.2uF 100VCapacitor_SMD:C_1210_3225MetricC101, C102, C107, C108, C109, C110, C201, C202, C402, C403
102N7002BKPackage_TO_SOT_SMD:SOT-23Q301, Q402, Q403, Q404, Q405, Q413, Q415, Q417, Q502, Q507
10HHXC800ARA820MJC5GCapacitor_SMD:CP_Elec_10x12.5C111, C112, C113, C114, C115, C116, C117, C118, C401, C420
9100nFCapacitor_SMD:C_0402_1005MetricC303, C304, C305, C306, C307, C308, C315, C317, C320
910kResistor_SMD:R_0805_2012MetricR607, R708, R801, R804, R807, R810, R811, R814, R815
9IPD90N10S4-06Package_TO_SOT_SMD:TO-252-2Q102, Q201, Q409, Q411, Q501, Q503, Q504, Q505, Q506
8VS-1EMH02HM3Diode_SMD:D_SMAD403, D404, D405, D406, D502, D503, D807, D808
74.7kResistor_SMD:R_0603_1608MetricR701, R702, R802, R805, R808, R812, R816
7PMBT3904-QPackage_TO_SOT_SMD:SOT-23Q407, Q419, Q801, Q802, Q803, Q804, Q805
7VS-16EDH02HM3ecu25kva:Vishay_SMPD_TO-263AC_K1_A2D408, D409, D410, D411, D412, D413, D414
6100kResistor_SMD:R_0603_1608MetricR204, R212, R703, R704, R820, R822
64.7uFCapacitor_SMD:C_0805_2012MetricC309, C801, C802, C803, C804, C805
547kResistor_SMD:R_0805_2012MetricR103, R108, R109, R305, R818
5AUIRS2181SPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU402, U403, U404, U405, U502
5INA592Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU601, U602, U603, U604, U605
5SQM85N15-19Package_TO_SOT_SMD:TO-263-2Q408, Q410, Q412, Q414, Q416
40R68 1206Resistor_SMD:R_1206_3216MetricR110, R111, R112, R113
43.3k 2512Resistor_SMD:R_2512_6332MetricR416, R417, R432, R433
460R0Resistor_SMD:R_0603_1608MetricR902, R903, R905, R906
4BZX84-C12-Qecu25kva:SOT-23_Zener_K1_A2D102, D106, D109, D301
4INA181A1Package_TO_SOT_SMD:SOT-23-6U406, U407, U501, U503
4SS20PH102HM3ecu25kva:TO-277A_K1_A2D103, D107, D110, D416
4TP GNDTestPoint:TestPoint_Keystone_5000-5004_MiniatureTP6, TP11, TP13, TP14
310nFCapacitor_SMD:C_0603_1608MetricC301, C302, C421
310uF 50VCapacitor_SMD:C_2220_5750MetricC214, C217, C220
31uFCapacitor_SMD:C_0805_2012MetricC206, C407, C704
3SMCJ43CA-HM3Diode_SMD:D_SMCD101, D105, D108
3TPS7B4253ecu25kva:TI_DDA0008J_HSOIC-8_EP2.95x4.9_Mask2.6x3.2U204, U205, U206
20RResistor_SMD:R_0603_1608MetricR303, R304
2100kResistor_SMD:R_0805_2012MetricR421, R424
211k 1WResistor_SMD:R_2512_6332MetricR401, R435
2120kResistor_SMD:R_0805_2012MetricR601, R604
212pFCapacitor_SMD:C_0402_1005MetricC318, C319
216kResistor_SMD:R_0603_1608MetricR608, R621
21nFCapacitor_SMD:C_0603_1608MetricC701, C702
21uFCapacitor_SMD:C_1206_3216MetricC104, C210
21uFCapacitor_SMD:C_0603_1608MetricC314, C316
22.2kResistor_SMD:R_0603_1608MetricR706, R707
224.9kResistor_SMD:R_0603_1608MetricR202, R438
24.7nFCapacitor_SMD:C_0603_1608MetricC903, C906
247kResistor_SMD:R_0603_1608MetricR414, R415
2499kResistor_SMD:R_1206_3216MetricR436, R437
2499k 1%Resistor_SMD:R_0603_1608MetricR105, R408
25.1kResistor_SMD:R_0603_1608MetricR312, R313
256RResistor_SMD:R_0603_1608MetricR418, R434
25mOhm 2W 1%Resistor_SMD:R_2512_6332MetricR428, R429
27.5kResistor_SMD:R_1210_3225MetricR430, R431
2AUIRS2184SPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU504, U505
2PMV280ENEAPackage_TO_SOT_SMD:SOT-23Q806, Q807
2PZTA42-QPackage_TO_SOT_SMD:SOT-223-3_TabPin2Q406, Q418
2SN74AHCT1G125-Q1Package_TO_SOT_SMD:SOT-23-5U801, U802
2SQM120P10-10m1LPackage_TO_SOT_SMD:TO-263-2Q103, Q104
2TCAN1042HGVPackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU901, U902
2TLV3201Package_TO_SOT_SMD:SOT-353_SC-70-5U101, U701
2XAL1510-103MEDInductor_SMD:L_Coilcraft_XAL1510-103L103, L104
2greenLED_SMD:LED_0603_1608MetricD303, D304
10437005.WRAFuse:Fuse_1206_3216MetricF101
1100RResistor_SMD:R_0603_1608MetricR209
110RResistor_SMD:R_0603_1608MetricR213
110k 0.1%Resistor_SMD:R_0603_1608MetricR211
110k 1%Resistor_SMD:R_0603_1608MetricR107
110k 1%Resistor_SMD:R_0805_2012MetricR104
110uFCapacitor_SMD:C_0805_2012MetricC207
110uF 25VCapacitor_SMD:C_1206_3216MetricC417
112.1kResistor_SMD:R_0603_1608MetricR206
1120RResistor_SMD:R_0603_1608MetricR101
1120kResistor_SMD:R_0603_1608MetricR308
115kResistor_SMD:R_0603_1608MetricR208
116kResistor_SMD:R_0805_2012MetricR709
1180R 1WResistor_SMD:R_2512_6332MetricR405
11kResistor_SMD:R_2512_6332MetricR710
11uF 100VCapacitor_SMD:C_1206_3216MetricC404
12.2nF/50V X7RCapacitor_SMD:C_0603_1608MetricC203

The 356 most common of 434 parts.

Questions

How big is the Prototype PCB?

It measures 300 × 200 mm and has 4 copper layers, 1.6 mm thick.

What parts does the Prototype use?

434 parts, built around the TCAN1042HGVDRQ1, AUIRS2181STR, INA592ID and TPS7B4253QDDARQ1. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Prototype KiCad files?

From the mohan4220/ecu25kva repository on GitHub, at the commit this page was made from: the board is prototype/prototype.kicad_pcb and its schematic hw/can.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Prototype design in my own project?

Its repository states no licence, so its author keeps all rights: ask mohan4220 before reusing the design.

More from mohan4220/ecu25kva

1
  • 4 layers180 × 130 mmEcu25kva, the printed circuit board in 3D

    Ecu25kva

    mohan4220/ecu25kva

    Replacement engine control unit for a 25 kVA Kirloskar diesel genset — engine 3GK550ETA 4SR1, application code GK3.8703, 26.5 kW at 1500 rpm, 12 V system. Panel controller is a Deep Sea Electronics DSE4522 MKII AMF.

    380 parts

Similar boards

  • 2 layers89.5 × 130 mmBMS 1.1, the printed circuit board in 3D

    BMS 1.1

    Purdue-Space-Program/PSPL_R4_Avionics_Hardware

    Boards and other components for R4

    113 parts2
  • 2 layers134.6 × 109.2 mmPacMan, the printed circuit board in 3D

    PacMan

    Lafayette-FSAE/PacMan

    A KiCad Schematic for PacMan, a Accumulator Management Board for the Lafayette FSAE Accumulator Management System

    169 parts1
  • 4 layers90 × 65 mmStaged board, the printed circuit board in 3D

    Staged board

    halbritt/fome-mc

    FOME-MC integrated single-PCB motorcycle ECU (STM32H753 + 2x STM32F042 WBO)

    331 parts1
  • 4 layers42 × 16 mmI CAN has carrot, the printed circuit board in 3D

    I CAN has carrot

    christophmuellerorg/voron_I_CAN_has_carrot_board

    An adapter board allowing to use the FYSETC ERB V1.0 or the SKR Pico via CAN

    13 parts6
  • 4 layers160 × 100 mmBench robotics controller 5eab0a5d, the printed circuit board in 3D

    Bench robotics controller 5eab0a5d

    mrcha033/hw-codesign

    Agentic hardware co-design: brief to KiCad, firmware, 3D review, and explicit fabrication blockers.

    46 parts2Apache-2.0
  • 4 layers160 × 100 mmLunar Hawks Rover Control, the printed circuit board in 3D

    Lunar Hawks Rover Control

    Matthew-Garcia/NASA-Lunabotics-UHCL-Lunar-Hawks

    UHCL Lunar Hawks proof-of-concept excavation rover: ROS 2, micro-ROS, MicroPython, control PCB development, CAD, and research.

    207 partsMIT
  • 4 layers163 × 117 mmTeensy 4.1 + Jetson Nano powered from board, the printed circuit board in 3D

    Teensy 4.1 + Jetson Nano powered from board

    olexsu/inos-rev-a-robotics-controller

    INOS Rev A — CAN-based robotic arm controller designed as a real-time motion-control node for NVIDIA Jetson robotics systems.

    157 partsMIT