Time of Flight Sensor (VL53L0x) for Distance Measuring in ESPHome - Pellet Level Monitor Update

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone and welcome back to the channel a while ago I made a video using this ultrasonic distance sensor where I made a pallet monitor for my home to monitor the levels of the pallets in my pallet boiler that I used to hit my home and that worked relatively well and it's been working uh quite nicely since so I can show you here in home assistant that it shows the current pallet level and it's been relatively reliable in the past to show me the uh level of pets that I have but in that video many of you commented that I should have instead used one of these this is the VL 53 LX time of flight sensor that uses lasers to measure distances instead of the sound that the other sensor uses and I've ordered a couple of them and in this video we will take a look at how we can connect them with arduno and how we can also connect them to ESP homes so we can also measure the pallet levels s uh with the ultrasonic Monitor and before we dive into the details of how this works I want to take a quick moment to thank today's sponsor a tool that has truly revolutionized the way we design Electronics Alim designer and Alim 365 Alim 365 is not just any platform it's where the world designs Electronics integrating all aspects of electronic development to help teams deliver better products faster than than ever imagine connecting directly to your design platform from your favorite tools without any hassle sharing real-time project updates and even collaborating seamlessly with your mechanical team plus with features like transparent design reviews efficient libraryi and data management and even Supply Chain management you can ensure that everyone from design to procurement is on the same page so if you are looking to enchange your electronic design process and deliver quality products faster check out altim designer and Alim 365 the way that this sensor works is it uses infrared laser light to shine a beam and then uh measure out the reflection and figure out what's the time that it took the light to travel to and back and that with some processing indicates the distance that it traveled you could see this uh on the camera that uh we have a blinking light and that's from the measuring and it only works on a certain angle because it's really focused so you can see if I move it slightly out of the way we no longer see the light and on the opposite side we have a tiny receiver I don't know if I can show this better without using a microscope and to connect it with the microcontroller sensor connects over iceq C so I have V in and ground connected to 3.3 uh volts and ground on the Node MCU and I have SC connected to D1 and I have SDA connected to D2 on the Node MCU so let's zoom out to see that and here is how it's connected so 3.3 in ground on the far left and then D1 and D2 connecting to the ice Square C pins on the sensor the sensor is really tiny so if I compare it to the node MCU you see that it's really small measuring about a centimeter by a centimeter and half uh on the development board while the sensor itself it's like really small on the back side there are some components that are required to control the chip and we also have two more pins that we are not using at the moment so I have nothing connected on them and that's gp1 so we can have an output coming in from that sensor to trigger something and then we have the uh x uh shut so we can use that if we have multiple sensors like this because they're all running on address 29 in ic we can choose to enable a certain sensor and just get the measurement from that sensor the maximum range that the sensor can detect is about a meter so I have it here pointed out to the wall that has it's about meter and a half 2 m it's saying that it's out of range but as soon as I place my hand in front of the sensor you can see that we are getting the measurement with the Arda Cod I'm using the default example that came with the Ada fruit library for the sensor so this is the VL 53 lox sensor and you can see that as I move my hand away from the sensor the distance increases and if I remove it completely then it goes out of range I think that the maximum I can go to is about so a meter and 20 cm and it really depends if I'm hitting the angle or not but I think that's where the maximum is it works reliably well in distances that are closer so like in the case that we used for the pellet monitor I think that the furest that we need to measure it's about 80 cm which should be perfect for this and on the low range similar to the ultrasonic sensor it gets tricky on the really close distances so anything below 3 cm it just uh measured as 3 cm so you can see I have it as touching and it says about 3 cm so but once we go further it gets correct and it measures the right distances now this is definitely very useful and we can already build a lot of projects with it but in order to replicate the pellet level monitor that we did with the ultrasonic sensor we need to connect this thing to ESB home so let's do that next and here is the now time of light version of the pallet monitor compared to the actual pallet monitor that I have installed on my pallet boiler you can see as I move my hand outwards it reduces the level until it reaches certain um threshold and then when it goes out of range it will drop down to zero so I'm trying to figure out where the beam is so you can see I can vary it depending on the distance and the closer I get the Fuller it gets until uh when it's over a few CM it always counts this as full and I can show you the code that does that and it's here so I have the sensor running on address 29 and it's updating every 1 second and that value from that distance sensor is then used in this template sensor that uh translates it to the level where same as with the pallet version I'm using the equivalent of the map function from ardino where anywhere between 10 cm and 80 cm I map it to a percentage I'm going to have all of the code and everything I've used linked down below so if you want to check it out in the meantime I'm going to continue working on making a standalone version of this sensor so if you are interested in that then be sure to subscribe below uh like the video if you liked it and I'm going to see you all in the next one cheers
Info
Channel: Taste The Code
Views: 30,462
Rating: undefined out of 5
Keywords: VL53L0x, ToF, Time Of Flight, distance sensor, ESPHome, Arduino, Home Assistant, pellet level monitor, pellet level, VL53L0x level sensor, vl53l0x, vl53l0x level sensor, iot, drone, laser distance sensor, laser distance measuring sensor, esp8266 nodemcu, esphome home assistant, wemos d1 mini, adafruit vl53l0x, lidar pico, tof, laser vs ultraschall sensor, ultrasonic sensor, smars mini, adafruit vl43l0x library, electronics, diy, electronics creator, project, smart home
Id: FsQGe6XXeQE
Channel Id: undefined
Length: 7min 53sec (473 seconds)
Published: Fri Apr 26 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.