Is LIDAR easy to use for hobbyists? DIY Roomba? Obstacle Avoidance System for Robotics

Here is the rewritten text in a well-structured article format:

Using the LiDAR Sensor with an Arduino: A Step-by-Step Guide

The LiDAR sensor is a fascinating technology that can be used to create a variety of fun and useful projects, including robotic vacuum cleaners. In this article, we will walk you through the process of connecting the LiDAR sensor to an Arduino board and using it to control a robot.

To begin with, I connected the LiDAR tune included USB to UART converter to my computer, installed the drivers, and Stoddard's point cloud viewer software. I then selected the X axis for lighter and clicked the start button, which not only activated the motor of the system but also created this beautiful dot map on my computer.

As I brought an object with a known distance next to the sensor, it seemed to measure the distance within the given resolution of the datasheet. This was brilliant! If you are confused about how the angle value is referenced, don't worry - we have a zero-degree line that increases to 360 degrees in the clockwise direction.

This system is not only fun to play around with but also useful for mapping rooms and maneuvering robots through them. Modern vacuum cleaner robots can do this using LiDAR sensors. However, the software I used was not suitable for this purpose because it required raw angle and distance values that could be extracted from the sensor's new art series interface.

To get around this, I opened the Real Term see program and set the baud rate of my communication port to 128 thousands, as mentioned in the data sheets. The sensor started spinning, and I saw few lines appear on the screen.

Next, I discovered that by sending over hexadecimal values, specifically '56' for 5 and 60 years, I could enter scanning modes that would hopefully output point data. However, the software started showing tons of unreadable science - the problem was that the sensor only sends over hexadecimal values.

After fixing this mistake, we were able to get all the angle and distance information we needed without decoding those hexadecimal values manually. Instead, I turned to the offered Arduino library for the X4 LiDAR sensor's example code, which could spit out the desired angle and distance values.

However, there was one problem - the sensor's maximum communication voltage is based around 3.3 volts, while the common Arduino uses 5 volts. To fix this, I used an Arduino Pro Mini that powered and programmed at 3.3 volts FTDI breakouts.

After connecting the TX and RX pin of the sensor to the Arduino according to its pin out given by the data sheets and powering it with five volts, I uploaded the Arduino code and checked the serial data through the Real Term software. While there were some correct values, there were also tons of error messages and distances of zero millimeters.

Despite this, I wanted to see whether the available data was enough for my crude vacuum robot experiments. To do this, I ordered a pretty cheap kit that comes with wheels, acrylic plates, motors, and more. It took me around an hour to completely assemble it, as the instructions came without any help.

Once I was done, it was a breeze to multiply light a sensor and thus I was almost ready for testing. Before doing that, however, I had to create a small power control circuit that turns the five volts of my battery power source used for the motors and divider system into 3.3 volts for the Arduino.

While I was editing this, I also added two MOSFETs to control the motor speeds later on for pulse width modulation. According to the finalized wiring scheme, I then hooked up all the components to one another and created a small test code to see whether the motors would function correctly.

This tipsy bicycle rider simulation seems to work just fine, so next I tried implementing the LiDAR system and an algorithm that pretty much stops the robot when it's about to crash and lets it move in the direction with the farthest away objects. Unfortunately, my final results only worked out to some degree.

In conclusion, using a LiDAR sensor with an Arduino is possible but not easy to accomplish. Nevertheless, I hope you still learned quite a bit about such LiDAR sensors if so don't forget to Like, share, subscribe, and hitting the notification bar. Stay creative and I will see you next time!

WEBVTTKind: captionsLanguage: enever wondered how modern robots don't run into walls or how driverless cars know where obstacles are positioned so that they can avoid them well one modern sensor system which can achieve such 360 degrees of object detection is called Leiter which is short for light detection and ranging and since the company Elector is currently selling a small lighter system with decent hobbyist specifications I picked one up without hesitation so in this video we will find out how the slider sensor works how we can display its data on a computer and use it with nod we know and finally I will assemble a small robots with the sensor on top to possibly create a crude DIY Roomba well let's get started this video is sponsored by elector who not only run an online store but also published quite awesome electronics magazines that have been reading for years now and best of all Alecto is offering a free green digital membership to the magazines for all my viewers so have a look in the video description for the coupon code great Scott's 19 and start reading electoral for free today after unboxing the lighter system and had a closer look at the quality of the plastic housing as well as the power PCB and I have to say that it seems like a compacts well-built robust units that can easily be mounted to objects with its four spacers but before praising it's too much let's continue by removing the top lids in order to find a big metal chunk in which a laser diode as well as probably a photo receiver is housed at the back we can also find an STM 32 microcontroller units which is the brain of the lidar system simplified speaking it turns on the laser diode 5000 times per second to send out a laser beam this beam then gets reflected from the objects that is in its way and thus it's the photo receiver which then tells the STM 3230 laser beam has returned now since the system measures the time difference between the firing of the laser beam and its receiving and since we know that light travels with a speed of 299,000 792 meters per second we can easily calculate what distance the laser beam travels and thus by dividing it by two we cut the distance to our objects of course this kind of measurement is only possible in one fixed direction in order to get a full 360 degree fields this system uses a motor to rotate the laser with a frequency of 6 to 12 Hertz that is very simplified how the distance measuring works but now that our stm32 work at the final distance values how does it send it over to the communication port on the bottom I mean solid wire connections are not possible because the control PCB constantly rotates to find that out I removed the control as well as the PowerPC BIA and found LEDs and light sensors on both of them which are probably used to send over the data both PCBs also feature a more or less hidden coil that are both directly connected to specialized C's which are utilized for wireless charging and that is basically how the control PCB gets powered but nevertheless the power PCB got one more IC which is a DC to DC converter which is used to turn the 5 volts input voltage to 9 volts to power the DC motor and with that being said we are now familiar with the basic functional principle of the slightest answer so after I finished reassembling it it was time to start testing it's by following the user manual guides given by the manufacturer that means I connected the lidar tune included USB to UART converter hooked that up to my computer installed the drivers fluids and Stoddard's the given point cloud viewer software there I selected the X for lighter and then basically clicked the start button which not only activated the motor of the system but also created this beautiful dot map on my computer now by bringing an object with a known distance next to the sensor it seems to measure the distance within the given resolution of the datasheet brilliant and if you are confused how the angle value is referenced then let me tell you that we got a zero degree line which then increases to 360 degrees in the clockwise direction as you might already have guessed this system is not only a lot of fun to play around with but it is also useful to for example map a room and thus a robot should be capable of maneuvering through this room with those information which is basically what modern vacuum cleaner robots can do and what I wanted to try next the software is not suitable for that though because we need the raw angle and distance values which can be extracted from the sensor through its new art series interface that is why I opened the real term see will capture program where I set the baud rate of my communication port to 128 thousands like it is mentioned in the data sheets after opening the ports these sensor starts spinning and it reads us were few lines next I found out that by sending over the hexadecimal value a five and sixty year we can enter these scanning modes which will hopefully outputs the point data after sending those values over though this software starts showing tons of unreadable science the problem was that the sensor only sends over hexadecimal values so after fixing this mistake we can not only feel like we're in the matrix but we also got all the angle and distance information we need but because decoding such hexadecimal values by hands does not make much sense I instead turned to the offered Arduino library for the x4 lighter sensor whose example code can basically spit out the desired angle and distance values there was just one problem being that the sensors maximum communication voltage is based around 3.3 volts while the common Arduino uses 5 volts that is why I had to use an Arduino Pro Mini which I powered and programmed gooble 3.3 volts FTDI breakouts so after connecting the TX and rx pin of the sensor to the Arduino according to its pin out given by the data sheets and additionally powering it with five foods I uploaded the Arduino codes and had a look at the serial data through the we term software now there seems to be a some correct values but then again tons of error messages and distances of zero millimeter but nevertheless I wanted to see whether the available data is enough for my crude vacuum robot experiments that is why I ordered myself this pretty cheap what kids that comes with wheels acrylic plates motors and tons of cruise now it took me around one hour to completely assemble it because the kids came without instructions but once I was done with it it was a breeze to multi light a sensor and thus I was almost ready for testing before doing that though I had to create a small power control circuits that turns the five foods of my battery power source used for the motors and divider system into 3.3 volts for the Arduino and while I was edits I also added two MOSFETs to control the motor speeds later on for pulse width modulation according to this finalized wiring scheme I then hooked up all the components to one another and firstly created a small test codes to see whether the motors would function correctly which as you can see in this tipsy bicycle rider simulation seems to work just fine so next I tried implementing the lighter system and an algorithm which pretty much stops the robots when it is about to crash and then let Saturn into the direction with the farthest away objects only to repeat this procedure but since I am let's face it's pretty terrible at writing codes my final results did only work out to some degree so all in all using this hobbyist lider system with an Arduino is possible but not easy to accomplish but nevertheless I hope you still learned quite a bit about such lighter sensors if so don't forget to Like share subscribe and hitting the notification bar stay creative and I will see you next timeever wondered how modern robots don't run into walls or how driverless cars know where obstacles are positioned so that they can avoid them well one modern sensor system which can achieve such 360 degrees of object detection is called Leiter which is short for light detection and ranging and since the company Elector is currently selling a small lighter system with decent hobbyist specifications I picked one up without hesitation so in this video we will find out how the slider sensor works how we can display its data on a computer and use it with nod we know and finally I will assemble a small robots with the sensor on top to possibly create a crude DIY Roomba well let's get started this video is sponsored by elector who not only run an online store but also published quite awesome electronics magazines that have been reading for years now and best of all Alecto is offering a free green digital membership to the magazines for all my viewers so have a look in the video description for the coupon code great Scott's 19 and start reading electoral for free today after unboxing the lighter system and had a closer look at the quality of the plastic housing as well as the power PCB and I have to say that it seems like a compacts well-built robust units that can easily be mounted to objects with its four spacers but before praising it's too much let's continue by removing the top lids in order to find a big metal chunk in which a laser diode as well as probably a photo receiver is housed at the back we can also find an STM 32 microcontroller units which is the brain of the lidar system simplified speaking it turns on the laser diode 5000 times per second to send out a laser beam this beam then gets reflected from the objects that is in its way and thus it's the photo receiver which then tells the STM 3230 laser beam has returned now since the system measures the time difference between the firing of the laser beam and its receiving and since we know that light travels with a speed of 299,000 792 meters per second we can easily calculate what distance the laser beam travels and thus by dividing it by two we cut the distance to our objects of course this kind of measurement is only possible in one fixed direction in order to get a full 360 degree fields this system uses a motor to rotate the laser with a frequency of 6 to 12 Hertz that is very simplified how the distance measuring works but now that our stm32 work at the final distance values how does it send it over to the communication port on the bottom I mean solid wire connections are not possible because the control PCB constantly rotates to find that out I removed the control as well as the PowerPC BIA and found LEDs and light sensors on both of them which are probably used to send over the data both PCBs also feature a more or less hidden coil that are both directly connected to specialized C's which are utilized for wireless charging and that is basically how the control PCB gets powered but nevertheless the power PCB got one more IC which is a DC to DC converter which is used to turn the 5 volts input voltage to 9 volts to power the DC motor and with that being said we are now familiar with the basic functional principle of the slightest answer so after I finished reassembling it it was time to start testing it's by following the user manual guides given by the manufacturer that means I connected the lidar tune included USB to UART converter hooked that up to my computer installed the drivers fluids and Stoddard's the given point cloud viewer software there I selected the X for lighter and then basically clicked the start button which not only activated the motor of the system but also created this beautiful dot map on my computer now by bringing an object with a known distance next to the sensor it seems to measure the distance within the given resolution of the datasheet brilliant and if you are confused how the angle value is referenced then let me tell you that we got a zero degree line which then increases to 360 degrees in the clockwise direction as you might already have guessed this system is not only a lot of fun to play around with but it is also useful to for example map a room and thus a robot should be capable of maneuvering through this room with those information which is basically what modern vacuum cleaner robots can do and what I wanted to try next the software is not suitable for that though because we need the raw angle and distance values which can be extracted from the sensor through its new art series interface that is why I opened the real term see will capture program where I set the baud rate of my communication port to 128 thousands like it is mentioned in the data sheets after opening the ports these sensor starts spinning and it reads us were few lines next I found out that by sending over the hexadecimal value a five and sixty year we can enter these scanning modes which will hopefully outputs the point data after sending those values over though this software starts showing tons of unreadable science the problem was that the sensor only sends over hexadecimal values so after fixing this mistake we can not only feel like we're in the matrix but we also got all the angle and distance information we need but because decoding such hexadecimal values by hands does not make much sense I instead turned to the offered Arduino library for the x4 lighter sensor whose example code can basically spit out the desired angle and distance values there was just one problem being that the sensors maximum communication voltage is based around 3.3 volts while the common Arduino uses 5 volts that is why I had to use an Arduino Pro Mini which I powered and programmed gooble 3.3 volts FTDI breakouts so after connecting the TX and rx pin of the sensor to the Arduino according to its pin out given by the data sheets and additionally powering it with five foods I uploaded the Arduino codes and had a look at the serial data through the we term software now there seems to be a some correct values but then again tons of error messages and distances of zero millimeter but nevertheless I wanted to see whether the available data is enough for my crude vacuum robot experiments that is why I ordered myself this pretty cheap what kids that comes with wheels acrylic plates motors and tons of cruise now it took me around one hour to completely assemble it because the kids came without instructions but once I was done with it it was a breeze to multi light a sensor and thus I was almost ready for testing before doing that though I had to create a small power control circuits that turns the five foods of my battery power source used for the motors and divider system into 3.3 volts for the Arduino and while I was edits I also added two MOSFETs to control the motor speeds later on for pulse width modulation according to this finalized wiring scheme I then hooked up all the components to one another and firstly created a small test codes to see whether the motors would function correctly which as you can see in this tipsy bicycle rider simulation seems to work just fine so next I tried implementing the lighter system and an algorithm which pretty much stops the robots when it is about to crash and then let Saturn into the direction with the farthest away objects only to repeat this procedure but since I am let's face it's pretty terrible at writing codes my final results did only work out to some degree so all in all using this hobbyist lider system with an Arduino is possible but not easy to accomplish but nevertheless I hope you still learned quite a bit about such lighter sensors if so don't forget to Like share subscribe and hitting the notification bar stay creative and I will see you next time