Community project

Versi Yang Anda Susun Sudah Sangat Lengkap Namun

Arduino
Photo of Versi Yang Anda Susun Sudah Sangat Lengkap Namun
Generated with AI

SOPIAN PRIATNA

Last updated August 11, 2026

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

Wiring diagram for Versi Yang Anda Susun Sudah Sangat Lengkap Namun

Gather all the parts

QtyComponent
1

IBT-2 BTS7960 43A High-Current H-Bridge Motor Driver

BTS7960 / IBT-2

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.

1

IBT-2 BTS7960 43A High-Current H-Bridge Motor Driver

BTS7960 / IBT-2

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.

1

HC-SR04

HC-SR04

Ultrasonic distance measurement sensor

1

NEO-6M GPS Module

NEO-6M

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.

1

DFRobot SEN0142 Fermion MPU-6050 6 DOF Sensor Breakout

MPU6050

DFRobot SEN0142 MPU-6050 breakout with 3-5 V board input, I2C interface, onboard I2C pull-ups, and i2cdevlib Arduino example coverage.

1

MLX90614 IR Temperature Sensor

MLX90614

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.

1

Adafruit INA219 High-Side DC Current Sensor

INA219

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.

1

LCD 16x2 I2C

16x2 I2C address 0x27

16x2 character LCD display with I2C backpack

1

LCD 16x2 I2C (PCF8574A, address 0x3F)

16×2, I2C 0x3F

LCD karakter 16×2 dengan backpack PCF8574A yang alamat I2C-nya dikonfigurasi/terverifikasi sebagai 0x3F agar berbeda dari LCD navigasi 0x27.

1

Li-ion 18650 Battery Pack 3S2P with 3S 20A BMS

11.1 V nominal, 6000 mAh

Six 3000 mAh 18650 cells in 3S2P configuration, 11.1 V nominal / 12.6 V full, protected by a 3S 20 A BMS.

1

MG90S Servo

MG90S

Servo 5 V for scanning the ultrasonic sensor.

1

Hc 05 Bluetooth Module

HC-05

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.

1

MicroSD SPI Module

MicroSD 32 GB FAT32

5 V compatible SPI MicroSD module for event logging.

1

MQ-2 Gas and Smoke Sensor Module

MQ-2

5 V heated MQ-2 module with analog output for smoke/combustible-gas trend detection.

1

MQ-135 Air Quality Sensor Module

MQ-135

5 V heated MQ-135 module with analog output for air-quality trend detection.

1

FC-51 IR Obstacle Sensor

FC-51 left

5 V digital obstacle sensor, left.

1

FC-51 IR Obstacle Sensor

FC-51 right

5 V digital obstacle sensor, right.

1

TCRT5000 Line Sensor

TCRT5000 left

5 V digital reflective line sensor, left.

1

TCRT5000 Line Sensor

TCRT5000 right

5 V digital reflective line sensor, right.

1

Manual/Autonomous Rotary Switch

SPDT

SPDT rotary mode selector; common terminal goes to the Mega input, one throw to ground.

1

Five Status LEDs with 220 ohm Series Resistors

5 LEDs + 5×220 Ω

Green, red, blue, yellow, and white 5 V indicator LEDs. Each anode is driven through its own 220 ohm series resistor; cathodes share ground.

1

Active 5 V Buzzer

Active buzzer

Active buzzer for obstacle and hazard alarm.

1

LM2596 Buck Regulator #1

5.0 V

Buck converter adjusted and verified to 5.0 V for Mega and logic modules.

Assemble it in 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.

  • Semua ground sistem, termasuk kedua BTS7960 dan Arduino, wajib tersambung bersama.
  • 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.

  • 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.

  • Arahkan antena GPS ke atas dan jauhkan dari BTS7960.
  • 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.

Review all connections

1. Connections between "battery_pack" and "Arduino"

Functionbattery_packArduino
powerPACK+VIN
groundPACK-GND

2. Connections between "logic_regulator" and "Arduino"

Functionlogic_regulatorArduino
powerIN+VIN
groundIN-GND
powerOUT+5V
groundOUT-GND

3. Connections between "motor_driver_left" and "Arduino"

Functionmotor_driver_leftArduino
powerVCC5V
groundGNDGND
pwmRPWMGPIO 5
pwmLPWMGPIO 6
digitalR_ENGPIO 22
digitalL_ENGPIO 23
powerB+VIN
groundB-GND
dataM+Drive train channel A positive terminalEXT
dataM-Drive train channel A negative terminalEXT

4. Connections between "motor_driver_right" and "Arduino"

Functionmotor_driver_rightArduino
powerVCC5V
groundGNDGND
pwmRPWMGPIO 7
pwmLPWMGPIO 8
digitalR_ENGPIO 24
digitalL_ENGPIO 25
powerB+VIN
groundB-GND
dataM+Drive train channel B positive terminalEXT
dataM-Drive train channel B negative terminalEXT

5. Connections between "ultrasonic" and "Arduino"

FunctionultrasonicArduino
powerVCC5V
groundGNDGND
digitalTRIGGPIO 26
digitalECHOGPIO 27

6. Connections between "servo_scan" and "Arduino"

Functionservo_scanArduino
powerVCC5V
groundGNDGND
pwmSIGGPIO 9

7. Connections between "gps" and "Arduino"

FunctiongpsArduino
powerVCC5V
groundGNDGND
uartTXGPIO 19

8. Connections between "bluetooth" and "Arduino"

FunctionbluetoothArduino
powerVcc5V
groundGNDGND
dataTXGPIO 17
dataRXGPIO 16

9. Connections between "imu" and "Arduino"

FunctionimuArduino
powerVIN5V
groundGNDGND
i2cSDAGPIO 20
i2cSCLGPIO 21

10. Connections between "ir_temperature" and "Arduino"

Functionir_temperatureArduino
powerVCC5V
groundGNDGND
i2cSDAGPIO 20
i2cSCLGPIO 21

11. Connections between "power_monitor" and "Arduino"

Functionpower_monitorArduino
powerVCC5V
groundGNDGND
i2cSDAGPIO 20
i2cSCLGPIO 21
powerVIN+VIN
powerVIN-VIN

12. Connections between "lcd_navigation" and "Arduino"

Functionlcd_navigationArduino
powerVCC5V
groundGNDGND
i2cSDAGPIO 20
i2cSCLGPIO 21

13. Connections between "lcd_environment" and "Arduino"

Functionlcd_environmentArduino
powerVCC5V
groundGNDGND
i2cSDAGPIO 20
i2cSCLGPIO 21

14. Connections between "micro_sd" and "Arduino"

Functionmicro_sdArduino
powerVCC5V
groundGNDGND
spiMOSIGPIO 51
spiMISOGPIO 50
spiSCKGPIO 52
spiCSGPIO 53

15. Connections between "gas_smoke" and "Arduino"

Functiongas_smokeArduino
powerVCC5V
groundGNDGND
analogAOGPIO 54

16. Connections between "gas_air" and "Arduino"

Functiongas_airArduino
powerVCC5V
groundGNDGND
analogAOGPIO 55

17. Connections between "obstacle_left" and "Arduino"

Functionobstacle_leftArduino
powerVCC5V
groundGNDGND
digitalOUTGPIO 28

18. Connections between "obstacle_right" and "Arduino"

Functionobstacle_rightArduino
powerVCC5V
groundGNDGND
digitalOUTGPIO 29

19. Connections between "line_left" and "Arduino"

Functionline_leftArduino
powerVCC5V
groundGNDGND
digitalOUTGPIO 30

20. Connections between "line_right" and "Arduino"

Functionline_rightArduino
powerVCC5V
groundGNDGND
digitalOUTGPIO 31

21. Connections between "mode_switch" and "Arduino"

Functionmode_switchArduino
groundGND_THROWGND
digitalCOMMONGPIO 44

22. Connections between "status_leds" and "Arduino"

Functionstatus_ledsArduino
groundGNDGND
digitalGREENGPIO 10
digitalREDGPIO 11
digitalBLUEGPIO 12
digitalYELLOWGPIO 13
digitalWHITEGPIO 46

23. Connections between "alarm_buzzer" and "Arduino"

Functionalarm_buzzerArduino
powerVCC5V
groundGNDGND
digitalSIGGPIO 45

Deploy the firmware

#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();}}}}

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