Average rainfall 2001-2016, global tropics

Map: Average rainfall 2001-2016, global tropics

Sensor Module Project Nano Multi Project

project: VL6810X sketch and wiring - UNO

Thomas Gumbricht bio photo By Thomas Gumbricht

Introduction

This post is about wiring the VL6180X lidar Time of Flight distance and ambient light meter to an Arduino UNO board.

The Adafruit manual for VL6180X Time of Flight Micro-LIDAR Distance Sensor Breakout contains more information.

Another post covers how to wire the VL6810X to Nano

The I2C communication bus

The default libraries and sketches for the VL6180X sensor all use the I2C protocol (communication bus). For details on the I2C protocol see the post on I2C communication.

Arduino library

Code packages that connects an Arduino board to different devices, including break out boards, sensors, displays, communication and storage devices, are available from different libraries. The Arduino app has a library manager that you reach from the menu:

Sketch -> Include Library -> Manage Libraries

The basics for handling libraries is explained on Arduinos official page Installing Additional Arduino Libraries.

Adafruit, sparkfun or Pololu

Breakout boards with the VL6180X lidar+ambinent light sensors are offered both by adafruit, sparkfun and Pololu. Sparkfun is easier to work with if you use their Qwiic connect system for I2C devices. You can then use the Qwiic Cable - Breadboard Jumper (4-pin) for connecting the spectrometer to the board. If you use Adafruit or Pololu you have to solder the breakout board.

Wiring

The wiring is the same regardless if you use the Adafruit, Sparkfun or Pololu breakout boards. Just connect power (5v) and ground, and then the SCL and SDA ports. All connections are item to item (5v -> 5v, gnd -> gnd, SCL -> SCL, SDA -> SDA).

Wiring a VL6180X Time-of-Flight sensor to an Arduino UNO board.

The Adafruit manual for VL6180X Time of Flight Micro-LIDAR Distance Sensor Breakout contains illustrations on how to wire the VL6810X module with different boards.

Coding

In my project I used the Pololu module, and the Pololu GitHub library for the Arduino IDE interface with the VL6180X breakout board.. The code below is just copies from that repo. Further down there are some url links to alternative codes.

Single shot range

Continuous

Advanced sketch 1

The Tutorial: STMicroelectronics VL6180X Time-of-Flight LIDAR Sensor is an in depth explanation of the VL6180X component and its breakout board, including different alternatives on how to sketch.

Advanced sketch 2

GitHub repo that contains Arduino Sketch for connecting multiple VL6180x sensors. The code includes how to connect multiple I2C devices.

Advanced sketch 3

Alternative code that shows how to access other data from the I2C stream.

Advanced sketch 4

A more detailed (exhaustive) sketch from GitHub.

Sensor Module Project Nano Multi Project