This lecture introduces two fundamental types of distance sensors used in robotics: infrared sensors (like the Sharp GP2D120) which use light reflection to measure distance (operating optimally between 4-30cm with a 32ms sampling rate) and ultrasonic sensors which use sound waves traveling at approximately 330 m/s to measure distance through time-of-flight calculations; both sensor types require calibration methods such as curve fitting or lookup tables to convert raw sensor readings into accurate distance measurements, with ultrasonic sensors being particularly useful for detecting obstacles in autonomous vehicles due to their ability to work in darkness and their relatively simple implementation.
Introduction to Robotics: Lecture 8 - IR and Ultrasonic Sensors
Added:[Music] all right uh we are doing ecgr 4161 lecture number eight and we just had a quiz thought I would go over the solution to the quiz it's really not as hard as you think it is how many of you think you got it all right not good all right so let's take a quick look here's the problem given the following information 12 bit ADC plus reference of 5 volts minus reference of 0o volts and oh by the way the digital representation is so the first thing to say is what is the step size well as we said you go from your lowest number over here 000000000000 Z how many zeros am I up to now um oh we got a total of 12 right 0 0 and it's going to go all the way up to 111 one one one one one one one and this is going to go from to guess 0 Vols to 5 Vols all right so obviously somewhere between here and here you go up by individual steps so the question is how much is each one of those step sizes each one of those step sizes is going to be 1 over 2 12th right yes multiply that by 5 Vols and your number is what's 2 the 12th off the top of your head that's 496 [Music] 4,096 divid five and if you didn't have a calculator I I would accept that and the answer is 00122 you know that for sure or 89.2 what is it oh never mind 01222 1.22 for St 1 22 MTS all right so now you have the value which is 1 0 0 0 1 1 0 0 1 0 and whatever that is converted to base 10 then you take that and you multiply that by 1.22 mols and that's going to be equal to that's your answer 2.5 a that's it that's it wait wait catch that I got that well I'm going to get there so my uh one uh 011 1 0 you're on decimal what crud sorry oh wow that's pretty B 00 0 001 1 00 1 0 convert that into decimal that's uh 2098 pardon me times 0.122 turns out to be 2.5 six vol which seems about right because this number is about half of what the entire range is 2.56 is a little bit more than half of what it is I provided this down to you just to remember what the concept is here I'll do that again I provided this at the bottom just so you can remember what the concept was if you wanted to you could have even for the first problem in here said one is equal to VN which is what you don't know yet time 2 to the N -1 V ref which is 5 +2 take the integer of that so for all in of purposes I'm close 4095 is what the form formula would have come out with but uh I would accept both cuz they're just about the same what is this this is the same as VN is = 5 over 2 N - 1 and what do you know that's what I said up here right 5 Vols to the 12th was that easy it is now it is now yeah so uh provided you got your name correct you will get at least some points woo glad you're all excited about that as you should rightly so me no Mr Morgan Morgan got all right so let's do another little recap or do I need to do another recap of AD sure ah after this one well let's look at an app appliation to see why you would need that and so if you remember at the uh end of last class I was talking about an infrared detector right so here's one that you're going to see very soon it is the sharp infrared Rangers not to be confused with the Texas Ranger but it is a device let's see if we have a picture in here and we see what it looks like from the side you have this device here that it has a uh a v out a ground and a VCC so introduction infared uh sophisticated they're talking about the interfacing uh the connector that you need stuff like that for those of you who are uh uh mechanically impaired they been tell you how to connect it all right way yeah way so here I tell you what it works infrared detector will take continuous readings every 32 milliseconds so notice that so that means that this is limited to a frequency of what one which is one which is so R sharp I range GP 2D 120 that me 32 milliseconds 3125 period that's it yeah frequency is equal to 1 over 0.032 seconds which is equal oops 3125 3125 31 2 25z 3125 you said yeah okays it is seconds at the bottom and that is the definition of Herz so you can only measure it every 31.25 Herz you can actually read the value more frequently than that but it won't change so if you read it once every 100 or if you read it once every millisecond you'll get the same measurement for 32 times if you read it once every 10 milliseconds you'll get three of them that will be the same sometimes four right right why would it be four it up what time that well if your measurement is like this and then it changes for uh let's see that's 0 10 20 [Music] 30 40 and then 2 milliseconds later it goes up well it just so happens if you read it at this point in time 2 3 four it'll be four in a row that'll be the same value you're saying if we read it a frequency higher than that right so if you read it as now as opposed to what I described earlier about aling you know how will a differ again this is not necessarily a periodic signal it's it's very not random but it's very uh um slowly changing unless you have a vehicle that moves extremely fast all right well I guess another thing to take a look at is is what is the range and you've seen a picture like this before what do they say they say that the analog output is connected to an a to a TOD converter and could be used uh in a circuit shows a typical response curve notice a distance down here centim it looks like it works pretty good up to 75 or so and this one says 10 but actually they'll they'll discuss later about variations in fact let's take a look at this the specific part is the gpd2 GP 2d1 120 and when you're running it at 25c with VCC of 5 Vols you can expect the range is going to be from 4 to 30 cm 4 cm is how much about an inch and a half right yeah uh 30 cm is about what 1T so obviously if you're going to use it it has to be more than a uh an inch off the ground to be worthwhile and that's better than some of these other ones if you look at this one right here this one says it's minimum is 10 cm so using it as something to reflect off the ground it might be a little bit better oh excuse me oh so what they're saying is at 30 cm you could typically see your voltage is going to be anywhere from.
25 volts to 055 volts and the expectation is that when it's at 4 cm you're going to see it they say a Delta Delta V is going to be 2.25 Vol to 1.85 Vol which means what is the voltage what is going to be the typical voltage at 4 cm that you'll measure four two two95 well if the difference between these two right here is going to be typically two yet at 30 cm it's 4 you would expect that the curve would say at uh see what our curve was right here at 4 cm it would have a difference and this is at 30 cm it said at 30 cm your typical voltage is going to be 0.4 and then the difference up here is going to be two so that means this will be 2.4 at 4 cm which means that this curve is somewhat representative if this number were four and that number were 30 we're not able to see the bottom oh yeah here we go if this number were four and that number were 30 that would be the typical curve so here is a good question for you so we're going to see and it's not it is not a direct line it is going to be a curve now usually what they include In A Book Like This is an indication of what the typical formula is for that curve and unfortunately I cannot find one in this book so typically what you have to do is you have to go online and look for the data pages so let's look it up today say it again we getting our test back today uh no I have to do something this week called or I had to do something these last week called uh helping people get ready for moving so I'm only halfway through the tests they don't look good other way so really no I should say for some people they don't look good oh for heaven's sakes open at some people pardon me I hope I'm not at some people fing Crossing all right so here's the data sheet for this from sharp themselves this book that I had shown you is from somebody who sells it so this from sharp shows you some of this typical information as well oh in this case they say it's 2.25 instead of two so that's even a little bit more different we have I'm looking for the formula of the Curve I look voltage distance reflected this is a nicer curve so you notice here it says 2.8 volts and down here which is uh where they're recommending uh the distance is at 30 cm it's down to4 and they even have a different uh value for white and gray when it gets towards the end where's my formula where's my formula no formula no formula well one would have to create their own if they wanted it to be uh fairly precise and it all depends on how it's manufactured so let's think about this if you were a uh an engineer and you wanted to characterize about what this curve would be do you think it would be safe just to say ah good enough let's just do this no or how would you go about determining what that curve is break it up in interval say that again break it up in intervals like measure at each all right maybe measure at a couple of distances so perhaps you can write a a uh small little lab View program to say all right I'm going to hold something 4 cm away now measure it now I'm going to hold something uh uh 10 cm away now measure it now I'm going to hold something 20 cm away now measure it and I'm going to hold something 30 cm away now measure it even if you're close for example you notice here is going to be your biggest uh slope even that's a better approximation than this entire slope right here from one point to the other you can even go halfway in the middle and you get something a lot better than than just a single straight line now let's say you are writing a software program to say how far am I what do you think you would be doing in software to measure so what I would like you to do is break up between you and one other person sitting next to you and write a your choice write a c set of C code do an algorithm just give me steps of what you would do in English and just let me know what do you think you would have to do to be able to identify where that is keeping in mind that hey remember what this [Music] is I show this you can pause all right we are back and the uh the common response to me was holy cow I don't know what to do so um let me tell you or let me give you one idea of what I would do multiply number one it it comes in two steps eight first I would sample measure actually there's a couple things you can do I'll give you one idea I would sample measure several points and then I would do a curve fit equation and I believe Microsoft Excel will do that for you right it will give you an equation that you can use so the aspect of this will be to create a couple of points and then you could feed those points into Excel and get out your formula since this is a uh second order right so it's going to be ax2 + BX + C right M something of that order then the second step is to program the following algorithm we assume that this is done measure a to [Music] d value use for to uh determine distance that's it and if you are doing this you something likea what we use exactly what we wrote is it exactly what you wrote pretty much all right there you go wasn't that hard was it well you guys trying to make things way too hard don't you when you do the curve fit after that um I thought you say how do you get distance you know your voltage value but you don't necessarily know distance thats to well that's what you have to use this best fit to determine because each one of these points you're supplying the X right and you're trying to find the Y got it we all right there is another one option two yeah can you do the second part of that by just assuming that you already know the the distance equation Vol to dist yeah you can do if you already know the distance equation build a database of voltage versus distance and what would you know what the voltage is well let's say we have an a TOD converter which is going to be 8 Bits so you're going to have a table when the voltage that you're measuring is 00000000 0 0 0 then your distance is going to be let's see what we're saying here 4 or we can actually ignore a lot of the stuff Let's see we said the maximum was going to be 2.5 or the minimum was going to be 0.4 so whatever you figure it out somewhere along here you're going to say something like 0000 uh 1 000000 0 and you expect the distance of this is going to be uh 30 actually we'll say 300 all right that's 300 well met Mill and then maybe 0011 00001 is going to be 32 millime and you'll keep on going somewhere and when you get closer to what a little bit over 2.5 maybe 1 0 1 0 0 is going to be close to oops I went the wrong way it was would be 298 mm and then this is going to be close to uh 42 mm and then 1 0 0 1 0 1 could be 40 mm and that's a table or an array that you'll set up beforehand you'll actually uh embed that in your uh software just by creating an array and entering all these values everybody know how you would do that how would you create the create the array no do I need to put that out there good sure all right so you would say something like uh um this array can you move it if we have 800 I'm sorry if we have 2 to the e that's how many different values 256 2 e is what 256 equal to in fact here curly if I'm going to do c I'm going to say I'm make this in dis array 0 0 Z am I doing this right or do I have to say how big it is first I forget I think I do have to say 256 mhm then you can equal in curly braet or anything you want to know we go 0 0 0 0 0 because all the first values are worthless right because the first values are worthless because if we look at this the value could never be that's not possible or it's not worth it and then eventually you'll get into the value 300 298 296 it'll keep on going then you'll reach 4 2 40 40 and then you'll probably go back to 0 0 0 0 until you get to uh a total of uh 256 of these values and then when you actually use it somewhere again using C you'll say uh um something like um what did I say in this one measure a is equal to ADC Port zero for example if we hooked it up to the Port Port zero of the ad converter and then you would say uh distance is equal to uh this array look easy enough so again that was option one and option two and I think I've kind of beat this to death so let me go on any questions before we go on anybody scared yeah yeah I tell you what let's take a break all right we are now done with a to d and I want to move off into another area that's more digitally based and that is rangef finding using something like ultrasonic so let's think of Nature and let's say we have Batman or just play Old bat let's see if we can get this right does that look pretty good that is a nice looking bat all right you're familiar with what a bat does to collect its food insects stuff like that it flies around in a wicked pattern and it actually sends out sounds an ultrasonic sound and if there is a insect out there you are tough Crow all right I do have to admit no I have never been an artist and I have never played one on TV don't dolphins do the same thing say that again don't dolphins I yeah they do all right water but I don't mess with dolphins so I don't mess with bats either well also the same concept well if you think about dolphins dolphin the medium is uh water and in fact water is a very good conductor of sound wav extremely good conductor of ways a lot faster than uh than Air 35 times faster Le that Scuba ah 35 times faster than air but uh I believe that sound will dissipate faster in water than air correct so your range is a lot better in air than it is water yeah I think you might be right yeah because basically a soundwave is uh is uh moving energy that is compress so obviously if you're compressing a lot of water a lot of density it's it's anyhow going on so imagine this what is the speed of sound somethinge yeah it changes with temperature altitude all sorts of things and let's say a nice rough estimate is 330 m/ second yes cuz that's about the ranges that we're going to be working with I think if you go online you can actually poke it into some sort of calculator and at sea level it's 336 m/s and stuff like that so so if a uh uh if a bat sends out a chirp and 1 second later it gets a response back from that chirp how far away is that [Music] insect so 1 second will travel a total of 330 m/ second keeping in mind that it has to go there and back so that means it will be 165 M away correct so if we have a wheel vehicle and we have a ultrasonic sensor on this and you have a wall and it is sending its chirp to you or to it and then it's getting a response back if it takes 0.1 seconds from the chirp to get the response how far away is it all right it is 16.5 M away right that's sitting still right that is if it's sitting still that so you never know if a quiz question may show up that asks you if the vehicle is traveling at a certain speed what will be and and and at uh and when it sends its chur well fact here let's see if you guys could figure this out yeah we got plenty of time problem if a vehicle with ultrasound sends a chirp chir ping whatever you want to call it I'll just call it a ping that's nice in our world we can see what you WR oh that would be nice p is moving at 1 m a second and a stationary object is 30 m away how long will it take for the chirp to be reflected back is it 30 m when it sends it or when it gets it back 30 m when it sends it so the actually only 29 me say that again so it is 30 m away when it sends the pain how long will it take until it uh it gets the chirp back so what I would like you to do is uh since you are wonderful uh uh seniors and graduate students this is another example of problem solving tell me how you solve the problem and tell me what the answer is we'll take a a break and let you figure that out all right this is now a uh uh continuation of uh the lecture where we were looking at this following problem if a vehicle using ultrasound sends a chirp is moving stationary object 30 m away how long will it take for the chirp to be reflected back so what this uh what this is is a simple physics problem constant velocity so we don't have to worry about any any derivatives so let's take a look and let's set up the problem we know for a fact that if this vehicle is here there's my ultrasound and it is 30 m away we are pretty sure we'll know how long it will take for that to uh be transmitted correct and that will be what need speed light 30 m and we divide that by 333 m/s and that's a time in One Direction and so the answer is going to be 0.09 090909 I think that's enough significant digits seconds now I guess one question could be how far did it travel did the vehicle travel in that time and so that's a fairly easy assumption to make because at the one point where the wave hits this point point we know that it took 0.09 090909 seconds and we know our velocity is going to be of this vehicle is 1 m per second so our total time is going to be our distance I should say is going to be 9 0 09 09 09 09 M now we need to look at the next part of the problem where we have the wave the sound wave and is going to be reflected back and at the same time the vehicle is traveling it's traveling so fast it's above ground and I guess one one thing I made it a little bit too complicated is what sort of problem is this like two trains two trains exactly train a travels in One Direction train B travels in another Direction how long does it take so to digress a little bit let's think about that so if uh if train a travels in this direction at a speed of 50 km per hour and train B can't see travels in this direction at 50 km per hour and the whole idea is that you have train a going this way train B going this way and the distance is 100 m I'm sorry kilm just by investigation you can easily see that how long will it take for one train to get from this point to this point 2 hours so our formula here is going to be the velocity of a time t plus the velocity of B * T is going to be equal to our our distance in this case velocity is going to be 50 km per hour time T hours plus our velocity of B again 50 km per hour our time T hours which is going to be obviously 100 T this is 100 kilm time t or t is equal to oops no that's time T and distance over here 100 which we know is 100 sorry so obviously T is going to be 1 hour so with that in in uh en Force everybody got that so then we'll look back at our problem where we say we have this vehicle and it's still traveling at this direction at 1 m per second second we have the wave traveling back this way at 330 m/s so the setup for our problem is going to be such that in the distance that it's traveling in that time 29 90999 I believe that's correct right pardon me I'm confused well that's because it's this is just uh 30 minus 0.099 09 09 so our problem turns out to be 29.
[Music] 99991 is equal to t plus 330t see which is is equal to 331 T which is equal to T is equal to um 0.09 03 598 seconds and that's how much time it takes to go back this is the returned time so obviously the total time is equal to the um um the first transmit plus the return which is equal [Music] to 0.09 0909 09 seconds Plus 0.093 5 9 8 seconds which is 0.181 1269 seconds would be nice if I actually set this up in a fairly decent way so I didn't have so many decimals for the demonstration but I neglected to do that sorry so just to solidify if this to make sure that everybody can follow I'm going to do the following example as well and ask you to solve this so the example an auto an automobile travels at 100 kilm per hour Pard me speed what is 100 km per hour 60 M hour about 62 m hour right yeah maybe I drive 62 all the time on interstate highway so assume an ultrasound system for the vehicle can identify a deer in the [Music] road at 500 M how fast can the car be going while it hits the beer with an acceleration of what's what's the BR the car what speed will you hit the deer now um how much time does this give I don't even say how much time how much distance that's even easier does this give the driver two avoid the deer to avoid the deer how much distance does that give the driver to avoid the deer driver or automated system how much distance yes 500 M pardon me it's not that 500 me by the time the signal comes back and identifies all right so in pairs this is very similar to a problem I might give you on a test so spend a couple of minutes with somebody uh sitting next to you and uh let's take a look at the solution you never know this might even show up on a quiz all right so we will uh do the quick solution for this one thing first off is uh the speed of 100 km per hour a lot is 100,000 m per hour and don't forget uh there are uh one hour 3600 oops y That's Right seconds so the answer to this is 27.7 I think you said yeah meters per second this is the car velocity so again with the vehicle that's my sports car I think looks fast it's Bing not drawn scale not drawn no this is well I guess it's closer to a uh a deer or a moose that might be like it looks like a small sports car though yeah that's my Miata right of that okay so ding yeah you need so again we have 500 M here and the speed that we're running is or the speed of sound in this direction is going to be 330 me per second what you got do is the time there and so how long does it take to get there 1.5 1.55 1.5s by the way in that time 1.55 seconds the car moves 27.7 m/s it's uh multiplying by 1.51 15 seconds so the car moves 42875 m 40 40 or 42 42 2875 075 0875 me so now we have to worry about the reflection and again it's the same problem as we've seen before 27.7 m/ second something is coming at it at uh um 330 m/s our distance is going to be equal to well our distance was uh what is this um 4 and 57 oh I don't want to go 9125 91 2 meal to 27.7 m/ Second plus 330 m/ second by the way that's also mult iped by some T seconds so in the end doing all the work T is equal to you don't need T distance we got to calculate the time first what is T 1.38 7 1.38 I got 1.3 second part for the second part yeah yeah 1.38 7 yeah but I was 79 so 1.28 I got 1.28 28 or 38 2 2 and so the distance the car travels9 [Applause] during the 1.28 seconds time 27.7 m/s is equal to 3546 so our distance away now 500 minus number s close enough say it again would it just be 47.91 35 I'm I'm doing the total distance okay 42.08 75- said to be 22 say again 422 I got 419 all right here's a question this be like at night cuz wouldn't you see the deer otherwise the answer is yes what's the whole reason for this this is an automatic avoidance system where a person is not actually driving the car that's why I said 500 m00 me for the car to be able to recognize that there that there is a you driver all right the automated driver of the system who uses sound instead of Lights to detect an object in the way so of course if we're worrying about uh if we're doing this with lar or some sort of light based mechanism it's going to be a lot faster right so what does this tell you about ultrasound slow it's relatively slow and in fact one of the other problems with this is that uh um ultrasound doesn't work all that well at Great distances because it's a sound wave and it dissipates a lot faster than light so perhaps to uh be able to avoid uh obstacles you will want to concentrate on uh something that is light based all right so let's take a look at some other details associated with ultrasound there are two ways that you you can communicate with ultrasound or that I should say that you can control with [Applause] ultrasound what of Technology do police officers us in their radar uh radar not use lar uh they use they've got laser they have laser now so it's a very similar concept with that uh one one thing the question was would do police use for uh speed detection one is radar which is um very similar to Ultrasound right but um another mechanism that they use is uh a liar based or laser based mechanism and the nice thing about or at least with their tool is that their beam is extremely narrow as opposed to your typical liar where you're at 60° this is bizarre stop here we go as opposed to your typical uh uh liar which is uh 60° or 120° or maybe even a little bit wider where you're making a big sweep and in the lar when you're making that big sweep you're actually limited by the um the speed of the mechanism that points the laser unless you have one of the Technologies where you're shooting out more than one beam of light some of the more industrial types of Lars like the sik lar sik is a uh siik is a German company they uh they have lots of implemented uh devices out in the uh out of the workplace specifically in manufacturing floors for obstacle avoidance um you could run a forklift into these things and they won't break because they solid steel and and the plastic lens is is bulletproof almost but if you start getting into the technologies that will be inexpensive for us hey that might be a nice topic that somebody wants to look at for the uh for homework assignment number four um then you'll have uh something that may have multiple pixels being sent out and recorded at the same time same time and that's where you get your uh your speed on that but for police they're probably just doing a couple of points and being able to do the triangulation on that my second question is is there any way of like effectively they get yeah it's a Jammer and it's actually cheaper than uh like than radar detectors because they're 100% illegal but they go under your hood and they have they have four points on it so like there's a Ka 60 which is like the best one and there's four points on that and it's just front and sides and then back and so no matter what they shoot you can program what they get back so like uh you're going like 200 M hour like just getting it and they shoot it and no matter what it would say 35 back you know what I wanted that the video okay going feel free to you talk to him during break how about that oh I don't know where to go now with this oh I I know where I was going to say to control ultrasound there are two ways to do this one is to give it a pulse and at the pulse there is the mechanism in the uh uh ultrasound device by the way typically it's one is a transmitter and one is a receiver this is from the front from the side it's uh they look like small aluminum cans when the pulse when the rising edge of the pulse is sent some simple circuitry here Will actually send out the single chirp then after a certain amount of time this other part of the can will actually detect a certain amount of energy a large amount of energy and when it detects that it will actually it will put a edge out there which means that you have the following circuitry you have some sort of CPU which is going to be connected to your uh to your ultrasound and both of these are going to send pulses so that means that the voltage on those need to be tied down so you need to have some sort of pull down resistor on that connection and the software has to be available in here to either poll or work with an interrupt to be able to detect this pulse that comes back so as you can imagine how are you going to determine how far away something is all right the difference size or magnitude magnitude magnitude oh I should say that these are the same size okay same voltage this is going to be Zer volts this is going to be let's say 5 volts time it's going to be there's going to be a certain amount of time delta T that is going to be represented by when the CPU puts the pulse out there and when the device returns and says I heard something now what you have to keep in mind is that with a typical ultrasound device if you're setting a pulse in I I'll even make this simple if we're setting a pulse towards this flat screen you're going to get a nice reflection back of just the screen there will be some other noise or some other sound that might come back from from this bucket I might empty bucket or I might get a sound reflection back from from this chair as well but the most energy is going to be reflected back from the screen the same will be true with identifying a deer there will be a lot of uh um noise out there from the road but again some of the reflection is such that if uh if I were to send out a signal from here that way it's going to reflect off the tabletop and go where back towards you hardly anything towards you most of it is just going to bounce off the surface and what happens if something reflects off a surface kind of changes phase too doesn't it but in any case when it reflects back off that wall which is probably the biggest amount of energy that will be reflected back that will be my my pulse the uh important aspect to think about this is when you're making a a uh when you're sending out a signal or sending out uh uh noise it actually has a that's the best way to put it a nice sweet spot or what we call a beam pattern so let's take an example this is from the srf 10 and this is a pretty readily available device and so what it is saying is that if this is the center of your transmission and you're sending it out it does a good job of detecting devices or other things in its way between this these angles here which look to be about a nice 120° field of vision and then its distance it looks to be about 30 and I think this is 30 cm it's just meters let me look minimum range 3 it's probably me yeah so this is 30 m away it says max range over there is 6 M okay then 6 M so this uh I guess these just mean energy so this will be 6 m is uh is your maximum range and what is that also tell you with respect to oh is another aspect of this what happens if I have an obstacle here in my beam and an obstacle up here what will it give you data back on the closest one because it's the first one that will encounter and send it back so that's one that's one uh disadvantage of an ultrasonic uh sensor is that it will only give you one value infrared will do the same thing so how do you think you would use that to your advantage or or now that you have that disadvantage that you have this big wide range how can you design your robotic system to uh get a better idea of all the obstacles that are out there say it again move the sensor all right move a sensor how do you move a sensor all right what have you seen on the uh on the uh what do you call that Servo motor the servo motor on the uh Danny definitely don't do it like that got two car CES car and what else could you do if you didn't if you weren't constrained by this uh map sensor map it have it sit scan 360 and then map do some mapping all right or instead of having a beam that's 120° get something that's a lot narrower and they have other devices if we were to look up the srf1 beam pattern versus uh some other ones always in Google oh look at that hit my nice little thing here let's look at an srf uh 06 sure we and you probably see have seen this before right in fact this is I believe what it is that we're using so in this case maybe this is a nicer one to use because wow that's like 15° and where which I'm going to see which one that is coming up so this this is the beam pattern for the srf 4 and 5 as opposed to this one which is the srf 235 so the uh the advantage of that is you've got a lot better um a lot better range now notice here Communications what is that digital serial i s c well one thing I want to point out is that here I showed one example of how you can do communication another one is literally to do seral like v9 and stuff like that and in particular you have different types of uh um different types of protocol that are available one in particular is called i c in which you have three wires and this is your CPU and this is your sensor and between the two you don't just do one of these signals you actually send bites and in this case the sensor is actually intelligent it has its own CPU as well so it does the same concept that sends a signal out when you tell it to you send it a bite to say go sense it'll then send a signal out it'll receive the signal back and then it'll return to you the actual value of centimet that it measure actually I think some of these might send back millimeters I'll have to look at that but instead of you having to do the calculation for time it does the calculation for you don't the pulse one anymore say it again we don't need the pulse one anymore and you don't need the pulse one anymore but that means that you need a microprocessor or a microcontroller that actually will be able to do iqu c Communications so that is it for my uh for some initial discussion on this let's take a quick break cuz I see some people mapping and uh we'll come back in about uh five let's say 10 minutes all right so there is another concept associated with the ultrasound where when you have this is going to be one big long class you know that where when you have a pulse sent by the CPU and the maximum distance would have been a pulse here but it didn't come because there was nothing in the way so you have your uh your vehicle we're looking down at uh at our our vehicle and here's a sensor and its range says yeah I can see out here and there's absolutely nothing in there so you expect at the max range that you will get some sort of signal back because it would have detected something in there so what these devices will do is they have a little bit of smarts in them too after something that's a quite a bit of time they'll actually will respond with a pulse and what that's is telling you is that yes I'm still alive in other words you know sometimes you don't know if the sensor went offline if it's if you're not getting a response back from it at all so it responds back to you and says yes I received your pulse I sent the ultrasonic sound I I heard nothing back and that will be an acknowledgement pulse that should be Way Beyond what the maximum range of that rated uh sensor is so in this case if you said uh the sensor would come back in a signal and this would recognize 6 M maybe this is the time that would be equivalent to 12 M and your software has to be smart enough to know not to accept that as a distance because it it goes Way Beyond what the uh what the range is of that ultrasonic device in other words you have to write smart code shouldn't be that hard but you'll never know when you have a need for on your uh your sensor device or I should say in your uh in your robot something that has a range like this and something that would have a range like this and you could Orient them such that you can see things that if there were an object here it would only be seen in one of the uh beams if something was here it would be seen in both if something were here it would only be SE seen in this one and this will uh this configuration to at least identify a rough location so if you're objective was to create one of these little vehicles that would follow someone have we done that in this class you did it with Lego right and how did you do it did it move around um yeah it what it did was um it sensed if there's nothing then it turns 90° and sens there you go so what you did is very similar to this with one sensor if you had two you could have fired one and fired another and actually instead of Po pointing them both forward he just point them off a little to the side and some of the beam will overlap again this is sound so what happens if you do both at the exact same time right you might have too much noise out there that one transmitter here will actually be picked up by this this uh transmitter receiver over here so you have to make sure that you are um only doing one ultrasound at a time and I think I mentioned this the way to fix that would be maybe having two two different ultrasounds with two different frequencies right and I believe this is everything I wanted to talk about with respect well no I will do one one more thing what it and that is in this situation if we set our exceeded range signal was received after 75 milliseconds what is the um max frequency of a ultrasound system sensor system that find that sees nothing so how often is that ultrasound system sending once every 75 Mill seconds correct so the frequency is frequency is equal to 1 over 0.075 seconds 13.3 13.3 seconds or 13.3 Herz would be the frequency all right that is it for infrared and ultrasound thank you very much [Music]
Up Next

Micromouse PID Control: Lecture 3 Tutorial for Maze Navigation
@UCLAIEEE
1.3K views•2023-11-12

MathWorks Virtual RoboSub Simulation Environment | Webinar 2026
@RoboNationInc
209 views•2026-03-10

How to Build a Self-Balancing Robot: Arduino Nano & MPU6050
@easytechzones
16.8K views•2022-03-09

Micromouse: The Fastest Maze-Solving Robots on Earth
@veritasium
23.5M views•2023-05-24
Related Study Plans & Knowledge Roadmaps
Structured learning paths in Robotics


































