LIDAR-Lite v3 Hookup Guide

Pages
Contributors: ShawnHymel
Favorited Favorite 1

Introduction

The LIDAR-Lite v3 is a compact optical distance measurement sensor, which is ideal for drones and unmanned vehicles.

LIDAR-Lite v3

SEN-14032
149.99
13

LIDAR is a combination of the words “light” and “RADAR.” Or, if you’d like, a backronym for “LIght Detection and Ranging” or “Laser Imaging, Detection, and Ranging.” At it’s core, LIDAR works by shooting a laser at an object and then measuring the time it takes for that light to return to the sensor. With this, the distance to the object can be measured with fairly good accuracy.

By sweeping or spinning a LIDAR unit, systems can create detailed distance maps. Survey equipment, satellites, and aircraft can be equipped with complex LIDAR systems to create topographic maps of terrain and buildings. Luckily, Garmin™ has created a user-friendly LIDAR unit for your robotics and DIY needs!

Note that this uses a Class 1 Laser, if you are concerned about your safety (in short: A Class 1 laser is safe under all conditions of normal use).

CLASS 1 LASER PRODUCT CLASSIFIED EN/IEC 60825-1 2014. This product is in conformity with performance standards for laser products under 21 CFR 1040, except with respect to those characteristics authorized by Variance Number FDA-2016-V-2943 effective September 27, 2016.

Required Materials

To follow along with this project tutorial, you will need the following materials:

Suggested Reading

If you aren’t familiar with the following concepts, we recommend checking out these tutorials before continuing.

Installing an Arduino Library

How do I install a custom Arduino library? It's easy!

How to Use a Breadboard

Welcome to the wonderful world of breadboards. Here we will learn what a breadboard is and how to use one to build your very first circuit.

What is an Arduino?

What is this 'Arduino' thing anyway?

Installing Arduino IDE

A step-by-step guide to installing and testing the Arduino software on Windows, Mac, and Linux.

Hardware Overview

Case

The LIDAR-Lite v3 has two tubes on the front that contain a transmitter (laser) and receiver. You’ll want to face these toward your target.

Front of LIDAR-Lite v3

On the side, you’ll find an electrical port that connects to the included 6-wire cable. Plug in the wire harness to the port to break out the pins.

Plugging in harness to LIDAR unit

On the back, you’ll find 4 mounting holes that are designed to accept #6 or M3.5 screws or bolts.

Back of LIDAR-Lite v3

Wires

The LIDAR-Lite v3 has 6 wires that can be used to communicate with the sensor.

LIDAR-Lite v3 pinout

NOTE: This is looking at the back of the unit

ColorPinDescription
Red5VPower (5V)
OrangePWR ENPower enable (internal pullup)
YellowMODEMode control (for PWM mode)
GreenSCLI2C clock
BlueSDAI2C data
BlackGNDGround

Power

The LIDAR unit requires between 4.5V to 5.5V of DC power to operate (nominally, 5V). Additionally, it can draw up to 135 mA of current during continuous operation (105 mA at idle). To maintain a level voltage, Garmin recommends putting a 680 μF capacitor between power (5V) and ground (GND) as close to the LIDAR unit as possible.

Hardware Assembly

Follow the diagram below to connect the LIDAR unit to a RedBoard or other Arduino-compatible board. The LIDAR-Lite v3 can communicate over I2C as well as use a pulse-width modulated (PWM) signal to denote measured distances. For this guide, we will show how to use I2C to communicate with the LIDAR unit.

LIDAR-Lite v3 to Arduino hookup

Click on the image to enlarge it

Note: Garmin recommends a 680 μF, but anything near that value will work. I used a 1000 μF capacitor in this example. Make sure to add the electrolytic capacitor correctly to the circuit since it has a polarity.

Software

Garmin maintains an Arduino library to make working with the LIDAR-Lite very easy. Visit the GitHub repository, or click the button below to download the library.

Download the Garmin LIDAR-Lite v3 Arduino library

Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.

Open a new Arduino sketch, and copy in the following code:

language:c
/**
 * LIDARLite I2C Example
 * Author: Garmin
 * Modified by: Shawn Hymel (SparkFun Electronics)
 * Date: June 29, 2017
 * 
 * Read distance from LIDAR-Lite v3 over I2C
 * 
 * See the Operation Manual for wiring diagrams and more information:
 * http://static.garmin.com/pumac/LIDAR_Lite_v3_Operation_Manual_and_Technical_Specifications.pdf
 */

#include <Wire.h>
#include <LIDARLite.h>

// Globals
LIDARLite lidarLite;
int cal_cnt = 0;

void setup()
{
  Serial.begin(9600); // Initialize serial connection to display distance readings

  lidarLite.begin(0, true); // Set configuration to default and I2C to 400 kHz
  lidarLite.configure(0); // Change this number to try out alternate configurations
}

void loop()
{
  int dist;

  // At the beginning of every 100 readings,
  // take a measurement with receiver bias correction
  if ( cal_cnt == 0 ) {
    dist = lidarLite.distance();      // With bias correction
  } else {
    dist = lidarLite.distance(false); // Without bias correction
  }

  // Increment reading counter
  cal_cnt++;
  cal_cnt = cal_cnt % 100;

  // Display distance
  Serial.print(dist);
  Serial.println(" cm");

  delay(10);
}

Upload the program, and open a Serial Monitor. You should see distance measurements (in cm) being printed.

Measuring distance with LIDAR

Resources and Going Further

Now that you’ve successfully got your LIDAR up and running, it’s time to incorporate it into your own project!

For more information, check out the resources below:

Need some inspiration for your next project? Check out some of these related tutorials:

Large Digit Driver Hookup Guide

Getting started guide for the Large Digit display driver board. This tutorial explains how to solder the module (backpack) onto the back of the large 7-segment LED display and run example code from an Arduino.

ReconBot with the Tessel 2

Build a robot with the Tessel 2 that you can control from a browser on your phone or laptop.

Building an Autonomous Vehicle: The Batmobile

Documenting a six-month project to race autonomous Power Wheels at the SparkFun Autonomous Vehicle Competition (AVC) in 2016.