Elegoo Arduino Smart Robot Car
Elegoo Arduino Smart Robot Car

How to Program Your Elegoo Smart Robot Car: Assembly and First Steps

Embarking on the journey of robotics with an Arduino is a thrilling experience, and building a robot car is a fantastic starting point. For many Arduino enthusiasts, constructing a small, mobile robot is a rite of passage, blending learning with impressive results. Among the numerous robot car kits available, the Elegoo Smart Robot Car stands out as a comprehensive and user-friendly option, especially for those eager to dive into programming.

While pre-made robot car bases simplify the mechanical aspects, the Elegoo Smart Robot Car kit takes ease of use a step further. It provides all necessary components in one package, ensuring a smoother build and a higher chance of success, particularly for beginners. This article, the first in a series, will guide you through assembling the Elegoo Smart Robot Car Version 3.0, setting the stage for the exciting world of robot car programming. We’ll explore the components, assembly process, and initial tests, all geared towards understanding how to bring this smart little vehicle to life with code.

Discovering the Elegoo Smart Robot Car Kit

The Elegoo Smart Robot Car kit is designed to be feature-rich and accessible, making it an excellent platform for learning about robotics and programming. Its key features include:

  • Four-Wheel Drive: Offers enhanced maneuverability and stability.
  • Versatile Control Options: Includes both IR Remote and Bluetooth Remote control for diverse interaction methods.
  • Intelligent Navigation: Equipped with Ultrasonic Collision Avoidance and Line Following capabilities, paving the way for autonomous behaviors.
  • Rechargeable Power: Comes with rechargeable LiPo batteries and a charger, ensuring long-lasting fun and learning.
  • Solder-Free Assembly: No soldering or specialized tools are needed, simplifying the building process significantly.

These features, combined with clear instructions and readily available Arduino code examples, make the Elegoo Smart Robot Car kit an ideal choice for Arduino learners across different age groups and skill levels who are keen on learning how to program elegoo smart robot car for various functionalities.

Unboxing the Elegoo Smart Robot Car Kit

The Elegoo Smart Robot Car kit arrives in a robust orange case, designed for reuse and organization. Inside, the case is thoughtfully divided into sections and compartments, each holding specific robot car components. A helpful diagram on the inside of the lid provides a visual inventory of all the included parts, ensuring you can easily check for completeness.

The kit contains a comprehensive set of components:

  • Elegoo Arduino Uno R3: The microcontroller brain of the robot.
  • Top and Bottom Acrylic Base Plates: Forming the chassis of the car.
  • Four DC Motors and Four Tires: Providing the movement for the robot car.
  • Custom Arduino Shield: An interface board designed specifically for this robot, including an IR Receiver.
  • L298N Motor Controller: Essential for driving the DC motors efficiently.
  • 3-Element Line Sensor Module: Enables line following capabilities.
  • SG90 Servo Motor: Used for controlling the direction of the Ultrasonic Sensor.
  • HCSR04 Ultrasonic Distance Sensor: Allows the robot to perceive its surroundings and avoid obstacles.
  • Bluetooth Module: For wireless control and communication.
  • Two 18650 LiPo Batteries and Battery Holder: Power source for the robot.
  • Battery Charger: For recharging the LiPo batteries.
  • Connection Cables: For easy and secure wiring of components.
  • USB Cable for Arduino: For programming and communication with a computer.
  • IR Remote Control: For infrared remote operation.
  • Servo & Ultrasonic Sensor Mounting Brackets: For securely attaching sensors.
  • Assembly Hardware: All necessary screws, nuts, and spacers.
  • Three Screwdrivers: Including Phillips and Hex screwdrivers needed for assembly.
  • Vinyl Electrical Tape: For insulation and tidying up wires.
  • CD ROM: Containing code examples and instruction manuals.

A particularly thoughtful touch is the packaging of assembly hardware into labeled plastic bags, simplifying the assembly process and preventing confusion. This meticulous organization is a boon for beginners eager to learn how to program elegoo smart robot car without getting bogged down in complex hardware assembly.

Now that we’ve explored the contents of the Elegoo Smart Robot Car kit, let’s move on to assembling it, step by step.

Assembling Your Smart Robot Car

Assembling the Elegoo Smart Robot Car is straightforward, thanks to the detailed instruction manuals provided in PDF format. These manuals, along with sample code, are available on the included CD-ROM and can also be downloaded from the Elegoo website. Having digital manuals ensures you always have access to the latest version.

The kit conveniently includes the necessary tools for assembly: small Phillips screwdrivers and a 2.5mm hex key. While these are sufficient, a pair of pliers can be helpful for easier handling, though not strictly necessary.

Elegoo’s smart packaging of mounting hardware into labeled bags, each corresponding to a specific assembly section, significantly streamlines the process.

Mounting Motors and Motor Mounts to the Chassis

The first assembly step involves attaching aluminum mounting blocks to the four DC motors. These blocks are secured using long screws that pass through the motors. Ensure the blocks are installed on the side of the motors where the connecting cables protrude. The blocks are versatile and can be installed in either direction, as threaded mounting holes for chassis attachment are present on both sides.

After mounting blocks, you can fix the motors to the bottom base plate. Before handling the base plate, remember to peel off the protective coating from both sides. Identify the side marked “A”; this is the top side.

Secure the four motors to the base plate using the blocks you just installed. Insert screws through the base plate into the threaded holes of the aluminum blocks and tighten them. Align the motors flush with the base plate edge before final tightening. Keep the base plate nearby as it’s needed for the next step.

L298N Motor Driver Mount

The L298N motor driver is crucial for controlling the DC motors. It’s an H-Bridge driver capable of managing two DC motors, and in this kit, it’s modified with dual connectors per motor output to accommodate parallel wiring of motors on each side of the robot car. The board also features connectors for power and data cables.

Orient the L298N board with the heatsink facing the rear of the chassis. It mounts onto the bottom base plate using four M3x14 screws and small spacers. Pass screws through the L298N mounting holes, then add spacers, and insert through the base plate holes. Secure everything with four M3 nuts.

Once the L298N is mounted, connect the four motors to their respective connectors. The connectors are keyed to prevent incorrect installation. Understanding the L298N is fundamental when you learn how to program elegoo smart robot car movements, as it’s the interface between the Arduino and the motors.

Line Follow Sensor Module Installation

Next, mount the line follow sensor array on the bottom base plate. This sensor is key for enabling line following behavior in your robot. It mounts beneath the chassis using four threaded spacers, four M3x7 screws, and four M3 nuts.

Orient the line follow sensor array so its sensitivity trimpot faces the front of the robot car. This placement positions the sensor array connector near the chassis’s large hole, which is used for cable routing. The line follower sensor is critical when you start to explore how to program elegoo smart robot car for autonomous navigation tasks.

Attaching Arduino to Top Chassis and Shield

Now, shift focus to the top chassis plate. Like the bottom plate, it has a protective covering that needs removal. Note the label on the covering, indicating the upward-facing side. Correct orientation is crucial for this plate to avoid disassembly and re-mounting.

Mount the Arduino Uno onto the top chassis plate using three M3x14 screws and three spacers, as one Arduino mounting hole is unused. Secure the screws with three M3 nuts.

After securing the Arduino Uno, install the custom interface shield on top. Align the connection pins carefully as you would with any Arduino shield to ensure proper connectivity. This shield is essential as it provides the necessary interfaces for all the robot’s sensors and actuators, simplifying how to program elegoo smart robot car functionalities.

Battery Compartment Installation

The battery compartment is the next component to add to your Smart Robot Car. Use four M3x10 screws to mount the battery holder. These screws are Phillips head, so use the appropriate screwdriver from the kit.

Remove the top of the battery compartment to access the screw holes and to prepare for battery insertion.

Align the holder flush with the top plate edges, insert the screws, and secure them with four M3 nuts. After mounting, install the two 18650 LiPo batteries, ensuring correct orientation as indicated inside the compartment. Close the cover once batteries are in place.

Finally, connect the battery holder to the power connector on the shield. Before connecting, ensure the power switch is in the “off” position to avoid premature power-up. Power management is a key aspect to consider when you start to program elegoo smart robot car for extended operations.

Servo Motor Mounting

Next is the servo motor, which will hold the Ultrasonic sensor assembly. Mount the servo onto a separate base plate included in the Ultrasonic sensor holder package. Attach the servo motor to this plate using two small M2x10 screws and secure with two M2 nuts. Ensure correct motor orientation as shown in the manual.

Once the servo is on its plate, mount it to the top chassis plate using three M3x10 screws and M3 nuts.

After placing the servo, route the servo cable through the hole in the top plate and connect it to the shield connector, ensuring correct direction based on the ground pin label on the shield (brown wire on SG90 servo). The servo motor is crucial for directional sensing when you program elegoo smart robot car for obstacle avoidance and scanning.

Ultrasonic Sensor Installation

The Ultrasonic sensor is then installed onto its mounting bracket using four tiny M1.6×8 screws. These require the smallest Phillips screwdriver from the kit.

After securing the sensor to its bracket, place the assembly onto the servo motor shaft. Align the sensor to face forward, though perfect flush alignment might not be possible due to gear meshing on the shaft.

Once mounted, use the provided 4-conductor cable to connect the sensor to the shield. This unique cable is keyed for correct orientation. The ultrasonic sensor is vital for obstacle avoidance, a key feature to program elegoo smart robot car for intelligent movement.

Cable Management and Wiring

Your robot car is now taking shape! It’s time for wiring. First, install the six copper spacers onto the bottom plate using six M3x10 screws. These spacers will connect the bottom and top plates.

The kit’s cables are unique, simplifying identification. Refer to the manual illustrations if needed. Start with the Line Follower sensor, connecting one end of its cable and routing it through the base plate hole. Leave the other end unconnected for now.

Next, wire the L298N motor driver, requiring a power and an interface cable. Again, these are unique cables. Leave the other ends unconnected.

Route all the cables connected to the base plate components up through the hole on the top base. Now, use the six M3x10 screws to fasten the top plate to the copper spacers, joining the chassis plates. Finally, connect the free ends of the cables to their respective connectors on the shield. Proper wiring is essential before you can program elegoo smart robot car to perform any actions.

Bluetooth Module Installation

Installing the Bluetooth module is straightforward. It has a connector that directly plugs into a socket on the shield. Simply snap it into place.

Remember to remove the Bluetooth module when programming the Arduino board via USB, as it shares the serial data line.

Tire Installation

The final assembly step is installing the four tires onto the motor shafts. The shafts are keyed to match the mounting holes in the tires. Press the tires onto the shafts and secure them using the long M2x25 screws. These are Phillips screws, so use the correct screwdriver.

Your robot car assembly is now complete!

Basic Testing of Your Smart Robot Car

The Elegoo Smart Robot Car is packed with features, but for this initial test, we’ll focus on verifying basic functionality. In subsequent articles, we’ll delve into Bluetooth control, IR remote operation, line following, and collision avoidance, all of which require you to program elegoo smart robot car to utilize these features.

Elegoo provides sample code on the included CD-ROM and website. Lesson one, “make the car go,” is an excellent starting point. Lesson one includes these code examples:

  • forward_back.ino: Moves the car forward and then backward.
  • left_wheel_rotation.ino: Moves only the left wheels.
  • right_wheel_rotation.ino: Moves only the right wheels.
  • speed_control.ino: Demonstrates car acceleration and stopping.
  • AUTO_GO.ino: Moves the car in all directions sequentially.

Each sketch illustrates how to control the L298N motor controller to drive the car. Familiarity with the L298N H-Bridge motor controller is beneficial for understanding motor control in your robot car projects.

We’ll examine the AUTO_GO.ino sketch and use it to test our assembled Elegoo Smart Robot Car.

AUTO_GO.ino Code:

//www.elegoo.com
// The direction of the car's movement
// ENA ENB IN1 IN2 IN3 IN4 Description
// HIGH HIGH HIGH LOW LOW HIGH Car is runing forward
// HIGH HIGH LOW HIGH HIGH LOW Car is runing back
// HIGH HIGH LOW HIGH LOW HIGH Car is turning left
// HIGH HIGH HIGH LOW HIGH LOW Car is turning right
// HIGH HIGH LOW LOW LOW LOW Car is stoped
// HIGH HIGH HIGH HIGH HIGH HIGH Car is stoped
// LOW LOW N/A N/A N/A N/A Car is stoped

//define L298n module IO Pin
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 11

void forward(){
  digitalWrite(ENA,HIGH);//enable L298n A channel
  digitalWrite(ENB,HIGH);//enable L298n B channel
  digitalWrite(IN1,HIGH);//set IN1 hight level
  digitalWrite(IN2,LOW); //set IN2 low level
  digitalWrite(IN3,LOW); //set IN3 low level
  digitalWrite(IN4,HIGH);//set IN4 hight level
  Serial.println("Forward");//send message to serial monitor
}

void back(){
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  Serial.println("Back");
}

void left(){
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,LOW);
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,LOW);
  digitalWrite(IN4,HIGH);
  Serial.println("Left");
}

void right(){
  digitalWrite(ENA,HIGH);
  digitalWrite(ENB,HIGH);
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);
  Serial.println("Right");
}

//before execute loop() function,
//setup() function will execute first and only execute once
void setup(){
  Serial.begin(9600);//open serial and set the baudrate
  pinMode(IN1,OUTPUT);//before useing io pin, pin mode must be set first
  pinMode(IN2,OUTPUT);
  pinMode(IN3,OUTPUT);
  pinMode(IN4,OUTPUT);
  pinMode(ENA,OUTPUT);
  pinMode(ENB,OUTPUT);
}

//Repeat execution
void loop(){
  forward(); //go forward
  delay(1000);//delay 1000 ms
  back();  //go back
  delay(1000);
  left();  //turning left
  delay(1000);
  right(); //turning right
  delay(1000);
}

To understand this code, knowing the L298N to Arduino connections is key:

  • ENA (Enable A): Arduino pin 5 (PWM capable)
  • ENB (Enable B): Arduino pin 6 (PWM capable)
  • IN1 (Input 1): Arduino pin 7
  • IN2 (Input 2): Arduino pin 8
  • IN3 (Input 3): Arduino pin 9
  • IN4 (Input 4): Arduino pin 11

ENA and ENB, connected to PWM pins, allow motor speed control. Motors on each side are wired in parallel.

The AUTO_GO sketch defines Arduino pins controlling the L298N and sets them as outputs in the setup() function. It defines functions for forward, back, left, and right movements, each printing direction to the serial monitor (optional). The loop() function sequentially calls these direction functions with one-second pauses, making the car move forward, backward, left, and right in a loop.

Important: Disconnect the Bluetooth module before connecting the robot car to your computer for programming. The Bluetooth module and USB connector share the same serial data lines and will conflict.

Conclusion: Ready to Program

The Elegoo Smart Robot Car kit is indeed well-designed, with high-quality parts that fit together seamlessly. The provided instructions are excellent, making assembly accessible to anyone. This kit is perfect for students and beginners learning about Arduino and robotics, offering great value with a comprehensive component set.

This concludes the first part of our series. You’ve successfully assembled your Elegoo Smart Robot Car and performed a basic functionality test. In the next article, we will explore how to program elegoo smart robot car using Bluetooth and Infrared remote controls. We’ll then advance to line following and collision avoidance programming in the final installment.

For now, enjoy your assembled robot car and get ready for the exciting journey of programming its advanced features!

Parts List

Components you might need for further experiments with your Elegoo Smart Robot Car.

COMING SOON!

Resources

Elegoo Smart Robot Car – Elegoo Smart Robot Car sales page.

Elegoo Robot Car Software – Latest instruction manual and software for the robot car.

Building the Elegoo Smart Robot Car Part 1 – Assemble an Arduino-Based Robot Car

Related

Summary

Article Name

Building the Elegoo Smart Robot Car Part 1 – Assemble an Arduino-Based Robot Car

Description

The Elegoo Smart Robot Car is an easy-to-assemble Arduino-based robot kit with several advanced features. Part 1 of this series covers the assembly of the car and a basic functionality test, preparing it for programming.

Author

DroneBot Workshop

Publisher Name

DroneBot Workshop

Publisher Logo

Tagged on: Arduino Project

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *