Bab 1: Pendahuluan
Latar belakang, tujuan, dan ruang lingkup proyek ECU Scanner
1.1 Latar Belakang
Honda Scoopy 2023 merupakan skutik populer di Indonesia yang telah menggunakan sistem injeksi bahan bakar elektronik PGM-FI (Programmed Fuel Injection) dengan ECU Keihin (Part Number: 30400-K2F-N01). Sistem PGM-FI mengandalkan Electronic Control Unit (ECU) untuk mengelola pembakaran secara presisi berdasarkan data dari berbagai sensor seperti TPS, ECT, IAT, MAP, CKP, dan O2 sensor.
Dalam praktik bengkel dan pendidikan teknik, kemampuan membaca data live ECU dan kode kerusakan (DTC - Diagnostic Trouble Code) sangatlah penting. Namun, alat scanner komersial seperti Honda Diagnostic System (HDS) memiliki harga yang sangat mahal dan tidak terjangkau oleh bengkel kecil maupun institusi pendidikan. Scanner aftermarket generik seringkali tidak mendukung protokol proprietary Honda secara penuh.
Proyek ini bertujuan membangun scanner ECU open-source berbasis Intel Genuino 101 yang mampu berkomunikasi dengan ECU Honda Scoopy 2023 melalui protokol K-Line (ISO 9141-2 Honda variant) pada baudrate 10.400 bps. Data yang diperoleh ditampilkan secara real-time melalui web dashboard yang terhubung via Bluetooth Low Energy (BLE) 4.0 menggunakan Web Bluetooth API.
Proyek ini bersifat open-source dan ditujukan untuk keperluan edukasi serta pengembangan komunitas. Bukan untuk penggunaan komersial atau modifikasi ECU.
1.2 Tujuan
- Merancang antarmuka hardware yang mampu menghubungkan Genuino 101 dengan ECU Honda Scoopy 2023 melalui K-Line menggunakan IC transceiver L9637D dan level shifter BSS138.
- Mengimplementasikan protokol komunikasi K-Line (ISO 9141-2 Honda variant) untuk mengirim query dan menerima respons data dari ECU pada baudrate 10.400 bps.
- Membangun web dashboard real-time yang terhubung via BLE 4.0 menggunakan Web Bluetooth API di browser Chrome, menampilkan data sensor secara live dengan grafik interaktif.
- Menyediakan fitur pembacaan DTC (Diagnostic Trouble Code), data logging ke CSV, mode gelap (dark mode), serta dukungan multi-bahasa (Indonesia/English).
1.3 Ruang Lingkup
Proyek ini mencakup perancangan skematik hardware lengkap, pengembangan firmware Genuino 101, implementasi komunikasi BLE GATT, dan pembuatan web dashboard berbasis HTML/CSS/JavaScript.
Target Spesifik
ECU Target: Honda Scoopy 2023 - ECU Keihin (30400-K2F-N01)
Protokol: K-Line ISO 9141-2 Honda variant, baudrate 10.400 bps
Mikrokontroler: Intel Genuino 101 (Intel Curie module)
Konektivitas: Bluetooth Low Energy 4.0 built-in
Dashboard: Web Bluetooth API (Chrome 56+)
Bab 2: Tinjauan Pustaka
Landasan teori komponen dan teknologi yang digunakan
2.1 Intel Genuino 101
Intel Genuino 101 (juga dikenal sebagai Arduino 101 di AS) adalah board mikrokontroler yang menggunakan modul Intel Curie. Board ini menggabungkan prosesor x86 (Quark SE) dan ARC EM untuk sensor processing, dilengkapi dengan Bluetooth Low Energy 4.0 dan IMU 6-axis (BMI160) secara built-in. Board ini ideal untuk proyek IoT yang membutuhkan konektivitas BLE tanpa modul eksternal.
| Parameter | Spesifikasi |
|---|---|
| Processor | Intel Curie (x86 Quark SE + ARC EM) @32MHz |
| Flash Memory | 196 KB |
| SRAM | 24 KB |
| Operating Voltage | 3.3V (toleran 5V di I/O pins) |
| Digital I/O Pins | 14 (4 PWM output) |
| Analog Input Pins | 6 |
| Bluetooth | BLE 4.0 (built-in) |
| IMU | BMI160 (accelerometer + gyroscope 6-axis) |
| Clock Speed | 32 MHz |
| Input Voltage (VIN) | 7-12V (rekomendasi), 7-20V (batas) |
| USB | Micro-USB (programming + power) |
| Dimensi | 68.6 x 53.4 mm |
Catatan: Intel Genuino 101 telah dihentikan produksinya (discontinued) sejak tahun 2017. Namun, board ini masih tersedia di pasaran dan library CurieBLE tetap kompatibel. Untuk proyek baru, pertimbangkan Arduino Nano 33 BLE sebagai alternatif.
2.2 Honda PGM-FI (Programmed Fuel Injection)
PGM-FI adalah sistem injeksi bahan bakar elektronik yang dikembangkan oleh Honda. Pada Honda Scoopy 2023, sistem ini menggunakan ECU Keihin yang memproses data dari berbagai sensor untuk mengontrol timing dan durasi injeksi bahan bakar, serta timing pengapian secara optimal.
Sensor-sensor PGM-FI
| Sensor | Singkatan | Fungsi | Output |
|---|---|---|---|
| Throttle Position Sensor | TPS | Mengukur posisi bukaan throttle body | 0.5-4.5V (analog) |
| Engine Coolant Temperature | ECT | Mengukur suhu cairan pendingin mesin | NTC thermistor |
| Intake Air Temperature | IAT | Mengukur suhu udara masuk (intake) | NTC thermistor |
| Manifold Absolute Pressure | MAP | Mengukur tekanan absolut di intake manifold | 0.5-4.5V (analog) |
| Crankshaft Position Sensor | CKP | Mendeteksi posisi dan kecepatan crankshaft | Pulsa AC |
| Oxygen Sensor | O2 | Mengukur kadar oksigen di gas buang | 0-1V (switching) |
Aktuator PGM-FI
| Aktuator | Fungsi | Kontrol |
|---|---|---|
| Fuel Injector | Menyemprotkan bahan bakar ke intake port | Pulse Width Modulation (durasi injeksi) |
| Ignition Coil | Menghasilkan percikan api di busi | Timing pengapian (advance/retard) |
| IACV (Idle Air Control Valve) | Mengontrol udara idle bypass | Duty cycle stepper motor |
| Fuel Pump Relay | Mengaktifkan pompa bahan bakar | On/Off relay control |
| MIL (Malfunction Indicator Lamp) | Indikator kerusakan di dashboard | On/Off + blink pattern |
2.3 K-Line ISO 9141-2
K-Line adalah bus komunikasi diagnostik single-wire, half-duplex yang digunakan pada kendaraan, terutama pada motor Honda. Protokol ini mengacu pada standar ISO 9141-2 dengan variasi proprietary Honda. Jalur K-Line dalam keadaan idle berada pada level tegangan 12V (battery voltage) dan ditarik rendah (0V) saat mengirim data.
Karakteristik K-Line Honda
- Tipe Komunikasi: Single-wire, half-duplex (bidireksi pada satu jalur)
- Level Tegangan Idle: 12V (pulled up ke battery melalui resistor di ECU)
- Level Tegangan Aktif: 0V (logika terbalik)
- Baudrate: 10.400 bps (Honda proprietary, bukan standar 10.200 bps)
- Format Data: 8 data bits, no parity, 1 stop bit (8N1)
- Wake-up: Slow init melalui DLC SCS pin shorting
- Protokol Pesan: Honda proprietary (bukan standar OBD-II PID)
Berbeda dengan K-Line standar ISO 9141-2 yang menggunakan baudrate 10.200 bps, Honda menggunakan 10.400 bps. Selain itu, format pesan Honda juga proprietary dan tidak mengikuti format OBD-II PID standar. Ini membuat scanner generik OBD-II tidak kompatibel dengan motor Honda.
2.4 BLE 4.0 (Bluetooth Low Energy)
Bluetooth Low Energy (BLE) 4.0 adalah protokol komunikasi nirkabel berdaya rendah yang ideal untuk perangkat IoT. BLE menggunakan model client-server berbasis GATT (Generic Attribute Profile) untuk pertukaran data.
Hirarki GATT
| Level | Komponen | Deskripsi |
|---|---|---|
| 1 | Profile | Kumpulan service yang mendefinisikan use case (e.g., ECU Scanner Profile) |
| 2 | Service | Kumpulan characteristic terkait (e.g., ECU Data Service UUID: 0xFFE0) |
| 3 | Characteristic | Unit data individual (e.g., Sensor Data Characteristic UUID: 0xFFE1) |
| 4 | Descriptor | Metadata tambahan untuk characteristic (e.g., CCCD untuk notification) |
BLE MTU dan Web Bluetooth
BLE default MTU (Maximum Transmission Unit) adalah 23 bytes, dengan payload efektif 20 bytes setelah dikurangi header ATT. Untuk mengirim data sensor ECU yang lebih besar, data dipecah menjadi paket-paket 20 bytes dan dikirim sebagai notifikasi berturut-turut.
Web Bluetooth API tersedia di Chrome 56+ dan memungkinkan aplikasi web mengakses perangkat BLE tanpa instalasi native app. API ini mendukung scanning, connecting, reading/writing characteristics, dan subscribing ke notifications.
Bab 3: Arsitektur Sistem
Diagram blok, Bill of Materials, dan alur data sistem
3.1 Block Diagram Sistem
Sistem ECU Scanner terdiri dari beberapa blok utama yang saling terhubung. Dimulai dari ECU Honda Scoopy yang terhubung ke DLC (Data Link Connector), sinyal K-Line dikonversi oleh IC L9637D, level tegangan disesuaikan oleh BSS138, diproses oleh Genuino 101, dan data dikirim via BLE ke web dashboard.
System Architecture Block Diagram
ECU Keihin → DLC 4-Pin → L9637D (K-Line Transceiver) → BSS138 (Level Shifter 5V↔3.3V) → Genuino 101 (Intel Curie + BLE) → Web Dashboard
3.2 Bill of Materials (BOM)
| No | Komponen | Part Number | Qty | Fungsi | Est. Harga |
|---|---|---|---|---|---|
| 1 | Intel Genuino 101 | DEV-13787 | 1 | Mikrokontroler utama + BLE | Rp 450.000 |
| 2 | L9637D | L9637D (SO-8) | 1 | K-Line bus transceiver | Rp 25.000 |
| 3 | BSS138 Level Shifter Module | BSS138 (4-ch) | 1 | Bidirectional level shifter 3.3V/5V | Rp 8.000 |
| 4 | LM2596 Step-Down Module | LM2596-5.0 | 1 | Voltage regulator 12V → 5V | Rp 15.000 |
| 5 | Schottky Diode | 1N5825 | 1 | Diode proteksi flyback LM2596 | Rp 3.000 |
| 6 | Inductor 33uH | SRN6045-330M | 1 | Induktor filter LM2596 | Rp 5.000 |
| 7 | Capacitor 680uF 25V | Electrolytic | 1 | Input filter capacitor | Rp 2.000 |
| 8 | Capacitor 220uF 25V | Electrolytic | 1 | Output filter capacitor | Rp 2.000 |
| 9 | DLC Connector 4-Pin | Honda OBD | 1 | Konektor diagnostik Honda | Rp 35.000 |
| 10 | Resistor 510 Ohm | 1/4W | 2 | Pull-up untuk K-Line | Rp 500 |
| 11 | Capacitor 100nF | Ceramic | 3 | Decoupling capacitor | Rp 500 |
3.3 Alur Data
Alur data dalam sistem ECU Scanner mengikuti jalur berikut:
- Inisialisasi: Genuino 101 mengirim wake-up sequence ke ECU melalui K-Line (L9637D). ECU merespons dengan acknowledgment.
- Query Data: Genuino mengirim pesan query (format Honda proprietary) ke ECU. Setiap query meminta tabel data tertentu (T10, T11, T20, T21, dll).
- Respons ECU: ECU merespons dengan paket data berisi nilai sensor mentah (raw bytes). Data ini perlu dikonversi menggunakan formula spesifik per sensor.
- Pemrosesan: Firmware Genuino mengekstrak dan mem-buffer data sensor dari respons ECU.
- Transmisi BLE: Data sensor yang sudah diproses dipecah menjadi paket-paket 20 bytes dan dikirim sebagai BLE notification ke web dashboard.
- Visualisasi: Web dashboard menerima data via Web Bluetooth API, mengkonversi raw bytes menjadi nilai terukur, dan menampilkan dalam gauge, grafik, dan tabel real-time.
Bab 4: Perancangan Hardware
Desain sirkuit detail setiap modul hardware
4.1 DLC Connector (Data Link Connector)
DLC (Data Link Connector) pada Honda Scoopy 2023 adalah konektor diagnostik 4-pin yang terletak di bawah jok atau dekat battery box. Konektor ini menyediakan akses ke jalur K-Line untuk komunikasi diagnostik dengan ECU.
DLC Connector Schematic
Honda 4-Pin DLC Pinout Diagram
Pinout DLC Honda Scoopy 2023
| Pin | Nama | Warna Kabel | Fungsi | Koneksi |
|---|---|---|---|---|
| 1 | GND | Hijau | Ground / massa | Chassis ground |
| 2 | K-Line | Putih/Hijau | Jalur komunikasi data K-Line | L9637D Pin 1 (K) |
| 3 | SCS (Service Check Signal) | Coklat | Short ke GND untuk mode diagnostik | GND (via jumper) |
| 4 | +12V Battery | Merah/Hitam | Tegangan battery positif | LM2596 VIN |
Penting: Pin SCS (Service Check Signal) harus di-short ke GND untuk mengaktifkan mode diagnostik pada ECU Honda. Tanpa shorting SCS, ECU tidak akan merespons query K-Line.
4.2 L9637D K-Line Transceiver
L9637D adalah IC transceiver K-Line buatan STMicroelectronics yang berfungsi sebagai interface antara mikrokontroler (level TTL/CMOS) dengan bus K-Line (level 12V). IC ini mengkonversi sinyal TX digital menjadi sinyal K-Line dan sebaliknya untuk RX.
L9637D Circuit Schematic
K-Line Interface Circuit with Decoupling Capacitors
Pinout L9637D (SO-8 Package)
| Pin | Nama | Tipe | Fungsi | Koneksi |
|---|---|---|---|---|
| 1 | K | I/O | K-Line bus (open-drain) | DLC Pin 2 (K-Line) |
| 2 | GND | Power | Ground | Common ground |
| 3 | VS | Power | Battery supply (7-40V) | +12V dari DLC Pin 4 |
| 4 | VCC | Power | Logic supply (5V ± 10%) | 5V dari LM2596 |
| 5 | EN | Input | Enable (active HIGH) | 5V (always enabled) |
| 6 | TX | Input | Transmit data (dari MCU) | BSS138 HV1 (via level shifter) |
| 7 | RX | Output | Receive data (ke MCU) | BSS138 HV2 (via level shifter) |
| 8 | L | I/O | L-Line bus (tidak digunakan) | NC (Not Connected) |
Absolute Maximum Ratings
| Parameter | Symbol | Min | Max | Unit |
|---|---|---|---|---|
| Battery Supply Voltage | VS | -0.3 | 40 | V |
| Logic Supply Voltage | VCC | -0.3 | 7 | V |
| K-Line Voltage | VK | -2 | 40 | V |
| Operating Temperature | Top | -40 | 125 | °C |
| Storage Temperature | Tstg | -55 | 150 | °C |
| ESD (HBM) | - | - | 4000 | V |
Electrical Characteristics (VCC=5V, T=25°C)
| Parameter | Symbol | Min | Typ | Max | Unit |
|---|---|---|---|---|---|
| Supply Current (active) | ICC | - | 5 | 15 | mA |
| TX Input HIGH | VIH | 2.0 | - | VCC | V |
| TX Input LOW | VIL | 0 | - | 0.8 | V |
| RX Output HIGH | VOH | 3.5 | - | VCC | V |
| RX Output LOW | VOL | 0 | - | 0.4 | V |
| K-Line Output LOW | VKOL | 0 | - | 2.0 | V |
| Baud Rate Max | fmax | - | - | 57.6 | kbps |
| Propagation Delay TX to K | tpd | - | 2 | 5 | μs |
4.3 BSS138 Bidirectional Level Shifter
BSS138 adalah N-channel MOSFET yang digunakan sebagai bidirectional logic level shifter antara domain tegangan 3.3V (Genuino 101) dan 5V (L9637D). Modul level shifter 4-channel menggunakan BSS138 MOSFET dengan pull-up resistor pada kedua sisi.
BSS138 Level Shifter Schematic
Bidirectional 3.3V ↔ 5V Level Shifting Circuit
Spesifikasi BSS138 Module
| Parameter | Nilai |
|---|---|
| MOSFET Type | N-Channel Enhancement |
| VDS(max) | 50V |
| VGS(th) | 0.8 - 1.5V |
| ID(max) | 220 mA |
| RDS(on) | ~0.9 Ω @ VGS=4.5V |
| LV Reference | 3.3V (dari Genuino 101) |
| HV Reference | 5V (dari LM2596) |
| Pull-up Resistors | 10KΩ pada kedua sisi |
| Channels | 4 bidirectional |
| Bandwidth | >100 kHz |
Prinsip Kerja 3 State
State 1: Idle (Tidak Ada yang Men-drive)
Kedua sisi ditarik HIGH oleh pull-up resistor masing-masing. LV side = 3.3V, HV side = 5V. MOSFET OFF (VGS = 0V, sumber di 3.3V, gate di 3.3V).
State 2: LV Side Drives LOW (TX dari Genuino)
Genuino menarik LV pin ke LOW (0V). VGS = 3.3V > Vth, MOSFET ON. Drain (HV side) ditarik LOW melalui MOSFET. Hasil: 0V di kedua sisi.
State 3: HV Side Drives LOW (RX dari L9637D)
L9637D menarik HV pin ke LOW (0V). Body diode MOSFET forward-bias, drain (LV side) turun ke ~0.7V. VGS meningkat, MOSFET ON penuh. Hasil: ~0V di kedua sisi.
4.4 LM2596 Step-Down Voltage Regulator
LM2596 adalah IC step-down (buck) voltage regulator dari Texas Instruments yang mampu mengkonversi tegangan 12V dari battery Honda Scoopy menjadi 5V stabil untuk mensuplai L9637D dan Genuino 101 (via VIN pin).
LM2596 Step-Down Regulator Circuit
12V Input → 5V Output @ 3A
Spesifikasi LM2596
| Parameter | Nilai |
|---|---|
| Input Voltage Range | 4.5V - 40V |
| Output Voltage (fixed) | 5V (±4%) |
| Output Current (max) | 3A |
| Switching Frequency | 150 kHz (fixed) |
| Efficiency | ~73% @ 12V in, 5V out, 1A |
| Quiescent Current | ~5 mA |
| Operating Temperature | -40°C ~ +125°C |
| Package | TO-263-5 (D2PAK) |
Komponen Eksternal LM2596
| Komponen | Nilai | Tipe | Fungsi |
|---|---|---|---|
| CIN | 680 μF / 25V | Electrolytic | Input filter, meredam ripple |
| COUT | 220 μF / 25V | Electrolytic | Output filter, stabilisasi output |
| L1 | 33 μH | Shielded inductor | Induktor penyimpan energi switching |
| D1 | 1N5825 | Schottky 5A 40V | Freewheeling diode (flyback) |
| CFF | 100 nF | Ceramic | Feedforward capacitor (opsional) |
4.5 Genuino 101 Pin Assignment
Berikut adalah pin assignment Genuino 101 yang digunakan dalam proyek ECU Scanner. Hanya beberapa pin yang digunakan karena komunikasi utama menggunakan SoftwareSerial untuk K-Line dan BLE built-in untuk wireless.
Genuino 101 Pin Assignment Diagram
Pin mapping untuk ECU Scanner project
| Genuino Pin | Tipe | Fungsi di Proyek | Koneksi ke | Keterangan |
|---|---|---|---|---|
| D10 | Digital (TX) | SoftwareSerial TX | BSS138 LV1 → L9637D TX (Pin 6) | Kirim data ke ECU via K-Line |
| D11 | Digital (RX) | SoftwareSerial RX | BSS138 LV2 → L9637D RX (Pin 7) | Terima data dari ECU via K-Line |
| VIN | Power Input | Board power supply | LM2596 Output 5V | Supply 5V dari regulator (melewati on-board regulator 3.3V) |
| 3.3V | Power Output | LV reference BSS138 | BSS138 LV VCC | Referensi tegangan rendah untuk level shifter |
| GND | Power | Common ground | Semua GND komponen | Ground bersama seluruh sistem |
| BLE (internal) | RF | Wireless data transfer | Web Dashboard (Chrome) | BLE 4.0 built-in, tidak memerlukan pin fisik |
3D Board Viewer
Interactive 3D Board Viewer
Rotate: Click + Drag | Zoom: Scroll | Pan: Right-click + Drag
4.6 Full Wiring Diagram
Diagram wiring lengkap menunjukkan seluruh koneksi antar modul hardware dari DLC konektor Honda Scoopy hingga Genuino 101, termasuk power supply dan level shifting.
Complete Wiring Diagram
DLC → L9637D → BSS138 → Genuino 101 | LM2596 Power Supply
Bab 5: Perancangan Software
Arsitektur firmware, state machine, dan fitur web dashboard
5.1 Arsitektur Software
Arsitektur software terdiri dari dua komponen utama: firmware Genuino 101 (C/C++ Arduino) dan web dashboard (HTML/CSS/JavaScript). Firmware mengelola komunikasi K-Line dan BLE GATT server, sementara web dashboard bertindak sebagai BLE GATT client yang menampilkan data secara real-time.
Software Architecture Diagram
Firmware Layer (K-Line + BLE) | Web Dashboard Layer (Web Bluetooth + UI)
5.2 Firmware State Machine
Firmware Genuino 101 menggunakan finite state machine (FSM) untuk mengelola alur komunikasi dengan ECU. Setiap state memiliki tugas spesifik dan transisi yang jelas.
| State | Deskripsi | Entry Action | Transisi ke | Kondisi Transisi |
|---|---|---|---|---|
IDLE |
Menunggu koneksi BLE dari web dashboard | LED OFF, K-Line idle | WAKING_UP | BLE client terkoneksi & mengirim perintah "start" |
WAKING_UP |
Mengirim wake-up sequence ke ECU | Kirim byte 0xFE ke K-Line, tunggu echo | INITIALIZING | Wake-up ACK diterima dari ECU |
INITIALIZING |
Handshake protokol dengan ECU | Kirim init message (72 05 00 F0 99) | CONNECTED | Init response valid diterima |
CONNECTED |
Polling data sensor secara periodik | Mulai query loop T10/T11/T20/T21 | ERROR / IDLE | Timeout / BLE disconnect |
ERROR |
Error recovery dan retry | LED blink, log error, reset K-Line | WAKING_UP / IDLE | Auto-retry 3x / BLE disconnect |
5.3 Web Dashboard Features
| No | Fitur | Teknologi | Deskripsi |
|---|---|---|---|
| 1 | BLE Connection | Web Bluetooth API | Scan, connect, dan subscribe ke BLE GATT notifications dari Genuino 101 |
| 2 | Live Data Display | Canvas / SVG Gauges | Menampilkan RPM, TPS, ECT, IAT, MAP, O2, VSS, battery voltage secara real-time |
| 3 | DTC Reader | JavaScript | Membaca dan menampilkan Diagnostic Trouble Codes dengan deskripsi ID/EN |
| 4 | Real-time Charts | Chart.js / Canvas | Grafik time-series untuk monitoring trend sensor (RPM, TPS, temperature) |
| 5 | Data Logging | IndexedDB | Menyimpan session data secara lokal di browser untuk analisis offline |
| 6 | CSV Export | Blob API | Mengekspor data log ke format CSV untuk analisis di spreadsheet |
| 7 | Dark Mode | CSS Variables | Toggle antara tema terang dan gelap, preferensi disimpan di localStorage |
| 8 | Internationalization | i18n JSON | Dukungan multi-bahasa Indonesia dan English, switchable tanpa reload |
5.4 Contoh Kode Firmware
// ECU Scanner Firmware - Genuino 101
// Pseudocode: Setup dan Inisialisasi
#include <CurieBLE.h>
#include <SoftwareSerial.h>
// K-Line pins
const int KLINE_TX = 10;
const int KLINE_RX = 11;
SoftwareSerial kLine(KLINE_RX, KLINE_TX);
// BLE Service & Characteristic
BLEService ecuService("FFE0");
BLECharacteristic dataChar("FFE1", BLERead | BLENotify, 20);
enum State { IDLE, WAKING_UP, INITIALIZING, CONNECTED, ERROR };
State currentState = IDLE;
void setup() {
Serial.begin(115200);
kLine.begin(10400); // Honda K-Line baudrate
// Initialize BLE
BLE.begin();
BLE.setLocalName("ECU-Scanner");
BLE.setAdvertisedService(ecuService);
ecuService.addCharacteristic(dataChar);
BLE.addService(ecuService);
BLE.advertise();
}
void loop() {
BLEDevice central = BLE.central();
if (central) {
handleStateMachine();
}
}Arduino C++
Bab 6: Protokol Komunikasi
Detail protokol K-Line Honda, format pesan, dan BLE GATT
6.1 K-Line Timing Diagram
Komunikasi K-Line dimulai dengan wake-up sequence, diikuti oleh init handshake, dan kemudian query-response loop. Timing yang tepat sangat kritikal untuk keberhasilan komunikasi.
K-Line Timing Diagram
Wake-up (25ms) → Init Delay (50ms) → Init Message → ECU Response → Query Loop
6.2 K-Line Simulator
Simulator interaktif untuk memvisualisasikan komunikasi K-Line antara scanner dan ECU. Kirim query dan lihat respons ECU secara real-time.
K-Line Protocol Simulator
Click "Run" to simulate wake-up, init, and query sequence
6.3 Format Pesan K-Line Honda
Setiap pesan K-Line Honda mengikuti format berikut:
// Format Pesan K-Line Honda
// [Header] [ByteCount] [QueryType] [TableNumber] [Checksum]
72 [ByteCount] [QueryType] [TableNumber] [Checksum]
// Header : 0x72 (fixed untuk Honda)
// ByteCount : Total bytes termasuk header hingga sebelum checksum
// QueryType : 0x00=Init, 0x71=Data Query, 0x72=DTC Query
// TableNumber : Nomor tabel data yang diminta (0x10, 0x11, 0x20, dll)
// Checksum : 256 - (sum of all bytes) mod 256Protocol
Contoh Pesan K-Line
| Nama Pesan | Hex Bytes | Penjelasan |
|---|---|---|
| Wake-up Request | FE 04 72 8C | Byte awal wake-up ke ECU, trigger init sequence |
| Init Handshake | 72 05 00 F0 99 | Header + 5 bytes + init type 0x00 + param 0xF0 + checksum |
| Query Table 10 | 72 05 71 10 08 | Request data tabel 10 (sensor group 1: RPM, TPS, ECT) |
| Query Table 11 | 72 05 71 11 07 | Request data tabel 11 (sensor group 2: IAT, MAP, O2) |
| Query Table 20 | 72 05 71 20 F8 | Request data tabel 20 (vehicle speed, battery voltage) |
| Query Table 21 | 72 05 71 21 F7 | Request data tabel 21 (injector, ignition timing) |
| Query DTC | 72 05 72 00 17 | Request Diagnostic Trouble Codes stored in ECU |
| Clear DTC | 72 05 60 00 29 | Clear/reset semua DTC yang tersimpan di ECU |
6.4 Sensor Byte Mapping
Respons dari ECU berisi raw bytes yang perlu dikonversi menggunakan formula spesifik untuk mendapatkan nilai sensor yang terukur.
| No | Sensor | Byte Position | Raw Range | Formula Konversi | Unit | Range Terukur |
|---|---|---|---|---|---|---|
| 1 | RPM | Byte 2-3 (T10) | 0x0000-0xFFFF | (byte2 * 256 + byte3) / 4 | rpm | 0 - 16383 |
| 2 | TPS (Throttle) | Byte 4-5 (T10) | 0x0000-0xFFFF | (byte4 * 256 + byte5) * 100 / 1024 | % | 0 - 100 |
| 3 | ECT (Coolant Temp) | Byte 6-7 (T10) | 0x00-0xFF | byte6 - 40 | °C | -40 ~ 215 |
| 4 | IAT (Intake Temp) | Byte 2-3 (T11) | 0x00-0xFF | byte2 - 40 | °C | -40 ~ 215 |
| 5 | MAP (Manifold Press) | Byte 4-5 (T11) | 0x00-0xFF | byte4 * 1.0 | kPa | 0 - 255 |
| 6 | O2 Sensor Voltage | Byte 6-7 (T11) | 0x0000-0xFFFF | (byte6 * 256 + byte7) / 1000 | V | 0 - 5.0 |
| 7 | Vehicle Speed (VSS) | Byte 2 (T20) | 0x00-0xFF | byte2 * 1.0 | km/h | 0 - 255 |
| 8 | Battery Voltage | Byte 3-4 (T20) | 0x00-0xFF | byte3 * 0.1 | V | 0 - 25.5 |
| 9 | Injector Duration | Byte 2-3 (T21) | 0x0000-0xFFFF | (byte2 * 256 + byte3) / 250 | ms | 0 - 262 |
| 10 | Ignition Advance | Byte 4-5 (T21) | 0x0000-0xFFFF | (byte4 * 256 + byte5 - 128) / 4 | °BTDC | -32 ~ 32 |
| 11 | IACV Position | Byte 6 (T21) | 0x00-0xFF | byte6 * 100 / 255 | % | 0 - 100 |
| 12 | Fuel Trim Short | Byte 7 (T21) | 0x00-0xFF | (byte7 - 128) * 100 / 128 | % | -100 ~ +100 |
| 13 | Fuel Trim Long | Byte 8 (T21) | 0x00-0xFF | (byte8 - 128) * 100 / 128 | % | -100 ~ +100 |
| 14 | AFR (Air-Fuel Ratio) | Byte 8-9 (T11) | 0x0000-0xFFFF | (byte8 * 256 + byte9) / 1000 | ratio | 0 - 65.5 |
| 15 | Barometric Pressure | Byte 5 (T20) | 0x00-0xFF | byte5 * 1.0 | kPa | 0 - 255 |
| 16 | Cranking RPM Flag | Byte 6 (T20) | 0x00-0x01 | byte6 & 0x01 | bool | 0 / 1 |
| 17 | Starter Signal | Byte 6 (T20) | 0x00-0x02 | (byte6 >> 1) & 0x01 | bool | 0 / 1 |
| 18 | MIL Status | Byte 7 (T20) | 0x00-0xFF | byte7 & 0x01 | bool | 0 / 1 |
| 19 | Fan Control | Byte 7 (T20) | 0x00-0xFF | (byte7 >> 1) & 0x01 | bool | 0 / 1 |
| 20 | O2 Sensor Ready | Byte 7 (T20) | 0x00-0xFF | (byte7 >> 2) & 0x01 | bool | 0 / 1 |
6.5 BLE GATT Structure
BLE GATT Service/Characteristic Hierarchy
ECU Service (0xFFE0) → Data Char (0xFFE1, Notify) + Command Char (0xFFE2, Write)
| GATT Element | UUID | Properties | Deskripsi |
|---|---|---|---|
| ECU Scanner Service | 0xFFE0 | - | Primary service untuk ECU Scanner |
| Sensor Data Characteristic | 0xFFE1 | Read, Notify | Data sensor ECU (20 bytes per packet) |
| Command Characteristic | 0xFFE2 | Write | Perintah dari dashboard (start, stop, query DTC) |
| DTC Data Characteristic | 0xFFE3 | Read, Notify | Data DTC yang terbaca dari ECU |
| Status Characteristic | 0xFFE4 | Read, Notify | Status koneksi ECU (state machine) |
6.6 Checksum Calculator
Kalkulator checksum untuk memverifikasi atau menghitung checksum pesan K-Line Honda. Masukkan byte-byte pesan (tanpa checksum) dalam format hex.
Honda K-Line Checksum Calculator
Bab 7: Rencana Implementasi
Timeline pengembangan dan detail setiap fase
7.1 Timeline Pengembangan
7.2 Detail Fase Implementasi
Deskripsi: Mengembangkan firmware dasar Genuino 101 untuk berkomunikasi dengan ECU Honda Scoopy via K-Line protocol. Termasuk implementasi wake-up sequence, init handshake, dan query data dasar.
Files:
firmware/src/kline.cpp- K-Line communication layerfirmware/src/kline.h- Header file dengan protocol constantsfirmware/src/main.ino- Main Arduino sketch
Milestone: Berhasil membaca RPM, TPS, dan ECT dari ECU via serial monitor.
Deskripsi: Mengimplementasikan BLE GATT server pada Genuino 101 menggunakan CurieBLE library. Setup service dan characteristics untuk streaming data sensor dan menerima perintah dari web dashboard.
Files:
firmware/src/ble_service.cpp- BLE GATT service setupfirmware/src/ble_service.h- BLE UUID definitionsfirmware/src/data_packer.cpp- Pack sensor data ke 20-byte BLE packets
Milestone: Data sensor dapat diterima di nRF Connect app via BLE notification.
Deskripsi: Membangun web dashboard dasar dengan HTML/CSS/JavaScript. Implementasi Web Bluetooth API untuk koneksi ke Genuino 101 dan menampilkan data sensor dalam format tabel dan nilai numerik.
Files:
dashboard/index.html- Main dashboard pagedashboard/css/style.css- Dashboard stylingdashboard/js/ble.js- Web Bluetooth connection handlerdashboard/js/parser.js- ECU data parser
Milestone: Dashboard menampilkan data sensor live dari ECU di browser Chrome.
Deskripsi: Menambahkan fitur pembacaan Diagnostic Trouble Codes (DTC) dari ECU. Termasuk database kode DTC Honda dengan deskripsi dalam bahasa Indonesia dan English.
Files:
firmware/src/dtc_reader.cpp- DTC query dan parsingdashboard/js/dtc.js- DTC display dan databasedashboard/data/dtc_codes.json- DTC code database
Milestone: Dapat membaca dan menampilkan DTC beserta deskripsinya.
Deskripsi: Mengimplementasikan visualisasi data menggunakan gauge interaktif (RPM, speedometer) dan grafik time-series untuk monitoring trend sensor.
Files:
dashboard/js/gauge.js- SVG/Canvas gauge componentsdashboard/js/chart.js- Time-series chart implementation
Milestone: Dashboard menampilkan RPM gauge dan temperature chart yang bergerak real-time.
Deskripsi: Menambahkan fitur recording/logging data sensor ke IndexedDB browser dan kemampuan mengekspor data ke format CSV.
Files:
dashboard/js/datalog.js- IndexedDB data loggingdashboard/js/export.js- CSV export functionality
Milestone: Dapat merekam session data 30 menit dan export ke CSV.
Deskripsi: Implementasi toggle dark/light mode menggunakan CSS custom properties dan sistem internationalization (i18n) untuk dukungan bahasa Indonesia dan English.
Files:
dashboard/js/theme.js- Dark mode toggle logicdashboard/js/i18n.js- Internationalization handlerdashboard/locales/id.json- Indonesian translationsdashboard/locales/en.json- English translations
Milestone: Theme switching dan language switching berfungsi tanpa page reload.
Deskripsi: Pengujian menyeluruh meliputi unit testing firmware, integration testing hardware, end-to-end testing komunikasi BLE, dan user acceptance testing web dashboard.
Files:
test/unit/kline_test.cpp- K-Line protocol unit teststest/integration/ble_test.js- BLE integration testsdocs/test_report.md- Test report documentation
Milestone: Semua test pass, dokumentasi lengkap, siap release v1.0.
Bab 8: Datasheet Ringkasan
Ringkasan spesifikasi komponen utama
L9637D - ISO 9141 Interface
| Parameter | Nilai |
|---|---|
| Manufacturer | STMicroelectronics |
| Package | SO-8 (Small Outline 8-pin) |
| Supply Voltage (VCC) | 4.5V - 5.5V |
| Battery Voltage (VS) | 7V - 40V (absolute max) |
| K-Line Driver Type | Open-drain N-channel MOSFET |
| K-Line Sink Current | Up to 50 mA |
| Max Baud Rate | 57.6 kbps |
| TX Input Threshold (HIGH) | 2.0V minimum |
| TX Input Threshold (LOW) | 0.8V maximum |
| RX Output HIGH | 3.5V minimum (VCC - 1.5V) |
| RX Output LOW | 0.4V maximum |
| Propagation Delay (TX→K) | 2-5 μs typical |
| Operating Temperature | -40°C to +125°C |
| ESD Protection | 4kV HBM |
BSS138 - N-Channel MOSFET (Level Shifter)
| Parameter | Nilai |
|---|---|
| Manufacturer | ON Semiconductor / NXP |
| Package | SOT-23 |
| Channel Type | N-Channel Enhancement Mode |
| VDS (max) | 50V |
| VGS (max) | ±20V |
| VGS(th) | 0.8V - 1.5V |
| ID (continuous) | 220 mA |
| ID (pulsed) | 600 mA |
| RDS(on) @ VGS=4.5V | 0.9 Ω typical |
| RDS(on) @ VGS=2.8V | 1.5 Ω typical |
| Power Dissipation | 360 mW |
| Input Capacitance | 28 pF typical |
| Turn-on Delay | 10 ns typical |
| Operating Temperature | -55°C to +150°C |
LM2596 - SIMPLE SWITCHER Step-Down Regulator
| Parameter | Nilai |
|---|---|
| Manufacturer | Texas Instruments |
| Package | TO-263-5 (D2PAK) |
| Topology | Buck (Step-Down) |
| Input Voltage Range | 4.5V - 40V |
| Output Voltage (fixed) | 3.3V / 5V / 12V / ADJ |
| Output Current (max) | 3A |
| Switching Frequency | 150 kHz (fixed, internal oscillator) |
| Efficiency @ 12V→5V 1A | ~73% |
| Output Voltage Tolerance | ±4% |
| Line Regulation | 0.5% typical |
| Load Regulation | 0.5% typical |
| Quiescent Current | 5 mA typical |
| Thermal Shutdown | 165°C |
| Operating Temperature | -40°C to +125°C |
Intel Genuino 101 (Arduino 101)
| Parameter | Nilai |
|---|---|
| Manufacturer | Intel / Arduino.cc |
| Module | Intel Curie |
| Processor (x86) | Intel Quark SE C1000 @ 32MHz |
| Processor (Sensor) | ARC EM4 @ 32MHz |
| Flash Memory | 196 KB (available to user) |
| SRAM | 24 KB |
| Operating Voltage | 3.3V |
| Input Voltage (VIN) | 7-12V (recommended) |
| Digital I/O Pins | 14 (4 PWM) |
| Analog Input Pins | 6 (10-bit ADC) |
| BLE | Bluetooth 4.0 Low Energy (built-in) |
| IMU | Bosch BMI160 (6-axis accel + gyro) |
| USB | Micro-USB (programming + serial) |
| Dimensions | 68.6 x 53.4 mm |
Daftar Pustaka
Referensi dan sumber yang digunakan
- [1] STMicroelectronics, "L9637D - ISO 9141 Interface," Datasheet, Rev. 7, 2016. st.com/l9637d
- [2] ON Semiconductor, "BSS138 - N-Channel Logic Level Enhancement Mode Field Effect Transistor," Datasheet, Rev. 10, 2017. onsemi.com/bss138
- [3] Texas Instruments, "LM2596 SIMPLE SWITCHER Power Converter," Datasheet, SNVS124E, 2020. ti.com/lm2596
- [4] Intel Corporation, "Intel Curie Module Datasheet," Rev. 3.0, 2016. intel.com/curie
- [5] Arduino.cc, "Arduino/Genuino 101 Getting Started Guide," 2016. arduino.cc/101
- [6] International Organization for Standardization, "ISO 9141-2:1994 - Road vehicles -- Diagnostic systems -- Part 2: CARB requirements for interchange of digital information," 1994.
- [7] Honda Motor Co., "Honda Service Manual - Scoopy eSP (K2F)," 2023.
- [8] Bluetooth SIG, "Bluetooth Core Specification v4.0," 2010. bluetooth.com/spec
- [9] W3C, "Web Bluetooth Community Group - Web Bluetooth API," 2021. webbluetoothcg.github.io
- [10] Google Developers, "Interact with BLE devices on the Web," Chrome Developer Documentation, 2020. developer.chrome.com/bluetooth
- [11] Keihin Corporation, "ECU Technical Reference - PGM-FI System for Honda Motorcycles," Internal Document.
- [12] NXP Semiconductors, "Application Note AN10441 - Level shifting techniques in I2C-bus design," Rev. 01, 2007. nxp.com/AN10441
- [13] Bosch Sensortec, "BMI160 - Small, low-power inertial measurement unit," Datasheet, Rev. 1.2, 2015.
- [14] Honda R&D, "PGM-FI Diagnostic Protocol Specification," Honda Technical Paper, 2019.
- [15] Society of Automotive Engineers, "SAE J1979 - E/E Diagnostic Test Modes," 2014.
- [16] Sparkfun Electronics, "Bi-Directional Logic Level Converter Hookup Guide," Tutorial. learn.sparkfun.com
- [17] ECUHACKING.com, "Honda OBD1 ECU Communication Protocol," Community Wiki. ecuhacking.com
- [18] Microchip Technology, "AN953 - Data Encryption Routines for PIC18 Microcontrollers," Application Note, 2005.
Lampiran
Data tambahan, tabel referensi, dan checklist
Lampiran A: Tabel Kode DTC Honda
Berikut adalah daftar kode DTC (Diagnostic Trouble Code) umum pada Honda Scoopy 2023 beserta deskripsi dalam bahasa Indonesia dan English.
| No | Kode DTC | MIL Blink | Deskripsi (ID) | Description (EN) |
|---|---|---|---|---|
| 1 | P0107 | 1 blink | Tegangan sensor MAP terlalu rendah | MAP Sensor Circuit Low Voltage |
| 2 | P0108 | 1 blink | Tegangan sensor MAP terlalu tinggi | MAP Sensor Circuit High Voltage |
| 3 | P0112 | 2 blink | Tegangan sensor IAT terlalu rendah | IAT Sensor Circuit Low Input |
| 4 | P0113 | 2 blink | Tegangan sensor IAT terlalu tinggi | IAT Sensor Circuit High Input |
| 5 | P0117 | 3 blink | Tegangan sensor ECT terlalu rendah | ECT Sensor Circuit Low Input |
| 6 | P0118 | 3 blink | Tegangan sensor ECT terlalu tinggi | ECT Sensor Circuit High Input |
| 7 | P0122 | 4 blink | Tegangan sensor TPS terlalu rendah | TPS Sensor Circuit Low Input |
| 8 | P0123 | 4 blink | Tegangan sensor TPS terlalu tinggi | TPS Sensor Circuit High Input |
| 9 | P0131 | 5 blink | Tegangan sensor O2 terlalu rendah | O2 Sensor Circuit Low Voltage |
| 10 | P0132 | 5 blink | Tegangan sensor O2 terlalu tinggi | O2 Sensor Circuit High Voltage |
| 11 | P0335 | 6 blink | Tidak ada sinyal dari sensor CKP | CKP Sensor Circuit No Signal |
| 12 | P0336 | 6 blink | Sinyal sensor CKP tidak normal | CKP Sensor Circuit Range/Performance |
| 13 | P1366 | 7 blink | Tegangan output ignition coil tidak normal | Ignition Coil Output Voltage Abnormal |
| 14 | P1456 | 8 blink | Tegangan supply sensor tidak normal | Sensor Supply Voltage Abnormal |
| 15 | P1600 | 9 blink | Kerusakan internal ECU (EEPROM) | ECU Internal Circuit Malfunction (EEPROM) |
Lampiran B: Hardware Verification Checklist
Gunakan checklist berikut untuk memverifikasi rangkaian hardware sebelum menghubungkan ke ECU Honda Scoopy.
Pre-Connection Verification
Lampiran C: Tabel Ringkasan Koneksi
| No | Dari | Pin / Terminal | Ke | Pin / Terminal | Sinyal / Keterangan |
|---|---|---|---|---|---|
| 1 | DLC Honda | Pin 1 (GND) | Common | GND bus | Ground reference |
| 2 | DLC Honda | Pin 2 (K-Line) | L9637D | Pin 1 (K) | K-Line bus (12V idle) |
| 3 | DLC Honda | Pin 3 (SCS) | GND | via jumper | Service Check Signal (short to enable diag) |
| 4 | DLC Honda | Pin 4 (+12V) | LM2596 | VIN | Battery voltage input |
| 5 | DLC Honda | Pin 4 (+12V) | L9637D | Pin 3 (VS) | Battery supply for K-Line driver |
| 6 | LM2596 | VOUT (5V) | L9637D | Pin 4 (VCC) | 5V logic supply |
| 7 | LM2596 | VOUT (5V) | BSS138 | HV VCC | 5V reference for HV side |
| 8 | LM2596 | VOUT (5V) | Genuino 101 | VIN | Board power (regulated to 3.3V internally) |
| 9 | Genuino 101 | 3.3V out | BSS138 | LV VCC | 3.3V reference for LV side |
| 10 | Genuino 101 | D10 (TX) | BSS138 | LV1 | SoftwareSerial TX → level shifted to 5V |
| 11 | BSS138 | HV1 | L9637D | Pin 6 (TX) | 5V TX signal to K-Line transceiver |
| 12 | L9637D | Pin 7 (RX) | BSS138 | HV2 | 5V RX signal from K-Line |
| 13 | BSS138 | LV2 | Genuino 101 | D11 (RX) | 3.3V RX signal → SoftwareSerial RX |