#40 Ultrasonic Distance Sensors Arduino Tutorial and Comparison for HC-SR04, HY-SRF05, US-015
Вставка
- Опубліковано 5 лип 2024
- In this video I test three ultrasonic sensors for distance accuracy and opening angle. I also show how to use them in one pin and two pin configurations and I introduce a three sensor set-up for autonomous robots. I use an Arduino Leonardo to transfer the results to Excel.
The video how to transfer data from Arduino to Excel: • #9 Arduino Data Logger... - Наука та технологія
Andreas, this was a very informative video. Thank you for all of the details you gathered and presented.
You are welcome
It's interesting how much you have changed I regard how more energetic you sound nowadays.
Makes me appreciate your energy you are giving into your videos as I know how hard it is to give it that much. 😁
Thank you. More than 400 videos should provide some experience ;-)
Great vid Andreas. I fully agree with metric being the logical system. Thanks for the share you saved me from buying more sensors as i hoped they would be better than what i have.
This is good for me. I like that.
Thank your for research too much! I was looking for difference between these sensors and possibility to connect trigger and output pins together. I'm very happy to find all I need in your useful video!
Greeting from Russia!
You are welcome!
Thank you very much for the excellent description in the video.
You are welcome!
This video saved me when I was in college.
Thank you for this informative video
Glad it was helpful!
Excellent analysis! Great job. Thank you I learned a lot from that 😁
Glad it was helpful!
Thanks for sharing your results. As always , you are very methodical and practical in your steps to the goal :-)
You are welcome!
Thanks so much for sharing all your research, it has helped me a lot! viele Grüsse aus Holland :)
It is my pleasure to share. In return I get nice comments like yours!
Im looking to make a radar detection device but i'm having a hard time finding the ultrasonic sensor with the longest range and the most stable and precise. I'd like it to be able to detect up to 10-15 feet (3-4 meters). I'm actually very new to arduino mechanics so it would be awesome to get some help.
@@AndreasSpiessi need help you can subcrib mee
Thank you for great video Andreas! I've learned a lot from it.
Thanks!
This video helped me with my arduino projects, Thanks!
:-)
Manny thanks for sharing this very useful information, keep up the good work.
You're welcome!
Super Video & Erklärung ! Danke !
Thank you for your research and data , it has helped me a lot too
Glad it was helpful!
Thank you sir..information provided here by you is really quite useful..:):)
:-)
Thank you for this very interesting video.
You are welcome!
I love your videos!
:-)
Excellent video and a great jab at the American system of measurement! Legit LOL.
+Jon Raymond Was not planned to be a jab. It is just the truth. I am relly struggling all the time wih this system!
Awesome my friend. Thank you.
Cool very clear explanation.
Thanks
I liked the feet/inch reference to Americans measuring system:)
+Cristi Istrate Thanks!
Awesome stuff keep it up...
Thank you!
Love u so much for your information brother
:-)
Great video, thanks! :)
:-)
Andreas Spiess gv
"For these sensors... I'm like a stealth bomber" - Legend! :D
:-)
That was some exercise! Thank you so much for sharing this. You've won yourself a fan :-)
Would it be possible to include the UC-026 in your test?
I have no future plans for such a test :-(
Thank you!
That´s great! Thanks!
You are welcome!
I'm pretty new to Arduino et al. From what I've found, I can get good results with just one sensor sat atop a servo motor - in conjunction with a real time clock module (probably overkill lol), I can call a function to 'look' and left and right of the 'bot, and nudge it left or right accordingly at regular intervals. It still has an IR sensor at the front to avoid walls just in case it's 'sweeping' at that particular moment.
This is too slow for a fast moving robot.
Can you have a single transmitter beam being reflected by a spinning mirror and a circle of receivers on the robot, and using the position of the mirror work where things are.
I do not know if this works with sound. For sure, it works with light (video#119).
Which one is safe to use for motion detection in home environment. PIR or Microwave or Dual Technology (PIR + Ultrasonic sonar sensor)
Hello Andeas, in one of your interesting clips you mentioned a push button with a built in led. Who is the vendor of this item?
Great Video
Can you please explain how to combine the PIR and Sonar sensor, or please provide any link from where I can buy a dual technology motion detection switch
Usually we build our own stuff on this channel. So I do not know of a ready made product
Andreas, Thank you so much for doing all this research. I'm currently working on an interactive display system for a photographer. Big prints of photos should light up as a person comes close to them. The problem I encountered was that the HC-SR04 works well up to a small distance of 30-40cm but I need to detect a person approaching the sensor at about 100-150cm. Do you have any advice how to solve this problem?
Thanks again!
Usually it works ok up to 4 meters. But you have a parameter which limits the distance. Maybe you set this parameter wrong (MAX_DISTANCE in new ping library)
this video is really very precious!! Thank you very much.. I have a question for you. Which of these sensors do you recommend to use in maze-solving robots? And do you have any other sensor suggestions
I do not know anything about maze solving. I would write down the requirements and search in the data sheets for the right sensor.
@@AndreasSpiess ua-cam.com/video/sKFIBQ64_zs/v-deo.html
Actually I want to make a high-speed robot just like in this video. I wonder which sensor can react so well
I assume they use the sensors I used.
Hi Andreas. I've been trying to work out the situation with voltage on the SR-04's. I've only used them with arduino 5v logic level and power before. But what about in ESP32 land? It looks like from your scope shown earlier in the video, if that is from the SR-04, I count ~2.5 divisions and see you have it set to 2v/division. So 5v in, 5v out? Will it work if power is 3.3v from the ESP32? I've seen potentially dubious looking examples online but struggled to find anything concrete about the how best to use the SR-04 with 3.3v logic level (and alas don't have a scope - although come to think of it I could maybe check with an arduino analogue in...)
Ah found the other videos also the data sheet(could have sworn I couldn't find it before). For 3.3v level shifter needed unless using P (plus +) version
A small correction... at 0:59 you call the transmitter a transceiver .... a transceiver is when the transmitter and receiver is build into one unit
Thanks for the correction.
I know you know the difference.. And this is a bit grammar nazi.. But this video is seen by a lot of people and getting the terms correct is important.. Besides if I were you, it would annoy me to have a video uploaded with small error like this when I know the difference (and I'm sure you do to)
If these small things would annoy me, I think, would be a very unhappy man ;-)
This was a very informative video. Thank you.
Two questions if I may. Do you believe it is possible to use a thermal / temperature sensor, connected to a arduino board, which makes the calculations that impact the speed of sound, which can then be used as a reference point of what the sensor distance actually is? I'm not sure if Arduino has the memory capacity to carry out the calculations and ultrasonic sensor calculations.
You have also clearly illustrated the angle limits of the ultrasonic sensor models used. This creates a problem for my project and I'm glad I came across your video. I might have to go back to square one on my flood detection alarm using an ultrasonic sensor that will have to detect water that can not be measured directly forward because of the space constraints of where the water is.
Measuring temperature is an easy task for an Arduino.
Yes, I am aware of this. I am referring using the temperature sensor that collects its results that can then be used in combination with an ultrasonic sensor which has multiple answers based on temperature 'results'
I am no specialist. But I assume that there is a formula for the influence of temperature on speed of sound. It should be possible to program the formula or at least an approximation into an Arduino
Hello Andreas. Thank you very much for your video. Now we also have RCWL-1670 ultra low power sensor. Would you happen to have the link to the manufacturer's website for this new RCWL sensor or it's datasheet?
I cannot post links here. icstation.com has a good description, for example
Merci :-)
Tks a lot for your videos, it is really good. additional to this could confirm me if it is possible connect 3 distance sensor (us-15) at same time in arduino lilypad?
I think I once did a video about it. It is possible.
I cannot find the link to the video where you explain how to collect the data in Excel. Could you please (re)post its link? Thank you very much for these great tests and the video.
I just entered "Excel" in the search of my videos ;-) ua-cam.com/video/AgJegJ30Pj4/v-deo.html
Impressive research! However can you explain in more detail the repeatability of measurements per sensor? By that I mean performing repeated measurements done over identical distances and verifying their deviation from mean (I am not talking accuracy). The HC-SR04 has a bad reputation in that regard (ref. various fora and issues reported with unstable measurements in halfway range, locking of transducer when "out of range", spurious large measurement errors,..).
Do you have any informaation from your measurements that would concur with this issue? Or would you describe this to probable software errors?
Also the US-100 sensor is an option: how do/would you rate that sensor compared to the US-015?
I only did the research presented in the video and I do not own a US-100. So, I never tried this one. I used mine on my robot. So, accuracy was not so important and I had more problems with non-even reflection surfaces. Because, if the surface does not reflect the sound back, you get no measurement and the robot drives on...
Is the us 015 sensor usable on raspberry pi? I am using on my project, but have a huge distance which is not right
I do not think because Linus systems are not good at real-time computing. Maybe the US-100 would work because it offers a serial connection
this is super nice video fucking love it!!
Thank you!
Hai
I want to use cheap HC sr04 for overhead water tank level monitoring.
To protect pcb from environment and moisture I wish to do potting with epoxy leaving sensors open.
But being sensors are also subject to high moisture , I wish to introduce ultrasonic admitting thin plastic films like ohp sheet separately for tx and rx.
Will it work?
How much the range decreases ,,,,,?
Please share your experiences
Thanks and regards
There is a project I would like to try that uses the 3 pin parallax sensor. Sounds like you are saying you could use that code and simply connect the trigger to the receiver as in 9:21 and it would operate somewhat similar to the 3 pin parallax ?
I do not know these sensors. But I checked their homepage and they have lots of documentation. I am sure you find the answer there.
@@AndreasSpiess Timing would apparently be the difference. I'll be comparing that.
Hello Ing.
Digging here and there I found something rather interesting, and maybe I can even upload an image.(...i can't in here...)
However, what I found in a discussion of ultrasonic sensors is that the on-board controller only "listens" to the first incoming echo while cutting others.
In your video I see that when you take the measurement test using plexiglass, the maximum distance you reach is about 4 meters, right where you have a tree by your side.
It could be that, just the echo of the tree, has blocked the measurement, as the sensor cannot "follow" the moving objects, but only the first echo that it hears coming back.
Don't you think it could be interesting to redo the measurement in an open field?
BTW,thanks a lot for your videos,always well done and interesting for me.
You can try it in an open field, but will not get much more than 4 meters range. And you are right, the measurement always takes the closest point. Which is ok for most of my applications.
Hello Andreas.
Why don't you separate a tx, put it on a pcb face up with a cone above it and the apex of the cone towards the tx (cone with a 90 ° angle) and, on the same pcb, don't put 4 or 8 rx all around the tx that look outwards (trans on axis y and receivers on axis x arranged at 360 °)?
Also you can amplificate the tx signal to improove the distance of the detection.
What do you think?
You would have to synchronize the receivers exactly with the TX. Otherwise, you would get bad readings. But it should be possible.
Andreas Spiess definitely needs to be synchronized everything, but what I said is just a general idea, the angle of the cone depends directly on the angle of emission of the transmitter, etc etc etc.
Andreas, I need a sensor to detect moving vehicles on a highway in front of my house (to count them). I need a range of 15 feet (from the sensor to close lane) to 25 feet,,almost 8 meters, (to get far lane traffic). I've tried 2 lidars, a couple ultrasonic (SRF04 and SRF08). The latter was supposed to be good to 11 metres, but I can't get it to detect >1.5 metres. I'm considering microwave and I do have a Doppler receiver device. Is this a good option? I just need a detection at this point, not speed, which I'll add later. Unit has to operate in bright sunlight so likely any lidar or IR is out, as I've found.
Doppler radars are used for that purpose. But you have to select one which complies with your distance needs. These are not cheap.
I ordered a few more hc-sr04 sensors, but they have "blind spots" in the cone of detection. I looked at the metal cone behind the mesh grill. The bad ones have a rough metal cone inside. The really bad ones have a rough cone on both the receiver and emitter. I don't know if the rough cone is the problem. Anyone know?
I do not know. Mine have shiny cones.
Great videos!, all ur Videos are great! Can you make a Video about ,,indoor GPS" (trigonomie location) (I work on a Projekt to navigate indor a cleaning Robot effecly not random moves detecting a wall ore something). maybe other systems too (ultraschall (dont know english word yet :), Cam opencv, optical, ir ect)) and whats the best system if a table in the Middle of the Room (The target is to use the Robot to clean our Hackerspace in Bremen (Germany))
+Daniel Stingl The only thing which is on my project list is a lidar with a TOF sensor. I recently did a video about the sensor itself.
Hi Andreas, just a question ... i have 4 x HC-SR04's connected to an Arduino Pro Mini 328 5V 16MHz. I'm reading distances and convert it to Mavlink signals for (future) object avoidance on my drone.I noticed that 2 of the HC-SR04's had huge spikes ..0-134 and measured value.. I tried a lot of things to get the measurement stable. As a last option i set the 3 wire option in the NewPing to False...this was the solver of my problem , super stable measurement now on all four ..but now the question ?..how can this cause the problem i HAD in your opinion ?.
I do not know. The only thing I can imagine is that they receive the sound of other sensors if fired nearly at the same time.
Thanks. Your videos are always unique. One question : I see most of the robots have UltraSonic sensor mounted on a stepper motor and they scan field for 0 to 180. Any thoughts about this setup. Please let me know.
+Venkatesh E Thank you for your compliment. This is exactly, what I want: To provede a unique twist.
Now to your question: It will be anwered in depth in the next video. Here the short answer: Servos do not work if you want to move fast as my robot. You have to react in miliseconds. You will see, I had even to build a sub-system using an ATtiny85 to get the speed I wanted.
In the future we might get LIDAR systems based on lasers like Googles car which somehow work like a servos, but much faster. Currently, they are still very expensive.
waiting for more videos.. keep posting..thank you.
+Andreas Spiess a surface mirror mounted in the flat section of a output shaft of a galvanometer could move fats enough , and you could apply a wave form to it to produce a sweep . You can see them used to direct beams for laser light show patterns . not sure if one could use the same reflector to measure the reflected light on almost same beam path .
Great video as ever man .
+XerotoLabs Interesting idea. I have a galvanometer lying aroud and waiting for test. So far, I did only think of the laser show. I will check your idea as soon as I start to play around with it.
The only problem then is, that a normal laser is not able to measure distance. I still did not find a sensor of a cheep laser range meter with a normal connection (I2C, serial). The ones I found were always more than 100$ plus shipping from the US, which adds another 30$ or so to the bill.
+Andreas Spiess if you shot a laser from a offset position , and surface mirror allowed a sensor to sweep a area , then you could use the defection angle of the mirror that returns the brightest spot to calculate distance . lets assume laser is brightest thing in view the farther from center the closer the target is . hmm now i need to draw that .
What if you attach ultrasonic sensor to the rotator and use it like a lidar? That would scan any wall. The communication to the microcontroller would have to be done over wireless (maybe 1m range BT).
These sensors are not very fast and the opening angle is big. Probably not a good solution.
Wonderful video, but it left two of my questions unanswered. When I get a bad reading from the HC-SR04, it seems to me that the distance sensed was always shorter than the real distance. I have been attributing this to ambient noise. So, questions:
1) Are these sensors indeed susceptible to ambient noise? And,..
2) Do they always err on the side of reading too short?
The solution to the problem that I am contemplating is to always do three readings in a row and then take the largest reading. Would that work? I know it will take longer to take three readings, but I figure that since the sensor is mounted on a servo the increased read-time should be negligible to the servo-movement time. Would this plan work?
These sensors do not measure. The timing is done by the Arduino. Speed of sound is not constant. It depends on the air pressure. So you maybe only gave to multiply your value by a correction factor. Loud ultrasonic ambient sound could harm the function. Never saw it, though.
@@AndreasSpiess Yes, I understand that, but for some reason, even though I keep calling the same routine to take a measurement and the distances being measured are out-of-range each time, every few readings I get "something is there" for one reading and then it goes back to "nothing is there." I am fiddling with a servo-mounted sensor on the front of a cheap smart car, and it keeps thinking an obstruction is there and reacting to it. I know a lot of things might cause this, from ambient noise to the cove of sensing touching the floor to just plain bad coding, I am trying to sort it out. Unfortunately I don't have much time to just sit and play with it, much of my Arduino time is taken up these days with work-oriented test fixtures, playing is a side-line. :)
A typical thing is also if not enough sound is reflected either because the target is soft or the angle of the target does not reflect the sound back to the sensor.
Hello Andreas, what sensor is better for Parking on the street, magnetometer sensor or ultrasonic sensor? Thank you for your response. Best regard. Congratulation for you work.
I do not know. I never tested magnetometers
Hi. Thanks for sharing. which sensor should I use for better accuracy for a short distance (eg 40 mm) abd 0° angle ???.
Maybe you use a TOF sensor for that purpose? I made a video about one
thank you for your answer, I'm waiting for your video
The video is already published. Jus search for TOF
ok, thanks
An interesting comparison, thanks for this upload. I purchased several HC-SR04 and set up the most simple program to measure distance. No matter which big, flat surface I use, no matter if the distance is 2m or 10cm, there is never a constant output of the distance values. Intermittently, incorrect readings come again and again, only individual ones but wrong ones. Is there any way to avoid this effect?
Maybe. I would look also at the wiring. And at the signal with an oscilloscope.
A viewer had similar issues and reported better results with the serial US-100 sensors.
Hi Andreas - great video!!! Can you recommend a sensor for measuring small changes in distance? Sensor distance from object: 25cm, smallest required change: 25microns. We would attach the sensor to a robot which positions a deposit gun. Idea is to monitor changes of coating thickness over time. Hg
I do not know of such precise sensors :-(
hello thank you for all your videos, how do you convert the cm in degree ?
+Amel Aitghezala I do not convert cm in degrees. Where
Thank you for answering me , actually i have to find the degree of opening angle and i would like to know how can I do it with excel ?
In my video #9
any chance you can share the info on those adapters you have used to connect those three sensors to the arduino???
thanks in advance
These are just dupont wires
thanks, how/what did you use to connect the trig+echo on to the arduino in one pin ???
just have a question, how would we be able to calculate the minimum distance reading or the resolution of this sensor?
I think you have to try it. Or read teh data sheet
nice video! My english is too bad to understand very well so which one is better ? US-015? I have to detect distance between people and a painting on the wall. Which sensor is the best? Because i have a HC SR04 and it gives me unstable values. How many sensors i have to combine to make a good people sensor ? And how i have to position them ? Thanks a lot!!
The differences between the sensors are small. So, if the SR04 does not work, the US-015 probably also will not work.
I cannot answer your question about your scenario, because I do not know, what you really want to achieve.
Hi Andreas, do you know of any ultrasonic sensor that works well with 3.3V source? My HC-SR04 becomes unstable below 3.7V
I did not try. The US-100 claims to start at 2.4 volt.
After posting this comment I found a new version of the HC-SR04 (HC-SR04P) that claims to support 3V-5.5V. I'll order a few and test them, they are cheaper than the US-100. Thanks!
That will depend on the angle, search up "refractive index" and "critical angle"
Can you do a short video on the oscilloscope set up?
+Glychee S I connected one channel to the trigger pin and the other to the echo pin or the pin at the transmitter (for the tone). Nothing special... Or did I miss something?
Ah i thought you had the oscilloscope itself do sme waveform generation and a special triggering. But that makes a lot of sense,thanks!
Hi, Can you also add your views on JSN-SR04T-2.0 + Blynk App, I am particulary interested in this because of its waterproof properties
I have no such plans. Maybe you google?
can make video characterizing JSN-SR04T water proof ultrasonic sensor?
I doubt that it will work under water
Thank you very much for sharing. Please Sir can I have the code for that car robot(with stepper motors) with 3 ultrasonic sensors? Please
I made videos about the robot and you find the link to the code there. Otherwise go directly to my GitHub page.
Can u give suggestion I need measure 3 meters ultrasonic sensor
Just do it
Are there any ultrasonic sensors that can listen for a ping without first sending one? I want to build a device that detects the ping from another sensor so I need it to be in a listening mode without first sending a ping. In short I'd like just a ultrasonic receiver.
I do not know of a ready-made module. Maybe it would be possible to change one of those (or use some parts) to create one
Andreas, onde encontro a biblioteca do SRF05?
+Neiva Berggrav All ultrasonic distance sensors use the same libraries
good day man, i have three ultrasonic sensors hc-sr04, i wanna make an evader obstacles with arduino one so i have decided to make a structure and to put the sensors like this:
(IOOI-IOOI-IOOI) to get the best coverage, so i wanna make is the following: the sensor of the middle will be emitting and receiver but the other two sensors will be receiver only, i made all ok, the connections, the trigg signal, the echo signal too, the vcc, i know that after trigg, it needs a delay. the middle sensor work exelent but the problem is the other two sensors, what do i must do with the trigg pin of the that two sensors?, already i connected it to gnd and dont work like this.
I do not know. But I think, you have to also trigger them (all three in parallel). Then, it might work. And if your senders emitted sounds interfere, you can put something in front of the two "passive sendes" or desolder them. This is, why
I assume, you know how to handle the three independent time measuring systems with arduino?
Did you check my video #42? There, I use 3 independent sensors.
thanks professor, i´m gonna see your video #42
do you know if there is any sensor to read distance around 10m for arduino?
I do not know one.
Yes. the best would be a LIDAR sensor. Google for low cost LIDAR. But lost cost thee 10M is about $50. For $150 you can get to 40M and for $2,500 out to at least 200M
There are also much beer ultras sensors priced at about $40 each that can do 10M. They are used for things like measuring water in big water tanks or even grain on silos
How to deal with erroneous readings that arise when the wall is at an angle?
I do not know how to deal with them because they are false results. Most of the time you will not get any readings in this situation because the sound is reflected in a different direction.
I hope that, because I have 3 different sensors, these are fewer. The next step would be a turning LIDAR which measures all angles.
but when you angle the sensors 20 degree from another then they shouldent detect each other? or am i wrong? Grüessi us de schwiz ;)
I did a sensor with 3 sensors for my robot. If you synchronize the three they work. But they can detect reflected sound from another. Because it is synchronized, it does not matter.
Or if you wait till the echo es back before you start the next.
We Americans who care to play with these kinds of gadgets are already using the metric system ;)
Good to know. Thanks!
Thank YOU for a great video!
3:43
believe me bro, metric calculation is so much common and better 😂😂
I agree!
hi how to set beam weight in ultrasonic sensor to avoid false output? tnx... :)
Ultrasonic behaves like sound. So, a funnel should work. But you also have to deal with reflexions which are hard to be controlled.
thnx...what is a funnel?
Just google with "pictures" and you see, how it looks
how many uv sensors are possible to connect in arduino UNO
+Shakthi Naren At least 8
Andreas Spiess
thank you sir
Go for meters, good!
:-)
Do these waves pass through water ?
+uttam arun I do not know
But I need for forward collision detection 800 meter to drive safe
If you want to make collision detection alarm, it's always best to use 3different frequency ultrasound sensor so that you can cover all the blindspot. After that you have to make PID controller which will analysis your input channel
Hi, at 9:39 you have mentioned that it is possible to use only 1 arduino pin for both trigger and echo pins on us-015. In my case i always getting 0cm :( I use NewPing library v1.8. Any ideas what i am doing wrong? Sketch from simple example playground.arduino.cc/Code/NewPing just replaced pin to same for both trigger and echo...
And one more question (of course if you have ideas on this :) ). I am trying to google how to trigger interrupt on some distance. Lets say, if sensor less that 10cm to obstacle, then trigger some function. If i adding this test simply in loop it consumes quite lot of time... I know that this should be possible, but... lack of experience and understanding how things works do its job ;)
1. Usually, it should work with just one pin. So, I do not know your problem. Does it work with the 2 pin configuration?
2. I think, you have to invest your time to understand the basic functions. This is maybe a good opportunity ;-)
Yep it works. The problem was in cheep chinesse sensor. One of two received sensors do not work at all :-) Sorry, i should remove my post after realized the real issue. Simply forgot :-(. Thanks for your tme!
No problem. Anyway, it is always good strategy to exchange part after part to find errors...
The main problem i am having is i need the ultrasonic sensor of range 10 meters maximum, no youtuber is replying😭😭, please reply
The cheap sensors do not offer such a range. Maybe you look at (more expensive) LIDAR sensors (also covered in a video)?
@@AndreasSpiess 👍.
Great video! Can you review the higher end ones? Like URM37 www.dfrobot.com/product-53.html it has temperature compensation for accurate measurements. Also Parallax sensor and Maxbotix sensors. It would be really interesting to compare the higher end models with those cheaper ones.
Thanks. I have no need for more precise devices. So I will not spend the extra money for a better quality. I am just a hobbyist. BTW. Some of the newer cheap ones seem also have temperature compensation, if I remember right.
The US-100 modules cost all of £2.12 at the moment (vs. £0.99 for HC-SR04 you tested). So either more than twice the price or basically the same cost, depending on whether you view it in relative or absolute terms :)
If you care about accuracy or repeatability at all then I would recommend using a US-100 in serial mode (in trigger/echo mode it is basically a HC-SR04 so not worth it). For a moving robot absolute accuracy might not matter of course, as long as you can spot an object is coming towards you.
See here: github.com/stoduk/PingSerial
your inches and feet hahaha true
:-)
In the US, we can handle imperial measurements or metric. We just choose to stay with imperial since we do not see any real advantage to us to switch to metric. Those here in the US who might have trouble with metric probably also have trouble with imperial. Some people have trouble walking and chewing gum at the same time. :)
You don't see any advantage to metric because you haven't used it. US is only one of two nations that still use imperial.
+Randy Meinert
Actually, I have used it. I'm an engineer and have used metric in certain things and imperial in others. It's not that big of a deal. There is nothing magical about the metric system. It's just another system where some arbitrary bases were chosen and units based them.
Your're right: nothing magical; any 'system' is a system. I use both too. But metric is everything pragmatic and easy: base 10, compatibility w/rest of world, easier to teach/learn, (ultimately) cost savings. In general, imperial is inferior because of its inconsistency and complexity (nobody expresses 1/64", they'll go to a base 10 decimal of .016)--though it is true that changing the measurement system of a nation is difficult and long. Canada did it successfully in the 70s. Jefferson tried to lobby for a 10" foot (base 10) because he was interacting w/scientists in France. Read more of pros and cons at www.us-metric.org/going-metric-pays-off/.
Hallo Andreas, auch hier einer mit dem swiss accent :)
Ich habe diesen (www.sparkfun.com/products/15171) Ultraschall-Sensor gekauft. Ich möchte diesen gerne mit I2C betreiben mit einem STM32F446RE Mikroprozessor. Leider habe ich die slave address noch nicht ausfindig machen können oder auch das abzurufende Register. Kannst du mir weiter helfen?
Hast du das Beispiel von Sparkfun versucht? github.com/ZIOCC/Zio-Qwiic-Ultrasonic-Distance-Sensor/blob/master/Arduino/Zio_Ultrasonic_Distance_Sensor_IIC_Test%20(1)/Zio_Ultrasonic_Distance_Sensor_IIC_Test.ino
as an american engineer. feet/inches is stupid... >.>
Good to know!
Merci :-)
+norm1124 Gern geschehen...