Community project

Versi Yang Anda Susun Sudah Sangat Lengkap Namun

SOPIAN PRIATNA

Published August 4, 2026 · Updated August 11, 2026

Arduino23 components3 assembly steps
Remix this project
Photo of Versi Yang Anda Susun Sudah Sangat Lengkap NamunGenerated with AI

This 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
Wiring diagram for Versi Yang Anda Susun Sudah Sangat Lengkap Namun

Pan and zoom to explore the wiring. Remix the project to edit it in your own workspace.

Parts list

Bill of materials
ComponentQtyNotes
IBT-2 BTS7960 43A High-Current H-Bridge Motor DriverBTS7960 / IBT-21IBT-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-21IBT-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-SR041Ultrasonic distance measurement sensor
NEO-6M GPS ModuleNEO-6M1u-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 BreakoutMPU60501DFRobot SEN0142 MPU-6050 breakout with 3-5 V board input, I2C interface, onboard I2C pull-ups, and i2cdevlib Arduino example coverage.
MLX90614 IR Temperature SensorMLX906141Melexis 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 SensorINA2191INA219 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 0x27116x2 character LCD display with I2C backpack
LCD 16x2 I2C (PCF8574A, address 0x3F)16×2, I2C 0x3F1LCD 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 mAh1Six 3000 mAh 18650 cells in 3S2P configuration, 11.1 V nominal / 12.6 V full, protected by a 3S 20 A BMS.
MG90S ServoMG90S1Servo 5 V for scanning the ultrasonic sensor.
Hc 05 Bluetooth ModuleHC-051Serial 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 FAT3215 V compatible SPI MicroSD module for event logging.
MQ-2 Gas and Smoke Sensor ModuleMQ-215 V heated MQ-2 module with analog output for smoke/combustible-gas trend detection.
MQ-135 Air Quality Sensor ModuleMQ-13515 V heated MQ-135 module with analog output for air-quality trend detection.
FC-51 IR Obstacle SensorFC-51 left15 V digital obstacle sensor, left.
FC-51 IR Obstacle SensorFC-51 right15 V digital obstacle sensor, right.
TCRT5000 Line SensorTCRT5000 left15 V digital reflective line sensor, left.
TCRT5000 Line SensorTCRT5000 right15 V digital reflective line sensor, right.
Manual/Autonomous Rotary SwitchSPDT1SPDT 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 Ω1Green, 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 buzzer1Active buzzer for obstacle and hazard alarm.
LM2596 Buck Regulator #15.0 V1Buck converter adjusted and verified to 5.0 V for Mega and logic modules.

Assembly

3 steps
  1. Rakit 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.
  2. 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.
  3. 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
PinConnectionType
VINbattery_pack PACK+power
GNDbattery_pack PACK-ground
VINlogic_regulator IN+power
GNDlogic_regulator IN-ground
5Vlogic_regulator OUT+power
GNDlogic_regulator OUT-ground
5Vmotor_driver_left VCCpower
GNDmotor_driver_left GNDground
GPIO 5motor_driver_left RPWMpwm
GPIO 6motor_driver_left LPWMpwm
GPIO 22motor_driver_left R_ENdigital
GPIO 23motor_driver_left L_ENdigital
VINmotor_driver_left B+power
GNDmotor_driver_left B-ground
5Vmotor_driver_right VCCpower
GNDmotor_driver_right GNDground
GPIO 7motor_driver_right RPWMpwm
GPIO 8motor_driver_right LPWMpwm
GPIO 24motor_driver_right R_ENdigital
GPIO 25motor_driver_right L_ENdigital
VINmotor_driver_right B+power
GNDmotor_driver_right B-ground
5Vultrasonic VCCpower
GNDultrasonic GNDground
GPIO 26ultrasonic TRIGdigital
GPIO 27ultrasonic ECHOdigital
5Vservo_scan VCCpower
GNDservo_scan GNDground
GPIO 9servo_scan SIGpwm
5Vgps VCCpower
GNDgps GNDground
GPIO 19gps TXuart
5Vbluetooth Vccpower
GNDbluetooth GNDground
GPIO 17bluetooth TXdata
GPIO 16bluetooth RXdata
5Vimu VINpower
GNDimu GNDground
GPIO 20imu SDAi2c
GPIO 21imu SCLi2c
5Vir_temperature VCCpower
GNDir_temperature GNDground
GPIO 20ir_temperature SDAi2c
GPIO 21ir_temperature SCLi2c
5Vpower_monitor VCCpower
GNDpower_monitor GNDground
GPIO 20power_monitor SDAi2c
GPIO 21power_monitor SCLi2c
VINpower_monitor VIN+power
VINpower_monitor VIN-power
5Vlcd_navigation VCCpower
GNDlcd_navigation GNDground
GPIO 20lcd_navigation SDAi2c
GPIO 21lcd_navigation SCLi2c
5Vlcd_environment VCCpower
GNDlcd_environment GNDground
GPIO 20lcd_environment SDAi2c
GPIO 21lcd_environment SCLi2c
5Vmicro_sd VCCpower
GNDmicro_sd GNDground
GPIO 51micro_sd MOSIspi
GPIO 50micro_sd MISOspi
GPIO 52micro_sd SCKspi
GPIO 53micro_sd CSspi
5Vgas_smoke VCCpower
GNDgas_smoke GNDground
GPIO 54gas_smoke AOanalog
5Vgas_air VCCpower
GNDgas_air GNDground
GPIO 55gas_air AOanalog
5Vobstacle_left VCCpower
GNDobstacle_left GNDground
GPIO 28obstacle_left OUTdigital
5Vobstacle_right VCCpower
GNDobstacle_right GNDground
GPIO 29obstacle_right OUTdigital
5Vline_left VCCpower
GNDline_left GNDground
GPIO 30line_left OUTdigital
5Vline_right VCCpower
GNDline_right GNDground
GPIO 31line_right OUTdigital
GNDmode_switch GND_THROWground
GPIO 44mode_switch COMMONdigital
GNDstatus_leds GNDground
5Valarm_buzzer VCCpower
GNDalarm_buzzer GNDground
GPIO 45alarm_buzzer SIGdigital
GPIO 10status_leds GREENdigital
GPIO 11status_leds REDdigital
GPIO 12status_leds BLUEdigital
GPIO 13status_leds YELLOWdigital
GPIO 46status_leds WHITEdigital
EXTmotor_driver_left M+Drive train channel A positive terminaldata
EXTmotor_driver_left M-Drive train channel A negative terminaldata
EXTmotor_driver_right M+Drive train channel B positive terminaldata
EXTmotor_driver_right M-Drive train channel B negative terminaldata

Firmware

Arduino
main.cppDeploy to device
#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.

Open in Schematik