Can You Make a LiDAR Self Driving Car?
by Shahbaz Hashmi Ansari in Circuits > Arduino
301 Views, 5 Favorites, 0 Comments
Can You Make a LiDAR Self Driving Car?

Greetings everyone, and welcome to my Instructables tutorial. Today, I'll guide you through the process of creating an Obstacle Avoiding Car using LiDAR Sensor and Arduino.
Project Overview:
This Obstacle Avoiding Car project leverages advanced sensing and mobility to create an autonomous robot capable of navigating complex environments. The core of this smart car is an Arduino Uno microcontroller, which processes sensor data and controls vehicle movement. For precise distance detection, the project utilizes the VL53L0X TOF Based LiDAR Laser Distance Sensor. This LiDAR sensor employs the Time-of-Flight (ToF) principle, emitting a laser pulse and measuring the time it takes for the light to return, enabling accurate, real-time obstacle detection up to 2 meters away, irrespective of the object's color or surface material. The car's unique omnidirectional movement capabilities are facilitated by Mecanum wheels, which allow for forward, backward, sideways, and diagonal motion, as well as rotation in place, offering superior maneuverability for collision avoidance in tight spaces. An Adafruit L293D Motor Driver/Servo Shield for Arduino efficiently manages the power and control signals to the four individual Mecanum wheel motors.
The operational logic for this robotics platform involves continuous scanning of the surroundings by the VL53L0X ToF sensor. When an obstacle is detected within a predefined proximity (e.g., 15 cm as per the provided code), the Arduino triggers an intelligent obstacle avoidance algorithm. Instead of merely stopping or backing up, the system evaluates the open space to the left and right by rotating the sensor's perspective. Based on which direction offers more clear path, the Mecanum wheel robot can execute precise turns or rotations to navigate around the impediment and resume its forward trajectory. This integration of accurate LiDAR sensing with the versatile Mecanum wheel system and an Arduino brain demonstrates a robust solution for autonomous navigation and enhances the overall intelligent car capabilities.
Before beginning a huge shoutout to JLCMC for sponsoring.
Now, let's get started with our project!
Supplies
.png)

.png)
.png)
.png)
.png)
.png)
Electronic Components Required:
- Arduino Uno
- Adafruit L293D Motor Driver/Servo Shield
- Mecanum Wheels
- VL53L0X TOF Based LIDAR Sensor
- 10 × 14 Cm CardBoard for Chassis
- Battery Holder
- 18650 Battery
Additional Tools:
- Soldering Iron
- Hot Glue
- Cutter
Softwares:
- Arduino IDE
Making the Chassis
.png)
.png)
Here is a step-by-step guide for making the Chassis:
- Cut a piece of cardboard to the dimensions of 10cm by 14cm to create the chassis.
- Obtain four-gear motors.
- Attach the motors to the cardboard using a hot glue gun.
- Wire the motors in a cross-word direction, as shown in the image above.
- Obtain four rubber wheels for the motors.
- Once these steps are completed, the chassis will be ready.
let's move to the next step...
Elevate Your Electronic Projects - JLCMC
.png)
.png)
JLCMC is your one-stop shop for all electronic manufacturing needs, offering an extensive catalog of nearly 600,000 SKUs that cover hardware, mechanical, electronic, and automation components. Their commitment to guaranteeing genuine products, rapid shipping (with most in-stock items dispatched within 24 hours), and competitive pricing truly sets them apart. In addition, their exceptional customer service ensures you always get exactly what you need to bring your projects to life.
they have everything you need for your next project:
- Custom Linear Guide Shafts: Precision-engineered for applications like 3D printing, CNC machines, and industrial automation.
- Aluminum Profiles: Versatile, durable framing solutions—perfect for machine enclosures, workstations, and custom assemblies.
To show their support for our community, JLCMC is offering an exclusive $70 discount coupon. This is the perfect opportunity to save on high-quality components for your next project. Don’t miss out—visit https://jlcmc.com/?from=RBL to explore their amazing range of products and grab your discount coupon today!
Motor Driver and Motor Wiring:
.png)
.png)
.png)
.png)
Mount the Shield on Your Arduino Uno
- Line up all the pins on the bottom of the L293D shield with the headers on the Uno.
- Press down gently until the shield is seated snugly.
DC Motors to the Adafruit L293D Shield Connection:
- On the shield, you’ll see four pairs of screw terminals labeled M1, M2, M3, and M4.
- Loosen both screws on the M1 terminals.
- Insert Motor 1 wire into the left M1 screw and the other wire into the right M1 screw.
- Tighten the screws so the wires don’t slip out.
- Motor 2 → M2 terminals
- Motor 3 → M3 terminals
- Motor 4 → M4 terminals
- Just the same: loosen, insert each wire into the two screws, then tighten.
What Is LiDAR?
.png)
LiDAR stands for “light detection and ranging,” Essentially, LiDAR works by emitting laser pulses in all directions and measuring how long it takes for each pulse to bounce back from an object. Since we know the speed of light, that time-of-flight measurement tells us exactly how far away the object is.
Imagine having hundreds of thousands of tiny laser pointers inside one sensor, each firing one at a time all around the room. Each time a pulse hits an object, the sensor measures the return time. For example, it takes twice as long for a pulse to return from an object 20 feet away compared to one 10 feet away—because light travels that much farther.
You might wonder: how does the sensor keep track of 640,000 laser pulses per second? Amazingly, they don’t all fire simultaneously. They fire sequentially—one after another—so the sensor only needs to time each pulse individually. This is possible because light is so fast that even if you slowed time down dramatically—say, so that the return from a 10 ft object takes your “slow-mo” clock four seconds—you could still wait 30 minutes on that slow-mo timescale before sending the next pulse. In reality, the pulses happen so quickly that the sensor can easily distinguish each one, even at hundreds of thousands of pulses per second.
LiDAR Sensor and Arduino Connection

.png)
.png)

.png)
VL53L0X LIDAR Sensor to Arduino Uno:
- Connect VL53L0X VCC → Arduino 5V
- Connect VL53L0X GND → Arduino GND
- Connect VL53L0X SDA → Arduino A4 (SDA)
- Connect VL53L0X SCL → Arduino A5 (SCL)
That’s it! After these four wires are in place, we are ready to upload the Arduino sketch.
Time to Upload the Sketch
.png)
.png)
.png)
.png)
Follow the steps:
- Connect the Arduino uno to your Computer.
- To install the library, open the Library Manager, search for “VL53L0X,” scroll down, and install the Adafruit library for VL53L0X TOF Based LIDAR Sensor. To install the AFMotor.h library, type “adafruit motor” and install the Adafruit Motor Shield library.
- Then copy and paste this code:
Code Breakdown:
AFMotor.h: Controls the Adafruit Motor Shield for managing four DC motors
Adafruit_VL53L0X.h: Interfaces with the VL53L0X Time-of-Flight laser distance sensor
Motor Configuration:
Four DC motors are configured for a 4-wheel drive system. Motors 1&2 use one frequency setting, while motors 3&4 use another for optimal performance.
Main Loop Decision Making:
Key Logic: When an obstacle is detected within 15cm, the robot:
- Stops and backs up
- Scans left and right
- Turns toward the direction with more clearance
The lookRight() and lookLeft() functions physically rotate the robot to scan different directions, then return to the original position.
Working Video and Tutorial

Congratulations! You’ve successfully built your Obstacle Avoiding Car using LiDAR Sensor and Arduino. Demonstration video of this project can be viewed here: Watch Now
Thank you for your interest in this project. If you have any questions or suggestions for future projects, please leave a comment and I will do my best to assist you.
For business or promotional inquiries, please contact me via email at Email.
I will continue to update this instructable with new information. Don’t forget to follow me for updates on new projects and subscribe to my YouTube channel (YouTube: roboattic Lab) for more content. Thank you for your support.