Demonstration of Automatic Door in Tinkercad

by S SRI SAILENDRA KRISHNAN in Circuits > Arduino

2760 Views, 2 Favorites, 0 Comments

Demonstration of Automatic Door in Tinkercad

IMG-20210715-WA0080.jpg
IMG-20210715-WA0082.jpg
Hello everyone, Today we are going to see about the simple automatic door presentation. I am gonna demonstrate my project in Tinkercad online website. We have seen automatic doors in malls , theatres etc. Have you ever wonder about the basics behind that?? Let's see what it is!!

Supplies

The basic components used for my demonstration:
1) Arduino UNO R3

2)PIR sensor

3)Micro Servo motor

Circuit Connection:

IMG-20210715-WA0080.jpg
Now this is the time for connecting the above mentioned components so that its becomes a circuit.
1)Open the Tinkercad website in your browser.
Open the tinkering environment.

2) Choose the mentioned components from the Component list .

3) Now let's give connections.

4)The ground terminals of both sensor and micro servo motor are connected to the ground pin mentioned as 'gnd' of the Arduino.

5) Similarly the power terminals of both sensor and micro servo motor are connected to the 5V pin of the Arduino board.

6)Now we are into the final step of connecting the signal terminals of sensor and micro servo motor into the digital pin number 2 (setting as input pin) and digital pin number 12(setting as output pin) respectively.

Coding Part!!

IMG-20210715-WA0082.jpg
Screenshot_2021_0715_233236.jpg
Coding part is the most important thing that one should take extra care while working on Arduino projects.
Coding:

#include
Servo s;
void setup()
{
pinMode(2, INPUT);
s.attach(12);
s.write(0);
}

void loop()
{
if(digitalRead(2)==HIGH)
{
s.write(90);
delay(5000);
s.write(0);
}
}

Explanation:
Since we are using a servo motor we use the header file 'Servo.h'.The servo motor is attached to the pin number 12 which is set as an output pin. The signal from the sensor is feed as an input through the pin number 2.Initially the servo motor is instructed to be in its original position demonstrating that the door is still closed. After that if the output (Given as input to the board) from the sensor is HIGH , the motor is instructed to turn by 90° which is the demonstration of opening of the door.delay(5000) describes that the door will be in open state for 5 seconds. After that it closes.

Screenshot_2021_0715_233236.jpg
Now Click on start stimulation to tinker our design. It will simulate our circuit and the desired outputs are produced. Thank You for visiting.