after going through more than 10 tutorials...this finally works for me...with clear instructions. Thank you! next i will need to know how to vary the distance and the servo movement
Great video but I'm having trouble getting my servos to react to the ultrasonic sensor my servos will move 90 - 100 degrees but when my sensor is at the distance I programed my servos just slow down when I want them to go 90 - 80 degrees. What do you think the problem is?
Hi Blake, you can lengthen the distance where your hand is sensed by changing the number 5 in the line "if (distance < 5)" to the number that you want. For example, if you want your hand to be sensed only within a distance of 100 cm from the ultrasonic sensor, please give that line as "if (distance
Hi, I have the issue where the servo motor keeps on spinning forever, instead of turning 90 degrees and then back again. I've directly copy+pasted your code and uploaded it numerous times. Suspecting that I'm using the wrong kind of servo motor ( MS-R-1.3-0 OLIMEX). Which one are you using in the video?
hi Can you help me please? I want some distance sensor for (20cm) with adjustment option if there is, and with dry contact open/close. so, when it detects Obstacle it will open the dry contact and automatically close it when it will stop detect the Obstacle can you help me to find the item that I need on AliExpress? Thanks Yossi
hello we have tried your code, and we got our servo to work, however it will not turn 90 degrees and then turn back. However it continues to turn in the same direction, and simply changes the direction of rotation when we release our hand or object.
please I asked you: i connected correctly to arduino, but when you load the code (though not load the library up), arduino lighting up , but servo is only spinning 2.3 round and stop, the ultrasonic sensor is not work, hope you help me, thank you very much!
I would start by checking the wiring for the Sensor and then make sure that the pins are in their right sequence. Instead of writing the code from stretch try to copy and paste so that you don't miss anything. The CODE is correct and should work if everything is fine.
The code is there. You will have to click the detail button under the video. However here is the link: docs.wixstatic.com/ugd/22a975_7fc48286344544d2a2518c36943bd70f.pdf
You've explained good but the servo motor is not working after I uploaded your code to my Arduino board. I checked the connection of the jumper cables and they are firm too, so I don't know what's wrong. The output for the ultrasonic is being output to the serial monitor, but there is no response from the servo motor. Kindly give a solution for this as I've a month's deadline for submitting the project but this servo motor does not seem to work at all. Please provide the solution!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@shantanukudav2148 Well I did discover a workaround for that but it's been more than an year since I finished that project so I don't know how I could help you. I'd have helped you if I had remembered how to do it. Sorry man. I hope you finish it on time.
I check the program and it's correct. Make sure that the following connections are correct: Servo Motor: Make sure the orange wire from the Servo motor is connected to Digital Pin 8. Ultrasonic Sensor: Make sure that Trig Pin is connected to Digital Pin 7 and Echo Pin to Digital Pin 6. Finally, check your BreadBoard make sure it is receiving 5V from the Arduino and that there is ground GND for both the Sensor and Servo Motor.
can you help with my project just like what youve done but with lcd. can you do that? and please provide schematic diagram and program thanks a lot in advanced
Here is the code link: docs.wixstatic.com/ugd/22a975_ac64d5bf20e944438cc36412e9a65746.pdf And this is the video th-cam.com/video/hSb3qB3Axvg/w-d-xo.html
Lasto bamboo First I was also unable to find the code. But it's now solved. If you are using a smartphone like me,then turn on desktop site from the menu section(3 dots in top right of screen), then you'll get it.
use the link provided below the video to get the CODE (www.techexult.com/project-lessn). Click the details button under the video that you need the CODE for and that will give you the CODE and instructions.
The code is no my website. Click on the link provided below the video and it will take you to my website. Go to the program page and look for the video you need and click details.
after going through more than 10 tutorials...this finally works for me...with clear instructions. Thank you! next i will need to know how to vary the distance and the servo movement
thank you for this i had bought other parts that i used for the motor that i prefered but this tutorial is just so good
Looked all over! yours was the best!!
Thank you very much, it helps me a lot!
I will be using this with my train set to make a auto crossing gate. Of course I will be adding blinking lights. Thanks for the helpful video.
Thanks man you really helped me out with my project
Very helpful thank you TechExult
Great explanation 🙏🏽
well explained...thank you sir..🤗
excelente trabajo Dios les pague
great video
helped me a lot thanks
Great video but I'm having trouble getting my servos to react to the ultrasonic sensor my servos will move 90 - 100 degrees but when my sensor is at the distance I programed my servos just slow down when I want them to go 90 - 80 degrees. What do you think the problem is?
You are amazing thank you so much your explanation was great after watching so many videos that don make sense.
Thank you
OMG THANK YOU SIRR YOU HAVE JUST SAVED MY GRADES AND DIPLOMA DEGREE :D
Congrats!!!
Thanks for the tutorial! Is there any way to lengthen the distance where your hand is sensed or can the ultrasonic sensor not do that?
Hi Blake, you can lengthen the distance where your hand is sensed by changing the number 5 in the line "if (distance < 5)" to the number that you want. For example, if you want your hand to be sensed only within a distance of 100 cm from the ultrasonic sensor, please give that line as "if (distance
thanks Sir, for your lesson. now i subscribed this channel, very educative. God bless
Thank you very much!
WE LOVE YOU!!!
if I want the servo motor to stop the movement, what is changing in the code?
I guess it could also work the other way around? Like as long as the sensor detects ur hand. The motor wont start the circlesaw?
First thank you !
i use your code and i add led work at the same time with the servo motor.
i will print a facility for Hand sanitize
Can you post your project?
fantastic! well explained sir
Thank you Sir
My kit came with a stepper motor. I tried to connect it with the stepper but it doesnt work once I connect it with the Ultrasonic Sensor
Hello, can i use the code for another servo, like Servo MG995?
hats off
How do u make it for just 1 DC motor? Please answer...
thank you
Can we use da big servos???
Much appreciated :)
how if i make an interface between 2 arduino to control servo by ultrasonic sensor
Hi, I have the issue where the servo motor keeps on spinning forever, instead of turning 90 degrees and then back again. I've directly copy+pasted your code and uploaded it numerous times. Suspecting that I'm using the wrong kind of servo motor ( MS-R-1.3-0 OLIMEX). Which one are you using in the video?
[SOLVED] Just tried it with another type of servo motor, and it worked!
I used Sg90 Micro Servo (9g)
says for me, echo pin was no declared in this scope???
hi
Can you help me please?
I want some distance sensor for (20cm) with adjustment option if there is, and with dry contact open/close.
so, when it detects Obstacle it will open the dry contact and automatically close it when it will stop detect the Obstacle
can you help me to find the item that I need on AliExpress?
Thanks
Yossi
Bro small help can you draw a diagram of the circuit please so it is easy to understand
my servo did not working at all even after changing with new servo motor 9g SG90... help me!!!!!!!!!!!
Heyy I tried reaching link you saved for the code but it does not appear
Amazing
Thanks a lot bro
You are welcome
hello we have tried your code, and we got our servo to work, however it will not turn 90 degrees and then turn back. However it continues to turn in the same direction, and simply changes the direction of rotation when we release our hand or object.
I just checked the code and it's working fine. Please try to upload it again
Sir Where Do i input my code
please I asked you: i connected correctly to arduino, but when you load the code (though not load the library up), arduino lighting up , but servo is only spinning 2.3 round and stop, the ultrasonic sensor is not work, hope you help me, thank you very much!
I would start by checking the wiring for the Sensor and then make sure that the pins are in their right sequence. Instead of writing the code from stretch try to copy and paste so that you don't miss anything. The CODE is correct and should work if everything is fine.
Code is not available in the link. Please share
Tech exult
I can't find the detail button for this project on your website.Can you please send me the code?
Sir its solved . Actually I was using a smartphone so I was unable to find the 'detail' button so I turned on the desktop site then it worked fine.
The code is there. You will have to click the detail button under the video. However here is the link: docs.wixstatic.com/ugd/22a975_7fc48286344544d2a2518c36943bd70f.pdf
How would I get the servo to move 20 degrees whenever the ultrasonic sensor is triggered? I don't need it to go back to the start position.
This is the code for that: #include
#define trigPin 7
#define echoPin 6
Servo servo;
int sound = 250;
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
servo.attach(8);
}
void loop() {
long duration, distance;
//Servo Motor Controlled By Ultrasonic Sensor
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance < 5) {
Serial.println("the distance is less than 5");
servo.write(20);
}
else {
servo.write(0);
}
if (distance > 60 || distance
ur code is not giving angle wise rotation insteat it gives continous rotation
What are the colors of the wires that needs to be used? Its not clear enough
Colors don't matter. You can use any colors you have available
when it is not pluged into my computer the servo dosent move fully plz help.
hey doe anyone know the code i am a beginer and i need some code for it thanks.
I called this code everywhere and I found the most understandable:)I'm Bealif(inanç)
Thanks
You've explained good but the servo motor is not working after I uploaded your code to my Arduino board. I checked the connection of the jumper cables and they are firm too, so I don't know what's wrong. The output for the ultrasonic is being output to the serial monitor, but there is no response from the servo motor. Kindly give a solution for this as I've a month's deadline for submitting the project but this servo motor does not seem to work at all. Please provide the solution!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Same problem for me, ultrasonic sensor works but motor doesn't :(
@@shantanukudav2148 Well I did discover a workaround for that but it's been more than an year since I finished that project so I don't know how I could help you. I'd have helped you if I had remembered how to do it. Sorry man. I hope you finish it on time.
I have connected all the components correctly, uploaded the program but still its not working, what to do sir????I need it urgently
I check the program and it's correct. Make sure that the following connections are correct: Servo Motor: Make sure the orange wire from the Servo motor is connected to Digital Pin 8. Ultrasonic Sensor: Make sure that Trig Pin is connected to Digital Pin 7 and Echo Pin to Digital Pin 6. Finally, check your BreadBoard make sure it is receiving 5V from the Arduino and that there is ground GND for both the Sensor and Servo Motor.
can you help with my project just like what youve done but with lcd. can you do that? and please provide schematic diagram and program thanks a lot in advanced
I did one already. Here is the link:
th-cam.com/video/hSb3qB3Axvg/w-d-xo.html
can i have a code thats for spining 360 degrees pls
I'm sorry but the code didn't work for me. Can you figure out what's wrong?
How to increase the distance of sensor in codes
You change it by changing the value in the "if(distance
TechExult thank q sir
Project tech creator I
Why does not it work? Is it possible that the servomotor is damaged?
sesi79 lack of power maybe what servo?
YOU ARE AWSOME
Thank you
weldone , is it right
#include
#define trigPin 7
#define echoPin 6
Servo servo;
int sound = 250;
void setup() {
Serial.begin (9600);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
servo.attach(8);
}
void loop(){
long duration, distance;
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;
if (distance < 5) {
Serial.println("the distance is less than 5");
servo.write(90);
}
else{
servo.write(0);
}
if (distance > 60 || distance
please response :( i need you sir. im almost done im done on your movie but i need it with lcd monitor please help
Here is the code link:
docs.wixstatic.com/ugd/22a975_ac64d5bf20e944438cc36412e9a65746.pdf
And this is the video
th-cam.com/video/hSb3qB3Axvg/w-d-xo.html
Saludos des de Coatzacoalcos, Veracruz, México o de la universidad Veracruzana o Ciclistas UV Coatzacoalcos en facebook:xd
Thanks
Otherwise it's awsome!!!
LIFEEE SAAAVERRRRRR
Happy to hear
distance = (duration/2) / 29.1;
I am getting a error in this line
Can you please help me out in this.
Hi Om Kulkarni, please try this code in that place - distance= duration*0.034/2;
I tried Three times but it didn't work.
I’m getting the error code “redefinition of ‘void setup()’”
Sathish blazer I fixed it. Thanks though
William Gilmore can you please share the code.
I can't find the code in the link.
Me too. I tried Three times but it didn't work.
Can u help me with the code I am a principal of a school and I want my students to engage in arduino more and more as I did when I was a kid
I couldn't find the code
Sir link is not here on the website plzz make video of code otherwise write the in reply ok sir bye i hope you solve my problem.
Use this link: www.techexult.com/project-lessn. Then click the DETAILS button below the video you want a CODE for.
Lasto bamboo
First I was also unable to find the code. But it's now solved. If you are using a smartphone like me,then turn on desktop site from the menu section(3 dots in top right of screen), then you'll get it.
Thank you
Pls code?
use the link provided below the video to get the CODE (www.techexult.com/project-lessn). Click the details button under the video that you need the CODE for and that will give you the CODE and instructions.
@@techexult2537 thanks 😊❤
Sir please its urgent
Who else is at school
pls code pls
The code is no my website. Click on the link provided below the video and it will take you to my website. Go to the program page and look for the video you need and click details.
Atleast please direct link, your webside sucks
Thanks for the feedback
The code
in the flippin description