How to make Arduino based Automatic Door Opening Using Ultrasonic sensor HRSC04

Automatic Door Wall

The project concerns about automatic door opening and closing system. An automatic door control system includes a sensor for sensing person or object approaching door. Systems and methods are very common in the art for opening and closing doors to enter and exit buildings, facilities etc. Automatic doors are commonly found in retail stores, supermarkets, and the like.

The project relates to an automatic opening and closing of door which will sense person or object approaching door and open automatically. This system is controlled by Arduino micro controller. The system includes DC motor which makes door to slides during opening or closing by rack and pinion gearing, a LCD to display information state of door, an audio buzzer to make sound through the duration of opened door and a controller for controlling the opening and closing of the door as a person or object detected by sensor.

The whole system is mechatronic system which is designed using seven steps of mechatronic system design.

To starts making such mechatronic system following elements and tools are required…

Step 1:- Gather all hardware (Materials and Tools)

Gather all hardware required to assemble system. LCD and Piezo Buzzer is not a mandatory requirement of this system. These are added just only for Visual and Audio identification to user for status of door whether it is open or closed.

To starts making such mechatronic system following elements and
tools are required…

Materials –

1) A computer to program instruction, must installed arduino IDE.

2) Arduino controller ( Any of UNO, MEGA etc.) but i took low cost UNO R3 for learning purpose and making this project for my academic partial fulfillment. ATMEL : ATmega328-PU

3) HRSC04 Ultrasonic sensor (Used as            proximity sensor to sens person or            object arrived at door).

Ultrasonic ranging module HC – SR04 provides 2cm-400cm non-contact measurement function, the ranging accuracy can reach to 3mm. The modules includes ultrasonic transmitters, receiver and control circuit. The basic principle of work:

Using IO trigger for at least 10us high level signal

The Module automatically sends eight 40 kHz and detect whether there is a pulse signal back

IF the signal back, through high level , time of high output IO duration is the time from sending ultrasonic to returning

Test distance = (high level time X                velocity of sound (340M/S) / 2

4) DC Motor

Load current: 70mA (250mA MAX)             (3V pm)

Operating voltage: 3V ~ 12V DC

Torque: 1.9 Kgf.cm

Speed without load: 170RMP (3V)

Reduction ratio: 1:48

Weight : 30gm

No-load current = 60 mA,

Stall current = 700 mA

5) LCD : 16 X 2 DOT MATRIX.

6) Piezo Buzzer

7) Motor Shield : L293D

The L293 and L293D devices are quadruple high current half-H drivers.

Reason to use Motor shield :

You can run motor directly connect to 9-12 V DC supply. The motor will draw current as much it requites from 12V DC supply. But In this project we have to control motor with program instruction so we have to connect motor through the arduino controller which output voltage and current is limited. So when you connect motor to arduino controller it it will draw more current at 5V. So there will be chances to burn controller.

To prevent micro-controller to burn, i used motor shield. which is simply acts as amplifier.

8) Mechanical elements : To make a prototype i used plastic acrylic sheet and cut them into peaces to make a house type model having sliding door.

9) Jumper Wires

10) Power Supply

Tools-

  1. Multi-meter
  2. Soldering Iron

The tools are not required, but if you have then you will be good.

Step 2: Arduino Program:-

You can also down load attached .ino file and directly complie and upload.

#include

LiquidCrystal lcd(12, 11, 5, 8, 9, 1);

const int trigPin = 7;

const int echoPin = 4;

const int mt_En_Pin1 = 2;

const int mt_IN1_Pin2 = 3;

const int mt_IN2_Pin3 = 6;

int buzz = 10;

long duration;

int distance;

void setup()

{

lcd.clear();

lcd.begin(16, 2);

lcd.print(“WELCOME”);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(mt_En_Pin1, OUTPUT);

pinMode(mt_IN1_Pin2, OUTPUT);

pinMode(mt_IN2_Pin3, OUTPUT);

Serial.begin(9600);

pinMode(buzz, OUTPUT);

}

void loop()

{

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance= duration*0.034/2;

if(distance <= 5)

{

digitalWrite(13, HIGH);

delay(1000);

digitalWrite(mt_En_Pin1, HIGH);

analogWrite(mt_IN1_Pin2,50);

analogWrite(mt_IN2_Pin3, 0);

delay(2000);

analogWrite(mt_IN1_Pin2, 0);

analogWrite(mt_IN2_Pin3, 0);

delay(1000);

tone(buzz, 1000);

delay(1000);

tone(buzz, 1000);

delay(1000);

noTone(buzz);

delay(3000);

lcd.clear();

lcd.setCursor(0,1);

lcd.print(“Please Enter”);

delay(1000);

analogWrite(mt_IN1_Pin2,0);

analogWrite(mt_IN2_Pin3,50);

delay(3000);

}

else

{

digitalWrite(13, LOW);

digitalWrite(mt_En_Pin1, LOW);

analogWrite(mt_IN1_Pin2,50);

analogWrite(mt_IN2_Pin3, 0);

}

}

 

Step 3:- Hardware connections

Connects all hardware to arduino controller. The attached schematics are just for the reference only. You may use pins as per available at controller board.

The best way you can use my program for pin information. Also you raise me request to share.

Step 4:- Flaysh Arduino Program and Power Supply

Upload arduino sketch provided in this tutorial to controller.

Watch video to view working system.

How to make Arduino based collision detection warning system

picture1

 

This is arduino based collision detection warning system. This kind of system is fastest growing safety feature in automotive industries. Such system enables vehicles to identify the chances of collision and give visual and audio warning to driver. So that driver can take necessary action to avoid collision. This project idea is based on arduino controller and the whole system will give you very good understanding that how this system works. The step by step method is explained so that you can make this system. The hardware connection, pin information and arduino program is explained clearly.

 

 

steps

Step 1: Items and Material Required

items-required

Please gather the following items

  1. Computer :- This is required to write program and flash program to controller. Also you need to install arduino IDE which is available free at arduino website download section.
  2. Controller :- I used arduino micro-controller. This you can get at online seller like amazon etc.
  3. Sensor :- I used HR SC-04 ultrasonic sensor.
  4. Piezo Buzzer :- I used piezo buzzer to make audio warning.
  5. LED :- There is two type of LED i used to which is red LED and blue LED.
  6. Wires :- There were jumper wires required to make hardware connections. You need to take all type of jumper wires like both end male, both end female and one end male another end female type.

Step 2: Connect all hardwares

pin-info

schematic

The hardware you gather in first step, now connect all them to controller through wires.

Sensor to controller pin information :-

Sensor has four pins VCC, Trig, Echo and GND. Connect…

VCC pin to 5V on controller

GND pin to GND on controller

Trig pin to pin-7 on controller

Echo pin to pin-4 on controller

Piezo Buzzer to controller pin information :-

Piezo buzzer has two pin.

Connect one pin to pin-10 on controller

Connect another pin to GND on controller

Red LED to controller pin information :-

Red LED has two pin.
Connect one pin to pin-2 on controller

Connect another pin to GND on controller

Red LED to controller pin information :-
Red LED has two pin.

Connect one pin to pin-13 on controller

Connect another pin to GND on controller

Controller to Computer connection information :-
You have USB data cable that you got while buying arduino. By this data cable you connect computer to arduino board.Now launch the arduino IDE. After connecting to computer you must have to select board and port from menu.

please see the attached screen shot for the help.

 

Step 3: Write Arduino Program

program

In the previous step we defined pin information for the hardware. No that info we’ll use to write program instructions.

Launch Arduino IDE and try to write program by yourself. Otherwise you can directly use my program or download the .ino format file attached.

While copying this code you have to be careful because some character used in program cannot be paste while writing this on instructable. Better to download .ino format file.

////Collision Warning System////

//// Year 2017 ////

//// Vijendra Kumar////

const int trigPin = 7;

const int echoPin = 4;

int buzz = 10;

long duration;

int distance;

// the setup function runs once when you press reset or power the board

void setup() {

// initialize digital pin 13 as an output.

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(13, OUTPUT);

pinMode(2, OUTPUT);

Serial.begin(9600);

}

// the loop function runs over and over again forever

void loop()

{

// Clears the trigPin

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

// Calculating the distance

distance= duration*0.034/2;

// Prints the distance on the Serial Monitor

if(distance <= 50 && distance >= 20)

{

digitalWrite(13, HIGH);

// digitalWrite(13, LOW);

// turn the LED on (HIGH is the voltage level)

}

else

{

digitalWrite(13, LOW); // turn the LED off by making the voltage LOW

// wait for a second

}

if(distance <= 20)

{

digitalWrite(2, HIGH);

tone(buzz, 2000);

delay(100);

noTone(buzz);

delay(100);

tone(buzz, 2000);

delay(100);

noTone(buzz);

delay(100);

tone(buzz, 2000);

delay(100);

noTone(buzz);

tone(buzz, 2000);

delay(100);

noTone(buzz);

delay(100);

}

else

{

digitalWrite(2, LOW); // turn the LED off by making the voltage LOW

// wait for a second

}

}

Step 4: Flash Arduino Board

After making all connection we are ready to upload the program to arduino board. Please see the attached image for reference.

Step 5: How This System Works

Let me explain you that how this system works.

I defined three different zones.

Zone 1 :- No warning

Zone 2 :- Only visual warning (In this zone driver has to pay attention)

Zone 3 :- Both visual and audio warning ( Driver has to take necessary action to avoid collision)

Step 6: Test you Setup

Now whole system is ready to test. Please see the Both video to see the how to check the system is working.

 

Which CAD software should I learn?

Today is not an era where any industry is relay on Paper-Pencil-Drafter skill in engineering drawing. The market is very fast and so product development cycle is faster too. So must have skilled in computer aided engineering drawing.


slider-cad-design


Instead of asking to other “which CAD software should I learn”, I would recommend you to ask yourself the same question. Once you ask to yourself, your mind will answer you choose one which is best. This answer of your mind will be very general.  Now you will be confused because there is a number of CAD software available in market. Again you will find another problem statement into your mind, find some experience person who can suggest you. The problem will be followed by another, where would I find the experience engineer who can suggest you and somehow you will manage to find person who is experience but what is the probability that he will suggest you a suggestion which is true for all always until or unless you belief with close eyes? So why don’t we ask this question to our self and analyses for solution.

Let’s analyses by yourself:

There are number of CAD tools available in market like Auto CAD, Solid works, Ideas, CATIA, Pro-e, Creo, NX-Unigraphics, Solid Edge etc.

capture

Now first of all ask question to yourself;

Why these CAD software tools required?

Ans: No need to invest cost to make real physical product to realize & study for feasibility and to make virtual 3D model to realize products shape, size, package space, number of parts and assembly methods, to analyses kinematics if there is moving parts and then to make virtual drawing sheets of modeled parts or assembly etc.

Today’s CAD software packages offers with number of analysis tools and engineering advantages.

Why there is so many such CAD tools required for same purpose of 3D realization?

Ans:  Every CAD software package is designed keeping some factors in mind

  • Cost and Maintenance
  • Time required to model same product
  • Flexibility
  • Powerful in 3D solid modeling
  • Powerful in creating 2D drawing sheets
  • Powerful in creating sheet metal design
  • Powerful in creating A-Class surfaces
  • Surface and solid model integration to create complex shape

Solid Model:

2

Surface Model:

3

Sheet-Metal Model:

4

Every CAD software package has all modules like solid modeling, surface modeling, sheet metal module, 2D drawing module etc. Simply you can say some CAD software packages have cost advantage and some have flexibility advantage so, now according to the needs industry buy software and make use of it.

Why we need CAD software tools?

Ans: The main advantage of CAD packages is realization of product without making physical part or assembly. In CAD we can create any shape and size 3D model that helps to imagine the product.

If you think of your engineering first year days when you learned engineering graphics or engineering drawing. The first lesion of this subject is “Engineering drawing is language of engineer”. Let’s justify this statement in context of CAD software. We are engineers, we have to design or make products with our imagination. Suppose you have an idea of some product which some shape and size, also how it looks from front, top, right and seeing from at an angle.

Now you took your drafter and starts making same sketches and views to draw on paper that what kind of product you imagine. This method of making drawing takes long time and there is very little 3D realization of product you have drawn. But in CAD you are able to make directly 3D model of your idea and then you can create quick 2D drawing. Not only this you can modify the model and change any parameter.

Which one is best?

Ans:  I personally do not think that which is best because if I cannot able to make 3D model of desired product that we are planning to manufacture because of shape complexity or any parameter which is mentioned above then what is the use of software that we have. So every industry which have design capability and use CAD packages only based on the product they design. Some of the company uses more than one CAD software packages. Do not waste time on thinking which is best.

Think like and engineer:

If you consider yourself as an engineer and you have to select a CAD package to create an 3D model and drawings then you have answer to your question that which software you should use.

If you are intended to get job:

Then you must think of software which is major used in industries. But always remember that every software package is capable of doing module like solid modeling, surface modeling, sheet metal modeling and drafting.

Automotive industries are one of the best examples where CAD software for 3D modeling and drafting is extensively used through life cycle of product. Not only this, their suppliers are also using CAD packages extensively. You also can refer below comments to justify your question.

AutoCAD –  Mainly used for 2D drafting where 3D model is not required and plays very imp role.

Autodesk Inventor – Parametric Software from the makers of AutoCAD pretty widely used. Used by medium to small companies.

UG NX – If you want to work in automotive for the big 3 or a tier 1 then you wants this. They all use it.

CATIA – I guess it’s used in Aerospace and Automotive too.

Pro/E or Creo – I always called it Pro/E but I guess it’s called Creo now.  Strongly recommended for parametric solid modeling and sheet metal modelling.

Solidworks – One class does not an expert make and Solidworks is awesome. Becoming really good at this may help you in school because I feel it’s the quickest 3D CAD out there which makes it great for class projects as they rarely run into scale problems that would be helped with a more advanced software.

Last but not least, if you are mechanical engineer you must have strong skills in engineering drawing. Most important part of this blog is today is not an era where any industry is relay on Paper-Pencil-Drafter skill in engineering drawing. The market is very fast and so product development cycle is faster too. So must have skilled in computer aided engineering drawing.

Be Prepared For Job

The choice is absolutely open for you to choose government or private sector. There are many open sources and many folks in India can tell you the difference between government jobs and private jobs. Just be careful of any rumors. In my observation that government cannot provide jobs to each and every engineer, there are limited vacancies. On the other hand private sector is big sector in each branch of engineering where you can also employ yourself and no doubt they are offering good salaries too.

Now if you see closely to the any recruitment process which is starts with eligibility criteria and ends at final jobs in hand. There is few more selections filter steps that you must qualify.

2-2

Skills and knowledge:

2-1

We are discussing about skills and knowledge. What set of skills and knowledge required to be good engineer? Before answer this question you must ask another question. Who is engineer? What is kind of skills and knowledge we need?  In the process of finding answer to this question we find some keywords that must be clear. What is engineering, who is engineer, why engineering, engineering thinking, product design, what is design, design engineering.

 

Fun way to get job:

Flow chart is process of getting job in few years back but still in tradition. I am talking about the way of getting jobs in hand which is not starting with eligibility criteria but starts with skills imbued into you from the first year of your engineering.  If you are miss interpreting my words then let me correct you. Please do not miss understand as skill will get you job directly. But it doesn’t mean you thinking in a wrong way. There are some vocational training educations in our country that train people at specific skill and get placed in company directly to work upon the shop floor, called diploma education. But everybody have more expectations from graduate engineer. So you have to have skilled yourself as engineer. You have to think like engineer. You have to be creative. I would suggest you go through my session “Who is engineer”.

 

Where you should involve yourself and what you will get:

To be successful in this profession you must understand the engineering and what engineering means in current market place. The market is changing rapidly and job and responsibility of engineers also increases accordingly. These rapid changes are drive by three most influencing factors which are innovation, technology and customers. Today market is not manufacturers market that any product that they will produce must buys by the customer. Market is customer driven. Engineers have to think what customers need. For example two of the product that we all are very familiar which is changing leaps and bound in technology are automobile cars and mobiles. So we all have to learn modern engineering rather than the engineering that we are learning since our country become free. It doesn’t mean we can avoid that but we have to learn those as fat as we can get time to learn and involve with modern engineering.

2-3

We all have to become smart engineer. Now question arises that who is smart engineer. To answer this question you just look at the products in the market. Every product is combination of engineering that we learn separately. But if you want to lead over all these engineers you have to have knowledge of all.

India has number of engineering colleges but few of them are good. Now you can understand the difference between them. Doesn’t matter which university you are studying, all you need to understand engineering and modern engineering. Innovation plays very important role in that. We will discuss innovation separate blog ton learn what is innovation and how we can develop innovative thinking.

Here are some required set of skills that engineers must have.

Suggestions to my dear engineering students:

Those students who desire job, I recommend them to pre aware from the first year of engineering. Please follow your desire and awareness of your desire is much important. Explaining everything in a single line or single paragraph or single blog would not be practically sufficient enough. So go through the series of my blogs which will give you better understanding of engineering and engineering jobs.

Featured post

Blog at WordPress.com.

Up ↑

%d bloggers like this: