Table of Contents

Land Buster - BT-Controlled RC Car -

Cucu Viorel-Cosmin 334CA

GitHub: PROIECT_PM_MASINUTA

MCU: ATmega328P Xplained Mini · PlatformIO

Introduction

Land Buster is a small RC car (1/12 scale Land Buster chassis) that I upgraded into a smart rover. Instead of using a standard radio remote, I control it from my phone via Bluetooth.

The main idea was simple: a normal RC car does whatever you tell it, even if it is about to crash. I wanted to fix that. So I added sensors and automatic logic on top of the manual control.

What it does:

Why it is useful: It shows how a cheap microcontroller can handle multiple real-time tasks at once - wireless communication, sensing, motor control, and display - using only hardware registers and no external libraries.

Course requirements met:

General Description

The ATmega328P is the brain of the system. Everything connects to it.

Block Diagram

Hardware Design

Components and Their Role

Component Model Role in Project
Microcontroller ATmega328P Xplained Mini Central brain. Reads all sensors, runs non-blocking logic, outputs PWM and I2C signals.
Bluetooth Module HC-05 Bidirectional telemetry with Android app - receives drive commands, sends sensor data.
Front Ultrasonic Sensor HC-SR04 Measures distance to obstacles ahead. Triggers buzzer alerts and emergency stop at <15 cm.
Rear Ultrasonic Sensor HC-SR04 Measures distance behind the rover. Powers the reverse parking assist display on the LCD.
Light Sensor GL5528 Photoresistor + 10kΩ Voltage divider read by ADC. Activates headlights automatically when ambient light drops.
Speed Controller 20A Brushed ESC Controls the rear 390 DC traction motor via 50 Hz PWM. Receives signal from MCU Timer 1.
Traction Motor 390 DC Motor (7.4V) Drives the rover forward and backward from Battery 2's dedicated high-current rail.
Steering Motor 3–6V DC Motor Turns the front axle left or right under L298N control.
Motor Driver L298N H-Bridge Two direction pins (IN1/IN2) to drive the steering DC motor.
LCD Display 1602 LCD + PCF8574 I2C “Smart dashboard”: shows expressive animated eyes in normal mode, parking assist in reverse.
Active Buzzer TMB12A05 5V Proximity alert (beep rate increases near obstacles) and horn command from phone.
Headlights & Taillights 5mm LEDs x4 + 220Ω x4 Front lighting (D7) activates automatically via LDR. Rear taillights (A3) activate on brake/reverse. Wired in parallel.
Voltage Regulator LM2596 Step-Down Converts Battery 1's 7.4V down to a stable 5V for all logic (MCU, sensors, LCD).
Battery 1 - Logic Rail 2x Murata US18650VTC5C in series 7.4V, 2600 mAh, 30A. Powers L298N and LM2596 (which feeds 5V logic).
Battery 2 - Traction Rail 2x Samsung 25R 18650 in series 7.4V, 2500 mAh, 8C. Dedicated high-current supply exclusively for the ESC.
Chassis Land Buster 1/12 scale Physical base of the rover.

Pin Mapping and Justification

Arduino Pin AVR Register Timer / Peripheral Connected To Why This Pin
D0 (RX) PD0 USART0 RX HC-05 TX Hardware USART - zero-latency interrupt-driven reception (RXCIE0). No bit-banging needed.
D1 (TX) PD1 USART0 TX HC-05 RX via 1kΩ/2kΩ divider Same USART peripheral. 5V output is divided to 3.3V to protect HC-05 RX logic level.
D2 PD2 GPIO Output HC-SR04 Front - TRIG Any GPIO works for the 10 µs trigger pulse. D2 keeps sensor pins grouped together.
D3 PD3 GPIO Input HC-SR04 Front - ECHO Paired with D2 for clean wiring. Reads echo pulse duration via pulseIn().
D4 PD4 GPIO Output HC-SR04 Rear - TRIG Same reason as D2; rear sensor pins grouped on D4/D5.
D5 PD5 GPIO Input HC-SR04 Rear - ECHO Paired with D4. Mirrors front sensor logic for parking assist.
D7 PD7 GPIO Output Headlight LEDs + 220Ω Simple digital ON/OFF for the LED array. D7 is free from any timer to avoid conflicts.
D8 PB0 GPIO Output L298N IN1 Direction bit for steering H-bridge. No special hardware needed - plain digital output.
D9 PB1 GPIO Output L298N IN2 Direction bit for steering H-bridge (opposite of IN1 to select left/right).
D10 PB2 Timer 1, OC1B (Phase-correct PWM) ESC Signal Timer 1 is 16-bit - essential for generating the precise 50 Hz (20 ms period) servo-style PWM the ESC requires. ICR1=39999, OCR1B range 2600–3400 for speed control.
A0 PC0 ADC0 LDR Voltage Divider First ADC channel; no mux change needed for single-channel reads. Direct analog measurement of light level.
A1 PC1 GPIO Input HC-05 STATE Reads hardware connection status (HIGH = connected, LOW = disconnected/searching).
A2 PC2 GPIO Output Active Buzzer Moved here from SPI pins to keep PB3/PB4/PB5 free for the Xplained Mini's programming interface (EDBG).
A3 PC3 GPIO Output Rear LED Taillights Dedicated pin for red rear taillights. Activates independently during AEB, reverse, or stop.
A4 PC4 TWI SDA (Hardware I2C) LCD PCF8574 SDA Hardware I2C peripheral - only PC4/PC5 support hardware TWI on ATmega328P.
A5 PC5 TWI SCL (Hardware I2C) LCD PCF8574 SCL Paired with A4. Hardware TWI runs at 100 kHz without CPU intervention.

Key Design Choices & Electrical Schematic

kicad_cucu2.pdf

The electrical schematic above illustrates the complete wiring of the Land Buster rover. The hardware architecture is built upon the following core engineering rules:

Proof of Functionality & Assembly

Photo 1: Power Drop Test

This early prototype test was conducted with only the steering system and ESC connected. While running the main traction motor at a low RPM, the output of the LM2596 regulator dropped dangerously to 4.7V. This critical observation proved that a single battery configuration was insufficient to handle the high current spikes, directly justifying the upgrade to the current dual-battery (4-cell) isolated power system.

Photo 2: Full System Test

All electronic components-including the ultrasonic sensors, I2C LCD, HC-05 Bluetooth module, and motor drivers-are integrated and tested together. This phase successfully verified the software integration, ensuring that the non-blocking logic, telemetry, and autonomous emergency braking (AEB) functioned simultaneously without interference, proving the system's core functionality.

Photo 3: Clean Build

The final hardware assembly mounted on the Land Buster chassis. This image highlights the strict cable management and the custom mechanical modifications made to the chassis to accommodate all the new components. To ensure maximum stability, the electronics and wiring were permanently secured using high-strength adhesives (epoxy resin and cyanoacrylate).

Photo 4: Final Assembly

The completed autonomous rover with the original outer car shell successfully mounted.

Software Design

Development Environment & Libraries Motivation

Justification of Laboratory Functionalities

The project actively uses 5 core concepts from the PM laboratory:

Project Skeleton, Interaction, and Validation

The software is structured around a single, highly optimized, non-blocking loop():

Sensor Calibration

Optimizations and Bug Fixes

How, why, and where I optimized the code:

Novelty

The main element of novelty is the Autonomous Emergency Braking (AEB) layered on top of manual RC control. Unlike a normal RC car that crashes if you make a mistake, this car intelligently intercepts your Bluetooth commands. If you command it to drive forward into a wall, the software debounces the sensor readings and overrides your command, applying a neutral brake to stop the car automatically. It implements a “directional block”: it stops you from hitting the wall in front, but still allows you to reverse safely.

Custom Android Application

To control the rover, I developed a custom Android application from scratch. Instead of relying on generic Bluetooth terminal apps, this dedicated app provides a custom user interface tailored for driving. It features:

Conclusions

This project shows that one small 8-bit microcontroller can handle wireless control, sensing, motor driving, and display - all at once -using only hardware registers.

Key lessons:

Download

All project files (C sources, Makefile / PlatformIO config, and schematics) are available in the GitHub repository: PROIECT_PM_MASINUTA GitHub

Bibliography and Resources

Hardware Datasheets

Tools

Export to PDF