Arduino code for VL53L1X Time-of-Flight 400cm Laser distance sensor

Поділитися
Вставка
  • Опубліковано 5 вер 2024

КОМЕНТАРІ • 136

  • @ThierryC2373
    @ThierryC2373 2 роки тому +1

    Thanks man, this is the only library working with the Sinkr VL53L1X sensor sold on Amazon US. All other libraries do not work. You only need to cut the power to the Arduino for 15sec after uploading the code, otherwise the sensor is not detected for some reason and then, it works.

  • @TheMechatronicEngineer
    @TheMechatronicEngineer 4 роки тому +3

    Awesome sensor. Thanks for the great video. XSHUT is used when multiple I2C sensors are present.

    • @robojax
      @robojax  4 роки тому

      Thanks for the info!

    • @dreambigedge4139
      @dreambigedge4139 10 місяців тому

      I need to connect 4 sensors to arduino for wall following car, how should I be doing it?

  • @dfk2107
    @dfk2107 4 роки тому

    RoboJax, engineer here, you are amazing

    • @robojax
      @robojax  4 роки тому

      Welcome Engineer. So are you. Thanks.

  • @CarcamoDavid2
    @CarcamoDavid2 3 роки тому +2

    Great video. I have a question, would it work inside a tube?

  • @karangajakosh362
    @karangajakosh362 3 роки тому +1

    How can i interface VL53L1X ToF sensor with stm32 and lcd display for human's counting and display number count on lcd? Can you help me with it's diagrams connection and program?

    • @robojax
      @robojax  3 роки тому

      by reading the datasheet, writing down the register address then using I2C communication reading or updating different registers. You can learn from the provided library in this video to use with stm32

  • @kbssaprodussoes
    @kbssaprodussoes 9 місяців тому

    Didnt managed to do it in mega 2560, used 20 and 21 for sda and scl...

  • @anujsaini9353
    @anujsaini9353 3 роки тому +1

    Good afternoon Sir, I am waiting for TUTORIAL video for VL53L1X ROI. Kindly upload the tutorial. Thank you

    • @robojax
      @robojax  3 роки тому +1

      this module might not be the best option. Region of Interest should be done using CCD or some kind of other sensor with camera and lens so you see the region. this is not emitting any light nor there is image . I believe this is not a suitable option for this purpose. Also very few people will have interest in RIO. I try to make videos that benefit lots of people. So I won't be making this video.

  • @roopesh668
    @roopesh668 Рік тому +1

    Can I use this sensor to measure the water level?

  • @user-bw2ly4rf9o
    @user-bw2ly4rf9o 2 роки тому

    When I ran the program again, the front was normal, but a bunch of garbled codes came out at the back, I want to know how can i deal with

  • @faresmo6687
    @faresmo6687 2 роки тому

    السلام عليكم ورحمة الله وبركاته
    ممكن تساعدني بكود لمشروع تخرج ب lr lidar with step motor ومستخدمين vl53l1x sensor

  • @varnarao8432
    @varnarao8432 6 місяців тому

    Will I be able to use a VL53L8 sensor with same Sparkfun library?

    • @robojax
      @robojax  6 місяців тому

      No. The registers holding the data are should be different. I just checked VL53L8 and it does not exist.

  • @TrueHouseBowler
    @TrueHouseBowler 4 роки тому +1

    Hello, love your channel! Do you have a way to display the distance on a 16x16 led matrix? I need to be able to see the distance reading from several feet away and the small lcd or 7 segment displays aren’t big enough. Thanks!

    • @robojax
      @robojax  4 роки тому

      Hi, yes I do have a 7 segment display with laser sensor ua-cam.com/video/oGWpb9C9XXA/v-deo.html and by the way you haven't subscribed.

  • @zamirazizi4097
    @zamirazizi4097 2 роки тому +1

    Hi Great Video, do you know where I can find to libraries for VL5301X/1XV2 distance sensor? To be used in Eclipse IDE for use of the sensor in an esp32 controller. Any help would be much appreciated. Cheers

    • @robojax
      @robojax  2 роки тому

      Search for VL53L0X in my channel. Here is how to find Specific UA-cam Video in a channel bit.ly/findUA-camVideo

  • @salahai2012
    @salahai2012 4 роки тому +1

    Hi dear ahmaed you are doing good I wonder if you can do video for tof 20120 sensor with abstraction thanks

    • @robojax
      @robojax  4 роки тому

      never heard of tof 20120 sensor

    • @robojax
      @robojax  4 роки тому +1

      I read your email. you typed 20120 but in the email you mentioned 10120 and I have purchased it from AliExpress.com . it will arrive in 40 days and then I will make video on it.

  • @anujsaini9353
    @anujsaini9353 4 роки тому +1

    Thanks for tutorial video. Can you please upload a tutorial for ROI for VL53L1X? Thanks you.

    • @robojax
      @robojax  4 роки тому +1

      you are welcome. I will look at.

    • @anujsaini9353
      @anujsaini9353 4 роки тому

      @@robojax Thank you for the prompt reply,Sir.

  • @user-bw2ly4rf9o
    @user-bw2ly4rf9o 3 роки тому

    Does the VL53L1X produce one line or does it produce a lot of lines bundled into a 27-degree array and the question about mirror reflection?

    • @robojax
      @robojax  3 роки тому

      it has one emitter or ray so it is one line.

  • @Jptoutant
    @Jptoutant 3 роки тому

    5 dollar lidar, and more fun than money can buy

  • @salahai2012
    @salahai2012 4 роки тому

    thanks dear ahmed its along time but i will be waiting actually i put some lines to code but it did not work

    • @robojax
      @robojax  4 роки тому

      Please provide error you are getting? did you run I2C scanner? it is provided on the same page as the code is. make sure you are getting I2C address printed on the serial monitor when you run I2C scanner.

  • @zerougmostefa7477
    @zerougmostefa7477 4 роки тому +1

    Hello
    Why the VL53L1X Time-of-Flight 400cm Laser distance sensorin the open place gives a wrong reading

    • @robojax
      @robojax  4 роки тому

      because it doesn't know what to do. So you should set your limit so it doesn't give error. float maxDistance = 350.00;//350mc and then if it reruns error, display 0

    • @zerougmostefa7477
      @zerougmostefa7477 4 роки тому

      @@robojax thank you for your time, can you help me with the correct code?

    • @robojax
      @robojax  4 роки тому

      I don't remember what I said in the video. But I never escape any point in the code and explain everything. so inside the loop where it prints the distance, add your own condition like if(distance >350 || distance

  • @miguelmosqueiro7499
    @miguelmosqueiro7499 3 роки тому

    hello, is it possible to use this setup to count people entering a room, with in and out leds?
    thank you, great video!

    • @robojax
      @robojax  3 роки тому

      Yes if you know how to do it.

  • @dijkhuisable
    @dijkhuisable 4 роки тому

    Great tutorial! Is it possible to configure the chip to give a trigger output when it detects a value? i want to wake my esp8266 on battery"s from sleeping mode(when motion is detected)

    • @robojax
      @robojax  4 роки тому

      it has XSHUT pin which can be triggered. I have explained similar module with XSHUT. Watch it I am sure you will learn from it to use on this module. ua-cam.com/video/vJStXiSS23Q/v-deo.html

    • @dijkhuisable
      @dijkhuisable 4 роки тому

      @@robojax Thank you for fast reply! i don't think you understand me right. I looking for a solution to trigger my esp8266 from sleeping mode. i don't want to trigger the ranging sensor. i found this api discription from the manufacturer.
      6.8 Interrupt settings
      Use VL53L0X_SetGpioConfig()and VL53L0X_GetGpioConfig() to set/get the
      functionality of the interrupt.
      Options are:
      • No Interrupt
      • Level Low (value < thresh_low)
      • Level High (value > thresh_high)
      • Out Of Window (value < thresh_low OR value > thresh_high)
      There is a dedicated procedure embedded in the API for when the interrupt threshold is
      programmed to be larger than 254mm and also set to continuous or continuous timed mode.
      In this case some specific tuning parameters are loaded by the API at each ranging start
      which will introduce a delay of a few milliseconds (depending on the host I2C performance)
      to the very first ranging measurement.
      In single ranging mode, the maximum programmable threshold is 254mm
      When i take a look in the code of the VL53L0X.h and VL53L0X.cpp arduino library i find this line.
      // "Set interrupt config to new sample ready"
      // -- VL53L0X_SetGpioConfig() begin
      writeReg(SYSTEM_INTERRUPT_CONFIG_GPIO, 0x04);
      writeReg(GPIO_HV_MUX_ACTIVE_HIGH, readReg(GPIO_HV_MUX_ACTIVE_HIGH) & ~0x10); // active low
      writeReg(SYSTEM_INTERRUPT_CLEAR, 0x01);
      // -- VL53L0X_SetGpioConfig() end
      Links of information:
      www.st.com/resource/en/user_manual/dm00279088-world-smallest-timeofflight-ranging-and-gesture-detection-sensor-application-programming-interface-stmicroelectronics.pdf
      github.com/pololu/vl53l0x-arduino
      I hope you could help me out how to configure these lines.
      sensor.writeReg(SYSTEM_INTERRUPT_CONFIG_GPIO, 0x04);
      tried this line but nothing happend on the gpio1 pin. the singal stay's high on (3,3v) on my occilloscope.

  • @bayuhariyansyahlubis3916
    @bayuhariyansyahlubis3916 Рік тому

    Assalamu 'alaikum.
    Excuse me sir. Can this module detect transparent objects to know the distance?
    Your answer will be useful for my college's final project. For my college graduation.
    Jazakallahu khairan

  • @davelopez9161
    @davelopez9161 2 роки тому

    Are you able to measure small distances. In the 1 to 2 centimeter range?

    • @robojax
      @robojax  2 роки тому +1

      I don’t remember, see the datasheet provide to the resource page where the code is

  • @raheels.1068
    @raheels.1068 4 роки тому

    Hi this can use also water level sens?

  • @midzyforever9656
    @midzyforever9656 3 роки тому

    Hi! This video is very helpful, thank you! Is it possible to use vibration motor instead of an LED??

    • @robojax
      @robojax  3 роки тому

      Hi, maximum output current of Arduino pin is 30mA . So if your motor needs up 30mA yes you can

    • @midzyforever9656
      @midzyforever9656 3 роки тому

      @@robojax Thankyou!!

  • @sophanop9332
    @sophanop9332 4 роки тому

    Hello. do you have away to show the distance by led or alarm buzzer?

    • @robojax
      @robojax  4 роки тому

      hello, here are my tutorials and code on laser sensor where the distance is shown on screen ua-cam.com/channels/kcBSig_Iu4ZnAIeCeG1TVg.htmlsearch?query=VL53L0X

  • @MoesKeckeEcke
    @MoesKeckeEcke 3 роки тому

    Is there any faster TOF Sensor with 100Hz maybe? Would be nice to sense objects in distance of 200mm or even less but fast before my little robot crash :-9

    • @robojax
      @robojax  3 роки тому

      I believe there is. but the price jumps from single digit dollar to 3 digits.

  • @starlingwatch3921
    @starlingwatch3921 2 роки тому

    Thanks for the video. I am making a wrist watch. I am excited to use the big brother of the 1X, the VL53L5X as a gesture sensor. Have you used it for gesturing with your hands? -Frank

    • @robojax
      @robojax  2 роки тому +1

      Hello, he so example of using a gesture sensor ua-cam.com/video/1Xf34Vw_kZo/v-deo.html

    • @starlingwatch3921
      @starlingwatch3921 2 роки тому

      @@robojax Thanks. In my experience working with the Adafruit_APDS9960 breakout from Adafruit, I have not yet gotten it to sense gestures as well as in the video from Robojox. I'm going to try using the VL53L5X and I'll post the results here. -Frank

  • @AhmedMAbbas-nq8gz
    @AhmedMAbbas-nq8gz 4 роки тому

    Hi thanks for your explain.I ned code to using flexiforce sensor and vl53 l0x in arduino mega 2560 in same time

    • @robojax
      @robojax  4 роки тому

      Hi, You are welcome. See my videos on VL53L0X here: ua-cam.com/users/robojaxTVsearch?query=VL53L0X

  • @shibbir_ahmed
    @shibbir_ahmed 4 роки тому +1

    Did you do any multiple VL53L1X sensor setup ?

    • @robojax
      @robojax  4 роки тому

      Not with the with VL53L0X because the library has limitation. For this also . I would have to work on it and write my own library to make it work. I got no time at the moments as I am busy with full time job and part time graduate school.

    • @Sagelbanan
      @Sagelbanan 4 роки тому

      @@robojax Hi! Thanks for a great video
      Im trying to connect several VL53L1X sensors to the same I2C bus and im using the SparkFun_VL53L1X.h library. For this I have to change the addresses of the sensors so that they aren't the same but I don't understand how to do it, I don't get the setI2CAddress()-method to work. Can you please help me with this?

  • @ianchizian7506
    @ianchizian7506 5 місяців тому

    Will this same code work for vl53l3cx?

  • @nicolaspozo9360
    @nicolaspozo9360 3 роки тому

    Hello, I am trying to communicate the sensor with a PIC, I cannot find the register address on the datasheet.

    • @robojax
      @robojax  3 роки тому

      Hello, please follow the link to the resources page and you will find the datasheet. besides typing "VLV5l1X datasheet" on Google or Bing will show you the datasheet.

  • @marknelson8574
    @marknelson8574 3 роки тому

    how do i use the ROI options for implementing Gesture recognition?

    • @robojax
      @robojax  3 роки тому

      the link is below this video in the description. always check the description of the videos.

  • @Shuaigede
    @Shuaigede 4 роки тому

    Very cool, could this be adapted to be a room entering and leaving person counter, sending the count over MQTT?

    • @robojax
      @robojax  4 роки тому +1

      sure you can. you may get the idea from one of these videos ua-cam.com/users/robojaxTVsearch?query=counter

    • @Shuaigede
      @Shuaigede 4 роки тому

      Thanks, but I couldn’t find anything to do with counters under that link?

    • @robojax
      @robojax  4 роки тому

      I just tested it and see three videos are counters. you can use them with this module

  • @santhosh3351
    @santhosh3351 3 роки тому

    HI I had ESP8266MOD and TOF0400H devices, I could not read the values, can you please help me with code.

    • @robojax
      @robojax  3 роки тому

      Hi, TOF0400H has problem. I has built-in microcontroller like Arduino. that makes is difficult to work with and there not enough documentation. that's why I did not make a video for it.

  • @juanmanueldiflorio845
    @juanmanueldiflorio845 2 роки тому

    Hello! I would like to know if this sensor works through a car windshield or glass... Thank you very much! Greetings from Argentina!

    • @robojax
      @robojax  2 роки тому

      Hello, I have not tested it but it should work.

    • @juanmanueldiflorio845
      @juanmanueldiflorio845 2 роки тому

      ​@@robojax Ahh well, thank you very much! Greetings!

  • @jaikomisune5196
    @jaikomisune5196 Рік тому

    hello nice video / i want to know if this sensor can work under the water ?

    • @robojax
      @robojax  Рік тому

      Hello, I have not tested and don't know but I have provided the datasheet in the recourse page where the code is. may be have a look at that.

  • @qzorn4440
    @qzorn4440 3 роки тому

    would the Dolla Tek VL6180X time of flight distance ranging sensor work with this arduino code to measure close up objects? also a little touch-screen display? thanks a lot...:)

    • @robojax
      @robojax  3 роки тому +1

      This is specific this module because this module has register with certain address and value. So it won’t work

  • @abrahammagnifico9538
    @abrahammagnifico9538 4 роки тому

    hey, good work, btw, what do you recommend for precise distance measurement ? Thanks in advance

    • @robojax
      @robojax  4 роки тому

      2mm precision is the best you can get with this price.

    • @abrahammagnifico9538
      @abrahammagnifico9538 4 роки тому +1

      @@robojax no, i mean what is the most precise distance measurement sensor !?

    • @bayuhariyansyahlubis3916
      @bayuhariyansyahlubis3916 Рік тому

      @@robojax how is the shortest range did you get with this module sir?

  • @nawinlifehacks9978
    @nawinlifehacks9978 4 роки тому

    Can I use this type of device for obstacle avoidance

    • @robojax
      @robojax  4 роки тому +2

      Yes absolutely. this is one of the main use of this VL53L1X sensor.

  • @jerecbazar205
    @jerecbazar205 3 роки тому

    is there lidar sensor that has wider angle field of view?

    • @robojax
      @robojax  3 роки тому

      There are tones of it. Here is the search result on Amazon amzn.to/3wTbQ2l

    • @jerecbazar205
      @jerecbazar205 3 роки тому

      @@robojax thanks

  • @trmusa3434
    @trmusa3434 4 роки тому

    Good

  • @mohdhafizzuddin6217
    @mohdhafizzuddin6217 4 роки тому

    Can u show me how to turn on and turn off dc motor using two push button..one button to turn on dc motor another one to turn off using arduino

    • @robojax
      @robojax  4 роки тому

      Have you searched for "push button" on my channel? Here ua-cam.com/users/robojaxTVsearch?query=push

    • @mohdhafizzuddin6217
      @mohdhafizzuddin6217 4 роки тому

      Already did..but can u make one video to turn on and off one dc motor with two push button with relay using arduino..one button to turn on dc motor one button to turn off dc motor with relay..sorry i still didnt get the concept and quite blank..hopefully with the help from your video i can understand it and see the concept clearly..

  • @rezwanzakaria1754
    @rezwanzakaria1754 4 роки тому

    is there a waterproof version of it? or how to I get a sensor to detect particles underwater?

    • @robojax
      @robojax  4 роки тому

      you can put this in a container and send it underwater. It just need calibration if you put inside the glass or transparent box. The library I have shown has the calibration. See datasheet on how to calibrate this chip.

  • @alingabrielafloarei3499
    @alingabrielafloarei3499 Рік тому

    Does this works with the esp32.?

    • @robojax
      @robojax  Рік тому

      This module used I2C . Yes. Check my channel to learn how to use LD with I2C or laser sensors

    • @alingabrielafloarei3499
      @alingabrielafloarei3499 Рік тому

      @@robojax Thank you. I am really struggling with this.
      I have an esp32 and a VL53L1X sensor from Pimoroni.
      I connect the power to 5v and GND, the SDA to GOPI21 and the SCL to GOPI22.
      I use the Adafruit_VL53L1X library example. and nothing happens.

  • @user-bw2ly4rf9o
    @user-bw2ly4rf9o 3 роки тому

    What does 27 degrees on the data sheet mean?

    • @robojax
      @robojax  3 роки тому

      Typical full field-of-view (FoV): 27 °. I just copied and pasted from datasheet

  • @salahai2012
    @salahai2012 4 роки тому

    thank you dear ahmed when you feel free please do something for me

    • @robojax
      @robojax  4 роки тому

      you are welcome. do what? I have no time to take any projects. This UA-cam is taking already too much time of mine.

  • @nhattrieu695
    @nhattrieu695 3 роки тому

    I can't read data of sensor with esp8266. I think problem is code. Can u help me, please ?

    • @robojax
      @robojax  3 роки тому +1

      of course, this library is not (i believe) for esp8266.

    • @nhattrieu695
      @nhattrieu695 3 роки тому

      @@robojax so i can only use this sensor with arduino? Do you have any way to use this sensor with esp8266. I really need that. Thank u very much.

    • @robojax
      @robojax  3 роки тому

      I am sorry, I just realized. it uses I2C and it should work with EsP8266. You must be dong something wrong. I assume you have installed the library. Please do not skip the video as you might miss details.

    • @nhattrieu695
      @nhattrieu695 3 роки тому

      @@robojax thanks, i will watch video again

    • @nhattrieu695
      @nhattrieu695 3 роки тому

      please give me your contact information. I want to talk to u. I have trouble when modify code to use this sensor with esp8266.

  • @salahai2012
    @salahai2012 4 роки тому

    dear ahmed I did not try vl53l0x because i donot have it Iam taking about TOF 10120 I will send you the codeby email with the details of my problem thanks

    • @robojax
      @robojax  4 роки тому

      Sorry I have no time to look at code. I am very busy. You can post your question or code forum.arduino.cc/ and 1000s of people will respond. good luck.

  • @user-bw2ly4rf9o
    @user-bw2ly4rf9o 3 роки тому

    What happens if VL53L1X encounters a mirror?

    • @robojax
      @robojax  3 роки тому

      Here on page 1 of datasheet it says: Unlike conventional IR sensors, the VL53L1X uses
      ST’s latest generation ToF technology which allows absolute distance measurement whatever the target color and reflectance.
      so it means it should not matter and it should measure because reflectance does not matter. The link to the datasheet is on the resources page for this video.

  • @shashanks2767
    @shashanks2767 Рік тому

    Can this laser penetrate through water

    • @robojax
      @robojax  Рік тому

      have not tested it but it should reflect from any object.

    • @shashanks2767
      @shashanks2767 Рік тому

      @@robojax is there any laser sensor that can penetrate through water and we can display how much distance it has travelled

  • @furqanali590
    @furqanali590 4 роки тому

    ahmad bhai tel me rfid card tage regester in arduino coding howto regester many cards

    • @robojax
      @robojax  4 роки тому

      it can't be said with test. I would have to make video on the topic. I will in the future God willing.

    • @furqanali590
      @furqanali590 4 роки тому

      @@robojaxInshAllha

  • @dilkibaat4727
    @dilkibaat4727 3 роки тому

    Can you please tell me partnumber for 10 meter

    • @robojax
      @robojax  3 роки тому

      Hi, why didn't you search? I just searched for "laser" and found this 12m sensor ua-cam.com/video/qEpWo5ebpXo/v-deo.html

  • @tienuc4133
    @tienuc4133 3 роки тому

    CHO TUI XIN CAI CODE DE LAM DO AN DI BRO I DON''T KNOW SPEAK ENGLISH

    • @robojax
      @robojax  3 роки тому

      I have provided subtitle in most languages.

    • @nhattrieu695
      @nhattrieu695 3 роки тому

      làm được chưa bro

  • @rifkyaditya4676
    @rifkyaditya4676 2 роки тому

    Apakah alat ini bisa dibawah 1cm?

  • @arduinonour4746
    @arduinonour4746 4 роки тому +1

    :)

  • @sergeyafonin2596
    @sergeyafonin2596 3 роки тому

    Pls. move out advertisement

    • @robojax
      @robojax  3 роки тому

      Here ua-cam.com/users/premium

  • @the4hunters
    @the4hunters 4 роки тому

    Too much ads

    • @robojax
      @robojax  4 роки тому

      It is free for you. Buy my course at udemy.com so u don’t see ads.

  • @balamurugan.nandhu
    @balamurugan.nandhu 4 роки тому

    CAN WE USE THIS FOR LEVEL MEASUREMENT?

    • @robojax
      @robojax  4 роки тому

      If you use gyroscope yes. otherwise you will not know the level.

    • @____________________________.x
      @____________________________.x 4 роки тому

      Ultrasonic sensor would be better, not reliant on reflectivity of a liquid