Autonomous Controllable LEGO Car
From a basic Autonomous Car project, it evolved into an intelligent robot capable of various multi-modes, including automatic obstacle avoidance and remote control via an infrared (IR) remote. This project combines the highly flexible LEGO Mindstorms building kit with the powerful deep-control capabilities of the Arduino Uno microcontroller.
Demonstration Videos
Autonomous Driving Mode: In this mode, the robot uses its sensor system to make autonomous path decisions. Watch Autonomous Operation Demo
Remote Control Mode (Manual IR Control): Real-time commands to control direction and various auxiliary functions. Watch Remote Control Demo
Mechanical Design
The main structure of the car is built entirely from LEGO Mindstorms NXT parts, referencing the basic 3-motor chassis design, which provides good strength and balance.
The Arduino Uno is installed in the original position of the NXT battery pack to maintain the car's Center of Gravity. The installation of the servo motors, stepper motor, and auxiliary batteries underwent experimental design testing to ensure the most stable mounting, even during rapid car movement.


Sensing & Scanning
The key to environmental awareness is the Ultrasonic Sensor, mounted on a Stepper Motor approximately 5 inches from the ground. Using a Stepper Motor instead of a fixed mount gives the robot a wider vision radius.
- Scanning Logic: In autonomous mode, the Stepper Motor continuously performs a wide-angle scan. If an obstacle is detected within a set range, the program instructs the Stepper to perform a detailed, degree-by-degree 360-degree scan around itself to calculate the safest clear path.
- Physical Protection: In addition to the Ultrasonic system, Push Buttons are installed on both the front and rear bumpers to act as a fail-safe in cases where objects are too small or positioned at an angle where ultrasonic waves cannot detect them.

Actuation & Features
One interesting function is the "Kicker" system, a kicking mechanism driven by a Servo Motor installed on the right side of the car, with the following programmed logic:
- Attack Mode: If the Ultrasonic sensor detects an object at close range (less than 15 cm), the robot immediately commands the Servo to deploy the kicking mechanism and reverses to maintain distance. This function could be adapted for creating soccer-playing robots in the future.
- Avoidance Mode: If an object is detected within 15 - 50 cm, the robot automatically calculates a direction to turn and avoid it.
- Cruising Mode: If no object is blocking the path within 50 cm, the car drives straight forward and periodically stops to scan for new paths, allowing for random exploration.

Motor Control & IR Logic
For propulsion, I chose to use motors from the original LEGO NXT kit due to their high Torque. However, to enable their use with Arduino, signal wire modification was necessary:
- Hardware Interface: The NXT Motor wires are stripped, using only two wires (black and white) to receive DC power signals.
- Motor Driver: Both wires are connected to an L9110 Dual Motor Driver, allowing Arduino to precisely control rotation direction and speed via PWM (Pulse Width Modulation) signals.
For the remote control system, I installed an IR Receiver to receive signals from a TV Remote.
- IR Decoding: The operation relies on the
IRremote.hlibrary. We need to map the hexadecimal values of each button on the remote to the desired functions; for example, the volume up button might command the car to move forward, or the channel change button might command the car to turn. - Versatility: Users can instantly switch operating modes from the remote, whether it's manual control, commanding the scanner motor to operate, or entering "Bumper Mode" (automatic operation using only the bumper push buttons).


This project demonstrates the potential of combining modern Microcontroller technology like Arduino with the classic nature of LEGO to create an embedded system that is both fun and truly educational in an engineering context.