Introduction: Make a Automatic Self Sensing Opening and Closing Door With Arduino!
Ever wanted to make your door open automatic just like in sci-fi movies? Now you can by following this Instructable.
In this instructable we will build a door which can open and close automatically without you touching the door. Ultrasonic sensors on the door will detect you from 50 cm away and will open the door automatic. You don't have to touch the door it will do everything automatic!
**If you like this instructable please vote for me in the contest!!**
For a demonstration check out the Youtube video.
For this project we need:
1x Electric motor ( I am using a old windshield motor from a VW Golf 3 )
1x Computer powersupply
2x ultrasonic sensor
A piece of metal (Can be wood but will be less strong)
A couple of wires
All these parts can be get for under 20$.
Step 1: Get and Mount the Electric Motor
First of all we need an electric motor. It is very important that the electric motor has a lot of torque and a low speed. This is why I am using a windshield wiper motor. Any windshield wiper motor wiper motor from any car will do. You can also use another DC motor you have lying around, but just make sure it has enough torque to move the door.
Power to the motor
The 12 V DC motor I am using can use up to 12 A of power. This is why it is so strong but now it needs a strong power supply to power it. That is where the Computer power supply comes in. I am using a 300 watt power supply but something lower/higher than that could also work. It will give 12 A on its 12 V rail which is plenty for our DC motor. To get power from it we first have to short the green wire with a black wire. This will act as the power button. Without it the power supply wont start up. Check the picture above to see the wires and how to short it.
To get the door to open we need to build a mechanism. Check out the pictures above. It consists of two metal pieces. One is 20 cm and the other 25 cm long. It can probably also be made from wood but I am not sure how strong that is. It is important that there are two points which can move. One is where the two pieces connect to each other and the other is where the longer piece connects to the door post. The other side of the smaller piece needs to be mounted on the electric motor. Because I am using metal parts I welded it on the motor. This maybe sounds a bit unclear but if you watch the video it will all be clear.
After you have made the mechanism you need to mount it on your door. I have done this by first screwing in some screw above where the motor needs to go. Then I got some zip ties and zip tied the motor to these screws. After that I used a lot of hot glue to mount in complexity. I have mounted the motor about 10 cm to the right of the center of the door and I have mounted the long piece of the mechanism a couple cm to the right of the center of the door post.
This is the hardest part of the project. If you find that the motor has not enough power to open the door or the door does not open completely try changing the location of the motor or change the length of the mechanism pieces.
Step 2: Get the Arduino Ready
As the brains of this project i am using an Arduino UNO. Any other Arduino compatible device will work to like a Arduino nano.
We first have to download the code wich can be found on my github:
Click the clone/download button and click download as ZIP.
Then unzip the package and open the AutomaticDoor.ino file with the Arduino IDE.
Then upload the code to the arduino board
In the Arduino IDE you can see the code. Above in the code there is a config part just like in the picture above. There is one very important which is the MotorDelay variable. This one decides how long the motor gets power. The longer this variable is, the longer the motor will turn and the longer the motor turns, the more the door opens. So if the door opens not completely or if it smashes into something, because if it opens to much, change this variable. Then upload the code again and see if it works correct now.
Step 3: Making the Controller and Wire Everything Up
To control the movement of the DC motor we have to build a motor controller. For this we use a H-bridge configuration like in the pictures above. I have build a H bridge using 5v relays but you can also use 4 N-channel mosfets. Just build it like the schematic above and make sure to use thick wires and high amperage components. If you are using mosfets i recommend using the IRFZ44n because they are logic level operated.
After the H bridge is completed we need to connect a couple of wires. Connect the coil pins from the relay (following the 2nd picture above) A1 and B2 together and B1 and A2 together. If you are making a mosfet H-bridge connect the Gate pins together like in the relay H bridge.
If you still don't understand the H-bridge check out this video below.
Now we have the H-bridge we need to connect it to the Arduino. Follow the schematic in the pictures and connect all the other thing to.
If you have wired everything up place one ultrasonic sensor on one side of the door and the other on the other side.
If the door is opening while it needs to close and other way around switch the wires on pin 8 and 9.
Step 4: Your Finished
Hope it was not to difficult. If you have done everything correct you now have your very own SciFi door! If something still is not working just sent me a message i am happy to help.
This project will get an update where the door will open automatically when you say: "Hey Cortana, please open the door". So stay tuned for that!
In the mean time check out my other projects which also involve home automation.
We have a be nice policy.
Please be positive and constructive.