How to make an automatic door using Arduino PIR sensor and Servo motor
HTML-код
- Опубликовано: 4 окт 2024
- In this lesson we learn how to use the PIR along with the Servo motor to make an automatic door that opens up when someone crosses around.
we will use the Arduino Uno board.
Thanks, buddy. Iam a student and was searching for this to make for the science exhibition. I searched many codes finally found this one works. Thank you so much
The pleasure is all mine
code
#include
int servoPin=4;
Servo Door;
int pirPin=2;
int val =0;
void setup()
{
pinMode(pirPin,INPUT);
Door.attach(servoPin);
Door.write(90);
}
void loop()
{
val= digitalRead(pirPin);
if(val == HIGH) {
Door.write(0);
}
else {
Door.write(90);
}
delay(200);
}
Very nice and important demo! Please, share other useful courses!
Thank you! More are coming
Good video, very explanatory, I am learning to program and this video was very useful to me
I am glad that it did, keep up
Bro can u put up to he connections please 🙏
ofcourse check this link raw.githubusercontent.com/lengolionel/simple_servo_motor/main/servo.png
Can you send the code to program an Arduino?
can i get the void setup?that one, for the arduino uno
i need that so muchhhhhh
what do you need?? the circuit design, tell me !!
@@idukunda_lengo no, the arduino code.like for the arduino...
Good day bro can you give give me diagram?
Yes sure! I will put it here, by today
I just need your help sir because I need to pass my project this week and I already had materials which are ADRUINO UNO, BREADBOARD, PIR SENSOR, AND MICRO SERVO
Do you have a social media account sir? Can I add you?
@@ryanmanlunas2103 on Instagram lengolionel
@@idukunda_lengo thank you for notice me sir sorry I don't have Instagram but I have only VIBER app. Sir I just ask you the PIR sensor is needed a led light?