Table of Contents

Height Selective Automatic Door

Author

Sergio Rodriguez Barnuevo

Introduction

Brief presentation of the project:

  • The goal and purpose of the project is to design and build an automatic door that only allows objects/users above a certain height to go through. This could be used for security reasons or simply in order to design a selective system of access to a building, event, area…
  • The idea of this project comes from the usual automatic door that opens with movement (i.e. shopping centre or supermarket doors) but with the addition of making it restrictive in order to improve its security.
  • This type of door can have numerous applications such as theme park attractions or zoo entrances and the idea can be adapted to different type of restrictions other than height (i.e speed or weight).

General description of the project



  • Ultrasonic sensor Module HC-SR04: Used for measuring distance to objects
  • LEDs: They will represent door state (denied entry, standby, etc.)
  • 4×7 LED display: This 4 digit display will show the current object's height
  • Button: The button will allow for emergency stops of the system
  • Servomotor: It will be used to opening and closing the door

The rest of the components will serve their usual basic functionality. The wifi won't be used for now, but it could allow for remote control of the door.

Hardware Design

List of components:

  • SG90 Servomotor
  • 3 LEDs
  • 4×7 LED display
  • Ultrasonic sensor Module HC-SR04
  • Connecting wires
  • Breadboard
  • Arduino UNO WIFI R2 motherboard
  • Resistors



Tinkercad Electrical Schemes








Early prototype of the door without the electrical connections

fotopuerta2.jpg 1)
fotopuerta1.jpg 2)

Finished prototype of the door

finalautomaticdoor2.jpg 3)
finalautomaticdoor1.jpg 4)

All the simulations were run correctly and performed in the desired way. More information about the results further down the page.

Software Design

Libraries used
Sources and functions imlpemented

Before the setup function, some macros and variables are defined, such as the time the door will stay open, the pin numbers and other variables such as flags defining the state of hte button or the state of the door.

setup():

In the setup the initial parameters for the normal state of the door are set:


objectDetectedInterrupt():

This interruption sets a flag to true when an object is detected, that is, the sensor measures a distance. But in the end it has no functionality because the sensor is always measuring a distance. It could be used for a different type of sensor or system though.

buttonInterrupt():

This interruption is meant to work when the “emergency button is pressed”. This emergency button can be configured in different ways. For example, in one version of the code it locks the door into the current state that it's in (Automatic_Door_1) but in the other version it blocks the door closing it and leaving it closed until the button is pressed again. Here's a wuick rundown of how it works:


openDoor():

This function moves the servo to its open angle value by using the function servo.write() from the servo.h library

closeDoor():

This function moves the servo to its closed angle value by using the function servo.write() from the servo.h library

Loop():

The main loop of the microcontroller. The loop essentially calculates the distance measured by the ultrasonic sensor and checks if it's within the specified values for the door to allow the object to go through.


Algorithms and structures

Obtained results

The results obtained after the realization of the project were, by the most part, the desired ones.

The microcontroller successfully identified whether the object was too short or tall enough and was able to turn the servo in order to open or close the door. The emergency button feature also worked as it was intended blocking the door and putting it in a standby mode until the button is pressed again. The 4×7 LED display, however, was not functional and could not be added to the system. This is because it was acquired from a third party and it was in a used state and it didn't work as it was intended initially when designing the project.

As for the hardware, the whole system was built in a primitive way, without regarding the esthetics since the purpose of the project was for the main idea to work and not build a finished product. Additionally, the LEDs which were intended to be placed by the side of the door had to be placed in the breadboard because of a lack of long wires and connectors (then again, this issue did not influence the performance of the door).

On the other hand, the method chosen to build a height selective automatic door was not ideal. There was an issue when programming the system because the sensor used is always detecting objects. In order to avoid this, a PIR sensor could've been added and therefore the calculation of the distance would only be made whenever this PIR sensor detects and object arriving in front of the door. This issue was not taken into account in the design phase of the project and the hardware necessary was not acquired in time.

Overall, the main idea of the project was accomplished and this early prototype could be modified and improved in many ways in order to be part of a real system or project.

The following videos show the functioning of the door for the code of the file AutomaticDoor2 where the emergency button blocks the door in the state it was and makes it enter the standby mode until the button is pressed again:

5) 6)

Conclusion

In conclusion, working on this Arduino automatic door project has been an incredibly rewarding experience. It has reinforced the importance of hands-on projects when it comes to learning about microprocessors like Arduino. Through practical experimentation and problem-solving, I've gained a deeper understanding of how hardware components interact and how to manipulate them using code. The automatic door project, in particular, has sparked my imagination. I can envision its integration into various systems or projects, such as a smart home setup or a security system. This project has truly showcased the versatility and potential of Arduino.

If you're passionate about microprocessors and eager to explore the endless possibilities of creative projects, hands-on experiences are an invaluable part of the learning journey.

Download

Schematics:

Code:

Bibliografie/Resurse

Export to PDF

1) Front side of the door where the sensor, display and leds are shown
2) Back side of the door where the servo, motherboard and breadboard are shown
3) Front side of the door where the sensor, breadboard, motherboard and leds are shown
4) Back side of the door where the servo is shown
5) Functioning of the door
6) Demonstration of the emergency button