65

Accident Prevention Automatic Door

Embed Size (px)

Citation preview

Page 1: Accident Prevention Automatic Door
Page 2: Accident Prevention Automatic Door

 ABSTRACT

Abstract:

This is a system in which the door is closed or opens automatically. This is  based  on  movement sensor. When somebody reaches the door, the sensor senses this and automatically opens the door. The door is closed when no person is in its proximity. However, if a person wishes to go through the door and due to some reason they stop at the middle of the door, then closing the door in such a situation is dangerous and causes accident. Hence we have considered this and accordingly we have taken action so as to not to close the door in this case. We have used a micro  controller  to  accomplish  the  task.  We have assembled and tested the system and found to be working to our satisfaction.                                        

 

                                                                                                                                                                                                 

              

1

Page 3: Accident Prevention Automatic Door

TABLE OF CONTENT

ABSTRACT

1. INTRODUCTION

2. DESIGN PROCEDURE

2.1 POWER SUPPLY

2.1.1 TRANSFORMER

2.1.2 RECTIFIER

2.1.3 SMOOTHING

2.1.4 REGULATOR

2.2 CURRENT LIMITING RESISTOR FOR LED

3. CIRCUIT DESCRIPTION

3.1 HARDWARE

3.2 SOFTWARE TOOLS

3.3 MOTOR CONTROL

4. MAJOR COMPONENTS INFORMATION

4.1 AVR MICROCONTROLLER

4.1.1 I/O PORT

4.1.2 AVR MICRO BLOCK DIAGRAM

4.1.3 AVR MICROCONTROLLER INTERNAL ARCHITECTURE

4.1.4 PIN DESCRIPTION

4.2 TRANSISTOR AS A SWITCH

4.3 555 INTEGRATED CIRCUIT TIMER

4.4 TSOP 1738 IR RECEIVER

2

Page 4: Accident Prevention Automatic Door

4.5 PIR SENSOR CIRCUIT

5.TESTING PROCESS

6.CONCLUSION

7.CODING

8.REFERENCES

1. INTRODUCTION

Technology has provided us with lots and lots of luxury and comfort. Many an areas are enjoying the benefits offered by the innovations in technology.

We wish to focus our attention to one of the area which is common for both domestic and industrial. The area is Security Doors. Doors are common for both the commercial establishment and residences.

The traditional method is either we keep the doors open or close them, manually. When then doors are open the entire time, one problem what we encounter is lot of dust is received. So

We keep the doors closed and open them only when someone wants to get in. In the second method the problem is one has to stay all the time at the door to open it whenever someone arrives or departs.

3

Page 5: Accident Prevention Automatic Door

We have designed electronics for an automatic door. This door senses the presence of the person in its proximity and opens them automatically. Once the person passes through the door they are closed automatically. During the passing time if the person stands in the middle of the door, the doors won't be closed, they are kept open. They will wait for the person to move out, either way, and then only they are closed. This way we can prevent the accidental closure of the doors.

This project offers us the challenges involved in designing an electronic system. During the process we will learn several aspects in design, development and testing skills.

The system level block diagram is shown in the next page.

 Automatic Door Block Diagram

230V AC

RECTIFIERREGULATOR CONTROL

CIRCUIT

MOTORS

DOOR OPEN / CLOSE SENSOR

CIRCUIT4

Page 6: Accident Prevention Automatic Door

The block diagram for Automatic Door system is as shown in the above diagram.

The mains voltage is stepped down, rectified and a regulated 5V DC is achieved. The 5V DC is required as supply for the on board electronic components.

The sensor senses the movement of the visitors and based on this information the control circuit activates the doors. Whenever a person approaches the door, the doors are opened automatically; they are closed once the person passes through the door. The sensors act smartly; they don't close the doors if a person stands in the middle of the doors, thus preventing accidental closure of the doors

 2. DESIGN PROCEDURE

Our design circuit consists of a power supply, a transistor, a relay, resistors, capacitors and LED’S.

In this design section we will go step by step on how different components  are used in our system,  how they perform, their features.

For  any  electronic  device  we  require  power  supply  in  it,  which  is  very  essential  requirement  for  any circuit. Here we are using a 5V regulated dc supply in our circuit. To obtain 5V dc supply procedure is as following.

5

Page 7: Accident Prevention Automatic Door

2.1 Power Supply

Power supply is a supply of electrical power. A device or system that supplies electrical or other types of energy  to  an  output  load  or  group  of  loads  is  called  a  power  supply  unit  or  PSU.  The term  is  most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others.

A  power  supply  may  include  a  power  distribution  system  as well  as  primary or  secondary  sources  of energy such as:

* Conversion of one form of electrical power to another desired form and voltage, typically involving converting AC line voltage to a well-regulated lower-voltage DC for electronic devices. Low voltage, low power DC  power  supply  units are commonly integrated with  the devices they  supply, such as computers and household electronics; for other examples, see switched-mode power supply, linear regulator, rectifier and inverter (electrical).

* Batteries

* Chemical fuel cells and other forms of energy storage systems

* Solar power

* Generators or alternators.

A brief description:-

6

Page 8: Accident Prevention Automatic Door

Transformer - steps down high voltage AC mains to low voltage AC.

Rectifier - converts AC to DC, but the DC output is varying.

Smoothing - smooth the DC from varying greatly to a small ripple.

Regulator - eliminates ripple by setting DC output to a fixed voltage.

 

2.1.1 Transfor mer

Transformer is a device which can efficiently transform the electric energy. Major use of transformer is in power distribution.  Which is used in electrical devices, control systems, communication system devices etc. Step-up transformers increase voltage, step-down transformers reduce voltage. Most power supplies use a step-down transformer to reduce the dangerously high mains voltage (230V) to a safer low voltage.

The  input  coil  is  called  the  primary  and  the output  coil  is  called  the  secondary.  There is no electrical connection between the two coils; instead they are linked by an alternating magnetic field created in the soft-iron core of the transformer. The two lines in the middle of the circuit symbol represent the core.

Transformers waste very little power so the power out is (almost) equal to the power in. Note that as voltage is stepped down current is stepped up.

The  ratio  of  the  number  of  turns  on  each  coil,  called  the  turns  ratio,  determines  the  ratio  of  the voltages.  A  step-down  transformer  has  a  large  number  of  turns  on  its  primary  (input)  coil  which  is connected to the high voltage mains supply,  and a small number of turns on its secondary (output) coil to give a low output voltage.

Turns ratio ==

VP = primary (input) voltage;                Np = number of turns on primary coil

Vs = secondary (output) voltage    Ns = number of turns on secondary coil

7

Page 9: Accident Prevention Automatic Door

Transformer and AC waveform

8

Page 10: Accident Prevention Automatic Door

The low voltage AC output is suitable for lamps, heaters and special AC motors. It is not suitable for electronic circuits unless they include a rectifier and a smoothing capacitor.

  2.1.2 Rectifier

There  are  several  ways  of  connecting  diodes  to  make  a  rectifier  to  convert  AC  to  DC.  The bridge rectifier is the most important and it produces full-wave varying DC.  A full-wave rectifier can also be made from just two diodes if a centre-tap transformer is used, but this method is rarely used now that diodes are cheaper. A single diode can be used as a rectifier but it only uses the positive (+) parts of the AC wave to produce half-wave varying DC.

Bridge rectifier:

A  bridge  rectifier  can  be  made  using  four  individual  diodes, but it  is  also  available  in special packages containing the four diodes required. It is called a full-wave rectifier because it uses the entire AC wave (both positive and negative sections).  1.4V  is  used  up  in  the  bridge  rectifier  because  each  diode  uses  0.7V when conducting and  there are always two diodes conducting,  as  shown  in the diagram  below. Bridge rectifiers are rated by the maximum current  they can pass  and the maximum reverse  voltage they can withstand (this must be  at least  three times the  supply RMS voltage so  the rectifier  can  withstand the peak voltages). Please see the Diodes page for more details, including pictures of bridge rectifiers.

9

Page 11: Accident Prevention Automatic Door

Bridge Rectifier Circuit and Waveform of DC

2.1.3 Smoothing

10

Page 12: Accident Prevention Automatic Door

Smoothing is performed by a large value electrolytic capacitor connected across the DC supply to act as a reservoir, supplying current to the output when the varying DC voltage from the rectifier is falling. The diagram shows the unsmoothed varying DC (dotted line) and the smoothed DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then discharges as it supplies current to the output.

Smoothing is not perfect due to the capacitor voltage falling a little as it discharges, giving a small ripple voltage. For  many  circuits a ripple  which  is 10%  of  the supply  voltage is  satisfactory  and the  equation below gives the  required value for the smoothing  capacitor. A larger capacitor will give fewer ripples.  The capacitor value must be doubled when smoothing half-wave DC.

Charging and Discharging of Capacitor

From  figure  4,  we  can  observe  that  when  waveform  is  rising  it  is  getting  charged  and  when  it  is decaying it will discharge.

11

Page 13: Accident Prevention Automatic Door

2.1.4 Regulator

Voltage regulator ICs are available with fixed (typically 5, 12 and 15V) or variable output voltages. They are also rated by the maximum current they can pass. Negative voltage regulators are available, mainly for use in dual supplies. Most  regulators  include  some  automatic  protection  from  excessive  current ('overload  protection') and  overheating ('thermal  protection'). Many of the fixed voltage regulator ICs has 3 leads and look like power transistors, such as the 7805 +5V 1A regulator shown on the right.

Three Terminal of Regulator

12

Page 14: Accident Prevention Automatic Door

From the  above  figure,  we can  see  that  regulator  consists  of  three  terminals  , one  is  input,  second  is output and third one is grounded

2.2 Current Limiting Resistor for LED

A suitable value for a current limiting resistor is calculated as follows.

The supply voltage is 5 volts.

The current that we want to flow through the LED is 5mA.

13

Page 15: Accident Prevention Automatic Door

Assume that the forward voltage drop will be 1.5 V.

BY KVL, the voltage drop across the resistor must be 5 -1.5=3V.

By Ohm's Law, this voltage drop equals iR

Therefore:

5- 1.5 = R*5mA

Rearranging terms gives:

R = (5- 1.5)/5mA

R = 3.5/5m = 0.7 K   = 700Ω.

So, if we select R value as 700Ω, then the current flowing through the LED is limited to 5 m

14

Page 16: Accident Prevention Automatic Door

3. CIRCUIT DESCRIPTION

The following Hardware and software is used in this system. Detailed explanation of these components follows in the later sections.

3.1 Hardware

1) Micro Controller

2) Movement Sensor

3) Power Supply 5V

4) IR Sensor

5) Motor

3.2 Software Tools

1) Express PCB/Pads

2) C cross compiler for AVR micro

The complete Circuit for the system is shown in the below figure.

15

Page 17: Accident Prevention Automatic Door

Circuit for Accident Prevention Automatic door

 Circuit Operation:

Some of the components in this system require DC5V for their operation, for example the movement sensor. Hence we have designed a 5V regulator.

The major power source for us is mains 230V ac. For the regulator design we need a lower ac voltage.

We have used a transformer to accomplish this task. The transformer stepped down the 230v ac to an acceptable level. This stepped down ac voltage was converted to DC with the help of a bridge rectifier.

The output of the regulator is DC. However this DC has some ac contents in it. This ac content is called as ripples. With the help of a smoothing capacitor these ripples are removed. Now we have a DC voltage.

However this DC voltage is not a regulated DC. Means this voltage is not constant. This gets varied depending on the load and the mains supply voltage. We have used a regulator IC which provides us constant DC with constant current. The DC voltage is 5V with a current of 1A.

The major circuit element is the movement sensor. The output of this sensor changes whenever it detects some movement with-in its proximity. The output of the sensor is given as input to the control circuit.

The other sensing element is IR sensor. In normal case the transmitted IR is received back through the door. This is active when it receives interruption.

The control circuit consists of a micro controller, AVR ATmega8. This Micro receives the information from the movement sensor   Based on the information the micro sends output to open or close the door. The micro also receives information from IR sensor. If the IR sensor is active the doors are kept open.

The output of the micro is given to a motor driver. This driver controls the operation of the motor. It will make the motor to turn in either forward direction or reverse direction.

16

Page 18: Accident Prevention Automatic Door

 

3.3 Motor Control

In this section we will explain how a DC motor is interfaced, how it is controlled. Controlling a DC motor is nothing, but controlling the direction and speed of a motor. In the following section we will present motor controlling concept to understand about its operation.

How DC Motor works???

Let’s see how a DC motor runs. Direction control of a DC motor is very simple; just reverse the polarity, means every DC motor has two terminals out. When we apply DC voltage with proper current to a Motor, it rotates in a particular direction but when we reverse the connection of voltage between two terminals, motor rotates in another direction.

Controlling using Micro Controllers!!!

17

Page 19: Accident Prevention Automatic Door

Now let us consider how to control motor using Microcontroller provided:

From the above explanation we see and observe how to change the direction of DC motor.

1. Micro controller gives output either logic low or high.

2. Means we will have either 0V or Vcc, usually 5V at the output of the micro controller.

3. We cannot connect motors to micro controller directly, as most of the time the motors requires voltage higher than +5V, and usually motors demands high current than what the micro controller pins are capable of.

  So then how can we control the voltages? Well we can use some switching elements between the micro controller and the motor. This requires 4 switches. This is illustrated in the following diagram

It is a circuit which allows motor rotation in both directions. From the four terminals we can control a DC motor direction and speed.

The above circuit can be realized with the help of simple transistors or power transistors or MOSFETs, depending on the motor requirement.

Upon investigation, luckily, we have found that all these arrangements are available in an IC. We preferred to use a readymade IC if one available for the reason that we understand the readymade IC works better than the discrete versions.

One such IC which can do this task is L293D. This is dual motor driver IC, what it means is that we can drive two motors with a single IC. However for our purpose we are not using two motors hence we will make use of one channel and leave the other channel unconnected.

18

Page 20: Accident Prevention Automatic Door

The truth table for one channel is shown in the following table. The other channel is identical.

19

Page 21: Accident Prevention Automatic Door

From the above table it is clear that the output is dependent on the enable. The output is available only when the enable pin is made high. When the enable pin is low the outputs are in high impedance state.

Now, say, we wish to run the motor in the forward direction. The connections to the motor are, the positive terminal of the motor is connected to output1 while the negative terminal is connected to the output2. To make the motor run in the forward direction, what all we need to do is make the input configuration as shown in the

20

CASE # ENABLE 1 INPUT 1 INPUT 2 OUTPUT 1 OUTPUT 2

1 LOW LOW LOW HIGH IMPEDANCE

HIGH IMPEDANCE

2 LOW LOW HIGH HIGH IMPEDANCE

HIGH OMPEDANCE

3 LOW HIGH LOW HIGH IMPEDANCE

HIGH IMPEDANCE

4 LOW HIGH HIGH HIGH IMPEDANCE

HIGH IMPEDANCE

5 HIGH LOW LOW LOW LOW

6 HIGH LOW HIGH LOW HIGH

7 HIGH HIGH LOW HIGH LOW

Page 22: Accident Prevention Automatic Door

above table, case#7. Similarly, to run the motor in the reverse direction we need to provide input to the IC as per case

4. MAJOR COMPONENTS INFORMATION

21

Page 23: Accident Prevention Automatic Door

In this section we present detailed information on the major components that we have used in our system.

4.1 AVR Microcontroller

A quick look on the market reveals there are tons of micros available.

Some of them which we have narrowed down are

1) AVR AT Mega microcontroller Series

2) 8051 Series

3) PIC microcontroller Series

4) ARM Series

AVR has got advanced features combined with rich instructions and architecture.  Hence we have used AVR as the controller. There are minimum six requirements for proper operation of microcontroller.

Those are:

1) Power supply section

2) Ports

3) Reset circuit

4) Crystal circuit

5) ISP circuit (for program dumping)

For this project we are using AVR microcontroller. we can use transistors instead of microcontroller and even  transistors  are  cheap  also  in  comparison  to  microcontroller  but  the  reason  behind  using  the microcontroller is we are in learning phase. One reason also stand for using microcontroller is that if we have used transistor, circuit would have been very complexes.  This  is because we prefer to use microcontroller.

4.1.1 I/O Port:

Microcontrollers usually have special hardware for dealing with outside world. These are called I\O ports. We normally use I\O ports

22

Page 24: Accident Prevention Automatic Door

to interface the microcontrollers to sensors, actuators etc. Microcontroller input\output is always logic high or logic low in terms of voltage. If logic high, it means +5 V and if logic low, it means 0 V. All AVR ports have true Read-Modify-Write functionality when used as general digital I/O ports.

This means that the direction of one port pin can be changed without unintentionally changing direction of any other pins.  Each  output  buffer  has  symmetrical  drive  characteristics  with  both  high  sink  and source  capability.  The  pin  driver  is  strong  enough  to  drive  LED  displays  directly.  All port pins have individually selectable pull-up resistors with a supply-voltage invariant resistance.

Pin Diagram

23

Page 25: Accident Prevention Automatic Door

In AVR microcontroller there are three I\O ports named B, C & D. The port B & D has 8 pins or bits and the port C has 7 pins. All the bits of any these said ports, we can use as both I\O port. In this above said system we'll use port D as input and port B as output. This is shown in the circuit diagram.

 

4.1.2 AVR Micro Block Diagram

24

Page 26: Accident Prevention Automatic Door

AVR Micro Block Diagram

 The AVR core combines a rich instruction set with 32 general purpose working registers. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU), allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC Microcontrollers.

The ATmega8 provides the following features: 8K bytes of In-System Programmable Flash with Read- While-Write capabilities, 512 bytes of EEPROM, 1K byte of SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible Timer/Counters with compare modes, internal and external interrupts, a serial programmable USART, a byte oriented Two wire Serial Interface, a 6-channel ADC (eight channels in TQFP and QFN/MLF packages) with 10-bit accuracy, a programmable Watchdog Timer with Internal Oscillator, an SPI serial port, and five software selectable power saving modes. The Idle mode stops the CPU while allowing the SRAM; Timer/Counters, SPI port, and interrupt system to continue functioning.

The Power down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next Interrupt or Hardware Reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping.

The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the crystal/resonator Oscillator is running while the rest of the dev ice is sleeping. This allows very fast start-up combined with low-power consumption.

The device is manufactured using Atmel's high density non-volatile memory technology. The Flash Program memory can be reprogrammed In-System through an SPI serial interface, by a conventional non-volatile memory programmer, or by an On-chip boot program running on the AVR core. The boot program can use any interface to download the application program in the Application Flash memory. Software in the Boot Flash Section will continue to run while the Application Flash Section is updated, providing true Read-While-Write operation. By combining an 8-bit RISC CPU with In-System Self- Programmable Flash on a monolithic chip, the Atmel ATmega8 is a powerful microcontroller that provides a highly-flexible and cost-effective solution to many embedded control applications.

The ATmega8 AVR is supported with a full suite of program and system development tools, including C compilers, macro assemblers, program debugger/simulators, In-Circuit Emulators, and evaluation kits.

25

Page 27: Accident Prevention Automatic Door

4.1.3 AVR Micro Controller Internal Architecture

AVR Micro Controller Internal Architecture

26

Page 28: Accident Prevention Automatic Door

4.1.4 Pin Descriptions

VCC:

Digital supply voltage.

GND:

Ground.

Port B (PB7...PB0) XTAL1/XTAL2/TOSC1/TOSC2

Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.

Depending on the clock selection fuse settings, PB6 can be used as input to the inverting Oscillator amplifier and input to the internal clock operating circuit.

Depending on the clock selection fuse settings, PB7 can be used as output from the inverting Oscillator amplifier.

If the Internal Calibrated RC Oscillator is used as chip clock source, PB7...6 is used as TOSC2...1 input for the Asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.

Port C (PC5...PC0)

Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port C output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The Port C pins are tri-stated when a reset condition becomes active, even if the clock is not running.

PC6/RESET

If the RSTDISBL Fuse is programmed, PC6 is used as an I/O pin. Note that the electrical characteristics of PC6 differ from those of the other pins of Port C.

27

Page 29: Accident Prevention Automatic Door

If the RSTDISBL Fuse is unprogrammed, PC6 is used as a Reset input. A low level on this pin for longer than the minimum pulse length will generate a Reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a Reset.

Port D (PD7...PD0)

Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port D pins that are externally pulled low will source current if the pull-up resistors are activated. The Port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.

Port D also serves the functions of various special features of the ATmega8..

RESET

Reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.

AVCC

AVCC is the supply voltage pin for the A/D Converter, Port C (3...0), and ADC (7...6). It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. Note that Port C (5...4) use digital supply voltage, VCC.

AREF

AREF is the analog reference pin for the A/D Converter.

Configuring the Pin

Each port pin consists of 3 Register bits: DDxn, PORTxn, and PINxn. The DDxn bits are accessed at the DDRx I/O address, the PORTxn bits at the PORT x I/O address, and the PIN xn bits at the PINx I/O address.

 The DDxn bit in the DDRx Register selects the direction of this pin. If DDxn is written logic one, Pxn is configured as an output pin. If DDxn is written logic zero, Pxn is configured as an input pin.

If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up resistor off, PORTxn has to be written

28

Page 30: Accident Prevention Automatic Door

logic zero or the pin has to be configured as an output pin. The port pins are tri-stated when a reset condition becomes active, even if no clocks are running.

If PORTxn is written logic one when the pin is configured as an output pin, the port pin is driven high (one). If PORTxn is written logic zero when the pin is configured as an output pin, the port pin is driven low (zero).

When switching between tri-state ({DDxn, PORTxn} = 0b00) and output high ({DDxn, PORTxn} = 0b11), an intermediate state with either pull-up enabled ({DDxn, PORTxn} = 0b01) or output low ({DDxn, PORTxn} = 0b10) must occur. Normally, the pull-up enabled state is fully acceptable, as a high-impeding environment will not notice the difference between a strong high driver

Reading the Pin Value

Independent of the setting of Data Direction bit DDxn, the port pin can be read through the PINxn Register Bit. The PINxn Register bit and the preceding latch constitute a synchronizer. This is needed to avoid Meta stability if the physical pin changes value near the edge of the internal clock, but it also introduces a delay.

OSCILLATOR CONNECTIONS:

29

Page 31: Accident Prevention Automatic Door

Note:

C1, C2 = 30 pF ± 10 pF for Crystals

= 40 pF ± 10 pF for Ceramic Resonato

4.2 Transistor as a switch

We have used NPN transistor in our system. It is configured as a switch. How the transistor is configured as a switch is here by explained.

The operation of npn Transistor consists three regions namely emitter,  base  and  collector.  Emitter and base constitute of EBJ and base and collector consists of CBJ.

Operating modes of Transistor:

Modes EBJ CBJ

Cut off Reverse Reverse

saturation Forward Forward

Transistor as a switch can be achieved with common-emitter circuit as shown below

30

Page 32: Accident Prevention Automatic Door

Common-emitter circuit

 4.3. 555 Integrated Circuit Timer:

As we told earlier that we are using a transmitter receiver pair in our design, so 555 timer IC along with Infra red LED which is going to transmit signal to receiver TSOP 1738. This TSOP 1738 receive frequency of 38 KHz square wave pulse which is generated by 555 timers IC.

31

Page 33: Accident Prevention Automatic Door

In  this  section,  we  discuss  the  most  popular  555  IC  timer  and  its  application  to  implement multivibrators.  The  555  Timer  IC  is  an  integrated  circuit  (chip)  implementing  a  variety  of  timer  and multivibrator applications.

The IC was designed by Hans R. Camenzind in 1970 and brought to market in 1971 by Signe tics (later acquired by Philips).  It has been claimed that the 555 gets its name from the three 5 kΩ resistors used in typical early implementations, but Hanz Camenzind has stated that the number was arbitrary.

The part is still in wide use, thanks to its ease of use, low price and good stability.

The 555 has three operating modes. They are

1. Monostable   mode:

In this mode, the 555 functions as a “one-shot".  Applications include timers, missing pulse detection, bounce free switches, touch switches, frequency divider, capacitance measurement, pulse-width modulation (PWM) etc.

32

Page 34: Accident Prevention Automatic Door

2. A stable mode:

Free running mode:  the 555 can operate as an oscillator. Uses  include  LED and lamp  flashers,  pulse  generation,  logic  clocks,  tone  generation,  security  alarms,  pulse  position modulation, etc.

3. BiStable   mode   or   Schmitt   trigger :

The  555  can  operate  as  a  flip-flop,  if  the  DIS  pin  is  not connected and no capacitor is used. Uses include bounce free latched switches, etc

33

Page 35: Accident Prevention Automatic Door

Block schematic of 555 IC

This IC consists of two comparators that drive the set(S) and reset(R) terminals of a flip flop. The Q output is available as the overall output. Q' drives the discharge transistor. The reference voltage of comparator 1 is fixed at (2/3) V+ and that of comparator 2 is fixed at (1/3) V+.A potential divider between V+ and GND is used for providing the reference voltages.

Definitions of Pin functions:

34

Page 36: Accident Prevention Automatic Door

Pin1 (ground): The ground (or common) pin is the most negative supply of the device, which   is normally connected to circuit ground when operated from positive supply voltage.

Pin2 (Trigger ):   This pin is the input to the lower comparator and is used to set the latch which cause the output to go high. This is the beginning of the timing sequence in monostable operation.

Pin3 (output): The output Q is responsible for the overall output and Q' is for transistor switch. The state of  the  output  pin  always  reflects  the  inverse  of  the  logic  state  of  the  latch.  The trigger input is momentarily taken from a higher to lower level. This cause the latch to be set and the output to go high.

The output can be returned to a low state by causing the threshold to go from a lower to a higher level which resets the latch

Pin4 (reset ): This pin is always used to reset the latch and output to a low state. The reset pin will force the output to go low, no matter w hat state the other inputs to the flip-flop are in. When not used, it is recommended that the reset input be tied to V+ to avoid any possibility of false triggering.

Pin5 (control voltage): This  pin allows  direct access to the (2\3) V+ voltage-divider  point, the  reference level for upper comparator.

Pin6 (threshold): This  pin  is  one  input  to  the  upper  comparator  and  is  used  to  reset  the  latch, which causes output to go low.

Pin7 (discharge): This pin is connected to the open collector of an n-p-n transistor, the emitter of which goes to the ground, so that when the transistor is ON, pin7 is effectively shorted to ground. Usually the timing capacitor is connected between pin7 and ground and is discharged when transistors turns ON.

Pin8 (V+): This pin is positive supply voltage terminal of the 555 timer IC. The supply voltage operating range is between +5 V and +15 V.

Now we talk about the internal functionality of 555 timers IC. As we can see  pin 7 is directly connected with a transistor, the output Q is connected with an output  buffer

35

Page 37: Accident Prevention Automatic Door

amplifier, the working principle of RS latch, these things we are going to discuss in further sections:-

(i) One of the outputs of latch i.e.  Q is connected to an output driver.  We use an output buffer amplifier. This is because for strengthen of output coming from latch. The output coming from latch is weak in nature. So, for getting strengthened output buffer amplifier is used.

(ii) As far concern to our application, the output Q' drives the discharge transistor and controls its ON and OFF cycles.  Pin  7  (discharge)  is  connected  to  the  open  collector  of  an  n-p-n  transistor,  the emitter of which goes to the ground,  so that when transistor  is  turned ON,  pin 7 is effectively shorted the ground.

  In this section we discuss about the operation of transistor as switch. To operate transistor as a switch, we utilize the cutoff and saturation modes of operation

n p n

Emitter Base collector

Emitter (E) Collector(c)

Collector-Base junction

Emitter-Base junction

36

Page 38: Accident Prevention Automatic Door

NPN Transistor

From  the  above  figure,  we  see  that  npn  Transistor  consists  three  regions  namely  emitter,  base  and collector. Emitter and base constitute of EBJ and base and collector consists of CBJ.

Operating modes of Transistor

To understand transistor as a switch, we will go through a common-emitter circuit:

Common-emitter circuit

 From the above figure, for V (AC input voltage) less than about 0.5 V, the transistor will be cut off. So, IIB= 0, IC= 0 and VC=VCC. Hence, node C will be disconnected from the ground and switch is in the open position. To turn the transistor ON, we have to increase V above than 0.5 V. In fact, for appreciable current to I flow, VB should be about 0.7 V and VI should be higher (VI > VBE)

Where,

ß=Common-emitter current gainVCE (voltage between collector and emitter) = 0.2 V (in saturation mode)

37

Page 39: Accident Prevention Automatic Door

At which point the transistor leaves the active region, enters the saturation region. That is called edge β saturation  and the  satisfying  condition  is VC>  VB -  0.4  V.  Hence, in this  way  transistor  can  work as  a switch. It is OFF in cutoff mode and ON in saturation mode. It is ON (low resistance to ground) when the output is low and OFF (high resistance to ground) when the output is high. The transistor switch is used to clamp the appropriate node of timing network to ground.

(iii) The output of comparator 1 & 2 are the two inputs of RS latch. In this section we will discuss about the working principle of RS latch.

RS latch diagram

Truth table:

S R Qn+1

0 0 Qn

0 1 0

1 0 1

38

Page 40: Accident Prevention Automatic Door

1 1 X

Truth Table for SR Latch

Above truth table shows that whenever set input is at high the output will be at high and whenever reset input is at high the output will be at low.

Testing of 555 timer IC:

Here, we used 555 IC timer for generating 38 kHz frequency of square wave pulse. This is possible when this IC will work in a stable mode as an oscillator.  Actually in astable mode this IC will produce the continuous stream of square wave pulse.

555 IC Timer Circuit

We have some formulas for further calculations:

f = 1/ (ln2). (R1+ 2R2). C

Where, f denotes frequency in Hertz.

High time of duty cycle is:     High = (ln2). (R1+ 2R2). C

Low time of duty cycle is:       Low = (ln2). R2. C

Here, we are taking the values of R1, R2 and C are

39

Page 41: Accident Prevention Automatic Door

R1 = 220, R2 = 1.8K, C = 10nF and

Duty cycle= (R1+ R2) \ R1+2 R2

It means that there should be difference between R1 and R2 and duty cycle doesn't depend upon value of capacitor. By applying these values, we are getting frequency approximately equal to 38 KHz and duty cycle is coming equal to 53 % and that is meeting to our requirement...

4.4 TSOP 1738 IR receiver:

This  TSOP 1738  work  as  receiver,  which  is  easily  available  and  operate  on  38Kfrequency.

Details:

Receives modulated infrared signal and converts into electrical signal.

Features:

Photo detector and preamplifier circuit in the same casing.

Receives and amplifies the infrared signal without any external component.

5 V output

40

Page 42: Accident Prevention Automatic Door

38 kHz integrated oscillator.

High sensitivity.

High level of immunity to ambient light.

Improved shielding against electrical field interference.

TTL and CMOS compatibility.

Applications: infrared remote control.

Technical specification:

Supply: 5 V

Power consumption: 0.4 to 1.0 mA

Angle of detection: 90

Dimensions of the casing (mm): 12.5 x 10 x Thickness 5.8

As concern to our design we are using three TSOP 1738 infrared receiver whereas three 555 timer IC with infrared sensor working as transmitter.

Now it is clear that why we are getting 38 kHz frequency output from 555 timer IC. This is   the reason we are using TSOP 1738 infrared receiver.

  Testing of TSOP 1738:

While  performing  experiment  after  assembling  hardware  on  printed  circuit  board  that  usually  called PCB, we will check input +5 V voltage between pin 1 & pin 2 of TSOP 1738 infrared receiver. Between pin 2 & pin 3 we will check whether it is receiving correctly or not. It will happen in following fashion:-

If IR LED (receiver) detects any hurdle in between of its line of sight communication then voltage across its output get low.

If IR LED (receiver) does not detect any hurdle in the way of its line of sight communication then voltage across it remains high.

 4.5 PIR Sensor Circuit

A PIR (Passive Infrared) sensor detects infrared light that is emitted from objects within its field of view. PIR sensors differ from other infrared sensors because they can only receive infrared waves. Because all objects  emit  infrared  waves  (electromagnetic  waves  that  travel  with  heat),  PIR  sensors  can  detect objects 

41

Page 43: Accident Prevention Automatic Door

that  are  in front of  them.  In fact, PIR sensors can detect many things that humans cannot.  PIR sensors are used in many applications, such as night vision, motion detection, and laser range finding.

PIR  detector  is  a  motion-detecting  sensor  that  functions  based  on  passive  infrared  technology.  The passive infrared technology is the most advanced form of technology, which is widely used  in defense and wireless video surveillance systems.  It  is usually  mounted onto  a  wall and positioned to  focus  the motion  activities  within  that  area.  The  motion  sensors  of  PIR  detector  emit  streaks  of  infrared  in  a covered area.

Among the streaks of rays emitted, the topmost layer of rays can reach up to 60ft in height and 35ft on either side. The rays emanating from the center covers the area that is closest to the sensor alarms. The rays  detect the  foreign intrusion by  noting  the difference between  the temperatures of the  individual beams  that  strikes  the  foreign  body.  For  example,  when  the  rays  from  the  PIR  detector  strike  your furniture, the motion sensor can easily detect its temperature. Likewise  when  somebody  passes  through  the  furniture,  the  motion  sensor  can  detect  even  the temperature of the person. So, the PIR detector can now analyze the temperature difference between the furniture and the person and will let you know the intrusion. Moreover, the microchip present inside the motion sensor is capable of adjusting according to the changing room temperature gradually. Some specific kinds of PIR motion detectors are designed to provide a 360°-viewing field downward. Hence, it is  not  easy  to  compromise  with  the  PIR  detectors  that  function  with  passive  infrared  motion  sensor technology.

42

Page 44: Accident Prevention Automatic Door

MOTION SENSOR

MOTION SENSOSOR

How PIR Sensors Work:

PIR sensors are made of piezoelectric (or thermoelectric) materials and usually contain lenses or mirrors in order to focus the infrared light for maximum reception. As infrared light comes in contact with the piezoelectric material, which is usually a thin sheet, it creates an electrical current that can be measured to determine the intensity of the infrared light (depth perception) and the direction that it came from.

 Because of these properties, PIR sensors are able to determine how far away someone is and whether he/she is approaching the sensor.

43

Page 45: Accident Prevention Automatic Door

Applications:

PIR sensors are used  in many  applications. They  are  used  on  television  sets  and  television  accessory devices,  such  as  VCRs  and DVD  players,  to  detect  infrared light  coming from  a  television  remote.  PIR sensors  are  also  used  as  motion  detectors  at  most  public  doorways  in  grocery  stores,  hospitals,  and libraries. PIR sensors can also be used for military purposes such as laser range-finding, night vision, and heat-seeking missiles.

Advantages:

PIR sensors have several important advantages. They detect infrared light from several feet/yards away, depending on  how the  device  is  calibrated.  PIR sensors  are  generally  compact  and  can  be  fitted into virtually any electronic device. Also, they do not need an external power source because they generate electricity as they absorb infrared light.

The unit is passive and it is not possible for intruders to locate their place of installation. They consume less power than IR or radar based systems. They are not affected by light and thus can work well both in day and night. Some of the high-end detectors are provided with precision optics that can detect narrow areas accurately. The detectors work coherently with the cameras, which limits the number of cameras being used in a particular area. The small designs of detectors can beautifully blend in confined spaces.

Disadvantages:

Although PIR sensors can be  advantageous, they also  have several  disadvantages. PIR sensors can only receive infrared light and cannot  emit  it like other types of infrared sensors. They can be expensive  to purchase,  install,  and  calibrate  as  well.

The  passive  infrared  rays  from  the  PIR  detector  cannot  pass through doors, windows or walls within the rooms. The rays emanating from the motion sensors cannot curve around in the corners. So, when you place the PIR detector in a room that has an open door, the motion sensor cannot detect intrusions when the door is closed.

Apart from that, a single PIR motion detecting camera  cannot cover every  square inch of  space in your room.  Moreover  someone  who  moves  rapidly  or  slow  can  fool  these  detectors  at  times.  The  PIR detector is more ideal for installing in places that are prone to more intrusions and invasion of burglars or other types of  intruders.  Presently, manufacturers  are  concentrating in combining the  technologies and features to offer good and reliable detectors to the areas that require high-end security. In addition  to  combining  video  and  detectors  in  one 

44

Page 46: Accident Prevention Automatic Door

place,  you  can  also  find  detectors  that  offer  wireless transmission for distances up to 1000 feet.

Motion sensors are integral part of home automation and security systems motion sensor lighting is also widely used to switch off lights when not needed and light up a passage or rooms when there is a need.

Turning off the lights in such circumstances can save substantial amounts of energy. In lighting practice occupancy sensors are sometime also called "presence sensors" or "vacancy sensors". Today wireless motion sensors, microwave motion sensor and infrared motion sensor alarms are gaining huge popularity.

There are many types of motion sensors from the simplest infrared detectors to the most sophisticated laser beams. These sensors serve mainly one purpose that is to detect the presence of some motion or some 'body' in the area it operates. This 'sensing' can be of something that happens at a specific location or one that occurs within a larger area.

The field of view of the sensor must be carefully selected/ adjusted so that it responds only to motion in the space served by the controlled lighting.

For example: an occupancy sensor controlling lights in an office should not detect motion in the corridor outside the office. Sensors and their placement are never perfect, therefore most systems incorporate a delay time before switching. This delay time is often user-selectable, but a typical default value is 15 minutes. This means that the sensor must detect no motion for the entire delay time before the lights are switched. Most systems switch lights off at the end of the delay time, but more sophisticated systems with dimming technology reduce lighting slowly to a minimum level. If lights are off and an occupant re-enters a space, most current systems switch lights back on when motion is detected.

However, systems designed to switch lights off automatically with no occupancy, and that require the occupant to switch lights on when they re-enter are gaining in popularity due to their potential for increased energy savings. These savings accrue because in a space with access to daylight the occupant may decide on their return that they no longer require supplemental electric light.

 

PIR motion sensor detects motion.

The working of this sensor completely depends upon the height at which it is fixed in the room and the angle of coverage that the sensor can make. The below figure shows a motion sensor fixed to the ceiling of a room at a height of 5 to 7 meters from the ground and the angle of coverage is about 35° to 155°.

45

Page 47: Accident Prevention Automatic Door

The motion sensor senses the movement of the person in this area.

5. TESTING PROCESS

In  this  section  we  will  check  our  all  components  so  far  used.  We  will  also  discuss  about  it working conditions, problems faced across its testing.

Testing of Power Supply

46

Page 48: Accident Prevention Automatic Door

To Design 5V, 500mA Power supply.

Circuit Diagram of Power Supply

1. TRANSFORMER:

Here,  AC mains 230V step down transformer is used. Hence, no. of turns in primary coil is more than in secondary coil. Since, it is step down transformer, so, it  will reduce the voltage. Since, we cannot apply ideal  transformer  in  practical  uses.  So,  according  to  variations  in  input  voltage,  output  voltage  is calculated further.

2. RECTIFIER:

Here,  full wave bridge rectifier  is  used to convert  AC to DC because four diodes are spent to make  full wave bridge rectifier where  two  conduct on the  positive half cycle, and the  other  two conduct on the negative half cycle. Hence, this said rectifier is used instead of half wave bridge rectifier.

1N4001 features:

In our design we require voltage of 5V and current of 500mA, so from the following datasheet we can see that 4001 is giving us 50V as reverse voltage and rest are giving higher voltage which is not required, and also giving us sufficient current(1 amp) required by uS

47

Page 49: Accident Prevention Automatic Door

Features of 1N4001

Low forward voltage drop

High surge (sudden increment) current capability

3. CAPACITOR:

For this  design an  electrolytic  capacitor of value 470µF (calculated) is applied.  This  capacitor  is applied for the smoothing purpose. We can  use more

than one capacitor but that is optional and based on  our requirement 

4. REGULATOR:

Voltage  regulator  is  an  electrical  regulator  designed  to  automatically  maintain  a  constant  voltage level. Now from the given datasheet we can see that we are obtaining 5V and current of 500mA from this regulator.

This (LM 7805) is  most  common  voltage regulator  that  is still  used  in embedded designs. :-

LM78XX Series:

3-Terminal 1A positive voltage regulators

Features:

1. Output current up to 1A

2. Output voltages of  5,6,8,9,10,12,15,18,24

3. Thermal overload protection

4. Short circuit protection

5. Output transistor safe operating area protection

6. Output voltage tolerance =

7. Operating temperature = -40

8. Input voltage range = 7V - 20V

48

Page 50: Accident Prevention Automatic Door

6. CONCLUSION

49

Page 51: Accident Prevention Automatic Door

We  have  spent  time  on  investigating  about  various  sensors  to  determine which  one suits for our application.

We have used movement sensor for detecting the movement of visitor, as it is best suited for our application.

We have used IR sensor for accident prevention purpose. A well regulated power supply was designed. This power supply produces 5V with 1 A current. A motor driver IC was used to drive the motor. The motor is controlled bidirectional. We have gained the design techniques. We have developed testing skills. We practiced the art of soldering. Finally, we thank the college and the university for providing us an excellent

opportunity to transform our theoretical knowledge in to practical application We have gained the confidence to handle similar projects in the future.

50

Page 52: Accident Prevention Automatic Door

7. CODING

SS#include<util /delay.h>

Int main ( )

{ DDRB =0X03;

DDRC =0XFF;

While (1)

{ It (((PINB& 0X01)!!((PINB& 0X02) ==0)));

{ Port=0x01 ; } If (ports==0X05)

{ IF ((portB&0X04) ==0)

{ Port=0X00;

If ((PINB&0X01) ==0)!!((PINB&0X02) ==port=0X05;

} } } Else { Port=0X02;

If ((port ==0X02))

{

If ((PINB& 0X08) ==0);

{ Port=0X00;

Else port=0X02; }

} }

}

51

Page 53: Accident Prevention Automatic Door

8. REFERENCE

1. www.google.com

2. www.wikipedia.com

Datasheet we referred:

1. Fairchild semiconductor/1N4001-1N4007 general purpose rectifiers

2. Fairchild semiconductor/LM78XX 3-terminal 1A positive voltage regulator

3. Atmel/AVRATMega8 datasheet

Books we referred:

1. Analog Electronics, L.K Maheshwari, M.M.S Anand, Prentice-Hall of India pvt. Ltd., Third edition

2. Microelectronic Circuits, Sedra/Smith, Oxford University press, Fifth edition.

 

52