Homemade LIDAR sensor with Arduino & Processing

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video we'll make a homemade lighter is not as good as a commercial either sensor but it will be good enough for a small robot to avoid obstacles for example I will show you what is a lidar sensor how they work and how I've made a homemade one based on the Arduino and an infrared distance sensor i've designed and 3d printed a case in such a way that it would spin 360 degrees without stopping for better support it also has a bearing inside the spin is controlled by a step motor and the lighter has a basic output with values of angle and distance we could use these values to create an obstacle map around the robot for example I'll also show you how to get better results in case that you need higher precision so make sure that you subscribe and also to hit a notification bell in order to see future projects also a huge tank at all my patterns for the support so let's get started if you want low-cost and fast production PCBs you might want to know about the sponsor of this video GLC PCB and by the way they recently won the prize of outstanding boot at the Rome Maker Faire you can get high quality prototyping PCBs for only two dollars and they also have the SMT service available where you could send the Gerber file together with the boom and the pick-and-place file and receive the board's with all the components already soldered and that's starting for only seven dollars what's up my friends welcome back this is my homemade lighter sensor and lighter stands for light detection and ranging system or better laser imaging detection and ranging and this is a device that allows you to get the distance from a laser emitter to an object or a surface using a post laser beam well in my case for this homemade version I'm using the VL 53 l1 sensor which is a time of flight distance sensor this measures the time it takes the light to get from the sensor to hit the object and get back to the receiver and by knowing the speed of light we can calculate the distance between the object and the sensor to get more information about the surroundings the lighter sensor will usually also be spinning and getting the distances all around that's why my sensor is placed on the spinning disk as you can see here in this example we detect the shape of the box and if I place an object inside of the box we can also detect that object we will see more examples at the end of the tutorial ok instead of the 3d printed part we have the so-called slip ring this component could spin while still making connections between the wires below and above the component in this way we can get the data from the sensor even if it's spinning all the time to precisely rotate the disk I'm using a step motor in this way by knowing the ratio between the pulley and the disk we can easily calculate the angle of rotation and use that later in the code to control the stepper motor I have the step motor driver and together with an Arduino Nano the same Arduino will get the distance from the sensor and then it will send the angle and the distance to the serial port and we could later use that data with a small robot for example now to measure the distance we could use some other distance sensor as well but this via 53 l1 is one of the most precise that I have right now but you could also use these sharp sensors such as the 2 y 0 821 sensor and the zero a 51 sk sensor which are both infrared light sensors but are not based on the speed of light for a more bulky and crude module we could even use this ultrasonic distance sensors if you want but that won't be a lighter anymore it will be some sort of sonar because it's based on the speed of sound there are a lot of better sensors on the market for this but I don't have those right now the problem with the VL 53 l1 sensor is that the emitted light has a big spot that means that the precision is not good for small objects and also lost with the distance so the received data is not that accurate but as I said before it will be good enough for a simple robot ok guys so this is all that we need for this project the 3d printed case which you could download from below and print it with your printer I've used PLA material to parameters and 20% infield for all the parts then we need the VL 53 l1 sensor an arduino nano a step motor driver together with a step motor like this one and the slippering module to pass the data while spinning this is a crucial component for the lighter to make a full rotation then we need a bearing like this one and some dual PCB to solder all the components on it and also some extra small parts that's pretty much it for this project see the full part list below now get the top part of the 3d printed case and fix in place the slip ring make sure that the rotating part is on the top side of the support so it will spin at the same time as the disk now get the step motor and screw that in place on these two holes then tie the screws and make sure it fits well in place ok so now I've placed some captain tape on the bearing to make it fit better now place that bearing on the support like this ok so now we get with the spinning disk we get the small thread insertions and using the soldering iron I push a thread on each of these two holes for the sensor so now we could use a three millimeter screw and fix in place the sensor so pass the wires from the slip ring through this hole of the spinning disk then solder four wires to the sensor for ground VCC data and Clark now using three millimeter screws fix in place the sensor then I use a little bit of hot glue to place the wires inside of the disk and then we could close it like this on top of the bearing so now it could spin and get the data from the sensor at the same time on the dual PCB I solder the step motor driver we also need to add a good capacitor at the power input pins also connect all the wires that we need after some tests I've decided to add a small booth converter board as well in order to increase the 5 volts voltage from the USB connector to pull volts for the step driver see more about this in the schematic below and also make sure to set the boost output at 12 volts okay so now we have the driver in place and also some female pins for the step motor solder the wires from the Arduino to the stepper driver just as in the schematic that you can see below we also soldered the wires for power ground data and Clark from the distance sensor then I've made these small holes and place this whole sensor here I also glue a small magnet on the rotating disc and using this will reset the angle each rotation so we know which is the front or the back of the sensor see the schematic for the connections of the whole sensor as well okay so now I figured we know just in front of this hole here and I fix it in place with some hot glue you might want to make some tests before you glue everything inside okay so now in the same way as before using the small metal threads and the soldering iron heat the thread till you can push it inside of the plastic case for the bottom case we had three screws okay now we could close the case connect the step motor to the fuel pins of the stepper driver now carefully close the case with some three millimeter screws and make sure that all the wires are inside using a simple elastic band I make the connection between the pulley and the rotating disc so now on the button case insert the USB connector and upload the example code this code will rotate the disc and each several steps it will make a measurement you can change these values here in the code in order to make more or less measurements or maybe change the range of the sensor the lower is the range the higher will be the precision right now I have it set to a maximum range with these lines here in the code now creating the steps for the step motor and the measurement lines in the code will take some time so we can't really spin the disk too fast in a future version I might try a different approach using a simple DC motor and a hall sensor together with the magnet to encode the position of the disk in that way we can spin a lot faster and calculate the angle using the rotating frequency detected with the hot sensor and the magnet okay so now the code is uploaded I connect the Arduino to a PC and open the serial monitor as you can see we receive the angle and the distance each step we calculate the angle in the code because I know the pulley ratio and the steps that the motor needs to make a full rotation so read more about this in the calculation part of the code now I've also made a simple application in processing that will print the distance to the screen so we can have a more visual representation of the data as you can see we now have the real-time distance around the lidar sensor but now I place the sensor inside of a box now I run the application again so as you can see we can detect the shape of the box but now I also play something inside and as you can see we also detect that object if nothing is around we'll have a circle of 800 millimeter diameter around the sensor because I now have it limited to that range but you can change that in the code if you want so this easy we can detect obstacles around the lighter sensor and also create a map around using the angles and the distances we get from the serial communication so you could use this project with any robot that you want okay guys so you now know how I've made this lidar sensor see the links below the video for some better distance measurement modules because the one that I'd used is not the best you also have all the other links for electronics comm where you could find the schematic the 3d printed files for the case the full part list and the example codes that I've used so make sure you also visit electrons that come for more details if you liked this project consider subscribing and also activate the notification bell in order to see my future videos consider supporting my work on patreon as well so thanks again and see you later guys [Music]
Info
Channel: Electronoobs
Views: 315,038
Rating: undefined out of 5
Keywords: homemade, lidar, IR, infrared, sensor, TOF, VL53L0X, sharp, 2y0a21, distance, robot, obstacle, avoid, processing, serial, angle, rotating, cloud point, Arduino
Id: fQ2iB7qkrUg
Channel Id: undefined
Length: 11min 12sec (672 seconds)
Published: Sun Nov 17 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.