AI Coding Agent Fixes NOx Emissions in a 1994 Jeep Cherokee for $3 in Hardware

    A 1994 Jeep Cherokee that failed California's smog test because of excessive NOx was eventually repaired using AI coding agents, a low-cost serial interface, and custom EEPROM code. This article explains the failure modes, the missing diagnostic path for pre-OBD2 vehicles, the Chrysler SCI protocol, the risks of writing to an ECU, and a reusable workflow for combining human verification with AI-assisted engineering on legacy hardware.}

    Introduction: A Classic Jeep That Could Not Pass the Smog Test

    A car owner used AI coding agents to repair a 1994 Jeep Cherokee that authorized dealerships could not fix. The vehicle eventually passed California’s smog test, with only about $3 in hardware costs.

    The 32-year-old Jeep Cherokee was powered by a 4.0L inline-six engine. It repeatedly failed California’s smog test because NOx emissions exceeded the limit. Each test cost about $100. The owner first replaced the oxygen sensor, but the emissions did not improve. Instead, they got worse.

    Dealerships had no practical path forward. The vehicle predated the modern OBD2 standard, and the diagnostic equipment commonly used at service centers could not communicate with the engine control unit. The ECU was produced in December 1993, before the North American OBD2 requirement took effect.

    This case is worth studying not simply because it saved money. It shows a different way to solve problems when standard tools no longer cover a long-tail failure case. With AI coding agents, an engineer can quickly cross into unfamiliar areas such as communication protocol reverse engineering, embedded development, and low-level storage writes. The cost of entry can be very low, while the problem itself may otherwise appear impossible to repair.

    This article abstracts the case into a neutral methodology for AI-assisted diagnosis and repair of legacy hardware.

    1. Why the NOx Problem Was Difficult

    1.1 The Physical Causes of Excess NOx

    NOx formation is strongly related to high combustion temperatures and oxygen-rich conditions. Older carbureted or early electronic fuel-injection vehicles are especially prone to high NOx when one or more of the following conditions exist:

    • Excessive ignition timing advance: Combustion peak temperature becomes too high, promoting the reaction between nitrogen and oxygen.
    • A lean air-fuel mixture: A higher air-fuel ratio leaves more oxygen available, which can also raise combustion temperature.
    • EGR system failure: If the EGR valve sticks or its passages become carbon-fouled, exhaust gas cannot recirculate properly, keeping combustion temperatures high.
    • Reduced cooling-system efficiency: The engine may operate at a higher overall temperature.

    The owner’s initial oxygen-sensor replacement was a typical component-swap repair. The oxygen sensor mainly affects closed-loop air-fuel-ratio control and has limited direct influence on NOx. Therefore, the result was not surprising: the new sensor may have changed the mixture in a way that made combustion more aggressive, and emissions increased.

    1.2 The Communication Barrier: No Modern Diagnostic Interface

    A 1994 vehicle predates the unified OBD2 standard, which became mandatory in North America in 1996. This Jeep used an earlier diagnostic path. Serial data had to be pulled from specific pins on the engine control unit.

    Dealership diagnostic equipment is generally designed for newer vehicles. It cannot adapt to this older protocol, so “the tool will not connect” becomes the first wall.

    1.3 The Traditional Repair Chain Was Broken

    Modern automotive repair depends heavily on standardized scan tools, service manuals, and parts databases. For vehicles more than 30 years old, that infrastructure may be incomplete or nonexistent.

    The dealership could not diagnose the problem not because the technicians lacked skill, but because the entire supporting toolchain had effectively disappeared.

    2. Breaking the Deadlock: Give the Problem to an AI Coding Agent

    2.1 Identifying the Communication Protocol

    The owner gave the problem to Claude Code, an AI coding tool from Anthropic. The AI first identified that the engine control unit used Chrysler’s older SCI protocol, or Serial Communications Interface.

    SCI was a common serial communication interface in early microcontrollers. It differs electrically from a standard RS-232 serial port. In particular, the signal line has the opposite polarity and requires an adapter.

    The key point is that the AI did not know the exact service manual for this specific model. However, based on general knowledge of SCI and automotive ECU communication architectures, it provided a reasonable direction. It guided the owner to use a multimeter to measure the diagnostic connector pin by pin.

    Eventually, three key pins were confirmed:

    • One pin provided 12V constant power, used to wake the system.
    • One pin was ground.
    • One pin was the SCI data line, using single-wire bidirectional communication.

    2.2 Hardware Adapter: A $3 “Translator”

    The solution was a $3 development board placed on a breadboard to act as a translator.

    The communication rate was about 7800 baud. This non-standard rate meant that common serial tools needed manual configuration. Default values such as 9600 or 115200 could not be used directly.

    Conceptual wiring diagram:

    1. [Jeep diagnostic connector, 6-pin]
    2. Pin A (12V) -----> Development board VCC, with current-limiting protection
    3. Pin B (GND) -----> Development board GND
    4. Pin C (SCI) <--> Development board GPIO/serial, with level shifting

    The main risk was that one pin carried 12V. Touching the wrong pin could damage the board. The AI recommended confirming voltage with a multimeter first, then adding simple protection such as a series resistor or a zener diode.

    After wiring was complete, the owner ran a simple serial monitoring script on a computer at 7800 baud.

    At first, the screen showed only garbled data. The AI then suggested trying different data-bit and stop-bit configurations. SCI commonly uses 8N1 or 8E1. It also provided a sequence of polling commands.

    After several attempts, real-time data from the ECU finally appeared: engine speed, intake airflow, ignition timing, oxygen sensor voltage, and other values.

    At that point, the diagnostic path was open. Further work could be done mostly at the software level.

    3. AI Can Also Make Mistakes: From Wrong Parameters to Self-Correction

    3.1 The Parameter Trap in Public Tools

    After communication was established, the owner tried a public open-source Chrysler scanner for diagnosis.

    The tool’s parameter table for this 1994 Jeep was wrong. It assumed that the ECU should add fuel under a certain condition, when in fact the ECU was subtracting fuel.

    If this error had gone unnoticed, it could have led to a serious misdiagnosis. The owner might have adjusted the fuel system based on incorrect assumptions, making the problem worse.

    3.2 How to Use AI for Cross-Validation

    This is where AI became useful. It did not blindly trust a single data source.

    When the actual data stream did not match expectations, the AI proposed several possibilities:

    1. The parameter table belonged to another model year in the same series.
    2. The ECU software version had a known bug.
    3. Some parameters were being interpreted with the wrong unit or numbering base.

    By comparing the raw byte stream returned by the ECU with physical behavior, such as injector pulse width and oxygen sensor feedback, the team confirmed that the parameter mapping was wrong.

    The lesson for developers is important: when relying on third-party libraries, tools, or documentation, data validation must remain a habit. AI coding agents can help locate parameter discrepancies quickly, but final conclusions still need to be checked against physical-world feedback.

    4. From Reading to Writing: Injecting Code Directly into the ECU

    4.1 The Difficulty Increases

    Diagnosis was only the first step. The real challenge was how to make the ECU accept new control logic that could reduce NOx emissions.

    The traditional approach would be to replace the ECU or reflash the calibration data. That usually requires specialized tools and authorization. The owner had neither.

    The AI proposed another approach: use the same three wires to send a small program to the ECU and make it run directly.

    4.2 First Attempt: A Short Stay in Volatile RAM

    OpenAI’s Codex, acting as another AI coding tool, wrote the first version of the program. It was injected into the ECU’s RAM for execution.

    RAM is volatile memory. After running a few diagnostic cycles, the ECU erased the code due to watchdog or memory-check mechanisms.

    The situation can be compared to running a script on someone else’s computer when a scheduled cleanup task removes it a few minutes later.

    4.3 Second Attempt: Writing to EEPROM

    Codex then changed strategy and moved the code into EEPROM, a type of electrically erasable programmable read-only memory that retains data after power is removed.

    The writing process had three steps:

    1. Unlock: Send a specific unlock sequence to enable EEPROM write mode.
    2. Erase and write: Erase the target area block by block, then write the new program byte by byte.
    3. Verify and jump: After writing, the ECU verifies the data. If successful, the jump vector is modified to point to the new program.

    The core logic of the new program was to reduce ignition timing under certain operating conditions, such as high-speed cruising, and to fine-tune injector pulse width. This lowered peak combustion temperature and reduced NOx formation.

    4.4 Safety Boundaries

    This step carried high risk. An incorrect write could brick the ECU.

    The AI recommended several precautions:

    • Back up the original EEPROM data first by reading it back through SCI and saving it.
    • Choose a non-critical boot area for the write operation.
    • Add a watchdog rollback mechanism. If the new program fails to send a heartbeat within a specified time, the system automatically returns to the original program.

    5. Validation: Passing California’s Smog Test

    The project took about one week. In the end, the Jeep passed California’s smog test. The report showed NOx reduced from above the limit to within the allowed range.

    The owner also admitted that he was not a professional automotive technician. Some of his judgments may have been wrong, and the result was based on a single vehicle. It had not yet undergone independent verification.

    This honesty is appropriate for technical practice. In safety-critical domains such as automotive repair, any modification should be validated thoroughly before being generalized.

    6. A General Methodology for AI Collaboration on Complex Long-Tail Problems

    This case can be abstracted into a collaboration pattern for developers.

    6.1 Role Division

    • Human: Responsible for physical wiring, voltage measurement, safe operation, and final validation.
    • AI: Responsible for protocol identification, script writing, parameter parsing, logical reasoning, and code generation.

    6.2 Iteration Path

    1. Describe the problem: Tell the AI the symptoms, previous attempts, and constraints.
    2. Narrow the scope: The AI generates hypotheses, while the human verifies them one by one using physical tools such as multimeters and oscilloscopes.
    3. Build a minimum viable solution: First prove that communication is possible at the lowest possible cost.
    4. Design for fault tolerance: Any write or modification step must include a rollback mechanism.
    5. Verify independently: After modification, confirm the result with objective tests, such as emissions testing or bench testing.

    6.3 Lessons for Developers

    • Do not give up just because the toolchain is missing. When standard tools do not support a legacy device, AI can help developers quickly enter unfamiliar technical areas.
    • Maintain a data-validation mindset. Parameter tables, documentation, and open-source code can all contain errors. Cross-validation is a basic skill.
    • Prioritize safety boundaries. In safety-critical areas such as hardware, vehicle control, and medical systems, AI-generated solutions must be reviewed by humans and verified in the physical world.
    • Document the process. Save key AI-generated scripts, wiring diagrams, and parameter configurations so they become reusable knowledge assets.

    7. Extending the Capability at the Cloud and Platform Level

    At a broader level, this practice shows a trend: AI coding tools can dramatically reduce the cost of solving long-tail problems. For engineering teams, the following general capabilities are worth considering.

    7.1 Knowledge Bases and RAG

    Legacy protocol documents, pin definitions, and communication parameters can be stored in a searchable knowledge base. When AI encounters similar problems, it can retrieve relevant references quickly.

    7.2 Automated Diagnostic Script Platforms

    Serial monitoring, protocol parsing, and data visualization can be packaged into reusable tools. This reduces repeated engineering effort.

    7.3 Model and Tool Collaboration

    Different AI models have different strengths. Some are better at logical reasoning, while others are better at code generation. Orchestrating multiple AI coding tools can cover more complex task chains.

    7.4 Security and Audit

    AI-generated code, modified firmware, and changed configurations should be version-controlled and auditable. This ensures traceability.

    If these capabilities are deployed on a cloud platform, container services can quickly provide runtime environments for diagnostic scripts. Object storage can archive EEPROM backups and test logs. Message queues can connect the stages of diagnosis, analysis, modification, and verification. Monitoring and alerting services can track device status in real time.

    Together, these capabilities can turn a one-off repair into a repeatable engineering system.

    8. Conclusion

    A 1994 Jeep Cherokee that authorized dealerships could not repair eventually passed California’s smog test with the help of AI coding agents and about $3 in hardware.

    The real value of this story is not simply saving money or showing off technical skill. It demonstrates a new collaboration model: when human engineering experience, observable behavior from the physical world, and AI code-generation ability are combined, many long-tail problems once considered unfixable or not worth fixing become solvable, controllable, and repeatable.

    For developers, this is both an expansion of the toolbox and an upgrade in mindset: stay curious, keep validating, and respect safety boundaries.