LIDAR V.3 Introduction and Interfacing With Arduino



Finding the range of an object in front of your robot is a rather simple task and has been done reliably using sonar and IR range sensors for a long time. In most cases, those two types of sensors fulfill the basic needs of the robot when it comes to distance measurement. Sonar can provide good ranging on most surfaces but they have wide detection beams that can easily be interfered with. On the other hand, IR range sensors provide a confined beam that is very small but suffers from reflective differences on varying surfaces, thus changing the distance readings. Until recently, there was no good option for projects on a hobbyist budget which needed a long range, high precision, small detection beam for distance measurement.

Lidar what?

For those of you who have not heard of the LIDAR-Lite before today, we figure a quick introduction would be best. The LIDAR-Lite v3 is the third generation of a low-cost, long-range laser-based distance measurement device (also sometimes referred to as “laser range finder”). The LIDAR-Lite v3 can provide measurements at distances up to 40 meters (accuracy of +-2.5 cm) and reliably function at night, in daytime (outdoors!) and even during rain / fog (provided that you protect it appropriately from the elements, of course!). The device also comes with an extensive Arduino library that exposes most of its settings and functions with a simple to use API. Over the last year and a half, LIDAR-Lites have been used in many projects, including UAVs, autonomous rovers, and even a laser harp!

Mounting / case

With a weight of just 22 g (0.77 oz) and its compact size of only 40 x 48 x 20 mm (1.6″ x 1.9″ x 0.8″), the LIDAR-Lite v3 has kept the same form factor as its predecessors, so no need to worry there all previous projects will still be able to use this new version as a drop-in replacement for the v1/v2 when it comes to size and mounting.


The LIDAR-Lite v3 still offers both of its traditional interfaces, I2C and PWM output. Therefore, you should have no issues using your previous wiring schemes with your projects, either. The connector and cable did change, though, but a cable is included with the product and the other end of each individual wire is bare, which is the same as the previous model. One notable change is the addition of colors to the wiring, which makes identifying which wire is associated with the SCL, SDA, MODE, etc. much easier than before. No more of that “use the other black wire” type of thing.



In the past, we have noticed many users running their LIDAR-Lite V1 straight off a USB-powered microcontroller board, such as an Arduino Uno. When the LIDAR-Lite v2 came out, some did the same but ran into intermittent issues which were due to the inrush current requirements of the V2 during power-up which was too high for what the average USB-powered voltage regulator could provide. Whenever such a situation happened, it would cause errors during the initialization sequence of the LIDAR-Lite V2, forcing the users to restart the board/LIDAR-Lite until it finally worked. This is still the case for the V3, but there is a simple solution to this “issue” and it comes in two parts:

Part 1: Capacitor

Adding a capacitor as shown in the diagram above will ensure a smooth power supply to your LIDAR-Lite v3 and it is required for consistent / proper operation. 680 µF is the minimum appropriate value for this capacitor, though if all you have available is a slightly larger capacitor such as 1000 µF, that will be fine, too.

Part 2: External power source

While the reported running current consumption of the LIDAR-Lite V3 is ~130 mA, the inrush current during initialization is much higher (possibly ~500 mA). While this current peak is only for a short duration, if your setup is not providing enough power, it will most likely prevent the proper initialization of your LIDAR-Lite V3. For our tests, we connected a wall adapter of 7 V DC, 2 A power supply to our microcontroller board, which worked quite well. For most cases, a power source that can provide at least 6 V DC with 1 A of current should be fine.

Another good option if you need your project to be mobile or just don’t want more cables would be to use a battery pack with your microcontroller setup. The typical recommendation would usually be either a 6 V DC NiMH (ex: RB-Sta-13) or a 7.4 V DC LiPo (2S) (ex: RB-Dfr-160) battery packs.

NOTE: The LIDAR-Lite V3 requires a stable, nominal voltage of 5 V DC (4.75 – 5.5 V DC is acceptable), so make sure your external power source is passed through a quality 5V DC regulator (such as is used on the Arduino boards) before reaching the LIDAR-Lite V3 (and its capacitor ).


Components Quantity
Arduino uno 1
Connector Cable 1
Power Supply 5v 1
Capacitor 680 uf 1


  1. Arduino IDE

Let’s Make It!

Let’s Code!


#define LIDARLite_ADDRESS 0x62 // Default I2C Address of LIDAR-Lite.
#define RegisterMeasure 0x00 // Register to write to initiate ranging.
#define MeasureValue 0x04 // Value to initiate ranging.
#define RegisterHighLowB 0x8f // Register to get both High and Low bytes in 1 call.

/******Access this part if you want to make your LIDAR V3 a self rotating autonomous device******/

Servo myservo;

int pos = 0; // Position of the servo (degress, [0, 180])
int distance = 0; // Distance measured
void setup()
// Serial output
Serial.println(“< START >”);

// Servo control
// myservo.attach(5);

// LIDAR control
Wire.begin(); // join i2c bus

// Get a measurement from the LIDAR Lite
int lidarGetRange(void)
int val = -1;

Wire.beginTransmission((int)LIDARLite_ADDRESS); // transmit to LIDAR-Lite
Wire.write((int)RegisterMeasure); // sets register pointer to (0x00)
Wire.write((int)MeasureValue); // sets register pointer to (0x00)
Wire.endTransmission(); // stop transmitting

delay(20); // Wait 20ms for transmit

Wire.beginTransmission((int)LIDARLite_ADDRESS); // transmit to LIDAR-Lite
Wire.write((int)RegisterHighLowB); // sets register pointer to (0x8f)
Wire.endTransmission(); // stop transmitting

delay(20); // Wait 20ms for transmit

Wire.requestFrom((int)LIDARLite_ADDRESS, 2); // request 2 bytes from LIDAR-Lite

if(2 <= Wire.available()) // if two bytes were received
val =; // receive high byte (overwrites previous reading)
val = val << 8; // shift high byte to be high 8 bits
val |=; // receive low byte as lower 8 bits

return val;

void serialPrintRange(int pos, int distance)
Serial.print(“Position (deg): “);
Serial.print(“\t\tDistance (cm): “);
void loo()

void loop()
for(pos = 0; pos <= 180; pos += 1) { myservo.write(pos); distance = lidarGetRange(); serialPrintRange(pos, distance); delay(20); } for(pos = 180; pos>=0; pos-=1)
distance = lidarGetRange();
serialPrintRange(pos, distance);



Hope you liked this project!

Happy Interfacing🙂

Shubham Gupta



One thought on “LIDAR V.3 Introduction and Interfacing With Arduino

  1. You’re so cool! I don’t think I’ve read through something like that before. So wonderful to find another person with original thoughts on this topic. Seriously.. thank you for starting this up. This web site is one thing that is needed on the internet, someone with a little originality!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s