กลับไปหน้ารวมไฟล์
autonomous-controllable-lego-car-4c16b3-en.md

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.

Front view: Showing Stepper Motor installation and Front Bumper
Rear view: Layout of the battery pack to power the system

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.
Scanner unit: The Stepper Motor rotates the Ultrasonic Sensor to create a distance map

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:

  1. 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.
  2. Avoidance Mode: If an object is detected within 15 - 50 cm, the robot automatically calculates a direction to turn and avoid it.
  3. 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.
Kicker mechanism connected to a Servo Motor for interacting with objects

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.h library. 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).
IR Receiver installed in a position for omnidirectional signal reception
Diagram of function assignments for each button on the remote control

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.

ข้อมูล Frontmatter ดั้งเดิม

title: "Autonomous Controllable LEGO Car"
description: "Autonomous car, built from a LEGO frame, which responds to nearby objects and can also be manually controlled via remote control."
author: "achyutayadunandan"
category: ""
tags:
  - "autonomous"
  - "cars"
  - "remote control"
views: 3260
likes: 1
price: 2450
difficulty: "Intermediate"
components:
  - "1x Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires"
  - "2x Through Hole Resistor, 470 ohm"
  - "1x High Brightness LED, White"
  - "2x Custom PCB"
  - "1x L9110S H Bridge Stepper Motor Dual DC Driver"
  - "1x Mastech MS8217 Autorange Digital Multimeter"
  - "4x Tactile Switch, Top Actuated"
  - "6x Alligator Clips"
  - "1x Arduino UNO"
  - "1x Soldering iron (generic)"
  - "1x Solder Wire, Lead Free"
  - "1x 5 mm LED: Red"
  - "1x SG90 Micro-servo motor"
  - "1x Rotary potentiometer (generic)"
  - "1x HX1838 Universal IR Infrared Remote Control Receiver Module"
  - "1x Ultrasonic Sensor - HC-SR04 (Generic)"
  - "1x Mindstorms NXT Programming Brick / Kit"
  - "1x Multitool, Screwdriver"
  - "20x Jumper wires (generic)"
  - "4x Resistor 10k ohm"
  - "1x 28YBJ-48 DC 5V 4 Phase 5 Wire Stepper Motor With ULN2003 Driver Board"
tools: []
apps:
  - "1x Arduino IDE"
downloadableFiles: []
documentationLinks: []
passwordHash: "ea5658765e76e1bbd71cbf7f3f7550364c75c047a3242d839af7f57658040a30"
encryptedPayload: "U2FsdGVkX19IQZ/PQ2rpYPhXwZL+wqlphQObMGVG8WtS0fAOceo1sEoJDsMUOIG73C2wa3tGZhWxqg/XQfM+lE51PjDydHotQSsDS1aC6No="
seoDescription: "Build an Autonomous LEGO Car that responds to nearby objects and supports manual remote control."
videoLinks: []
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/autonomous-controllable-lego-car-4c16b3_cover.jpg"
lang: "en"