Elegoo Arduino Smart Robot Car
Elegoo Arduino Smart Robot Car

Getting Started with Elegoo Smart Robot Car Programming: A Beginner’s Guide

Are you fascinated by robotics and eager to dive into the world of Arduino programming? Building a robot car is a fantastic project for beginners and experienced makers alike, offering a hands-on way to learn about electronics, mechanics, and coding. While designing a robot car from scratch can be complex, kits like the Elegoo Smart Robot Car V3.0 simplify the process, providing all the necessary components and clear instructions to get you started quickly.

If you’ve been exploring robotics projects, you might have considered using a bare robot car chassis. These bases are affordable and provide a platform for experimentation. However, for newcomers, assembling and wiring all the components can be challenging, potentially requiring drilling, soldering, and troubleshooting. An all-in-one kit like the Elegoo Smart Robot Car removes these hurdles, ensuring a smoother and more rewarding learning experience, especially when your goal is to learn Elegoo Smart Robot Car Programming.

This article will guide you through the journey of building and understanding the Elegoo Smart Robot Car, focusing on its assembly and initial programming concepts. We’ll explore why this kit is an excellent choice for learning Elegoo smart robot car programming and robotics. Let’s unpack the features and get ready to build!

Discovering the Elegoo Smart Robot Car Kit

The Elegoo Smart Robot Car is designed with beginners in mind, offering a comprehensive set of features in an easy-to-assemble package. This kit isn’t just about building a car; it’s about opening doors to Elegoo smart robot car programming and exploring various robotic functionalities. Here’s what makes it stand out:

  • Versatile Movement: Equipped with a 4-wheel drive system, the car is capable of moving in all directions, providing a solid foundation for learning robot control.
  • Multiple Control Options: The kit includes both Infrared (IR) remote and Bluetooth control, allowing you to operate the car in different ways and explore wireless communication.
  • Intelligent Features: Integrated Ultrasonic obstacle avoidance and line following capabilities introduce you to sensor-based navigation and autonomous robot behavior.
  • Ready to Run Power: Rechargeable LiPo batteries and a dedicated charger are included, eliminating the hassle of sourcing power and ensuring you can get started right away.
  • Simple Assembly: Designed for ease of use, the kit requires no soldering and minimal tools, making it accessible for users of all skill levels.

With its detailed instructions and pre-written Arduino code examples, the Elegoo Smart Robot Car is an ideal platform for anyone eager to learn Elegoo smart robot car programming, from students to hobbyists.

Unboxing the Elegoo Smart Robot Car: What’s Inside?

The Elegoo Smart Robot Car kit arrives in a robust orange carrying case, perfect for storing the components and keeping everything organized. Inside, you’ll find a well-organized layout with compartments for each part. A helpful diagram on the case lid illustrates all the included components, making inventory easy.

Here’s a detailed list of what you’ll find in the Elegoo Smart Robot Car kit:

  • Microcontroller: Elegoo Arduino Uno R3 – The brain of your robot, programmable for various functionalities.
  • Chassis: Top and bottom acrylic base plates – Providing a sturdy and customizable platform for the robot.
  • Motors & Wheels: Four DC motors and four tires – Enabling movement and drive for the robot car.
  • Custom Shield: Elegoo specific Arduino Shield – Simplifies wiring and integrates an IR receiver for remote control.
  • Motor Driver: L298N Motor Controller – Essential for controlling the DC motors’ speed and direction.
  • Line Tracking: 3-element Line Sensor module – Allows the robot to follow lines on a surface.
  • Servo Motor: SG90 Servo Motor – Used to control the direction of the Ultrasonic sensor.
  • Distance Sensor: HCSR04 Ultrasonic Distance Sensor – Enables obstacle detection and avoidance.
  • Bluetooth Connectivity: Bluetooth Module – For wireless control and communication with the robot.
  • Power Supply: 18650 LiPo Batteries (x2) and Battery Holder – Provides rechargeable power to the robot.
  • Battery Management: Battery Charger – For safely recharging the LiPo batteries.
  • Wiring: Connection Cables (x4) – For connecting various modules to the Arduino shield.
  • Programming Cable: USB cable for Arduino – To upload code and communicate with the Arduino Uno.
  • Remote Control: IR Remote Control – For manual control of the robot car.
  • Mounting Hardware: Servo & Ultrasonic Sensor mounting brackets and all necessary screws, nuts, and spacers.
  • Tools: Three screwdrivers (Phillips and hex) – Providing the basic tools needed for assembly.
  • Insulation: Vinyl Electrical Tape – For cable management and insulation if needed.
  • Software & Documentation: CD ROM containing code examples and instruction manuals.

A thoughtful detail in this kit is the organization of hardware. Screws, nuts, and spacers for each assembly step are pre-packaged in labeled bags, making the building process straightforward and less confusing, especially for beginners learning Elegoo smart robot car programming.

Now that we’ve inventoried the parts, let’s move on to the exciting part – assembling the Elegoo Smart Robot Car!

Assembling Your Smart Robot Car: Step-by-Step Guide

Building the Elegoo Smart Robot Car is designed to be a user-friendly experience, thanks to the well-structured instruction manuals provided. These manuals, along with sample code, are conveniently available on the included CD-ROM and can also be downloaded from the Elegoo website, ensuring you have access to the latest versions.

To begin the assembly, gather the tools included in the kit: a couple of small Phillips screwdrivers and a 2.5 mm hex key. While these are sufficient, a pair of pliers can be helpful for tightening nuts, though not essential.

Elegoo simplifies the assembly by packaging the mounting hardware for each step into separate, clearly labeled plastic bags. Let’s start with mounting the motors.

Mounting Motors and Motor Mounts to the Chassis

The first step involves attaching aluminum mounting blocks to the DC motors. These blocks are secured using longer screws that pass through the motor body. Ensure you mount the blocks on the side of the motors where the connecting wires protrude. The blocks are symmetrical, so orientation doesn’t matter as long as the threaded holes for chassis mounting are accessible.

After attaching the blocks to all four motors, you can proceed to mount them to the bottom base plate. Before you start, peel off the protective film from both sides of the acrylic base plates. Identify the side marked “A”; this is the top side of the bottom plate.

Secure the four motors to the bottom base plate using the blocks you just installed. Insert screws through the base plate and into the threaded holes of the aluminum blocks. Tighten the screws, ensuring the motors are aligned flush with the edge of the base plate before final tightening. Keep the base plate nearby, as we’ll continue building upon it in the next step.

Installing the L298N Motor Driver

The L298N motor driver is crucial for Elegoo smart robot car programming as it allows you to control the speed and direction of the DC motors. This H-bridge driver board in the kit is customized with dual connectors for each motor output, accommodating the parallel wiring of motors on each side of the robot. It also includes connectors for power and control signals.

Orient the L298N board with its heatsink facing the rear of the chassis. Mount it onto the bottom base plate using four M3x14 screws and four small spacers. Pass the screws through the L298N mounting holes first, then add the spacers, and finally insert them through the corresponding holes in the base plate. Secure everything from the bottom with four M3 nuts.

Once the L298N is mounted, connect the four motors to their respective connectors on the driver board. The connectors are keyed to prevent incorrect connections.

Mounting the Line Follow Sensor

Next, we’ll install the line follow sensor array on the bottom base plate. This sensor is essential for line following functionality, a fun project to explore after you’ve mastered basic Elegoo smart robot car programming.

The line follower module mounts underneath the chassis using four threaded spacers, four M3x7 screws, and four M3 nuts.

When mounting the line follow sensor array, ensure it’s oriented with the sensitivity potentiometer facing the front of the robot car. This positioning places the sensor connector near the larger hole in the chassis, which is used to route the connecting cable.

Attaching the Arduino to the Top Chassis and Installing the Shield

Now, let’s shift our focus to the top chassis plate. As with the bottom plate, remove the protective film from both sides. Pay close attention to the label on the film, indicating the upward-facing side. Correct orientation is crucial here to avoid having to disassemble and redo your work!

The first component to mount on the top chassis plate is the Arduino Uno. Use three M3x14 screws and three spacers to mount the Arduino, as only three mounting holes are utilized on the Uno board in this configuration. Secure the screws with three M3 nuts.

After mounting the Arduino Uno, install the custom interface shield on top of it. When installing any Arduino shield, carefully align the connection pins before pressing it down firmly onto the Arduino board.

Installing the Battery Compartment

The battery compartment is the next component to add to your Smart Robot Car. You’ll use four M3x10 screws to mount the battery holder. These screws have Phillips heads, so use the appropriate screwdriver from the kit.

You’ll need to remove the top cover of the battery compartment to access the screw holes. Of course, the cover needs to be off to install the batteries later as well!

Align the battery holder flush with the edges of the top plate, then insert and tighten the screws. Secure them from underneath with four M3 nuts.

Once the holder is mounted, install the two 18650 LiPo batteries. They come pre-charged, but you might want to top them off using the supplied battery charger. Ensure correct battery orientation; the battery compartment has a diagram inside indicating the correct polarity. After inserting the batteries, close the cover.

The final step for the battery holder is connecting it to the power connector on the shield. Before connecting, ensure the power switch is in the “off” position to avoid accidentally powering up the circuit prematurely.

Mounting the Servo Motor

The servo motor is next in line for installation. This motor will control the orientation of the Ultrasonic sensor, enabling the robot car to “see” and avoid obstacles as you progress in Elegoo smart robot car programming.

The servo motor is mounted on a separate small base plate included in the kit, typically found in the same packaging as the Ultrasonic sensor holder. Attach the servo to this plate using two small M2x10 screws, securing them with two M2 nuts. Note that the screws are inserted from the bottom of the plate. Refer to the manual for the correct servo orientation.

With the servo mounted on its plate, you can now attach it to the top chassis plate using three M3x10 screws and M3 nuts. Once secured, pass the servo cable through the designated hole in the top plate and connect it to the servo connector on the shield. Ensure correct polarity; the shield is labeled with the Ground connection, which corresponds to the brown wire on the SG90 servo.

Installing the Ultrasonic Sensor

The Ultrasonic sensor is the “eyes” of your robot car, allowing it to measure distances and detect obstacles as you delve deeper into Elegoo smart robot car programming. Let’s mount it.

Install the Ultrasonic sensor onto its mounting bracket using four very small M1.6×8 screws. These tiny screws require the smallest Phillips head screwdriver included in the kit.

Once the Ultrasonic sensor is secured to its bracket, attach the assembly to the shaft of the servo motor. Align the sensor to face forward. It might not sit perfectly flush with the car’s front edge as it needs to mesh with the servo shaft gear.

After mounting the sensor, use the provided 4-conductor cable to connect it to the shield. This is the only 4-conductor cable in the kit, making it easily identifiable. Like all cables in this kit, it is keyed to ensure correct orientation.

The small screw to hold the bracket to the motor shaft is included with the SG90 servo packaging. The servo package also contains additional screws and arms not used in this kit; save them for future projects.

Cable Management and Wiring Connections

Your robot car is really starting to look like a functional machine! Now it’s time to connect all the modules to the Arduino shield.

Before wiring, install the six copper spacers that will hold the bottom plate to the top plate. Mount these spacers onto the bottom plate using six M3x10 screws. Six more screws will be used later to attach the top plate.

The cables in the kit are uniquely designed to fit specific connectors, minimizing confusion during wiring. However, if you’re unsure, refer to the illustrations in the manual for guidance.

Start with the Line Follower sensor. Connect one end of its interface cable to the sensor board and pass the other end through the hole in the base plate. Leave the other end unconnected for now.

Next, wire up the L298N motor driver. It requires two cables: a power cable and an interface cable. Again, these are unique and easy to identify. Leave the shield ends of these cables disconnected for now.

Take all the cables you’ve connected to the components on the bottom plate and carefully pass them up through the hole in the top base plate.

Now, use the six remaining M3x10 screws to fasten the top plate to the six copper spacers, effectively joining the top and bottom chassis plates.

Finally, connect all the loose ends of the cables to their respective connectors on the Arduino shield. Double-check the manual if you are uncertain about any connection.

Installing the Bluetooth Module

Adding Bluetooth connectivity is straightforward. The Bluetooth module has a connector that directly plugs into a matching socket on the Arduino shield. Simply align and snap it into place.

An important note for Elegoo smart robot car programming: when you need to upload new code to the Arduino, you’ll need to temporarily remove the Bluetooth module. This is because it shares the same serial communication lines as the USB connector, and they will conflict during programming.

Attaching the Wheels

The final step in assembly is attaching the four tires to the motor shafts. The motor shafts are keyed to match the mounting holes on the tires, ensuring a secure fit.

Press the tires firmly onto the motor shafts. Then, secure each tire with a long M2x25 screw. These are Phillips head screws, so use the correct screwdriver to tighten them.

Congratulations! Your Elegoo Smart Robot Car assembly is now complete.

Basic Testing of Your Smart Robot Car

Your robot car is assembled, but does it work? Let’s perform a basic test to ensure everything is functioning correctly. In the upcoming parts of this series, we’ll delve into using Bluetooth, IR Remote, Line Following, and Collision Avoidance features in detail.

Elegoo provides sample code on the included CD-ROM, and you can also download the latest versions from their website. The sample code is organized into “lessons,” and “lesson one,” titled “make the car go,” is an excellent starting point.

Lesson one includes these code examples:

  • forward_back.ino: Makes the car move 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 accelerating and stopping the car.
  • AUTO_GO.ino: Moves the car in a sequence of directions.

Each sketch is designed to teach you how to control the L298N motor controller to drive the car. If you’re unfamiliar with the L298N H-Bridge motor controller, further resources are available online to learn about its operation.

We’ll focus on the AUTO_GO.ino sketch to test our Elegoo Smart Robot Car.

AUTO_GO.ino Code Snippet

//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 and start your journey into Elegoo smart robot car programming, you need to know how the L298N is connected to the Arduino. Here are the pin connections:

  • ENA (Enable A): Arduino pin 5 (PWM) – Controls speed of motors on one side.
  • ENB (Enable B): Arduino pin 6 (PWM) – Controls speed of motors on the other side.
  • IN1 (Input 1): Arduino pin 7 – Controls direction of motors on side A.
  • IN2 (Input 2): Arduino pin 8 – Controls direction of motors on side A.
  • IN3 (Input 3): Arduino pin 9 – Controls direction of motors on side B.
  • IN4 (Input 4): Arduino pin 11 – Controls direction of motors on side B.

The Enable pins (ENA, ENB) are connected to PWM-capable pins on the Arduino, allowing for motor speed control. Motors on each side of the car are wired in parallel and controlled together.

The AUTO_GO sketch begins by defining the Arduino pins connected to the L298N. The setup() function initializes serial communication and sets these pins as outputs.

Four functions (forward(), back(), left(), right()) are defined, each controlling the motor directions to achieve the respective car movements. These functions also include Serial.println() commands to output the current action to the serial monitor (useful for debugging).

In the loop() function, these direction functions are called sequentially with a one-second delay in between. This makes the car move forward, backward, left, and right in a repeating loop.

Important: Before uploading code to the Arduino, remember to disconnect the Bluetooth module. Reconnect it after programming is complete and the USB cable is removed.

Conclusion: Your First Step into Robotics and Programming

The Elegoo Smart Robot Car kit is a remarkably well-designed and high-quality product. The components fit together seamlessly, and the provided instruction manuals are excellent, making assembly accessible to almost anyone. This kit is a fantastic educational tool for students of all ages who are new to Arduino and robotics. It also offers exceptional value, providing a comprehensive set of components at a competitive price. We highly recommend it as a starting point for your robotics journey and Elegoo smart robot car programming adventures.

This concludes the first part of our series on building and using the Elegoo Smart Robot Car kit. In the next installment, we will explore controlling the car using Bluetooth and the Infrared remote. Following that, in the final part, we’ll delve into line following and collision avoidance functionalities.

Until then, enjoy your newly assembled robot car and happy experimenting!

Parts List

Here are some components that you might need to further explore Elegoo smart robot car programming and projects. Please note that some of these links may be affiliate links, and carcodereader.store may receive a commission on your purchases. This does not increase the cost to you and is a method of supporting this ad-free website.

COMING SOON!

Resources

Article Name: Getting Started with Elegoo Smart Robot Car Programming: A Beginner’s Guide

Description: Learn how to assemble and perform basic tests with the Elegoo Smart Robot Car V3.0, an excellent Arduino-based kit for beginners interested in robotics and programming. This first part of a series covers unboxing, assembly, and initial testing.

Author: Car Code Reader Expert

Publisher Name: carcodereader.store

Publisher Logo: [Place carcodereader.store logo URL here]

Tagged on: [Arduino Robot Car Programming]([carcodereader.store category link for Arduino Robot Car Programming, if available])

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 *