LESSON 20: Ultrasonic Sensor and LCD on Arduino for Distance Measurements

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Paul, you don't get enough appreciation for putting this series up, so thanks for that. I hope your students know how good of a teacher they have.

NearlyFromAfar
Автор

Hey Paul - many thanks for all the work you do and for making available to us!
I've found this lesson in your earlier series and it was just what I was looking for.
Successfully assembled and mistakes corrected but as a UK follower inches are of no real value to me.
Happy to report that I managed to get mine to measure and display in metres successfully and I've been really surprised at the accuracy displayed in relation to actual measurements.
Your presentations are superb, and as a retired Design and Technology teacher with 38 years in the classroom/workshop, I feel qualified to compliment you on your approach, knowledge and style of presentation - absolutely outstanding!!! 😎😁👍👍

smartisme
Автор

Paul, Thank you so much for your contribution. That cough is a little concerning though... Stay healthy

samloney
Автор

Eber, I really put these lessons together so students can learn to to write code. I show how to do it on the video, but think it is important for students to at least type in the code as I do on the video. Thanks, and hope you will give it a try following along with the video.

paulmcwhorter
Автор

you are an amazing teacher sir. I have watched most of your series and I really like the way you taught us.Thank you very much, sir:)

pranavreddy
Автор

thanks a lot, I was missing this line " lcd.print(" ");", and I have been looking for hours for a solution, and now I'm good, have a great day !!!

maramam
Автор

Awesome fun lesson Mr. Mcwhorter. You're right I could do this by myself(it would take longer) but that wouldn't be fun or thorough. I 100% agree with the comment below this one. I will try to watch and participate it all your videos thank you sir. People would pay for these lessons online or off.

erygion
Автор

All your tutorials are AMAZING! I'm always learning so much. :)

tabithakemunto
Автор

Thanks Paul, this was a very fun lesson.  I have been going through your lessons in order and have learned quite a bit.  Because of what I have learned from your lessons I was able to adapt this lesson to use the LCD with the 4 pin I2C  interface and get the results as desired.  Thanks again!

jamesdillon
Автор

Hello Paul.
I will try to explain what I am trying to accomplish....

I am trying to figure out how to capture the oscillation extent of a moving object using 2 vl53l0x distance sensors. Also I need to use that measurement to trigger an action at a specific point detected by a second distance sensor.

So for visualization lets say I have two sensors set up on the ends of a rail with a target that is oscillating. Let’s say the target in the center is a measurement of 0 to each sensor. Max -100 to the left and 100 to the right. So let’s say the target moved to the left to variable of -50 then returns to the right. I want to trigger a device at 51 and also take a reading of the oscillation extent on the right. If the target oscillates at variable 82 right then I want to trigger the device at -83 left. The sequence would loop over and over and the variable would change due to loads on the device being triggered.

This is a rough map of thought as to how I might start writing. So far I haven’t found anyone who can help me figure out how to capture the oscillation reading to use as a variable.

180 steps


//Arduino uno

//300mm precision sensors
// distance sensor1 value 181 to 270 degrees
//distance sensor2 value 179 to 90 degrees


//1 stepper Nemo 17 or 23
//Stepper full rotation 0-359 steps (clock wise count 0 north)
//Home 180, max rotation from 90 to 270 degrees
//sensors placed at the ends of a rail with oscillating target.

//if sensor1 value oscillates set sensor1 to highvalue of oscillation
//Oscillation at 172-173-172 would set value at 173

// if sensor2 lowalue is = 178
// run stepper to 183 when sensor1 reaches 182 //1degrees
// if sensor2 lowalue is =177
// run stepper to 184 when sensor1 reaches 183
// if sensor2 lowalue is =176
// run stepper to 185 when sensor1 reaches 184
// if sensor2 lowalue is = 175
// run stepper to 186 when sensor1 reaches 185
// if sensor2 lowalue is =174
// run stepper to 187 when sensor1 reaches 186
// if sensor2 lowalue is =173
// run stepper to 188 when sensor1 reaches 187
// if sensor2 lowalue is = 172
// run stepper to 189 when sensor1 reaches 188
// if sensor2 lowalue is =171
// run stepper to 189 when sensor1 reaches 188
// if sensor2 lowalue is 170
// run stepper to 190 when sensor1 reaches 189
// if sensor2 lowalue is 169
// run stepper to 191 when sensor1 reaches 190
// if sensor2 lowalue is 168
// run stepper to 192 when sensor1 reaches 191
// if sensor2 lowalue is 167
// run stepper to 193 when sensor1 reaches 192
// if sensor2 lowalue is 166
// run stepper to 194 when sensor1 reaches 193
// if sensor2 lowalue is 165
// run stepper to 195 when sensor1 reaches 194
to lowvalue of 90

//If sensor 2 value oscillates set sensor2 to lowvalue of oscillation
Ocilation at 186 - 185 - 186 would set value at 185

// if sensor1 highvalue is 182
// run stepper to 177 when sensor2 reaches 178
// if sensor1 highvalue is 183
// run stepper to 176 when sensor2 reaches 177
// if sensor1 highvalue is 184
// run stepper to 175 when sensor2 reaches 176
// if sensor1 highvalue is 185
// run stepper to 174 when sensor2 reaches 175
// if sensor1 highvalue is 186
Etc to lowvalue of 270

jameselliott
Автор

You are just an awesome lecture...Thanks a lot Sir...

rakshitks
Автор

Hello Mr. McWhorter, Thank you for all these videos and everything you teach. I have a question though. do you might have anything similar to Light gate Ardino project? Anything!!

davidispiryan
Автор

Muchas Gracias por el video y compartir tu conocimiento

KmiloGuzman
Автор

Thanks For Making this Kind Of tutorials .it's such good and very useful tutorial for us, so thank you again.

yashparsana
Автор

Thanks for the video. I don’t know a lot about electronics and I’m new to arduino but I really enjoyed doing this lesson # 20. I want to use this sensor to make a security device that turns on a light, a motor and a siren when an object comes closer than 20 inches. Any help or advice pointing me in the right direction I would appreciate. Thanks.

endlesshorizonsTV
Автор

Amazing! Watching this in 2020.
Thank you so much!

Chxxvo
Автор

Hi Paul, Why don't you use the UltraDistSensor.h library for the ultrasonic sensor

alanjackson
Автор

Hello Mr McWho!
// Question about LESSON 19 ( Using LCD Display with Arduino):
// Can one work-around the remaining "s" through typing just one blank extra space?

//Example:
LCD.print(" Seconds "); #/instead of/# : LCD.print(" Seconds");
would that work too?
// I imagine that the " "(blank) character leaves the last column erased, or even written over
with " " whitespace, while sweeping left.

Thanks a lot for uploading your videos.
Today i saw you for the first time and already have learnt so much.
I have some project in my head that needs to come real and your videos helped me to solve some assymetrical Ohms Law Issues with a bunch of floating unknowns.

Also your python example has persuaded me to try my favorite language on pi3+ and ...
IT WORKS! I can now collect and format the incoming arduino data with raspberry which is neat.
Sometimes i need a little hint when stuck. Thanks.

Ivy

hederahelix
Автор

That squawk when you were uploading the program tho...
I jumped straight out of my chair.

saijeyaprakash
Автор

how do you set a specific number of sig fig?

ThinkTwiceLtu