Wiring the VL53L0X ToF Accurate Laser Ranging / 

Distance Measuring Sensor on Microcontroller



This is the VL53LOX breakout module a type of ToF (Time-of-Flight) laser ranging sensor in smallest package capable of delivering accurate distance measurements whatever the object reflectance compared to conventional measuring sensor, the VL53LOX can measure a distance up to 2 meter. This sensor has integrated SPAD (Single Photon Avalanche Diodes) and a 2nd generation Flight SenseTM patented technology from STM. The VL53LOX Vertical Cavity Surface Emitting Laser is totally invisible to the eye along with the internal physical infrared filters, enables a longer ranging distance in a higher immunity to ambient light and better robustness to cover-glass optical cross communication. This device is suitable for computers, energy saving, robotics, households appliances, industrial, building automation and automotive.  for further details please refer to the datasheet below.

Required Components

  • Arduino Microcontroller, ESP8266 12, 12E, ESP8266 NodeMCU, ESPDuino, ATMEGA328 16/12, ATMEGA32u4 16/8/ MHz, ESP8266, ATMEGA250 16 MHz, ATSAM3x8E, ATSAM21D, ATTINY85 16/8 MHz (Note: The Diagram below is using NANO. (please refer to the respective pin-outs)
  • VL53L0X Sensor / Module
  • Solder Less Bread Board
  • Jumper Wires / DuPont Wires

Wiring Guide



Source Code

The code below used this <VL53X.H> library if you want to use other library please refer to the downloads option below.


============= THIS IS BEGINING OF CODE BLOCK =================

#include <Wire.h> //Import wire library

#include <VL530X.h> //Import VL530X library


VL53L0X myDistanceSensor;


void setup(){

    Serial.begin(9600);

    Serial.println("14CORE | Range Measurements with VL53L0X Test");

    Serial.println("Starting....");

    Serial.pirntln("----------------------------------------------");

    delay(200);

    Serial.println("Initializing continuous....");

    Wire.begin();

    myDistanceSensor.init();

    myDistanceSensor.setTimeout(500);

    myDistanceSensor.startContinuous(); //Using continuous time mode place inter-measurement period in ms ex: .startContinuous(100)).

}


void loop(){

    Serial.println(myDistanceSensor.readRangeContinuousMillimeters());

    if (myDistanceSensor.timeoutOccurred()){

        Serial.println("TIMEOUT............................");

        Serial.println();

    }

}

============= THIS IS END OF CODE BLOCK =================

Downloads


+ Recent posts