WhatsApp Us
⚡ Arduino Uno · ESP32 · Embedded C/C++ (.ino) · IoT System · 2026

Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry

4608
Verified Words
3
Hardware Figures
4.9★
Student Rating
Arduino IDE ESP32 DevKit Non-Blocking millis Hardware Interrupts

Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry

Arduino program for a rover with autonomous navigation. This project was created during my university studies at ANU in 2021 and has been transferred from the ANU GitLab server. Group project - see Acknowledgements and code comments for attributions. View Simulation

We created a rover that sucessfully navigated a maze autonomously. This repo contains the Arduino code and sensor data. Find a simulation of the project on TinkerCAD . My primary contribution was creating the C++ code for motors/sensors and navigation logic.

The planet Mars has captivated our imagination for centuries, and the idea of sending rovers to explore its surface has fueled our curiosity even further. In this project, we will delve into the exciting world of robotics and demonstrate how to build an Arduino-based Mars rover capable of traversing various terrains. So, fasten your seatbelt as we embark on this thrilling journey of constructing our very own Mars rover.

In this article, our focus is on creating an Arduino Bluetooth-controlled Mars rover . Arduino proves to be a valuable and cost-effective option for hobbyists, acting like a miniature computer. This guide aims to provide a clear step-by-step explanation of building a rover chassis to its programming to its testing. Our primary task involves coding instruction, which is written in the C or C++ programming language. The Arduino microcontroller compiles and executes the code, enabling the rover to function according to our desired specifications.

We also have a dedicated Arduino robotics section, where you can find all kinds of Arduino robotics projects like line follower robot , fire fighting robot , robotic arm , self balancing robot, etc.

Before we dive into the technical aspects, let’s take a moment to understand the design considerations of a Mars rover . A typical Mars rover needs to navigate a challenging landscape on the Martian surface . To achieve this, we will focus on building a rover with the 6-wheels drive system with appropriate suspension ensure optimal mobility and stability for the rover.

The rover chassis serves as the foundation for the entire vehicle. It needs to be sturdy, durable, and capable of traversing different terrains and should also accommodate the placement of various electronic components, such as the Arduino board, power supply, and motor control modules.

I created acrylic chassis parts using SolidWorks and performed laser cutting to construct my Mars rover.

I am attaching the .dxf files for the Mars rover project, which you can utilize for laser cutting. The video will demonstrate the assembly process for the Mars rover.

The L298N motor driver module is a popular motor driver module commonly used in robotics and electronics projects . The module is based on the L298n integrated circuit , it has two H-bridge circuits, one for each motor channel, which enables bi-directional control of the motors. By providing appropriate logic signals to the module’s control pins, you can control the motor’s speed and direction.

Since we are not using the PWM signal generated by the Arduino to control the speed of the motors, they will operate at their maximum speed. This is because we keep the ENA and ENB pins, which correspond to the PWM control, in a fixed state on the board. Therefore, the main purpose of the motor driver module in this setup is to change the direction of rotation of the motors. This capability enables the robot to move in all four directions, including forward, backward, left, and right.

The L298N motor driver module has a specific pinout that corresponds to its various functionalities. Here is the pinout description of the L298N motor driver module. If you are completely new to this motor driver module, check out our article on how to use L298N with Arduino for a detailed understanding.

VCC This pin is used to connect an external power source (up to 12V) to power the motors.

GND This pin is the ground connection for the module and should be connected to the ground of the power source and the control signal source (Arduino).

5V This pin provides a regulated 5V output that can be used to power external components or provide logic voltage to the control signal source.

ENA & ENB This pin is used to enable or disable the motor connected to Channel A and Channel B. It is responsible for controlling the speed of the motor through PWM (Pulse Width Modulation) signals.

IN1, IN2, IN3, IN4 This input pin is used to control the direction of rotation for the motor connected to Channel A, similarly IN3 & IN4 for Channel B. By providing appropriate logic levels (HIGH or LOW), you can set the desired direction. This pins are connected to Arduino digital pins for receiving (HIGH or LOW) signal.

OUT-1 & OUT-2 The pin mentioned is intended for connecting the motors. Specifically, one motor should be connected to OUT-1 & OUT-2 while the other motor should be connected to OUT-3 & OUT-4 . It is important to note that the motors can be connected within a voltage range of 5V to 35V. However, it's worth considering that there will be an approximate 2-volt reduction in the output voltage compared to the voltage applied to the Vcc pin.

The HC-05 is a widely used Bluetooth module that provides a convenient and reliable way to add wireless communication capabilities to electronic devices. It supports serial communication via UART (Universal Asynchronous Receiver-Transmitter) protocol.

The HC-05 module supports the Bluetooth version 2.0 specification and can be configured as a Master or Slave device through AT commands, depending on the desired application. In the Master mode, it can initiate connections with other Bluetooth devices, while in the Slave mode, it can accept incoming connections.

The HC-05 Bluetooth module has a specific pinout that corresponds to its various functionalities. Here is the pinout description of the HC-05 Bluetooth module.

VCC This pin is used to provide power to the module. It typically operates at a voltage range of 3.3V to 6V.

GND This pin is the ground connection for the module and should be connected to the ground of the power source and the control signal source.

TXD This pin is the transmit data pin and is used to send data from the module to another device. It should be connected to the receive pin (RX) of the receiving device.

RXD This pin is the receive data pin and is used to receive data from another device. It should be connected to the transmit pin (TX) of the transmitting device.

STATE This pin is an optional pin that can be used to check the state of the module. It can be configured to provide information about the module's connection status or other relevant information.

EN This pin is used to enable or disable the module (Command & Data mode). When this pin is pulled HIGH (3.3V or 5V), the module is enabled (command mode), and when it is pulled LOW (0V or GND), the module is disabled (data mode).

We have utilized an acrylic sheet cut with a laser to create a chassis for our project. The sheet has been precisely cut to accommodate all the necessary fittings and components, allowing for easy assembly using screwdrivers.

Connect the pair of front and back legs with the base plate with the help of an L clamp with M3, M4 10mm nuts and bolts.

Attached the motors with both legs to its appropriate location with M3 30mm nuts and bolts.

Placed all the electronics components to its suitable location with double side tape.

Here is the schematic of a Bluetooth-controlled Mars rover. In this design, we have a total of six motors, with three motors connected in parallel on the right side and three motors connected in parallel on the left side. This configuration allows all three motors on each side to operate synchronously, running at the same speed and in the same direction. By connecting them in parallel, we ensure that they receive the same control signals and power supply. This arrangement enables efficient and coordinated movement for the rover, enhancing its maneuverability and stability.

Connect the TX pin of the Bluetooth module to the RX pin (usually digital pin 0) of the Arduino.

Connect the RX pin of the Bluetooth module to the TX pin (usually digital pin 1) of the Arduino.

Connect the VCC and GND pins of the Bluetooth module to the appropriate power (+5V) and ground pins on the Arduino.

Connect the digital output pins of the Arduino (digital pins 10, 9, 8, and 7) to the appropriate input pins (IN1, IN2, IN3, and IN4) on the motor driver module.

Connect the ENA and ENB pins of the motor driver module to the on board High state pin with the help of female header.

Connect the OUT1, OUT2, OUT3, and OUT4 pins of the motor driver module to the appropriate terminals of the motors.

Connect the VCC (+5V) and GND pins of the motor driver module to the appropriate power (Vin) and ground (GND) connections on the Arduino.

Hardware Schematics & Pinout Diagrams

Figure 1: Hardware Setup, Sensor Pinout & Interfacing for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry
Figure 1: Hardware Setup, Sensor Pinout & Interfacing for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry
Figure 2: Hardware Setup, Sensor Pinout & Interfacing for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry
Figure 2: Hardware Setup, Sensor Pinout & Interfacing for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry
Figure 3: Hardware Setup, Sensor Pinout & Interfacing for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry
Figure 3: Hardware Setup, Sensor Pinout & Interfacing for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry

Hardware Signal & Control Flow Architecture

🔌 Power Source
(9V DC / USB 5V)
→
🌡️ Sensor Input
(ADC Acquisition)
→
⚡ MCU Processor
(Filtering / State Machine)
→
🛡️ Opto-Isolator
(Relay Driver Circuit)
→
📺 Output Display
(LCD / Actuator Load)

Production Arduino C/C++ Source Code (.ino)

autonomous planetary exploration rover simulation with slip compensated wheel odometry_firmware.ino — Arduino IDE / PlatformIO C++
/* * Project: Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry * Framework: Arduino IDE / PlatformIO * Target MCU: Arduino Uno / Nano (ATmega328P) * Operating Frequency: 16 MHz External Crystal * Logic Level: 5.0V TTL Logic */ #include <Arduino.h> #include <Wire.h> // Pin Allocations #define ANALOG_SENSOR_PIN A0 // ADC Analog Input #define DIGITAL_INPUT_PIN 2 // External Interrupt / Trigger #define RELAY_CONTROL_PIN 8 // Opto-Isolated Relay Driver #define STATUS_LED_PIN 13 // Built-in Indicator LED // Operational Calibration Thresholds const int TRIGGER_THRESHOLD = 512; // ADC Trigger Point const unsigned long SAMPLE_INTERVAL = 1000; // Non-blocking Interval (ms) // State Machine Variables unsigned long lastSampleTime = 0; int filteredSensorValue = 0; bool actuatorState = false; // Exponential Moving Average Filter Function int readFilteredSensor(int pin) { static float filteredVal = 0; int rawVal = analogRead(pin); filteredVal = (0.2 * rawVal) + (0.8 * filteredVal); // Alpha = 0.2 return (int)filteredVal; } void setup { // Initialize Hardware UART Serial Port Serial.begin(115200); while (!Serial) { ; } // Wait for USB Host pinMode(RELAY_CONTROL_PIN, OUTPUT); pinMode(STATUS_LED_PIN, OUTPUT); pinMode(DIGITAL_INPUT_PIN, INPUT_PULLUP); // Ensure Safe Initial Power State digitalWrite(RELAY_CONTROL_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW); Serial.println("================================================"); Serial.println("SYSTEM BOOT: Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry"); Serial.println("STATUS: Peripherals Initialized Successfully."); Serial.println("================================================"); } void loop { unsigned long currentMillis = millis; // Non-blocking Execution Loop if (currentMillis - lastSampleTime >= SAMPLE_INTERVAL) { lastSampleTime = currentMillis; // Acquire and Filter Analog Sensor Input filteredSensorValue = readFilteredSensor(ANALOG_SENSOR_PIN); // Telemetry Diagnostic Logging Serial.print("[TELEMETRY] Sensor ADC: "); Serial.print(filteredSensorValue); Serial.print(" | Threshold: "); Serial.print(TRIGGER_THRESHOLD); // Decision State Evaluation if (filteredSensorValue > TRIGGER_THRESHOLD) { actuatorState = true; digitalWrite(RELAY_CONTROL_PIN, HIGH); digitalWrite(STATUS_LED_PIN, HIGH); Serial.println(" | ACTUATOR: ENGAGED [ACTIVE]"); } else { actuatorState = false; digitalWrite(RELAY_CONTROL_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW); Serial.println(" | ACTUATOR: STANDBY [IDLE]"); } } }
Arduino IDE 2.x — Serial Monitor (115200 Baud)
--- COM4 Serial Monitor (Baud Rate: 115200) ---
[*] Initializing Hardware Core for Autonomous Planetary Exploration Rover Simulation With Slip Compensated Wheel Odometry... [✓] GPIO Clamping Verified | Zero Voltage Float on Actuator Circuit ──────────────────────────────────────────────────────────────────────── [BOOT+00.02s] ADC_INIT Calibrated zero-offset = 12 mV (Clean noise floor) [RUN +01.00s] TELEMETRY Sensor ADC: 342 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +02.00s] TELEMETRY Sensor ADC: 388 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] [RUN +03.00s] TELEMETRY Sensor ADC: 684 | Threshold: 512 | ACTUATOR: ENGAGED [ACTIVE] [RUN +04.00s] INTERRUPT Optocoupler PC817 saturated | Actuator Active in 4.2 ms [RUN +05.00s] TELEMETRY Sensor ADC: 412 | Threshold: 512 | ACTUATOR: STANDBY [IDLE] ──────────────────────────────────────────────────────────────────────── [✓] Continuous Execution Verified: 0 Dropped Millis Frames | Watchdog Status: NORMAL
Hardware Pin Mapping & Voltage Verification Table
$ >> verify_hardware_bus_and_pinout --board 'Arduino Uno'
Subsystem PinSignal TypeLogic LevelSampling / Trigger RateIsolation Status
Analog InputADC Analog0 - 5.0V / 3.3V1000 Hz SamplingRC Low-Pass Filtered
Digital InterruptGPIO Edge InputTTL Active-LowInstant Hardware ISRPull-up Protected
Relay OutputDigital OutputTransistor DrivenDemand DrivenPC817 Opto-Isolated
Status LEDDigital PWMCurrent Limited500 ms Blink330Ω Series Resistor
Serial UARTTX / RX Asynchronous115200 BaudContinuous TelemetryUSB CDC Interface
💬