YTread Logo
YTread Logo

Getting Started with LIDAR

Getting Started with LIDAR
today in the workshop will be working with

lidar

we'll take a look at to light our devices the TF mini which is an inexpensive

lidar

unit that you can use for collision avoidance and the RP

lidar

a lighter device capable of doing a full 360 degree sweep there's plenty to scan today so welcome to the workshop hello and welcome to the workshop today we're going to be working with a really cutting-edge piece of technology and before we get

started

I want to tell you a little background story behind this now about two months ago in response to one of my other videos I got a comment from one of you asking if I could do a video about using

lidar

and I responded to the comment and said I would love to work with

lidar

because I think it's a really interesting technology the only problem is the commonly available

lidar

devices and sensors were just too expensive to be using here in the workshop I tend to try to use components that are inexpensive because I want you to be able to reproduce the things I do as well and if I start working with two three hundred dollar components no one's going to be able to afford to do that well it was after having this discussion that I had another discussion with the good people over at DF robot and they pointed out that they have a couple of

lidar

devices that are not at all expensive and they have actually been kind enough to send me not one but two of these devices and I'm really excited to be able to show you these two...
getting started with lidar
devices today now one of these devices is a stationary

lidar

device and it goes through the whopping price tag of $40 which is really absolutely remarkable the other device is a full 360-degree rotating

lidar

similar to the type of

lidar

that you have seen on top of self-driving vehicles and this goes for an unbelievable $100 so this really brings the cost of

lidar

down to the point where we can start using them in our robotics experiments now

lidar

may seem like a very new technology and that's because we see it in self-driving cars and that's a very new technology but an actual fact

lidar

has been with us for a very long time over 50 years

lidar

was actually developed not long after the laser was developed and was pretty well confined to government and military experiments the most famous use of

lidar

in the early days was during the Apollo 15 moon mission 1970s when they actually used

lidar

to do a topographical map of a section of the moon nowadays of course we think of

lidar

as being used as one of the navigation systems in our self-driving cars and so we would love to be able to use this technology within our robots and with these inexpensive devices now we can so the way this episode is going to work is as follows I'm going to do the usual show you how

lidar

works and explain why you would use

lidar

in certain situations and I'm going to show you a few experiments with the 2df robot devices that were provided to me for this video but before we do any of...
getting started with lidar
that I want to show you these two devices so let's go take a look at them right now so here are the two devices the DF robot were kind enough to send along for our

lidar

experiments the first one here is called a TF mini

lidar

sensor I'll show you that one first now here is the sensor itself as you can see it's got a source and receiver on it with a couple of lenses and a whole bunch of circuitry and a small connector for connecting it to the outside world now in order to use that connector they were actually kind enough to supply not one but two cables now this cable has got the little mini connector on one end for the

lidar

and another connector that you could put on to a printed circuit board in order to connect a device this connector has the mini connector on one end and on the other end they've got four of these female DuPont connectors and that's actually perfect for doing experiments with breadboards than that so that's the TF mini

lidar

let's put that aside over here now this is the rpi

lidar

and this is an absolutely awesome little device and it's really packaged nicely I'll have to say that for it let's just open it up so I can show you that comes with a little packet at the top here first a little packet you get a cable and a little note on how to connect the

lidar

up to a PC using an adapter that's included in the box over here now as you can see this is packaged beautifully this was sent to me from China and it arrived...
getting started with lidar
in perfect condition no surprise because of this great packaging this is a little adapter device that can be used to connect the

lidar

directly to a computer it's got a connector on one end for this cable and on the other end it's got a micro USB connector to connect to your computer and this is the device itself now take a look at this now this is a real little beauty this is a full scanning

lidar

unit you can see the transmitter and receiver over here and it's on a scanning platform with a motor it's a completely self-contained unit has a processor and everything on it got this cable here to hook it up to the USB adapter and there you have it a beautiful little device amazing quality and amazing value so let's go take a look at what we can do with these devices now so what exactly is

lidar

well the original meaning of

lidar

was light detection and ranging it was based on the acronym for radar which is radio detection and ranging these days

lidar

can also stand for light imaging detection and ranging which is a more accurate description of what it does

lidar

uses a focused beam of light and a sensor to detect the range and reflectivity of a remote object lighter is used in survey applications to create high-resolution maps and of course it's used in self-driving vehicles and robotics which is the interest that we have in

lidar

basically

lidar

works by sending a beam of focused light to a remote object the beam is reflected back to the

lidar

sensor the...
distance that a remote object is determined by the travel time of the beam which of course is traveling at the speed of light the reflectivity of the object is determined by the beams intensity in surveillance applications

lidar

is often carried in an aircraft which beams to light our light beams down toward the earth which are reflected back to the aircraft here's a NASA provided computer animation of a

lidar

scan of the Amazon rainforest you now in self-driving vehicles

lidar

is used as one of the primary sensors it's used along with an orientation sensor that determines where the vehicle actually is at the moment as well as a very high-powered computer and software to correlate all the information in actual fact self-driving vehicles use several

lidar

sensors as well as radar camera and other sensors to determine their position and the position of objects around them here is an example of the type of data that'll

lidar

scan on a self-driving vehicle would be using in order to determine its position and the position of items around it so now let's get

started

with

lidar

so let's compare the TF mini

lidar

sensor to a couple of other methods of sensing distance and proximity now I've got two other devices other than the TF many over here to show you this one I'm sure you're familiar with this is the HC SR 0 for ultrasonic sensor and it's got a source and a receiver that sends out ultrasonic signals in order to measure distance now we did an...
article and a video about the HC SR 0 for the HC SR 0 for has a minimum range of around 2 centimeters and a maximum range of about 4 meters and it's accurate to within about a half a centimeter or so within that range so this is pretty good for detecting objects in the distance that you would normally encounter in robotics now it uses ultrasonic sound and it doesn't work very well outdoors it works a lot better indoors it can be interfered by other sound sources and some objects tend to absorb sound as opposed to reflect them so this is good for certain objects but in other applications it's not so good now this is an optical source sensor arrangement that is actually used as a proximity detector and it's got a little potentiometer on it over here a little trim pot now the way this device works is it sends out a beam of infrared light and looks for the reflected beam coming back but instead of using it to measure distance it simply sends it as a trigger so the output pin over here will go high when an object is detected within the detection distance you set the detection distance by using this potentiometer so this is not very good at all for actually doing distance measurements but is great for finding out if there is a device immediately in front of you this only has a range of about a meter at the maximum but what you would use these for in a robot is you'd strategically locate a few of these on the robot and you would use this pulse over here to derive...
an interrupt on your Arduino or Raspberry Pi or other my her controller so that if the robot came in proximity to something this would go high and you would be alerted to it and then could take the appropriate action like stopping or moving the robot and here of course we have the TF mini

lidar

sensor now this has a minimum range of about thirty centimeters so it's not very good for anything closer than that however it has a maximum range of about 12 meters and that's a really long distance so this will cover any situation that we have indoors and a lot of outdoor situations as well this is also much better at working outdoors than a device like this would be now of course this is much more expensive than these two devices so it's really a trade-off between performance and capabilities and in many designs you would use all three of the devices but I just wanted to show you what the difference is between the different types of proximity sensors that you can use in robotics the TF mini

lidar

is a low-cost stationary

lidar

device instead of using a laser beam it uses a focused infrared LED and this keeps the cost of the device low the range of the TF mini is from 30 centimeters to 12 meters which is approximately 1 to 40 feet the device has its own internal processor and communicates with external devices via a serial input/output port it has a maximum sample rate of a hundred Hertz in other words it can take a hundred readings every second and those readings will...
have an accuracy of five millimeters or half a centimeter over its entire range the TF mini has a four pin connector on it here is the pin out of the TF mini now let's take a look at those pins in detail GND is obviously the ground pin VCC is the supply of voltage the device requires four point five to six volts to work so it'll work well in a five volt power supply txd is to transmit data line note that this is a 3.3 volt logic line and not a 5-volt logic line rxd is the received data line it is also a 3.3 volt logic line now let's take a look at how we use the TF mini

lidar

now as you just saw the TF mini makes use of 3.3 volt logic levels instead of the 5 volt logics that most of us are used to working with now we've worked with 3.3 volt logic before if you remember when we did the motion sensor video and article it's a 3.3 volt device and we fed it directly into a 5 volt Arduino without any problems so here's how interfacing 3.3 volt logic the 5-volt logic works when you have a 3.3 volt output you can safely put it into a 5 volt input obviously it's not going to exceed the voltage it can only get to 3.3 volts but it will also work correctly and the reason for that is that TTL logic which is what we call the 5 volt logic TTL meaning transistor transistor logic 5-volt logic actually has a threshold of 2.8 volts so in other words any signal over 2.8 volts will be considered a digital one anything below 2.8 volts is going to be considered a digital...
zero and so since 3.3 volt logic satisfies that requirement you can safely feed the transmit output of the TF many into an input on your Arduino without any problems going the other direction however is another story feeding a 5 volt output from the Arduino into the 3.3 volts input on the TF many can be very dangerous now the inputs can be tolerant to some degree to the 5 volts but it's not always safe to assume that so you'll need to do something to drop that voltage now one way of doing that is this with a couple of dropping resistors but calculating the values can be a bit tricky because it really depends on the individual situation the best way of doing this is with something called a logical Converter now these are very inexpensive devices and they're available as one channel 2 channel 4 channel 8 channel converters and they basically just take a 3.3 volt signal on one end and output a 5 volt signal on the other end or the reverse they take a 5 volt signal on one end and output a 3.3 on the other end most of these devices are bi-directional so it doesn't matter whether you connect them to inputs or outputs they will work as long as you keep all the 3.3 volt logic on one side and the 5 volt logic on the other side now on the breadboard I'm about to show you I've got a voltage converter right here I don't know if you can see it it's this small little item here this is just a two channel voltage converter basically it has inputs and outputs...
for the two channels plus a ground connection of five volts and a 3.3 volt connection now this 2 channel converter is a very handy thing to have around your workshop and they're very inexpensive you can pick these things up on eBay and I suggest that you pick up a handful of them because you're going to find a lot of uses for them I like the two Channel ones because they're very good for I 2 C buses and quite often with the i2c bus you have a situation where you have a 5 volt device and a 3.3 volt device such as an Arduino and a Raspberry Pi and you want to tie them together again it can be done with resistors but the safest way of doing it by far is with a logic level converter so now that we've discussed this important aspect let's take a look at how we wire up our TF mini to our 5 volt Arduino Uno so let's hook our TF Mini up to an Arduino Uno we will of course need the Arduino Uno and the TF mini as well as a logic converter to convert the 3.3 volt logic signals on the TF mini to the 5 volt signals required by the Arduino Uno we will begin by connecting the 5 volts in the Arduino to the VCC connection on the TF mini will also connect 5 volts to the V in connection on the logic converter visit the 5 volt power supply input put murder will take the ground from the Arduino and connect it to the ground of the TF mini we are also connected to one or both of the ground connections on the logic converter an actual fact these are internally connected so...
you really only need to connect one the 3.3 volt output from the Arduino is connected to the three v3 input or the three punk 3 volt input on the logic converter next we will connect pin 10 from the Arduino to one side of the 5-volt logic converter outputs I'm using 5 a the corresponding 3 a which is the 3.3 volts side of that is connected to the txd connection on the TF mini in a similar fashion pin 11 of the Arduino is connected to the 5 volt 5b connection on the logic converter the corresponding 3 B connection is connected to the our XD connection on the TF mini this chart will show you the wiring and make it simple to follow so now that we've wired it up let's take a look at a sketch we can use to test this out now before you run this sketch to control the TF mini you're going to need to install a new library into your arduino ide so open up the ide and go into sketch i'm going to include library and go to manage libraries once your library manager opens go into the filter box and type in TF mini there'll be one library in the result and that is the one you wish to install when you click the more info button you will get an install button over here in my libraries you can see is already installed once you've installed your library just close the library manager now go into file go into examples and scroll down until you get to the examples from custom libraries under TF mini you will see one example called basic reading this is the code...
we're going to be using so select that and open it up I've done that over here now it starts off the number of comments lets you know which two pins we've connected the TF mini to because we're going to set up a software serial port on those pins the Arduino Uno like many models of Arduino only has one serial port and those are on pins 1 2 we would like to use a second serial port to connect the TF mini and use the original serial port for our serial monitor in order to use a software serial port we include the software serial library which is part of the Arduino IDE we will also of course include our TF mini library well then set up the software serial library for pins number 10 and 11 these are the two pins that we will be using to connect our TF mini we'll also set up an object called TF many using the TF mini library in the setup we initialize our serial port this is the one that we are going to be using our serial monitor on notice the speed that we're initializing it at many of you run the serial port at 9600 baud you're going to need the bump up to speed because the data is coming at is pretty fast we also then initialize a software serial port and we initialize the TF mini and assign it to that software serial port now the loop is very very simple we take two unsigned integers 16-bit integers and we define them as a distance and the strength and the distance is the TF many objects get distance property and the strength is the TF mini...
objects get recent signal strength property then we simply display these on our serial display we give it a short time delay and do the loop over and over again so now that we've seen the code let's take a look at it in action okay I've got a little TF mini demo hooked up and you can see the serial monitor right now it's reading us straight hundred and 26 centimeters which I'm sure I'm going to find is the distance between the sensor and my ceiling and I'll pick this up and kind of move it around the room a little bit and as you can see we got various readings as we go around the room now one thing I want you to notice is I'm gonna aim this back down at the table you'll notice I'm just inches from the table here I'll do this against the wall if you can't see that note that I'm

getting

a reading of 30 centimeters which is obviously incorrect that's because 30 centimeters is the minimum amount that you can read with this sensor but one thing about the sensor is it's very directional much more directional than an ultrasonic sensor and the data comes in very fast remember you can get a hundred readings per second from the TF mini so as you can see this sensor is very accurate it's very quick and would make an excellent sensor for a collision avoiding robot the ultrasonic sensors work well for this too but because you can't take as many readings per second it's always possible that an object could move in...
front of your robot in between readings with something that takes a hundred readings a second that's far less likely so now that we've seen the TF mini let's move on to the RP

lidar

device the RP

lidar

is a 360-degree omnidirectional

lidar

scanner it uses the principle of laser triangulation to determine distance the unit can sample up to 8,000 points per second at 10 Hertz the 10 Hertz refers to the rotation speeds that would be 10 rotations per second it has an internal wireless connection so it doesn't use slip rings to connect to the rotating section it has a range of 12 meters which is approximately 40 feet the RP

lidar

has a seven pin connector here are the connections on the pins notice that there are two ground connections let's look at those connections in detail the GND connections are obviously the grounds rxd is the received data txd is the transmit data these are five volt TTL level VCC is the five volt DC logic supply for the device moto CTL is the motor control input this is a pulse width modulation input to control the speed of the motor and V moto is the power supply for the motor which also requires five volts DC now the skanda rate of the RP

lidar

is controlled by the motor speed which in turn is controlled by PWM the sample rate on the other hand is determined by the controlling software these rates can determine the scan speed and the accuracy of the device here are some example scans at different rates and sample rates note the...
difference between the scans in terms of speed and the number of points retrieved so now let's start using the RP

lidar

for ourselves now you may recall when I unpack the RPI

lidar

device there was a couple of accessories included there was a little USB adapter a cable that connected the USB adapter to the RPI lighter and a little card that gave you some information on the little card you will find a link and I've got the link repeated in the article associated with this video and this is to download some software for it a software development kit and some sample applications and so I want to take a look at that right now now the software development kit and the applications are actually available for all three platforms meaning Linux Windows and Macintosh however there is one application that is only available for Windows and it's actually the one that I think is the most impressive so for that reason I've brought a computer into the workshop I've got two computers in the workshop already but they're both Linux so this is a Windows notebook that I'm going to be using for this demonstration now I've got my RPI

lidar

mounted over here on this little gig just to give it some space and I've got the serial device connected to it and I'm going to connect this via USB to my serial port on the computer now when I first connect this up you're going to notice that the RPI lighter just spins continuously that's because it's not being...
controlled so it's just

getting

power to the motor and I'll just keep going and going let's take a look at what's in the SDK right now now when you open it up you'll see two different directories SDK and tools we're not actually going to look at the software development kit directory today instead we're going to go into tools so if you go into tools you'll see there's two folders CP 2102 driver and win32 now before you do anything you'll need to go in and in stall a driver for your computer now it really depends on what type of computer you have but most of you will need the 64-bit driver which is what I installed however if you have an older computer maybe a Windows XP box that you're still using you might want the 32-bit driver and so the drivers are over here just install the one that you need and then go back and open this win 3-2 directory and you will see a number of different applications the ultra simple the simple grabber and the frame grabber the one that I think is the most impressive is the frame grabber so I'm going to open up the frame grabber right now and it'll ask me what comport I'm going to use it should default to the correct one so I will say ok and give it a moment it'll open you'll notice the motor stopped right now while it opened because now it's being controlled ok so this is the frame grabber I've maximized it to full screen over here so you can see it and in order to do this...
test I want to introduce you to a friend of mine this is kind of taking you into the background scenes of the drone bot workshop filming process and my friend is this guy over here this is a little jig that I built actually a couple of years ago for doing filming and you'll notice that this is about the same size that I am the reason is I'm both the person in front of the camera and I'm the cameraman since I can't be at two places at once in order to focus I built this little device here and it's got some focused targets on it and you know it also has a white background to let me do a white balance but I found out that when I was doing the scanning in this very small room it actually is a pretty good target to demonstrate the rpi

lidar

with so I'm going to use this device right now as a target so at any rate as I said the room is very small and remember the minimum range of this device is thirty centimeters so you're not going to get a great reading in this tiny room this would work much better in a larger room but nonetheless you'll still get an idea of how this works so I'm going to start the scan right now and you start this by pressing this little button over here and as you can see we're

getting

some scan results right now now let me show you something I'm gonna put my target over here now can you see a straight line inside there let's move the straight line do you see that line moving over here let's move it over here...
move it there that flat line that you're seeing is actually the surface over here on my my target now there's another moving thing inside here as well and if you'll watch it's kind of like sitting at about the 240 degree mark right now and it's moving down a little bit and is moving up a little bit that of course is me it's picking me up in there and otherwise you'll notice everything is confined mostly to the center except for a few dots down around 150 degree mark and that actually represents a door opening that you can't see that's right behind you over here that goes outside of the worktop so it's actually gone out there and it's it's targeted on a couple of objects in the next room which is for your information my laundry room so it's probably hitting the dryer or something right now so at any rate it's a very impressive little display and it also goes to show you the kind of data that you can get from a scanner like this and that is the sort of data that a self-driving vehicle would be using in order to determine its position so now that we've seen that let's see if we can make some more use of our our API

lidar

device so for this experiment we will need an Arduino Uno of course we'll need our RP

lidar

device we're also going to need a common anode RGB LED note that this is common anode and not the more popular common cathode variety you'll also need three resistors I used 150 ohm resistors but...
pretty well any resistor in that range should suffice now let's go to the connections we're going to connect things from the RP

lidar

to the Arduino first so on the connector for the RP light are starting on the top we will connect the ground connection to the Arduinos ground the RX or receive connection on the RP

lidar

will be connected to the transmit line on the arduino which is pin number 1 the TX are transmitted line on the RP

lidar

is going to be connected to the Arduino receive which is pin number 0 the v 5.0 connection on the RP

lidar

is the 5 volt power supply and we will connect this to the 5 volt output from the Arduino the next connection is ground and that will be connected to the existing ground connection the Moto CTL connection is the motor control connection for the RP

lidar

this will be connected to pin 3 of the Arduino so that we can send a pulse width modulated signal to control the motor speed and finally V mode o this is the power supply for the motor now you can connect this to an external 5 volt power supply if you wish however in this case I'm going to use the Arduino 5 volt supply the RP

lidar

device has noise filtering on it to prevent some of that noise from

getting

into the data lines however again you can use an external 5 volt supply if you'd prefer now we'll hook up the led the common anode of the LED is going to be connected to pin 12 of the Arduino this allows us to enable and disable the LED the red connection on the LED...
is connected through a 150 ohm resistor to pin 9 of the Arduino the green connection goes through another 150 ohm dropping resistor and it gets connected to pin 10 and finally the glue connection is also passed through its dropping resistor and then connect it to pin 11 on the Arduino and so now that we've seen how to hook this up let's take a look at a sketch that we'll be using in order to run our demonstration now in order to use the art P

lidar

with the Arduino you're going to need to grab some code for it and add a driver to your Arduino IDE the RP

lidar

SDK is up on github and I've got the link for that in the article associated with this video so go over there and take a look at it now you can download this entire thing as a zip file and I would recommend that you do that to take a look at the items that are inside it however that zip file cannot be installed directly into your Arduino IDE it does simply a matter of the fact that it's not structured correctly I explained this in the article and show you how you can create your own zip file and for your convenience I've created one as well and you'll also find a link to that in the resources section of the article in the drone bot workshop comm website so once you've got the zip file go to your arduino ide because you'll need to install it go up to sketch go to include library add zip library select the folder that you downloaded your zip file to in my case of downloads file and...
then select the RP

lidar

driver and then click OK to install it I won't do that now because mine is already installed once you have it installed there are two example programs that you can look at go into examples and go to RP light our driver and you will see both distance to color and simple connect let's take a look at simple connect simple connect is actually just a template that you can use in order to write your own for the RP

lidar

device and so in aspect it really doesn't do anything by itself it gives basically is a template that you'll be able to use to write other code now if you do decide to run this in the air we know IDE it'll run fine but the only thing that you will notice is that the

lidar

device will spin and nothing else will happen but basically it will start any code that you're using for this device by including the RP

lidar

library itself and then after that you'll create an instance of that driver that we're calling

lidar

you'll also define the pin that you're using to control the motor speed now we are using pin three you could use another pin but it has to be one capable of pulse width modulation because that's how you regulate the speed of the motor which in turn regulates the scanning speed of the

lidar

itself in the setup you need to begin the light our object to use it begin and you point it the serial because our lighter device is connected to pin zero one one which are the serial ports in an Arduino...
Uno now remember these are the same places that the USB connection on the Arduino Uno is connected so you actually can't use both at the same time you're going to need to power your uno with something other than your computer in order to make this work so you'll upload your code to it and then disconnect it from the computer and power it with something else the next thing we do in setup is simply set the RP light our motor pin that we've defined pin three in our case as an output and then we go into the loop and this is basically the basics of reading data off the RP

lidar

device we find out if the

lidar

is at a weight point we say is it okay is it at a weight point if it is we get the current point we get data for every single point that we scan and remember we can bring it up to eight thousand of these points per second if we run this at full speed now get current point can provide us the distance the angle there's also a boolean that tells you whether this is the very first bit in a scans so there's this number one of the entire scan or not and the quality of the signal is also set out as a byte value over here now if we do get that data we can perform our own data processing down here and use these variables within our processing and indeed when we write some proper code for this that's exactly what we'll do if it isn't at the weight point then we stop the motor we try to detect the light our device and if it is detected we scan it and...
then we start the motor all over again and so that's the basics of using the lighter device now there's another example I'm not going to go through it in great detail because there's a lot to it there there's more detail explained in the article if you're really interested but I just want to show it to you this is the distance the color example and this is actually the one that you're going to load up to your Arduino IDE that we've wired up with the RGB LED now the interesting thing about that RGB LED as you recall is that it's a common anode device whereas the common cathode device is a bit more popular common anode device needs its common section connected to 5 volts however we've connected at the pin 12 as you'll see over here so when we enable this pin when we send it to 5 volts and bring it high it provides the 5 volts through the common lead on the LED this lets us actually completely turn the LED on and off through control of this pin we define pins 9 10 11 as the RGB pins the rest of this is very similar again we're defining the PWM connection to the motor as pin number 3 we have some functions which essentially convert color in from angles so we take the angles of display color the float angle the float distance and we use this function and the previous one to create a unique color for that particular angle and if you go through you can actually read the parameters they've set for these over here I'm not going...
to go through it now because is this going to get a bit confusing and in the setup we'll go and we'll do the same thing will begin serial will bind we'll set the Quinns that we've defined as outputs and this over here actually enables the LED but turns it off keep in mind being a common anode LED at 255 is actually fully off and a zero is fully on we define a couple of other variables a couple of floats through the minimum distance and the angle of the minimum distance and then in our loop we do basically what you saw in the early example if it's at a weight point we perform the data processing we get the angle in the distance and assign it to the LED otherwise we go and we try to start the light our device over and over again so I know that's sort of a brief skim not the normal detail I give you on the code but you can take a look at the code and you'll essentially see what it's doing so now that you've seen that let's take a look at the code in action so upload the distance to color sketch to your Arduino and we'll take a look at it all right so I've got my RP

lidar

and Arduino and LED hooked up over here on the workbench I've just got the RGB LED on this small solderless breadboard that's also where I've connected the RP

lidar

connections and one little hint if you're trying to do this yourself is how to make a connection to that connector I didn't have that type of connector but what I found is that this...
male header actually worked really good what you do is you actually plug the connector onto the short ends over here and then you can plug the long ends into your solderless breadboard so that really worked out well and was making it quite easy in order to hook up the RP lighter now you'll also notice that I've mounted the RP

lidar

up on a stand and the reason is if I keep it down on this level on every scan it's going to actually start hitting the components on my Arduino and solderless breadboard and we don't want that now I'm hoping you're going to be able to see the RGB LED because it actually is quite neat to watch this work but I've had some difficulty filming RGB LEDs so hopefully you will be able to see all the color changes that I am seeing and if not I apologize now I'm driving everything off of 9-volt battery remember you can't use the USB port for this because the USB port transmit and receive shares the same pins as pins 1 & 2 and we're using that for the RP lighter and using the library that we use right now I couldn't find a way to switch over to software serial so we kind of have to run this without being connected to the computer so let's connect the 9 volt battery to it and the

lidar

starts and our light comes on and as I move my target which is this going to be my hand in this case around the

lidar

device hoping you can see that I'm

getting

different colors on the LED and as I come in closer and...
further from it the colors tend to change remember if I go too far out it's going to trigger on the next nearest object it finds which is probably one of the items on my workbench I tried to clear the area as good as possible but as I'm hoping you're seeing the color goes through some quite dramatic changes depending on where the target is and that's really great it's obviously not that practical use for the device but it is showing the fact that it is capable of detecting the angle that the reflected object is that within the 360 degree perimeter it's also detecting the distance that the thing is act be it by the hue or the intensity of the LED and of course this data could be used for a lot more practical purposes including back in a self-driving car so although it's a simple demonstration this shows you how the RP

lidar

can be connected up to an Arduino alright well that about wraps it up for today's video but it most certainly does not wrap it up for these two sensors these devices are just too amazing to just devote a small video to so I'm going to be building a project with each of these devices now with the TF mini

lidar

what I'll have a pan and tilt mechanism that I want to attach to it I saw another YouTube project using another

lidar

device in which they did a 180 degree scan of a room both horizontally and vertically and created a really cool point cloud with it and I think I could probably do the same thing with the TF mini...
so I'm working with that right now and as soon as I have that working I will release a video an article to show you how to do that now as for the RP

lidar

that's an amazing device and the obvious use for it would be in a self-driving vehicle now I have a robot car base not the normal plastic one I use but a really nice metal one from DF robot that I actually purchased about a year and a half ago and haven't put to use yet I think it would be the perfect mate for this RP

lidar

device and I'm going to start working with that it may take a little while but I intend to try to start working with a self-driving vehicle using the device and of course once I have something I will release a video an article to show you how to do that now the best way to find out about these videos and their corresponding articles is to subscribe to the YouTube channel so if you haven't done that already please hit the subscribe button below I would very much appreciate that I would also appreciate it if you would sign up for the drone bot workshop newsletter you'll find a link below the video as well as a forum on the drone bot workshop comm website now the newsletter is my way of keeping in touch with you to let you know what I'm working on in the workshop but also to find out what it is you would like me to work on in the workshop and what articles and videos would be useful to you so please subscribe to the newsletter and become part of that community until next time...
please take care of yourselves and I hope to see you again very soon here in the workshop good bye for now you