Тёмный

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

Robojax
Подписаться 107 тыс.
Просмотров 71 тыс.
50% 1

Step by step test and explanation of this VL53L1X 4m laser distance sensor with Arduino Code.
This video is part of Arduino Step by Step course that starts here • Lesson 00 What is Ardu...
The best thank you for me is to not to skip ads and Subscribe 🔔 to my channel, like 👍 the video It is greatly appreciated. 🔔 😊.
I will reply to all Subscriber's 🔔 questions. So make sure to Subscribe and enable the bell 🔔.😊
*** Purchase VL53L1X from Affiliated Store :
Amazon USA: amzn.to/3kx0Fao
Amazon Germany: amzn.to/2HFGDM4
Amazon Canada: amzn.to/35B3Fw0
Amazon UK: amzn.to/35GLJzY
Amazon France: amzn.to/35yTWX4
Amazon Italy: amzn.to/2J3Tmcc
Amazon Spain: amzn.to/2HuWkX2
アマゾンジャパン:amzn.to/3jxB3sB
Banggood: www.banggood.com/custlink/3vm...
eBay: ebay.us/pGu2Ly
AliExpress: s.click.aliexpress.com/e/_9RPxo4
** Purchase Arduino Start Kit **
Amazon USA: amzn.to/3z88F9G or just UNO board amzn.to/3aY7KOL
Amazon Canada: amzn.to/31an88J or just UNO board amzn.to/3pYxSNN
Amazon Europe (all Europe): or Just uno board amzn.to/2PgGItD
AliExpress: s.click.aliexpress.com/e/_9uc7Xe
Banggood: www.banggood.com/custlink/3GD... or UNO board www.banggood.com/custlink/vKm...
eBay: ebay.us/B1JWLi
Download code and library: robojax.com/course1/?vid=lect...
Jump to different section of video by clicking on the time:
00:00 Start
00:40 Introduction
03:42 Datasheet Visited
06:48 Soldiering Pin headers
08:22 Wiring explained
09:06 Code explained
11:53 Demonstration
16:03 Demonstration in Complete Dark
Learn about Region Of Interest (RIO): www.st.com/resource/en/applic...
Tutorial by Ahmad Shamshiri form Canada
Subscribe To my channel now bit.ly/rj-subscribe
****************************
Arduino Step by Step Course (over 150 lectures) Starts here • Lesson 00 What is Ardu...
****************************
If you found this tutorial helpful, please support me so I can continue creating contents like this. Here is PayPal link paypal.me/robojaxTV
Follow me on Facebook robojaxTV
Follow me on Twitter: / robojaxtv
Follow me on Instagram: / robojax
Robojax on Ticktok: / robojaxtv
Tutorial by Robojax.com
Get other projects code and learn Arduino
robojax.com/learn/arduino
*** AFFILIATE PROGRAM ***
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
#robojax #robojax_laser #robojax_VL53L1X

Наука

Опубликовано:

 

2 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 136   
@ThierryC2373
@ThierryC2373 2 года назад
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 года назад
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 8 месяцев назад
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.
@TrueHouseBowler
@TrueHouseBowler 4 года назад
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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oGWpb9C9XXA.html and by the way you haven't subscribed.
@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
@CarcamoDavid2
@CarcamoDavid2 2 года назад
Great video. I have a question, would it work inside a tube?
@dijkhuisable
@dijkhuisable 3 года назад
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 3 года назад
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. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-vJStXiSS23Q.html
@dijkhuisable
@dijkhuisable 3 года назад
@@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.
@kbssaprodussoes
@kbssaprodussoes 7 месяцев назад
Didnt managed to do it in mega 2560, used 20 and 21 for sda and scl...
@zamirazizi4097
@zamirazizi4097 2 года назад
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 RU-vid Video in a channel bit.ly/findRU-vidVideo
@midzyforever9656
@midzyforever9656 2 года назад
Hi! This video is very helpful, thank you! Is it possible to use vibration motor instead of an LED??
@robojax
@robojax 2 года назад
Hi, maximum output current of Arduino pin is 30mA . So if your motor needs up 30mA yes you can
@midzyforever9656
@midzyforever9656 2 года назад
@@robojax Thankyou!!
@raheels.1068
@raheels.1068 4 года назад
Hi this can use also water level sens?
@roopesh668
@roopesh668 Год назад
Can I use this sensor to measure the water level?
@trmusa3434
@trmusa3434 4 года назад
Good
@robojax
@robojax 4 года назад
Thanks.
@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.
@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 года назад
Hello, he so example of using a gesture sensor ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-1Xf34Vw_kZo.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
@Shuaigede
@Shuaigede 3 года назад
Very cool, could this be adapted to be a room entering and leaving person counter, sending the count over MQTT?
@robojax
@robojax 3 года назад
sure you can. you may get the idea from one of these videos ru-vid.comsearch?query=counter
@Shuaigede
@Shuaigede 3 года назад
Thanks, but I couldn’t find anything to do with counters under that link?
@robojax
@robojax 3 года назад
I just tested it and see three videos are counters. you can use them with this module
@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
@user-bw2ly4rf9o
@user-bw2ly4rf9o 2 года назад
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 2 года назад
it has one emitter or ray so it is one line.
@faresmo6687
@faresmo6687 2 года назад
السلام عليكم ورحمة الله وبركاته ممكن تساعدني بكود لمشروع تخرج ب lr lidar with step motor ومستخدمين vl53l1x sensor
@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 года назад
@@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?
@anujsaini9353
@anujsaini9353 3 года назад
Good afternoon Sir, I am waiting for TUTORIAL video for VL53L1X ROI. Kindly upload the tutorial. Thank you
@robojax
@robojax 3 года назад
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.
@anujsaini9353
@anujsaini9353 3 года назад
Thanks for tutorial video. Can you please upload a tutorial for ROI for VL53L1X? Thanks you.
@robojax
@robojax 3 года назад
you are welcome. I will look at.
@anujsaini9353
@anujsaini9353 3 года назад
@@robojax Thank you for the prompt reply,Sir.
@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: ru-vid.comsearch?query=VL53L0X
@salahai2012
@salahai2012 3 года назад
Hi dear ahmaed you are doing good I wonder if you can do video for tof 20120 sensor with abstraction thanks
@robojax
@robojax 3 года назад
never heard of tof 20120 sensor
@robojax
@robojax 3 года назад
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.
@karangajakosh362
@karangajakosh362 2 года назад
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 2 года назад
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
@ianchizian7506
@ianchizian7506 3 месяца назад
Will this same code work for vl53l3cx?
@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.
@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 ru-vid.com/show-UCkcBSig_Iu4ZnAIeCeG1TVgsearch?query=VL53L0X
@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.
@qzorn4440
@qzorn4440 2 года назад
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 2 года назад
This is specific this module because this module has register with certain address and value. So it won’t work
@shibbir_ahmed
@shibbir_ahmed 4 года назад
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?
@salahai2012
@salahai2012 3 года назад
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 3 года назад
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.
@davelopez9161
@davelopez9161 2 года назад
Are you able to measure small distances. In the 1 to 2 centimeter range?
@robojax
@robojax 2 года назад
I don’t remember, see the datasheet provide to the resource page where the code is
@Jptoutant
@Jptoutant 3 года назад
5 dollar lidar, and more fun than money can buy
@varnarao8432
@varnarao8432 3 месяца назад
Will I be able to use a VL53L8 sensor with same Sparkfun library?
@robojax
@robojax 3 месяца назад
No. The registers holding the data are should be different. I just checked VL53L8 and it does not exist.
@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.
@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!
@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.
@nawinlifehacks9978
@nawinlifehacks9978 4 года назад
Can I use this type of device for obstacle avoidance
@robojax
@robojax 4 года назад
Yes absolutely. this is one of the main use of this VL53L1X sensor.
@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.
@santhosh3351
@santhosh3351 2 года назад
HI I had ESP8266MOD and TOF0400H devices, I could not read the values, can you please help me with code.
@robojax
@robojax 2 года назад
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.
@jerecbazar205
@jerecbazar205 2 года назад
is there lidar sensor that has wider angle field of view?
@robojax
@robojax 2 года назад
There are tones of it. Here is the search result on Amazon amzn.to/3wTbQ2l
@jerecbazar205
@jerecbazar205 2 года назад
@@robojax thanks
@salahai2012
@salahai2012 3 года назад
thank you dear ahmed when you feel free please do something for me
@robojax
@robojax 3 года назад
you are welcome. do what? I have no time to take any projects. This RU-vid is taking already too much time of mine.
@zerougmostefa7477
@zerougmostefa7477 4 года назад
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
@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 ru-vid.comsearch?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..
@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.
@arduinonour4746
@arduinonour4746 4 года назад
:)
@robojax
@robojax 4 года назад
😄
@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
@user-bw2ly4rf9o
@user-bw2ly4rf9o 2 года назад
What does 27 degrees on the data sheet mean?
@robojax
@robojax 2 года назад
Typical full field-of-view (FoV): 27 °. I just copied and pasted from datasheet
@salahai2012
@salahai2012 3 года назад
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 3 года назад
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.
@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 года назад
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.
@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 ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-qEpWo5ebpXo.html
@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
@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
@user-bw2ly4rf9o
@user-bw2ly4rf9o 2 года назад
What happens if VL53L1X encounters a mirror?
@robojax
@robojax 2 года назад
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.
@rifkyaditya4676
@rifkyaditya4676 2 года назад
Apakah alat ini bisa dibawah 1cm?
@rifkyaditya4676
@rifkyaditya4676 2 года назад
Pengukuran dibawah 1cm
@robojax
@robojax 2 года назад
? English or Farsi
@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
@sergeyafonin2596
@sergeyafonin2596 2 года назад
Pls. move out advertisement
@robojax
@robojax 2 года назад
Here ru-vid.com
@the4hunters
@the4hunters 3 года назад
Too much ads
@robojax
@robojax 3 года назад
It is free for you. Buy my course at udemy.com so u don’t see ads.
Далее
Laser vs Ultrasonic - TOF10120 vs. HC-SR04
31:09
Просмотров 179 тыс.
How accurate are time of flight sensors?
6:55
Просмотров 18 тыс.
Distance Sensor Comparison Guide
2:45
Просмотров 64 тыс.
Игровой Комп с Авито за 4500р
1:00