2. EMBEDDED System
2. 1 Definitions
2. Examples Of Embedded Systems
3. Microprocessor and Microcontroller
4. Microprocessor verses Microcontroller
3. BLOCK DIAGRAM
3. 1. 1 Block Diagram Description
3. 1. 2 555 Timers
3. 1. 3 Infrared Sensor
3. 1. 4 Microcontroller ( 89S52 )
3. 1. 5 Power Supply
4. CIRCUIT DIAGRAM
4. 1. 1 555 Timers
4. 1. 2 Infrared Emitted Diode ( TSAL 6200 )
4. 1. 3 IR Receiver ( TSOP )
4. DTMF generator
5. COMPONENTS & amp ; THEIR
5. 1. 1Microcontroller
5. 1. 2 Description Of 8952 Microcontroller
5. 1. 3 Features Of Microcontroller
5. 1. 4 Block Diagram Of Microcontroller
5. 1. 5 Pin Configurations
5. 1. 6 Pin Description
6. 555 Timer
7. ULN 2003
1. Pin Connection
7. 2 Description
8. STEPPER MOTOR
8. 1 Description
8. 2 Back EMF
8. 3 Driving a hoofer motor
9. FLOW CHART
10. Beginning Code
11. CIRCUIT DIAGRAM
12. KEIL SOFTWARE
12. 1 Software Description
The railroad gate is to be controlled so that the route traffic is to be predicted. The railroad gate is to be closed when a train is go throughing by the manner. The gap and shutting of the gate is to be done utilizing DC motors and this DC motor is controlled by micro accountant. The signaling of the train is besides controlled depending upon the gate place. Merely when gate is closed the ruddy signal is otherwise green signal. So in this undertaking the railroad signaling includes the gate control is done utilizing microcontroller. The automatic gap and shutting of the gate and besides the signaling which depending on the gate place that will be controlled by the microcontroller.
Present undertaking is designed utilizing 8051 microcontroller to avoid railroad accidents go oning at unattended railroad Gatess. if implemented in spirit. This undertaking utilizes two powerful IR senders and two receiving systems ; one brace of sender and receiving system is fixed at up side ( from where the train comes ) at a degree higher than a human being in exact alliance and likewise the other brace is fixed at down side of the train way. Sensor activation clip is so adjusted by ciphering the clip taken at a certain velocity to traverse at least one compartment of standard minimal size of the Indian railroad. We have considered 5 seconds for this undertaking. Detectors are fixed at 1km on both sides of the gate. We call the detector along the train way as ‘foreside sensor’ and the other as ‘aft side sensor’ .
When foreside receiving system gets activated. the gate motor is turned on in one way and the gate is closed and corsets closed until the train crosses the gate and reaches aft side detectors. When aft side receiving system gets activated motor turns in opposite way and gate clears and motor Michigans. Buzzer will instantly sound at the fore side receiving system activation and gate will shut after 5 seconds. so giving clip to drivers to clear gate country in order to avoid pin downing between the Gatess and halt sound after the train has crossed.
The same rule is applied for path shift. Sing a state of affairs wherein an express train and a local train are going in opposite waies on the same path ; the express train is allowed to go on the same path and the local train has to exchange on to the other path. Two detectors are placed at the either sides of the junction where the path switches. If there’s a train nearing from the other side. so another detector placed along that way gets activated and will direct an interrupt to the accountant. The interrupt service modus operandi switches the path. Indicator visible radiations have been provided to avoid hits. Here the shift operation is performed utilizing a stepper motor. Assuming that within a certain hold. the train has passed the path is switched back to its original place. leting the first train to go through without any break. This construct of path shift can be applied at 1km distance from the Stationss.
The undertaking is simple to implement and subject to farther betterment.[ movie ] [ movie ]
2 Embedded System:
2. 1 Definition:
Embedded system is a combination of hardware and package. it is besides named as “Firm ware” . An embedded system is a particular intent computing machine system. which is wholly encapsulated by the device it controls. It is a computer-controlled system. An embedded system is a specialised system that is a portion of a larger system or machine. As a portion of a larger system it mostly determines its functionality. Embedded systems are electronic devices that incorporate microprocessors with in their executions. The chief intent of the microprocessors are simplify the system design and better flexibleness. In the embedded systems. the package is frequently stored in a read merely memory ( RAM ) bit. Embedded systems provide several major maps including monitoring of the parallel environment by reading informations from detectors and commanding actuators.
2. 2 EXAMPLES OF EMBEDDED SYSTEMS:
Embedded systems are found in broad scope of application countries. Originally they were used merely for expensive industrial control applications. but as engineering brought down the cost of dedicated processors. they began to look in reasonably expensive applications such as cars. communicating and office equipments and telecasting Today’s embedded systems are so cheap that they are used in about every electronic merchandise in our life. Embedded systems are frequently designed for mass production.
Some illustrations of embedded systems:
• Automatic Teller Machines
• Cellular telephone and telephone switches
• Computer web equipment
• Computer pressmans
• Disk thrusts
• Engine accountants and antilock interruption accountants for cars • Home mechanization merchandises
• Handheld reckoners
• Household contraptions
• Medical equipment
• Measurement equipment
• Multifunction carpus tickers
• Multifunction pressmans
2. 3 MICROPROCESSOR AND MICROCONTROLLER:
1. Microprocessors and microcontrollers are used in embedded system merchandises. An embedded merchandise uses a microprocessor ( or microcontroller ) to make one undertaking and one undertaking merely. 2. Microprocessor as the term come to be known is a general intent digital computing machine cardinal processing unit. Although popularly known as a “computer on chip” . the microprocessor is in no sense a complete digital computing machine. 3. Microprocessor CPU contains Arithmetic Logical Unit. a plan counter. a stack arrow. some working registries. a clock clocking circuits and interrupt circuit. 4. The hardware design of microprocessor CPU is arranged so that a little or really big system can be configured around the CPU as the application demands. The internal CPU architecture every bit good as the attendant machine degree codification that operates that architecture is comprehensive but every bit flexible as possible.
The premier usage of microprocessor is to read informations execute extended computations on that information and shop those computations in mass storage devices or expose the consequences for user usage. The plan is used by microprocessor are stored in the mass storage devices and loaded into RAM as the user directs. A microcontroller is a computing machine on a individual bit. Micro suggests that the device is little and accountant Tells that the device is used to command objects. procedure or events. A microcontroller is a general intent device but one that is meant to read informations. perform limited computations on that informations and command its environment based on those computations. The premier usage of microcontroller is to command the operation of machine utilizing a fixed plan that is stored in ROM that does non alter over the life clip of the system.
The advantages of microcontroller over microprocessor are:
• cost is less
• velocity is more
• power ingestion is less
• compact device
• external constituents are minimal
2. 4 MICROPROCESSOR VERSES MICROCONTROLLER:
The contrast between microprocessor and microcontroller is best exemplified by the fact that: Most microprocessor has operational codifications for traveling informations from external memory to CPU. microcontroller may hold one or two. Microprocessor may hold one or two types of spot handling instructions microcontroller will hold many. Microprocessor concerned with rapid motion of codification and informations from external reference to the bit. microcontroller is concerned with rapid informations motion of spots with in bit. Microcontroller can calculate map as a computing machine with out add-on of external devices. but microprocessor must hold many add-ons to operations.
3. BLOCK DIAGRAM:[ movie ]
3. 1 BLOCK DIAGRAM DESCRIPTION:
The block diagram of the embedded security system consists of the undermentioned faculties • 555 timer
• IR Receiver
• Buzzer dismay
• Power supply
3. 2 555 Timers:
The 555 timer has been employed to bring forth a square moving ridge of 56 KHz frequence. The 555 timer has connected for astable operation. With an astable operation. the frequence and responsibility rhythm accurately controlled by two external resistances and capacitance connected to the 555 timer. The end product signal for this faculty is used to drive the Infrared Emitting Diode. 3. 3 Infrared Detector:
This undertaking makes usage of an infrared detector faculty. which consists of an Infrared emitting IR receiving system TSOP 1356. The end product of IR receiving system is connected to trap 1 of the microcontroller 8952. This detector is used near the door. Whenever the door is opened. it sense the obstruction and a logic low appear at the pin 1 of the microcontroller.
3. 4 MICROCONTROLLER ( 89S52 ) :
This undertaking employs the 8-bit microcontroller from ATMEL ( AT89S52 ) . The microcontroller in our security system is used for directing signals to the car dialer and doorbell dismay. A figure is already stored in the EEPROM of the microcontroller. When a logic low signal appears at the pin 1 of the microcontroller. the figure stored in the memory is sent to the car dialer. 3. 5 BUZZER ALARM:
When the security system detects an interloper. the microcontroller activates the doorbell dismay and the telephone car dialer. The doorbell dismay serves the undermentioned three maps: • It alerts the residents and neighbours that person has broken into the edifice. • It drives the interloper off.
• It signals to the constabulary which house has been broken into. 3. 6 POWER SUPPLY
Supply of 230V. 50Hz ac signal from chief supply board is given to a measure down transformer. The transformer is selected such that its end product scopes from 10V to 12V. which is supplied to the power supply block for doing the end product compatible with the TTL logic supply. This TTL logic supply Acts of the Apostless as the power supply for the microcontroller. IR detector. car dialer. timer circuit and doorbell. Thus the chief map of the power supply is to give the electromotive force supply required for the logic households. which is an end product of +5V. For illustration a 5V regulated supply can be shown as below
Similarly. 12v regulated supply can besides be produced by suited choice of the single elements. Each of the blocks is described in item below and the power supplies made from these blocks are described below with a circuit diagram and a graph of their end product: Transformer:
A transformer stairss down high electromotive force AC mains to low electromotive force AC. Here we are utilizing a center-tap transformer whose end product will be sinusoidal with 36volts extremum to top out value.[ movie ]
The low electromotive force AC end product is suited for lamps. warmers and particular AC motors. It is non suited for electronic circuits unless they include a rectifier and a smoothing capacitance. The transformer end product is given to the rectifier circuit.
A rectifier converts AC to DC. but the DC end product is changing. There are several types of rectifiers ; here we use a span rectifier. [ pic ] The Bridge rectifier is a circuit. which converts an ac electromotive force to dc electromotive force utilizing both half rhythms of the input ac electromotive force. The Bridge rectifier circuit is shown in the figure. The circuit has four rectifying tubes connected to organize a span. The Ac input electromotive force is applied to the diagonally opposite terminals of the span. The burden opposition is connected between the other two terminals of the span. For the positive half rhythm of the input ac electromotive force. rectifying tubes D1 and D3 behavior. whereas diodes D2 and D4 remain in the OFF province.
The conducting rectifying tubes will be in series with the burden opposition RL and therefore the burden current flows through RL. For the negative half rhythm of the input ac electromotive force. rectifying tubes D2 and D4 behavior whereas. D1 and D3 remain OFF. The carry oning rectifying tubes D2 and D4 will be in series with the burden opposition RL and therefore the current flows through RL in the same way as in the old half rhythm. Thus a bi-directional moving ridge is converted into unidirectional. The end product wave form of the rectifier is shown as below[ movie ]
The changing DC end product is suited for lamps. warmers and standard motors. It is non suited for electronic circuits unless they include a smoothing capacitance. SMOOTHING:
The smoothing block smoothes the DC from changing greatly to a little rippling. The ripple electromotive force is defined as the divergence of the burden electromotive force from its DC value. Smoothing is besides named as filtering. Filtering is often effected by shunting the burden with a capacitance. The action of this system depends on the fact that the capacitance shops energy during the conductivity period and delivers this energy to the tonss during the no conducting period. In this manner. the clip during which the current base on ballss through the burden is prolongated. and the rippling is well decreased. The action of the capacitance is shown with the aid of wave form. The wave form of the rectified end product after smoothing is given below: [ movie ]
A regulator eliminates ripple by puting DC end product to a fixed electromotive force Voltage regulator ICs are available with fixed ( typically 5. 12 and 15V ) [ movie ]
Railwaies being the cheapest manner of transit are preferred over all the other agencies. When we go through the day-to-day newspapers we come across many railroad accidents happening at remote-controlled railroad crossings. This is chiefly due to the sloppiness in manual operations or deficiency of workers. We. in this undertaking has come up with a solution for the same. Using simple electronic constituents we have tried to automatize the control of railroad Gatess. As a train approaches the railroad traversing from either side. the detectors placed at a certain distance from the gate detects the nearing train and consequently controls the operation of the gate. Besides an index visible radiation has been provided to alarm the automobilists about the approaching train.
4. CIRCUIT DESCRIPTION[ movie ].
4. 1 555 Timers:
NE 555 is a extremely stable accountant capableness of bring forthing accurate
timing pulsations. In this circuit. 555 timer has been connected in astable manner to accurately bring forth a square moving ridge of frequence 56KHz. For the astable manner. we connect two external resistances ( R1. R2 ) and one capacitance ( C1 ) . • Pin 8 is connected to +5V power supply.
• Pin 1 is grounded and pin 3 is connected to the Infrared emitting rectifying tube ( TSAL 6200 ) . 4. 2 INFRARED EMITTING DIODE ( TSAL 6200 ) : TSAL 6200 is a high efficiency infrared breathing rectifying tube modeled in clear grey tinted plastic bundles. The pulse current through the LED can change from 100mA to good over 1A. In order to acquire an acceptable control distance. the LED currents have to be every bit high as possible. A tradeoff should be made between LED parametric quantities and maximal control distance. Average power dissipation of the LED should non transcend the maximal value though. We adopt transition technique to guarantee that our IR message gets across to the receiving system without mistakes. With transition. we make the IR visible radiation beginning wink in a peculiar frequence.
The IR receiving system will be tuned to that frequence. so it can disregard everything else. In our IR detector faculty. we have chosen a bearer frequence of 56kHz. Hence the current pulsations are at a frequence of 56 kilohertz. There are several makers of IR receiving systems in the market. Siemens. Vishay and Telefunken are chief providers. Vishay has its TSOP merchandise series ( TSOP 13xx. TSOP 48xx. TSOP 62xx where twenty indicates the transition frequence of 30. 33. 36. 38. 40 or 56 kilohertz ) . The anode of LED is connected to trap 3 of 555 timer and the cathode of the LED is grounded through a resistance ( R3 ) of 500 ohms. 4. 3 IR RECEIVER ( TSOP 1356 ) :
TSOP 13xx series are miniaturized receiving systems for infrared distant control systems. PIN rectifying tube and preamplifier are assembled on lead frame. the epoxy bundle is designed as IR filter. The demodulated end product signal can straight be decoded by a microprocessor. TSOP 13xx is the standard IR remote control receiving system series. back uping all major transmittal codifications. • Pin 1 is grounded.
• A capacitance ( C3 ) of 4. 7 micro Fs connected between pin 1 and pin 2. • Pin 2 is connected to a supply of +5V through a resistance ( R4 ) of 1k ohms. The end product of TSOP 1356 is active low. When there is a proper transmittal and response between the LED and IR receiving system. the end product of TSOP 1356 is logic high. The bearer frequence should be near to 56 kilohertz. Whenever there is no nexus between IR sender and receiving system. the end product pin 3 of TSOP 1356 will be logic low.
4. 4 DTMF GENERATOR ( UM95089 ) :
The UM95089 is a low threshold electromotive force. field implanted metal gate CMOS integrated circuit. It interfaces straight to a standard telephone line and generates all double tone multi-frequency braces required in tone dialing systems. • A crystal oscillator ( 3. 579545MHz ) is connected between pin 7 and pin 8. • Pin 16 is connected to the base of NPN transistor BC 547 • The emitter of transistor is grounded through a resistance ( R6 ) of 10k ohms. • The aggregator of the transistor is connected to the telephone line trough a 1:1 transformer. In the concerned undertaking 8052 microcontroller is used. Here microcontroller used is AT89S52. which is manufactured by ATMEL research labs.
5. COMPONENTS & A ; DESCRIPTION
5. 1 MICROCONTROLLER:
The microcontroller used in this undertaking is AT89S52. which is a 40 pin IC. • Pin 40 is connected to +5v power supply
• Reset circuit is connected to trap 9 of 8952 to supply reset status when the microcontroller is powered away. The reset circuitry comprises of 10 micro Fs ( C6 ) and a resistance ( R5 ) of 8. 2k ohms. • Pin 31 ( EAVPP ) is tied to VCC for internal plan executing. • The crystal oscillator ( 11. 0592MHz ) is connected across pin 18 and pin19. • Pin 1 ( port 1. 0 ) is connected to the end product ( pin 3 ) of the IR receiving system ( TSOP 1356 ) . • Pin 2 ( port 1. 1 ) is connected to the doorbell.
• Pin 3 ( port 1. 2 ) is connected to the Chip Enable input ( pin 2 ) of the DTMF generator ( UM95089 ) . • Port 2 of the microcontroller is used to reassign the information from the microcontroller to the DTMF generator. • P2. 0 ( trap 21 ) of the AT89S52 is connected to trap 14 ( R1 ) of UM95089. • P2. 1 ( trap 22 ) of the AT89S52 is connected to trap 13 ( R2 ) of UM95089. • P2. 2 ( trap 23 ) of the AT89S52 is connected to trap 12 ( R3 ) of UM95089. • P2. 3 ( trap 24 ) of the AT89S52 is connected to trap 11 ( R4 ) of UM95089. • P2. 4 ( trap 25 ) of the AT89S52 is connected to trap 3 ( C1 ) of UM95089. • P2. 5 ( trap 26 ) of the AT89S52 is connected to trap 4 ( C2 ) of UM95089. • P2. 6 ( trap 27 ) of the AT89S52 is connected to trap 5 ( C3 ) of UM95089. P2. 7 ( trap 28 ) of the AT89S52 is connected to trap 9 ( C4 ) of UM95089 5. 1. 2 Description of 8952 Microcontroller:
The AT89S52 provides the following standard characteristics: 8Kbytes of Flash. 256 bytes of RAM. 32 I/O lines. three 16-bit timer/counters. a six-vector two-level interrupt architecture. a full semidetached house consecutive port. on-chip oscillator. and clock circuitry. In add-on. the AT89S52 is designed with inactive logic for operation down to zero frequence and supports two package selectable power salvaging manners. The Idle Mode stops the CPU while leting the RAM. timer/counters. consecutive port. and interrupt system to go on working. The Power down Mode saves the RAM contents but freezes the oscillator. disenabling all other bit maps until the following hardware reset. By uniting a various 8-bit CPU with Flash on a massive bit. the Atmel AT89S52 is a powerful personal computer which provides a extremely flexible and cost effectual solution to many embedded control applications with MCS-51 Products.
5. 1. 3 Features of Microcontroller ( 8052 ) :
• 8 Kbytes of In-System Reprogrammable Flash Memory
• Endurance: 1. 000 Write/Erase Cycles
• Fully Inactive Operation: 0 Hz to 24 MHz
• Three-Level Program Memory Lock
• 256 ten 8-Bit Internal RAM
• 32 Programmable I/O Lines
• Three 16-Bit Timer/Counters
• Eight vector two degree Interrupt Beginnings
• Programmable Serial Channel
• Low Power Idle and Power Down Modes
In add-on. the AT89S52 is designed with inactive logic for operation down to zero frequence and supports two package selectable power salvaging manners.
The Idle Mode stops the CPU while leting the RAM. timer/counters. consecutive port and interrupt system to go on working. The Power down Mode saves the RAM contents but freezes the oscillator disenabling all other bit maps until the following hardware reset. 5. 1. 4 Block Diagram of Microcontroller
5. 1. 5 Pin Diagram of 8952[ movie ]
5. 1. 6 Pin Description
Pin 40 provides Supply electromotive force to the bit. The electromotive force beginning is +5v GND.
Pin 20 is the grounded Port 0 is an 8-bit unfastened drain bidirectional I/O port from pin 32 to 39. As an end product port each pin can drop eight TTL inputs. When 1s are written to port 0 pins. the pins can be used as high-impedance inputs. Port 0 may besides be configured to be the multiplexed low-order address/data coach during entrees to external plan and informations memory. In this manner P0 has internal pull-ins. Port 0 besides receives the codification bytes during Flash scheduling. and outputs the codification bytes during plan confirmation. External pull-ins are required during plan confirmation. Port 1
Port 1 is an 8-bit bidirectional I/O port with internal pull-ins from pin 1 to 8. The Port 1 end product buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ins and can be used as inputs. As inputs. Port 1 pins that are externally being pulled low will beginning current ( IIL ) because of the internal pull-in. Port 1 besides receives the low-order reference bytes during Flash scheduling and plan confirmation.
Port 2 is an 8-bit bidirectional I/O port with internal pull-ins from pin 21 to 28. The Port 2 end product buffers can drop / beginning four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ins and can be used as inputs. As inputs. Port 2 pins that are externally being pulled low will beginning current ( IIL ) because of the internal pull-in. Port 2 emits the high-order reference byte during fetches from external plan memory and during entrees to external informations memory that usage 16-bit references ( MOVX @ DPTR ) . In this application it uses strong internal pull-in when breathing 1s. During entrees to external informations memory that usage 8-bit references ( MOVX @ RI ) . Port 2 emits the contents of the P2 Special Function Register. Port 2 besides receives the high-order reference spots and some control signals during Flash scheduling and confirmation. Port 3
Port 3 is an 8-bit bidirectional I/O port with internal pull-ins from pin 10 to 17. The Port 3 end product buffers can drop / beginning four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ins and can be used as inputs. As inputs. Port 3 pins that are externally being pulled low will beginning current ( IIL ) because of the pull-ins. Port 3 besides serves the maps of assorted particular characteristics of the AT89C51 as listed below:[ movie ]
Particular Features of 89S52:
• Port 3 besides receives some control signals for Flash scheduling and programming confirmation. RST
Pin 9 is the Reset input. It is active high. Upon using a high pulsation to this pin. the microcontroller will reset and end all activities. A high on this pin for two machine rhythms while the oscillator is running resets the device. ALE/PROG
Address Latch is an end product pin and is active high. Address Latch Enable end product pulsation for latching the low byte of the reference during entrees to external memory. This pin is besides the plan pulsation input ( PROG ) during Flash programming. In normal operation ALE is emitted at a changeless rate of 1/6 the oscillator frequence. and may be used for external timing or clocking intents. Note. nevertheless. that one ALE pulsation is skipped during each entree to external Data Memory. If desired. ALE operation can be disabled by puting spot 0 of SFR location 8EH. With the spot set. ALE is active merely during a MOVX or MOVC direction. Otherwise. the pin is weakly pulled high. Puting the ALE-disable spot has no consequence if the microcontroller is in external executing manner. PSEN