Community project
Versi Yang Anda Susun Sudah Sangat Lengkap Namun
SOPIAN PRIATNA
Published August 4, 2026 · Updated August 11, 2026
Generated with AIThis guide builds a comprehensive Arduino-based mobile robot platform with 4WD drive capability, environmental sensing, and GPS navigation. The robot integrates motor control via the IBT-2 H-bridge driver, obstacle detection with ultrasonic ranging, thermal imaging with the MLX90614, motion tracking via the MPU-6050 IMU, and wireless Bluetooth control. Power comes from a protected 3S Li-ion battery pack with current monitoring through the INA219 sensor.
Makers will receive a complete wiring diagram showing all 20+ connections, a detailed parts list with pinout specifications, the full Arduino firmware with motor control and sensor integration routines, and step-by-step assembly instructions covering safe power distribution, 4WD drivetrain installation, and sensor mounting. The guide includes code for autonomous navigation modes, manual Bluetooth control, real-time data logging to microSD, and dual LCD display output for navigation and environmental parameters.
Wiring diagram
Interactive · read-only
Pan and zoom to explore the wiring. Remix the project to edit it in your own workspace.
Parts list
Bill of materials| Component | Qty | Notes |
|---|---|---|
| IBT-2 BTS7960 43A High-Current H-Bridge Motor DriverBTS7960 / IBT-2 | 1 | IBT-2 high-current H-bridge motor driver module built around BTS7960 half-bridge devices. Common modules are sold for 6V-27V motor supplies and 5V logic, with 43A as a module headline rating; practical continuous current depends on board cooling and wiring. Direction and speed are controlled with RPWM/LPWM PWM inputs plus R_EN/L_EN enable lines. Logic-side VCC is separate from the high-power motor supply, and grounds must be common. |
| IBT-2 BTS7960 43A High-Current H-Bridge Motor DriverBTS7960 / IBT-2 | 1 | IBT-2 high-current H-bridge motor driver module built around BTS7960 half-bridge devices. Common modules are sold for 6V-27V motor supplies and 5V logic, with 43A as a module headline rating; practical continuous current depends on board cooling and wiring. Direction and speed are controlled with RPWM/LPWM PWM inputs plus R_EN/L_EN enable lines. Logic-side VCC is separate from the high-power motor supply, and grounds must be common. |
| HC-SR04HC-SR04 | 1 | Ultrasonic distance measurement sensor |
| NEO-6M GPS ModuleNEO-6M | 1 | u-blox NEO-6M based GPS receiver module. Outputs NMEA sentences (GGA, RMC, etc.) over UART at 9600 baud by default. Provides latitude, longitude, altitude, speed, and time. The NEO-6M module itself is a 3.3V-class device; many GY-NEO6MV2 breakout boards accept 5V on their VCC header through an onboard regulator, but UART I/O remains 3.3V-domain and must not be driven above 3.6V. Features an on-board patch antenna footprint and an SMA/IPEX connector for external active antenna (preferred for faster lock acquisition). Supply current ~45 mA in acquisition, ~11 mA in tracking. |
| DFRobot SEN0142 Fermion MPU-6050 6 DOF Sensor BreakoutMPU6050 | 1 | DFRobot SEN0142 MPU-6050 breakout with 3-5 V board input, I2C interface, onboard I2C pull-ups, and i2cdevlib Arduino example coverage. |
| MLX90614 IR Temperature SensorMLX90614 | 1 | Melexis MLX90614 non-contact infrared thermometer sensor. It reports object and ambient temperature over SMBus/I2C and is factory calibrated. Common GY-906 breakouts expose VCC, GND, SDA, and SCL and are used for contactless body, surface, and process temperature sensing. |
| Adafruit INA219 High-Side DC Current SensorINA219 | 1 | INA219 high-side current and bus-voltage monitor breakout. It is powered from 3.3V or 5V and communicates over I2C. Route the measured load current through VIN+ and VIN-; those shunt terminals are part of the power path, not MCU GPIO. |
| LCD 16x2 I2C16x2 I2C address 0x27 | 1 | 16x2 character LCD display with I2C backpack |
| LCD 16x2 I2C (PCF8574A, address 0x3F)16×2, I2C 0x3F | 1 | LCD karakter 16×2 dengan backpack PCF8574A yang alamat I2C-nya dikonfigurasi/terverifikasi sebagai 0x3F agar berbeda dari LCD navigasi 0x27. |
| Li-ion 18650 Battery Pack 3S2P with 3S 20A BMS11.1 V nominal, 6000 mAh | 1 | Six 3000 mAh 18650 cells in 3S2P configuration, 11.1 V nominal / 12.6 V full, protected by a 3S 20 A BMS. |
| MG90S ServoMG90S | 1 | Servo 5 V for scanning the ultrasonic sensor. |
| Hc 05 Bluetooth ModuleHC-05 | 1 | Serial Bluetooth module for wireless communication using UART interface. Operates at 9600 baud (Data Mode) or 38400 baud (AT Command Mode). Supports two-way full-duplex wireless functionality with range up to 100m. |
| MicroSD SPI ModuleMicroSD 32 GB FAT32 | 1 | 5 V compatible SPI MicroSD module for event logging. |
| MQ-2 Gas and Smoke Sensor ModuleMQ-2 | 1 | 5 V heated MQ-2 module with analog output for smoke/combustible-gas trend detection. |
| MQ-135 Air Quality Sensor ModuleMQ-135 | 1 | 5 V heated MQ-135 module with analog output for air-quality trend detection. |
| FC-51 IR Obstacle SensorFC-51 left | 1 | 5 V digital obstacle sensor, left. |
| FC-51 IR Obstacle SensorFC-51 right | 1 | 5 V digital obstacle sensor, right. |
| TCRT5000 Line SensorTCRT5000 left | 1 | 5 V digital reflective line sensor, left. |
| TCRT5000 Line SensorTCRT5000 right | 1 | 5 V digital reflective line sensor, right. |
| Manual/Autonomous Rotary SwitchSPDT | 1 | SPDT rotary mode selector; common terminal goes to the Mega input, one throw to ground. |
| Five Status LEDs with 220 ohm Series Resistors5 LEDs + 5×220 Ω | 1 | Green, red, blue, yellow, and white 5 V indicator LEDs. Each anode is driven through its own 220 ohm series resistor; cathodes share ground. |
| Active 5 V BuzzerActive buzzer | 1 | Active buzzer for obstacle and hazard alarm. |
| LM2596 Buck Regulator #15.0 V | 1 | Buck converter adjusted and verified to 5.0 V for Mega and logic modules. |
Assembly
3 stepsRakit catu daya aman
Susun enam sel 18650 sebagai 3S2P memakai holder/pack yang sesuai dan BMS 3S 20 A. Pasang fuse blade 10 A, saklar utama, dan emergency stop secara seri pada jalur positif sebelum distribusi. Atur LM2596 logic_regulator tepat 5,0 V dengan multimeter sebelum Arduino Mega dan modul apa pun dipasang.
- Tip: Semua ground sistem, termasuk kedua BTS7960 dan Arduino, wajib tersambung bersama.
- Tip: Gunakan kabel daya motor yang lebih tebal daripada kabel sinyal.
- ⚠ Jangan hubungkan charger 12,6 V ke keluaran pack tanpa mengikuti terminal BMS yang benar.
- ⚠ Jangan pernah mengatur LM2596 saat Arduino/modul masih tersambung.
Pasang penggerak 4WD
Pasang motor kiri depan dan belakang paralel pada keluaran driver kiri; motor kanan depan dan belakang paralel pada keluaran driver kanan. Hubungkan suplai motor 3S setelah fuse/saklar/emergency stop ke B+ dan B− masing-masing driver. Hubungkan sinyal Mega sesuai tabel wiring proyek.
- Tip: Uji roda terangkat dari lantai terlebih dahulu; tukar M+ dan M− pada satu sisi jika arah maju terbalik.
- ⚠ BTS7960 bukan pengganti fuse. Pastikan kabel dan konektor mampu menahan arus stall motor.
- ⚠ Jangan menghubungkan motor langsung ke pin Arduino.
Pasang sensor, antarmuka, dan layar
Hubungkan semua modul I²C ke SDA D20 dan SCL D21; LCD navigasi memakai 0x27 dan LCD lingkungan 0x26. Hubungkan GPS ke Serial1, HC-05 ke Serial2, MicroSD ke SPI D50–D53, serta sensor analog ke A0/A1. Pasang servo dan HC-SR04 di bagian depan.
- Tip: Arahkan antena GPS ke atas dan jauhkan dari BTS7960.
- Tip: Pasang resistor 220 Ω seri pada setiap LED.
- ⚠ INA219 standar tidak aman untuk arus total motor; gunakan hanya untuk cabang logika atau sensor arus ber-rating tinggi khusus jalur motor.
- ⚠ Modul MQ perlu pemanasan dan kalibrasi di udara bersih sebelum pembacaan dipakai sebagai ambang bahaya.
Pin assignments
Board wiring reference| Pin | Connection | Type |
|---|---|---|
| VIN | battery_pack PACK+ | power |
| GND | battery_pack PACK- | ground |
| VIN | logic_regulator IN+ | power |
| GND | logic_regulator IN- | ground |
| 5V | logic_regulator OUT+ | power |
| GND | logic_regulator OUT- | ground |
| 5V | motor_driver_left VCC | power |
| GND | motor_driver_left GND | ground |
| GPIO 5 | motor_driver_left RPWM | pwm |
| GPIO 6 | motor_driver_left LPWM | pwm |
| GPIO 22 | motor_driver_left R_EN | digital |
| GPIO 23 | motor_driver_left L_EN | digital |
| VIN | motor_driver_left B+ | power |
| GND | motor_driver_left B- | ground |
| 5V | motor_driver_right VCC | power |
| GND | motor_driver_right GND | ground |
| GPIO 7 | motor_driver_right RPWM | pwm |
| GPIO 8 | motor_driver_right LPWM | pwm |
| GPIO 24 | motor_driver_right R_EN | digital |
| GPIO 25 | motor_driver_right L_EN | digital |
| VIN | motor_driver_right B+ | power |
| GND | motor_driver_right B- | ground |
| 5V | ultrasonic VCC | power |
| GND | ultrasonic GND | ground |
| GPIO 26 | ultrasonic TRIG | digital |
| GPIO 27 | ultrasonic ECHO | digital |
| 5V | servo_scan VCC | power |
| GND | servo_scan GND | ground |
| GPIO 9 | servo_scan SIG | pwm |
| 5V | gps VCC | power |
| GND | gps GND | ground |
| GPIO 19 | gps TX | uart |
| 5V | bluetooth Vcc | power |
| GND | bluetooth GND | ground |
| GPIO 17 | bluetooth TX | data |
| GPIO 16 | bluetooth RX | data |
| 5V | imu VIN | power |
| GND | imu GND | ground |
| GPIO 20 | imu SDA | i2c |
| GPIO 21 | imu SCL | i2c |
| 5V | ir_temperature VCC | power |
| GND | ir_temperature GND | ground |
| GPIO 20 | ir_temperature SDA | i2c |
| GPIO 21 | ir_temperature SCL | i2c |
| 5V | power_monitor VCC | power |
| GND | power_monitor GND | ground |
| GPIO 20 | power_monitor SDA | i2c |
| GPIO 21 | power_monitor SCL | i2c |
| VIN | power_monitor VIN+ | power |
| VIN | power_monitor VIN- | power |
| 5V | lcd_navigation VCC | power |
| GND | lcd_navigation GND | ground |
| GPIO 20 | lcd_navigation SDA | i2c |
| GPIO 21 | lcd_navigation SCL | i2c |
| 5V | lcd_environment VCC | power |
| GND | lcd_environment GND | ground |
| GPIO 20 | lcd_environment SDA | i2c |
| GPIO 21 | lcd_environment SCL | i2c |
| 5V | micro_sd VCC | power |
| GND | micro_sd GND | ground |
| GPIO 51 | micro_sd MOSI | spi |
| GPIO 50 | micro_sd MISO | spi |
| GPIO 52 | micro_sd SCK | spi |
| GPIO 53 | micro_sd CS | spi |
| 5V | gas_smoke VCC | power |
| GND | gas_smoke GND | ground |
| GPIO 54 | gas_smoke AO | analog |
| 5V | gas_air VCC | power |
| GND | gas_air GND | ground |
| GPIO 55 | gas_air AO | analog |
| 5V | obstacle_left VCC | power |
| GND | obstacle_left GND | ground |
| GPIO 28 | obstacle_left OUT | digital |
| 5V | obstacle_right VCC | power |
| GND | obstacle_right GND | ground |
| GPIO 29 | obstacle_right OUT | digital |
| 5V | line_left VCC | power |
| GND | line_left GND | ground |
| GPIO 30 | line_left OUT | digital |
| 5V | line_right VCC | power |
| GND | line_right GND | ground |
| GPIO 31 | line_right OUT | digital |
| GND | mode_switch GND_THROW | ground |
| GPIO 44 | mode_switch COMMON | digital |
| GND | status_leds GND | ground |
| 5V | alarm_buzzer VCC | power |
| GND | alarm_buzzer GND | ground |
| GPIO 45 | alarm_buzzer SIG | digital |
| GPIO 10 | status_leds GREEN | digital |
| GPIO 11 | status_leds RED | digital |
| GPIO 12 | status_leds BLUE | digital |
| GPIO 13 | status_leds YELLOW | digital |
| GPIO 46 | status_leds WHITE | digital |
| EXT | motor_driver_left M+ → Drive train channel A positive terminal | data |
| EXT | motor_driver_left M- → Drive train channel A negative terminal | data |
| EXT | motor_driver_right M+ → Drive train channel B positive terminal | data |
| EXT | motor_driver_right M- → Drive train channel B negative terminal | data |
Firmware
Arduino#include <Arduino.h>
#include <Wire.h>
#include <Servo.h>
#include <LiquidCrystal_I2C.h>
#include <TinyGPS++.h>
#include <Adafruit_MLX90614.h>
#include <Adafruit_INA219.h>
#include <SD.h>
#define LEFT_LPWM 6
#define RIGHT_RPWM 7
#define RIGHT_LPWM 8
#define ECHO_PIN 27
#define SERVO_PIN 9
#define MODE_PIN 44
#define FC_RIGHT 29
#define LINE_LEFT 30
#define LINE_RIGHT 31
#define MQ135_PIN 55
#define SD_CS 53
#define BUZZER 45
// Forward declarations
void drive(int l,int r);
void stopDrive();
long distanceCm();
void manualControl();
void autonomous();
const uint8_t LEFT_RPWM=5, LEFT_LPWM=6, RIGHT_RPWM=7, RIGHT_LPWM=8;
const uint8_t LEFT_REN=22, LEFT_LEN=23, RIGHT_REN=24, RIGHT_LEN=25;
const uint8_t TRIG_PIN=26, ECHO_PIN=27, SERVO_PIN=9, MODE_PIN=44;
const uint8_t FC_LEFT=28, FC_RIGHT=29, LINE_LEFT=30, LINE_RIGHT=31;
const uint8_t MQ2_PIN=A0, MQ135_PIN=A1, SD_CS=53;
const uint8_t LED_GREEN=10, LED_RED=11, LED_BLUE=12, LED_YELLOW=13, LED_WHITE=46, BUZZER=45;
LiquidCrystal_I2C lcdNav(0x27,16,2), lcdEnv(0x26,16,2);
TinyGPSPlus gps; Adafruit_MLX90614 mlx; Adafruit_INA219 ina219; Servo scanServo;
bool sdOK=false; unsigned long lastDisplay=0,lastLog=0;
void drive(int l,int r){digitalWrite(LEFT_REN,HIGH);digitalWrite(LEFT_LEN,HIGH);digitalWrite(RIGHT_REN,HIGH);digitalWrite(RIGHT_LEN,HIGH);analogWrite(LEFT_RPWM,l>0?l:0);analogWrite(LEFT_LPWM,l<0?-l:0);analogWrite(RIGHT_RPWM,r>0?r:0);analogWrite(RIGHT_LPWM,r<0?-r:0);}
void stopDrive(){drive(0,0);}
long distanceCm(){digitalWrite(TRIG_PIN,LOW);delayMicroseconds(2);digitalWrite(TRIG_PIN,HIGH);delayMicroseconds(10);digitalWrite(TRIG_PIN,LOW);unsigned long t=pulseIn(ECHO_PIN,HIGH,25000);return t?t/58:400;}
void manualControl(){while(Serial2.available()){char c=Serial2.read(); if(c=='F')drive(170,170); else if(c=='B')drive(-170,-170); else if(c=='L')drive(-150,150); else if(c=='R')drive(150,-150); else if(c=='S')stopDrive();}}
void autonomous(){long d=distanceCm(); bool blocked=(d<25)||(digitalRead(FC_LEFT)==LOW)||(digitalRead(FC_RIGHT)==LOW); if(blocked){stopDrive();digitalWrite(LED_RED,HIGH);digitalWrite(BUZZER,HIGH);delay(180);drive(-140,-140);delay(280);drive(150,-150);delay(350);stopDrive();}else{digitalWrite(LED_RED,LOW);digitalWrite(BUZZER,LOW); bool l=digitalRead(LINE_LEFT)==LOW,r=digitalRead(LINE_RIGHT)==LOW; if(l&&!r)drive(100,180); else if(r&&!l)drive(180,100); else drive(155,155);}}
void setup(){pinMode(TRIG_PIN,OUTPUT);pinMode(ECHO_PIN,INPUT);pinMode(MODE_PIN,INPUT_PULLUP);pinMode(FC_LEFT,INPUT);pinMode(FC_RIGHT,INPUT);pinMode(LINE_LEFT,INPUT);pinMode(LINE_RIGHT,INPUT);pinMode(BUZZER,OUTPUT);for(uint8_t p: {LED_GREEN,LED_RED,LED_BLUE,LED_YELLOW,LED_WHITE})pinMode(p,OUTPUT);Serial.begin(115200);Serial1.begin(9600);Serial2.begin(9600);Wire.begin();lcdNav.init();lcdNav.backlight();lcdEnv.init();lcdEnv.backlight();scanServo.attach(SERVO_PIN);scanServo.write(90);mlx.begin();ina219.begin();sdOK=SD.begin(SD_CS);digitalWrite(LED_GREEN,HIGH);}
void loop(){while(Serial1.available())gps.encode(Serial1.read());bool autonomousMode=digitalRead(MODE_PIN)==LOW;if(autonomousMode)autonomous();else manualControl();if(millis()-lastDisplay>500){lastDisplay=millis();float obj=mlx.readObjectTempC();float v=ina219.getBusVoltage_V();int mq2=analogRead(MQ2_PIN),mq135=analogRead(MQ135_PIN);lcdNav.setCursor(0,0);lcdNav.print(autonomousMode?"AUTO ":"MANUAL");lcdNav.print(" D:");lcdNav.print(distanceCm());lcdNav.print(" ");lcdNav.setCursor(0,1);if(gps.location.isValid()){lcdNav.print(gps.location.lat(),4);lcdNav.print(",");lcdNav.print(gps.location.lng(),4);}else lcdNav.print("GPS searching...");lcdEnv.setCursor(0,0);lcdEnv.print("T:");lcdEnv.print(obj,1);lcdEnv.print("C V:");lcdEnv.print(v,1);lcdEnv.setCursor(0,1);lcdEnv.print("M2:");lcdEnv.print(mq2);lcdEnv.print(" M135:");lcdEnv.print(mq135);digitalWrite(LED_BLUE,gps.location.isValid());digitalWrite(LED_YELLOW,sdOK);digitalWrite(LED_WHITE,obj>45);if(sdOK&&millis()-lastLog>5000){lastLog=millis();File f=SD.open("arv.csv",FILE_WRITE);if(f){f.print(millis());f.print(',');f.print(autonomousMode);f.print(',');f.print(distanceCm());f.print(',');f.print(obj);f.print(',');f.print(mq2);f.print(',');f.println(mq135);f.close();}}}}“Deploy to device” opens this project in Schematik, where you can flash it to your board over USB.
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.