Community project
Create Me Good Schematic This Bread Board Setup
This breadboard setup connects an ESP32 microcontroller to a vehicle's OBD-II diagnostic port using the ISO 9141 K-line protocol. The project bridges automotive diagnostics with modern microcontrollers, enabling real-time communication with engine control units for reading fault codes, sensor data, and vehicle parameters.
The guide provides a complete wiring diagram, full parts list with sourcing information, ready-to-use Arduino firmware, and step-by-step assembly instructions. The build uses an L9637D K-line transceiver for protocol compliance, a 74AHCT125 level shifter for signal integrity, and a regulated 5 V supply with automotive-grade protection. After assembly and inspection, the transparent serial bridge firmware lets you interact directly with your vehicle's diagnostics system.
Wiring diagram

Gather all the parts
Assemble it in 7 steps
1. Place the two interface chips
Put the L9637D adapter or SO-8-to-DIP breakout across the centre gap of the breadboard. Put the 74AHCT125 DIP-14 across the centre gap too, with both chip notches facing the same way. The bare L9637D chip is too small for breadboard holes, so it needs a breakout board.
- The tiny dot or notch marks pin 1; check this before connecting any power.
- Putting a chip in backwards can send power into the wrong legs and damage it.
2. Add the fixed 5 V regulator
Use the small Pololu D24V5F5 fixed-output regulator board in the breadboard setup. Connect its GND pad to the ground rail. Connect its VOUT pad to the 5 V rail. This module has no adjustment screw: it makes 5 V automatically from the vehicle supply.
- This is the built-in power-conversion part of the interface circuit, not a separate adjustable bench converter.
- Do not connect the 5 V rail to the ESP32 3V3 pin; that can damage the ESP32.
3. Wire protected vehicle power
Connect OBD-II pin 16 to the IN side of the 500 mA fuse. From the fuse OUT side, connect one wire to the regulator VIN pad and another wire to the unbanded end of the 1N4148 diode. Connect the striped end of that diode to L9637D pin 7, VS. Connect OBD-II pins 4 and 5 to the shared ground rail.
- OBD pin 16 → fuse → regulator VIN (power); regulator GND → ground rail (ground); regulator VOUT → 5 V rail (power).
- The striped band on the 1N4148 faces the L9637D VS pin.
- OBD pin 16 can be live battery power even with the ignition off; never connect it to an ESP32 GPIO or its 3V3 pin.
- A short on a breadboard connected to a car can damage wiring; use the fuse and inspect for stray wire strands.
4. Power and filter the interface chips
Connect the 5 V rail to L9637D pin 3 VCC and 74AHCT125 pin 14 VCC. Connect L9637D pin 5 GND and 74AHCT125 pin 7 GND to the ground rail. Add the new 100 nF ceramic capacitor directly from L9637D pin 3 VCC to the ground rail, with its two leads as close to the L9637D as the breadboard allows. Connect ESP32 GND to that same ground rail. Keep the ESP32 powered through its USB connector during testing.
- L9637D VCC → 5 V (power), L9637D GND → GND (ground), 74AHCT125 VCC → 5 V (power), 74AHCT125 GND → GND (ground), ESP32 GND → GND (ground).
- Ceramic capacitors have no positive or negative side, so either lead can go to 5 V.
- Never put 5 V onto the ESP32 3V3 pin; swapped or excessive power can permanently damage it.
5. Wire the vehicle K-line
Connect the 510 Ω resistor from L9637D pin 7 VS to pin 6 K. Connect the original 100 nF ceramic capacitor from pin 7 VS to the ground rail. Connect OBD-II pin 7 to L9637D pin 6 K. Leave L9637D pins 2 LO and 8 LI empty because this build uses K-line only.
- 510 Ω resistor: VS → K (keeps the vehicle data wire at its normal high level).
- 100 nF capacitor: VS → GND (reduces electrical noise).
- Do not connect OBD-II pin 7 to an ESP32 pin: it uses vehicle-voltage signals and can destroy the ESP32.
6. Wire the ESP32 send and receive signals
On the ESP32 DevKit V1 right-hand header, use the hole labeled TX2 / GPIO17 for the send wire and the hole labeled RX2 / GPIO16 directly below it for the receive wire. Connect GPIO17 to 74AHCT125 pin 2, 1A. Connect 74AHCT125 pin 1, 1OE, to ground, then connect pin 3, 1Y, to L9637D pin 4 TX. For received data, connect L9637D pin 1 RX to the 12 kΩ resistor. Join the other end of that resistor to ESP32 GPIO16 and to one end of the 20 kΩ resistor. Connect the other 20 kΩ resistor end to ground.
- GPIO17 / TX2 → 1A (send data), 1OE → GND (turns the buffer on), 1Y → L9637D TX (safe 5 V send signal).
- L9637D RX → 12 kΩ → GPIO16 / RX2 (data); GPIO16 junction → 20 kΩ → GND (reduces 5 V received data to about 3.1 V).
- Do not use TX0 or RX0 near the top of the ESP32 header; those pins are used by the USB programming connection.
- Never connect L9637D RX straight to GPIO16; its 5 V output can damage the ESP32 input.
7. Inspect before plugging into the car
Before inserting the OBD connector, check that only pins 16, 4, 5, and 7 are used. Check that the fuse is between pin 16 and the circuit, the diode band faces L9637D VS, and the regulator VOUT only reaches the 5 V rail. Then plug the ESP32 into USB and use Schematik’s Deploy button to flash the serial-bridge firmware.
- The intended OBD wiring is pin 16 → fuse (power), pins 4 and 5 → ground rail (ground), and pin 7 → L9637D K (data).
- Do not use a loose breadboard circuit while driving; it can short or distract the driver.
- Pins 6 and 14 are CAN wires, not part of this K-line circuit.
Review all connections
1. Connections between "obd2_socket" and "ESP32"
2. Connections between "vs_diode" and "ESP32"
3. Connections between "k_pullup" and "ESP32"
4. Connections between "vs_capacitor" and "ESP32"
5. Connections between "kline_transceiver" and "ESP32"
6. Connections between "tx_buffer" and "ESP32"
7. Connections between "rx_bottom_resistor" and "ESP32"
8. Connections between "rx_top_resistor" and "ESP32"
9. Connections between "input_fuse" and "ESP32"
10. Connections between "buck_5v" and "ESP32"
11. Connections between "vcc_capacitor" and "ESP32"
Deploy the firmware
#include <Arduino.h>
// ESP32 UART2 connects to the L9637D K-line transceiver.
constexpr int KLINE_RX_PIN = 16;
constexpr int KLINE_TX_PIN = 17;
constexpr uint32_t KLINE_BAUD = 10400;
HardwareSerial KLine(2);
void setup() {
Serial.begin(115200);
KLine.begin(KLINE_BAUD, SERIAL_8N1, KLINE_RX_PIN, KLINE_TX_PIN);
Serial.println();
Serial.println("ESP32 K-line interface ready.");
Serial.println("UART2: 10400 baud, RX GPIO16, TX GPIO17.");
}
void loop() {
// This is a transparent bridge: bytes typed on USB serial are sent to K-line,
// and bytes returned by the vehicle are printed on USB serial.
while (Serial.available() > 0) {
KLine.write(static_cast<uint8_t>(Serial.read()));
}
while (KLine.available() > 0) {
Serial.write(static_cast<uint8_t>(KLine.read()));
}
}Remix this project
Make it yours in one click
Open a full copy of this project in your own Schematik workspace — diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.




