Vous êtes sur la page 1sur 84

MONITOR AND CONTROL THE DC MOTOR VIA WIRELESS WITH INTERACIVE VOICE RESPONSE SYSTEM

In this project we show that how we control the direction and speed of the motor. If the motor generate a more current, or motor running on more voltage or in the case of over temperature motor is off immediately. As the motor is off, voice processor connected in this circuit is activate and produce a sound. SOUND message is different in each casing For the voice processor we use APR 9600 IC TO GENERATE up to 8 different sound at a time. APR 9600 is record and play digital IC for UPTO 40 second recording and divided into 8 different tracks As the motor is off circuit connect a mobile phone to dial the particular number, As the number is dial then voice processor is active and produce a sound message on connecting call. In the motor section we use slow speed dc motor for operation.

AS THE CALL is receive by the receiver and message is confirm then operator control the motor for direction and on/off with the help of DTMF decoder.

CIRCUIT 1

CIRCUIT FOR OVER CURRENT

CIRCUIT FOR OVER TEMPERATURE

CIRCUIT FOR OVER VOLTAGE

In THIS PROJECT WE USE ONE DC MOTOR FOR CHECK ALL THE PARAMETERS OF THIS PROJECT. So to control the direction of the motor we use two relay coil for the clock wise and anticlock wise circuit. For this purpose we use two transistor base circuit plus two relay coil to interface with the microcontroller. With the help of microcontroller we change the direction of the motor for clock wise anti clock wise direction. To vary the speed of the motor we use op-amp lm 358 circuit to vary the speed of the motor. As the current is vary of the motor we monitor the variation of the

current with the help of op-amp amplifier circuit. With the help of op-amp amplifier we change the speed of the motor with the help of the variable resistor.

As the current is vary across the motor , op-amp current is to be raise automatically and this signal is connected to the microcontroller directly.

For the over voltage measurement we use lm 35 transistor as a temperature measurement. LM 35 is connected with the op-amp. As the threshold voltage is to be increase with the reference voltage then op-amp deliver a output and microcontroller stop the motor

For the temperature measurement we use lm 35 as a temperature sensor and LM 339 as a coparator.

APR 96 00
General Description The APR96 00 device offers true single-chip voice recording,non-volatile storage, and playback capability for 40 to 60 seconds.The device supports both random and sequential access of multiple messages. Sample rates are user-selectable,allowing designers to customize their design for unique quality and storage time needs. Integrated output amplifier,microphone amplifier, and AGC circuits greatly simplify system design. the device is ideal for use in portable voice recorders, toys, and many other consumer and industrial applications. APLUS integrated achieves these high levels of storage capability by using its proprietary analog/multilevel storage technology implemented in an advanced Flash non-volatile memory process, where each memory cell can store 256 voltage levels. This technology enables the APR9600 device to reproduce voice signals in their natural form. It eliminates the need for encoding and compression, which often introduce distortion

Sampling Application

The following reference schematics are included as examples on how a recording system might be designed. Each reference schematic shows the device incorporated in one of itsthree main modes, Random Access, Tape mode - Normaloperation, and Tape mode - Auto Rewind option. Note that in several of the applications either one or all of the /Busy, /Strobe, or /M7_END pins are connected to LEDs as indicators of device status. This is possible because all of these pins and signals were designed to have timing compatible with both microprocessor interface and manual LED indication. Figure 3 shows the device configured in tape mode, normal operation. This mode is the minimal part count application of the APR96. 00 Sampling rate is determined by the resistor value on pin 7 (OscR). The RC network on pin 19 sets the AGC attack time. A bias must be applied to the electret microphone in order to power its built in circuitry. The ground return of this bias network is connected to the normally open side of the record push button. This configuration gates power to microphone so that it is biased only during recording. This

configuration saves power when not recording by shutting off power to the electret microphone. Both pins 18 and 19, MicIn and MicRef, must be AC couple to the microphone network in order to block the DC biasing voltage.

WHAT IS DTMF?

When you press a button in the telephone set keypad, a connection is made that generates a resultant signal of two tones at the same time. These two tones are taken from a row frequency and a column frequency. The resultant frequency signal is called "Dual Tone Multiple Frequency". These tones are identical and unique. A DTMF signal is the algebraic sum of two different audio frequencies, and can be expressed as follows: f(t) = A0sin(2**fa*t) + B0sin(2**fb*t) + ........... ------->(1)

Where fa and fb are two different audio frequencies with A and B as their peak amplitudes and f as the resultant DTMF signal. fa belongs to the low frequency group and fb belongs to the high frequency group. Each of the low and high frequency groups comprise four frequencies from the various keys present on the telephone keypad; two different frequencies, one from the high frequency group and another from the low frequency group are used to produce a DTMF signal to represent the pressed key.

The amplitudes of the two sine waves should be such that (0.7 < (A/B) < 0.9)V -------->(2)

The frequencies are chosen such that they are not the harmonics of each other. The frequencies associated with various keys on the keypad are shown in figure (A). When you send these DTMF signals to the telephone exchange through cables, the servers in the telephone exchange identifies these signals and makes the connection to the person you are calling. The row and column frequencies are given below:

Fig (A) When you press the digit 5 in the keypad it generates a resultant tone signal which is made up of frequencies 770Hz and 1336Hz. Pressing digit 8 will produce the tone taken from tones 852Hz and 1336Hz. In both

the cases, the column frequency 1336 Hz is the same. These signals are digital signals which are symmetrical with the sinusoidal wave. A Typical frequency is shown in the figure below:

Figure (B) Along with these DTMF generator in our telephone set provides a set of special purpose groups of tones, which is normally not used in our keypad. These tones are identified as 'A', 'B', 'C', 'D'. These frequencies have the same column frequency but uses row frequencies given in the table in figure (A). These tones are used for communication signaling. The frequency table is as follows:

Figure (C)

Due to its accuracy and uniqueness, these DTMF signals are used in controlling systems using telephones. By using some DTMF generating ICs (UM91214, UM91214, etc) we can generate DTMF tones without depending on the telephone set.

Mobile CONTROL MOTOR. In this project we also control the direction of the motor for clockwise and anticlockwise and on off the motor from any mobile phone. IN this project we dial the number connected to this phone. As the call is receive then phone is on auto answer mode and call is received automatically. Now for control the motor direction we send a dtmf code by pressing a key code from controlling phone. This DTMF code is received by the DTMF decoder circuit. DTMF decoder circuit decode the signal and this data is further converted into bcd signal. This BCD signal is now connected to the microcontroller. Microcontroller get and compare the data and then control the motor for direction control and for on/off operation. For DTMF decoder we use ic 8870 to decode the dtmf tones to bcd signal.. MOBile Hndsfree is connected to the pin no 2 and 3 via RC circuit. Pin no 11,12,13,14 is output pin for bcd signal. Crystal is connected to the pin no 4 and 5 of the ic. Pin no 15 is as a ack pin. On this pin we connect a one l.e.d to provide a ack as the data is decoded.

Temperature sensor.

NEXT IMPORTANT PART OF THIS PROJECT IS LM 35 TEMPERATURE SENSOR. BY USING THIS SENSOR WE GIVE A INPUT TO THE ADC AND THEN USE THE ADC INTO MICROCONTROLLER CIRCUIT

Temperature Sensor - The LM35

The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature (in
o

C)

The LM35 - An Integrated Circuit Temperature Sensor

Why Use LM35s To Measure Temperature?

You can measure temperature more accurately than a using a thermistor.

o o

The sensor circuitry is sealed and not subject to oxidation, etc. The LM35 generates a higher output voltage than thermocouples and may not require that the output voltage be amplified.

What Does An LM35 Look Like?

What Does an LM35 Do? How does it work?

It has an output voltage that is proportional to the Celsius temperature.

o o

The scale factor is .01V/oC The LM35 does not require any external calibration or trimming and maintains an accuracy of +/-0.4 oC at room temperature and +/- 0.8 oC over a range of 0 oC to +100 oC.

Another important characteristic of the LM35DZ is that it draws only 60 micro amps from its supply and possesses a low selfheating capability. The sensor self-heating causes less than 0.1
o

C temperature rise in still air.

The LM35 comes in many different packages, including the following.


TO-92 plastic transistor-like package, T0-46 metal can transistor-like package 8-lead surface mount SO-8 small outline package TO-202 package. (Shown in the picture above) How Do You Use An LM35? (Electrical Connections)
o

Here is a commonly used circuit. For connections refer to the picture above.

In this circuit, parameter values commonly used are:


Vc = 4 to 30v 5v or 12 v are typical values used. Ra = Vc /10-6 Actually, it can range from 80 KW to 600 KW , but most just use 80 KW.

Here is a photo of the LM 35 wired on a circuit board.


The white wire in the photo goes to the power supply. Both the resistor and the black wire go to ground. The output voltage is measured from the middle pin to ground.l

RELAYS

In order to enable a circuit to be isolated from the system only under faulty conditions, protective relays are used. In normal cases, it is open circuit relay. The relay is usually provided with 4 terminals, two of which are connected to relay winding and other two are connected to the circuit to be controlled. It has following characteristics : Sensitivity Speed Selectivity

TYPES OF RELAYS : Electromagnetic Attraction Type : These relays are actuated by DC or AC quantities. Electromagnetic Induction Type : Its operation depends upon EMI phenomena. Thermal Relays : Its operation depends upon the heating effect of electric Current. Distance Relays : Its operation depends upon the ratio of voltage to current.

ELECTROMAGNETIC RELAY : These relays are electromagnetically operated. The parts of these relays are an iron core & its surrounding coil of wire. An iron yoke provides a low reluctance path for magnetic flux, the yoke being shaped so that the magnetic circuit can be closed by a movable piece of iron called the armature, and a set of contacts. The armature is

hinged to the yoke and is held by a string in such a way that there is an air gap in the magnetic circuit. Figure shows the principle of operation of this relay. When an electric current flows in the coil, the armature is attracted to the iron core. Electrical switching contacts are mounted on the armature. When the armature coil is energized, these movable contacts break their connections with one set of fixed contacts and close a connection to a previously open contact. When electric power is removed from the relay coil, spring returns the armature to its original position.

Standard voltages for D.C. relay are 6,12,24,48 & 110 volts and for A.C. relays are 6,12,24,48,120 & 240 volts.

Fig. Basic Diagram Showing the Operating Principle of a Relay

In this project we use lm 339 as a comparator for room light from window. Lm 339 is compartor ic and there is four comparator is inside the lm 339 The LM139 series consists of four independent precision voltage comparators with an offset voltage specification as low as 2 mV max for all four comparators. These were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. These comparators also have a unique characteristic in that the input common-mode voltage range includes ground, even though operated from a single power supply voltage. Application areas include limit comparators, simple analog to digital converters; pulse, squarewave and time delay generators;wide range VCO; MOS clock timers; multivibrators and high voltage digital logic gates. The LM139 series was designed to directly interface with TTL and CMOS. When operated from both plus and minus power supplies, they will directly interface with MOS logic where the low power drain of the LM339 is a distinct advantage over standard comparators.

Features

Comparator Operation
The following drawing show the two simplest configurations for voltage comparators. The diagrams below the circuits give the output results in a graphical form. For these circuits the REFERENCE voltage is fixed at one-half of the supply voltage while the INPUT voltage is variable from zero to the supply voltage.

In theory the REFERENCE and INPUT voltages can be anywhere between zero and the supply voltage but there are practical limitations on the actual range depending on the particular device used.

Basic Comparator Operation

Input Vs. Output Results


1. Current WILL flow through the open collector when the voltage at the PLUS input is lower than the voltage at the MINUS input. 2. Current WILL NOT flow through the open collector when the voltage at the PLUS input is higher than the voltage at the MINUS input.

Input Vs. Output Results

Input Offset Voltage


Voltage comparators are not perfect devices and their performance may suffer from the effects of a parameter known as the Input Offset Voltage. The Input Offset Voltage for many comparators is only a few millivolts and in most circuits can be ignored. Problems related to the Input voltage normally occur when the Input voltage changes very slowly. The net result of the Input Offset Voltage is that the output transistor does not fully turn on or off when the input voltage is close to the reference voltage. The following diagram attempts to illustrate the effect of the input offset voltage with a slowly changing input voltage. This effect increases as the output transistor current increases so keeping the value of RL high will help reduce the problem.

Effect Of Input Offset Voltage The effects of the input offset voltage can be countered by adding hysteresis to the circuit. This causes the reference voltage to change when the comparators output goes high or low.

Input Offset Voltage And Hysteresis


For most comparator circuits Hysteresis is the difference between the input signal voltages at which a comparator's output is either fully ON or fully OFF. Hysteresis in comparators is generally undesirable but it can also be added to a circuit to reduce the sensitivity to noise or a slowly moving input signal. Typical hysteresis causes the output of the comparator to go from OFF to ON and vice-versa relatively slowly. The effect of added hysteresis is that as the input voltage slowly changes, the reference voltage will quickly change in the opposite direction. This gives the comparator's output a "snap" action.

A mechanical analog of added hysteresis can be found in many toggle switches: As the handle moves past its center point, a spring in the switch forces the contacts of the switch to open or close, ensuring that the switch's contacts snap to the ON or OFF position.

The width of the loop outlined by an off-on-off cycle is the input hysteresis voltage. The hysteresis voltage for most comparators is only a few millivolts and usually only affects circuits where the input voltage rises or falls very slowly or has voltage spikes known as "noise".

Adding Hysteresis To A Comparator Circuit


A comparator's Hysteresis range can be increased by adding a resistor between the comparator's output and the PLUS input terminal. This creates a feedback loop so that when the output makes a transition the feedback changes the voltage at the positive which increases the voltage difference between the PLUS and MINUS inputs. The feedback can only be made to the PLUS input terminal.

Increasing The Input hysteresis Range If the comparator's output is initially 'OFF', the MINUS input voltage has to become above the PLUS input voltage by the hysteresis voltage range before the comparator output turns 'ON'.

If the comparator is 'ON', the MINUS input voltage needs to drop slightly below the PLUS input voltage by the hysteresis voltage range before it turns 'OFF'. The hysteresis voltage range can also be made quite large in order to force the comparator's output to change as quickly as possible. The FLIP-FLOP circuits shown later on this page make use of an exaggerated hysteresis to create the memory effect with large input voltage changes needed to trigger a change in the output.

Window Comparator

Comparator Oscillator Circuit


Comparators can also be used as oscillators but are not well suited for this type of application.

Oscillator Made From A Comparator

Basic Comparator Circuits


The following diagrams are of some basic comparator circuits. Most have a Cadmium Sulfide photocell input but could just as easily use a phototransistor or a voltage signal from another

circuit as an input. The resistance values are not critical but should be used as a guide. In most comparator circuits the ratio of the resistances is more important than their actual values.

Photocell Circuits

Photocell Circuits Schematic

If higher current loads are to be driven a PNP transistor can be added to the comparators output this will allow loads of up to 300Ma. to be controlled.

Relay Driver Output Schematic

POWER SUPPLY
All digital circuits require regulated power supply. In this article we are going to learn how to get a regulated positive supply from the mains supply.

Figure 1 shows the basic block diagram of a fixed regulated power supply. Let us go through each block. TRANSFORMER

A transformer consists of two coils also called as WINDINGS namely PRIMARY & SECONDARY. They are linked together through inductively coupled electrical conductors also called as CORE. A changing current in the primary causes a change in the Magnetic Field in the core & this in turn induces an alternating voltage in the secondary coil. If load is applied to the secondary then an alternating current will flow through the load. If we consider an ideal condition then all the

energy from the primary circuit will be transferred to the secondary circuit through the magnetic field.

So

The secondary voltage of the transformer depends on the number of turns in the Primary as well as in the secondary..

Rectifier A rectifier is a device that converts an AC signal into DC signal. For rectification purpose we use a diode, a diode is a device that allows current to pass only in one direction i.e. when the anode of the diode is positive with respect to the cathode also called as forward biased condition & blocks current in the reversed biased condition.

Rectifier can be classified as follows: 1) Half Wave rectifier.

This is the simplest type of rectifier as you can see in the diagram a half wave rectifier consists of only one diode. When an AC signal is applied to it during the positive half cycle the diode is forward biased & current flows through it. But during the negative half cycle diode is reverse biased & no current flows through it. Since only one half of the input reaches the output, it is very inefficient to be used in power supplies. 2) Full wave rectifier.

Half wave rectifier is quite simple but it is very inefficient, for greater efficiency we would like to use both the half cycles of the AC signal. This can be achieved by using a center tapped transformer i.e. we would have to double the size of secondary winding & provide connection to the center. So during the positive half cycle diode D1 conducts & D2 is in reverse biased condition. During the negative half cycle diode D2 conducts & D1 is reverse biased. Thus we get both the half cycles across the load. One of the disadvantages of Full Wave Rectifier design is the necessity of using a center tapped transformer, thus increasing the size & cost of the circuit. This can be avoided by using the Full Wave Bridge Rectifier. 3) Bridge Rectifier.

As the name suggests it converts the full wave i.e. both the positive & the negative half cycle into DC thus it is much more efficient than Half Wave Rectifier & that too without using a center tapped transformer thus much more cost effective than Full Wave Rectifier. Full Bridge Wave Rectifier consists of four diodes namely D1, D2, D3 and D4. During the positive half cycle diodes D1 & D4 conduct whereas in the negative half cycle diodes D2 & D3 conduct thus the diodes keep switching the transformer connections so we get positive half cycles in the output.

If we use a center tapped transformer for a bridge rectifier we can get both positive & negative half cycles which can thus be used for generating fixed positive & fixed negative voltages. FILTER CAPACITOR Even though half wave & full wave rectifier give DC output, none of them provides a constant output voltage.For this we require to smoothen the waveform received from the rectifier. This can be done by using a capacitor at the output of the rectifier this capacitor is also called as FILTER CAPACITOR or SMOOTHING CAPACITOR or RESERVOIR CAPACITOR. Even after using this capacitor a small amount of ripple will remain. We place the Filter Capacitor at the output of the rectifier the capacitor will charge to the peak voltage during each half cycle then will discharge its stored energy slowly through the load while the rectified voltage drops to zero, thus trying to keep the voltage as constant as possible.

If we go on increasing the value of the filter capacitor then the Ripple will decrease. But then the costing will increase. The value of the Filter capacitor depends on the current consumed by the circuit, the frequency of the waveform & the accepted ripple.

Where, Vr= accepted ripple voltage.( should not be more than 10% of the voltage) I= current consumed by the circuit in Amperes. F= frequency of the waveform. A half wave rectifier has only one peak in one cycle so F=25hz whereas a full wave rectifier has Two peaks in one cycle so F=100hz. VOLTAGE REGULATOR A Voltage regulator is a device which converts varying input voltage into a constant regulated output voltage. voltage regulator can be of two types 1) Linear Voltage Regulator Also called as Resistive Voltage regulator because they dissipate the excessive voltage resistively as heat. 2) Switching Regulators. They regulate the output voltage by switching the Current ON/OFF very rapidly. Since their output is either ON or OFF it dissipates very low power thus achieving higher efficiency as compared to linear voltage regulators. But they are more complex & generate high noise due to their switching action. For low level of output power switching regulators tend to be costly but for higher output wattage they are much cheaper than linear regulators. The most commonly available Linear Positive Voltage Regulators are the 78XX series where the XX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.

After filtering the rectifier output the signal is given to a voltage regulator. The maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher than the output voltage. If the input voltage gets below the Vmin of the regulator due to the ripple voltage or due to any other reason the voltage regulator will not be able to produce the correct regulated voltage

POWER SUPPLY in this project we use one 5 volt regulated power supply to convert the 220 volt ac in to 5 volt dc with the help of the 5 volt regulator circuit. First OF all we step down the 220 volt ac into 6 volt ac with the help of step down transformer. Step down transformer step down the voltage from 220 volt ac to 9 volt ac. This ac is further converted into the dc voltage with the help of the full wave rectifier circuit

Output of the diode is pulsating dc . so to convert the pulsating dc into smooth dc we use electrolytic capacitor. Electrolytic capacitor convert the pulsating dc into smooth dc. This Dc is further regulated by the ic 7805 regulator. IC 7805 regulator provide a regulated 5 volt dc to the microcontroller circuit and lcd circuit.

Pin no 40 of the controller is connected to the positive supply. Pin no 20 is connected to the ground. Pin no 9 is connected to external resistor capacitor to provide a automatic reset option when power is on.

Reset Circuitry:

Pin no 9 of the controller is connected to the reset circuit. On the circuit we connect one resistor and capacitor circuit to provide a reset option when power is on As soon as you give the power supply the 8051 doesnt start. You need to restart for the microcontroller to start. Restarting the microcontroller is nothing but giving a Logic 1 to the reset pin at least for the 2 clock pulses. So it is good to go for a small circuit which can provide the 2 clock pulses as soon as the microcontroller is powered.

This is not a big circuit we are just using a capacitor to charge the microcontroller and again discharging via resistor.

Crystals Pin no 18 and 19 is connected to external crystal oscillator to provide a clock to the circuit.
Crystals provide the synchronization of the internal function and to the peripherals. Whenever ever we are using crystals we need to put the capacitor behind it to make it free from noises. It is good to go for a 33pf capacitor.

We can also resonators instead of costly crystal which are low cost and external capacitor can be avoided.

But the frequency of the resonators varies a lot. And it is strictly not advised when used for communications projects.

How

is

this

time

then

calculated?

The speed with which a microcontroller executes instructions is determined by what is known as the crystal speed. A crystal is a component connected externally to the microcontroller. The crystal has different values, and some of the used values are 6MHZ, 10MHZ, and 11.059 MHz etc. Thus a 10MHZ crystal would pulse at the rate of 10,000,000 times per second.

The time is calculated using the formula No of cycles per second = Crystal frequency in HZ / 12. For a 10MHZ crystal the number of cycles would be, 10,000,000/12=833333.33333 cycles. This means that in one second, the microcontroller would execute 833333.33333 cycles.

Pin no 1 to pin no 8 is PORT 1 and Pin no 10 to 17 is PORT 3. Pin no 18 and 19 of the ic is connected to the external crystal to provide a external clock to run the internal CPU of controller . Pin no 20 is ground pin. Pin no 21 to 28 is PORT 2 pins. Pin no 29,30,31 is not use in this project. We use these pin when we require a extra memory for the project. If we internal memory of the 89s51 ( which is 4k rom) then we connect pin no 31 to the positive supply.

HOW TO PROGRAM BLANK CHIP.


8051 micro controller

The 8051 The 8051 developed and launched in the early 80`s, is one of the most popular micro controller in use today. It has a reasonably large amount of built in ROM and RAM. In addition it has the ability to access external memory. The generic term `8x51` is used to define the device. The value of x defining the kind of ROM, i.e. x=0, indicates none, x=3, indicates mask ROM, x=7, indicates EPROM and x=9 indicates EEPROM or Flash.

Different micro controllers in market.


PIC One of the famous microcontrollers used in the industries. It is based on RISC Architecture which makes the microcontroller process faster than other microcontroller.

INTEL These are the first to manufacture microcontrollers. These are not as sophisticated other microcontrollers but still the easiest one to learn.

ATMEL Atmels AVR microcontrollers are one of the most powerful in the embedded industry. This is the only microcontroller having 1kb of ram even the entry stage. But it is unfortunate that in India we are unable to find this kind of microcontroller. Intel 8051

Intel 8051 is CISC architecture which is easy to program in assembly language and also has a good support for High level languages.

The memory of the microcontroller can be extended up to 64k.

This microcontroller is one of the easiest microcontrollers to learn.

The 8051 microcontroller is in the field for more than 20 years. There are lots of books and study materials are readily available for 8051.

First of all we select and open the assembler and wrote a program code in the file. After wrote a software we assemble the software by using internal

assembler of the 8051 editor. If there is no error then assembler assemble the software abd 0 error is show the output window.

now assembler generate a ASM file and HEX file. This hex file is useful for us to program the blank chip. Now we transfer the hex code into the blank chip with the help of serial programmer kit. In the programmer we insert a blank chip 0f 89s51 series . these chips are multi time programmable chip. This programming kit is seperatally

available in the market and we transfer the hex code into blank chip with the help of the serial programmer kit

RELAY

Relay is a common, simple application of electromagnetism. It uses an electromagnet made from an iron rod wound with hundreds of fine copper wire. When electricity is applied to the wire, the rod becomes magnetic. A movable contact arm above the rod is then pulled toward the rod until it closes a switch contact. When the electricity is removed, a small spring pulls the contract arm away from the rod until it closes a second switch contact. By means of relay, a current circuit can be broken or closed in one circuit as a result of a current in another circuit.

Relays can have several poles and contacts. The types of contacts could be normally open and normally closed. One closure of the relay can turn on the same normally open contacts; can turn off the other normally closed contacts.

Relay requires a current through their coils, for which a voltage is applied. This voltage for a relay can be D.C. low voltages upto 24V or could be 240V a.c.

A relay is an electrical switch that opens and closes under control of another electrical circuit. In the original form, the switch is operated by an electromagnet to open or close one or many sets of contacts. It was invented by Joseph Henry in 1835. Because a relay is able to control an output circuit of higher power than the input circuit, it can be considered, in a broad sense, to be a form of electrical amplifier. These contacts can be either Normally Open (NO), Normally Closed (NC), or changeover contacts.

Normally-open contacts connect the circuit when the relay is activated; the circuit is disconnected when the relay is inactive. It is also called Form A contact or "make" contact. Form A contact is ideal for applications that require to switch a high-current power source from a remote device. Normally-closed contacts disconnect the circuit when the relay is activated; the circuit is connected when the relay is inactive. It is also called Form B contact or "break" contact. Form B contact is ideal for applications that require the circuit to remain closed until the relay is activated. Change-over contacts control two circuits: one normally-open contact and one normally-closed contact with a common terminal. It is also called Form C contact.

Operation
When a current flows through the coil, the resulting magnetic field attracts an armature that is mechanically linked to a moving contact. The movement either makes or breaks a connection with a fixed contact. When the current to the coil is switched off, the armature is returned by a force that is half as strong as the magnetic force to its relaxed position. Usually this is a spring, but gravity is also used commonly in industrial motor

starters. Relays are manufactured to operate quickly. In a low voltage application, this is to reduce noise. In a high voltage or high current application, this is to reduce arcing. If the coil is energized with DC, a diode is frequently installed across the coil, to dissipate the energy from the collapsing magnetic field at deactivation, which would otherwise generate a spike of voltage and might cause damage to circuit components. If the coil is designed to be energized with AC, a small copper ring can be crimped to the end of the solenoid. This "shading ring" creates a small out-of-phase current, which increases the minimum pull on the armature during the AC cycle. [1] By analogy with the functions of the original electromagnetic device, a solid-state relay is made with a thyristor or other solid-state switching device. To achieve electrical isolation, a light-emitting diode (LED) is used with a photo transistor. Relays are used:

to control a high-voltage circuit with a low-voltage signal, as in some types of modems, to control a high-current circuit with a low-current signal, as in the starter solenoid of an automobile, to detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers (protection relays), to isolate the controlling circuit from the controlled circuit when the two are at different potentials, for example when controlling a mains-powered device from a low-voltage switch. The latter is often applied to control office lighting as the low voltage wires are easily installed in partitions, which may be often moved as needs change. They may also be controlled by room occupancy detectors in an effort to conserve energy, to perform logic functions. For example, the boolean AND function is realised by connecting NO relay contacts in series, the OR function by connecting NO contacts in parallel. The change-over or Form C contacts perform the XOR (exclusive or) function. Similar functions for NAND and NOR are accomplished using NC contacts. Due to the failure modes of a relay compared with a semiconductor, they are widely used in safety critical logic, such as the control panels of radioactive waste handling machinery. to perform time delay functions. Relays can be modified to delay opening or delay closing a set of contacts. A very short (a fraction of a second) delay would use a copper disk between the armature and moving blade assembly. Current flowing in the disk maintains magnetic field for a short time, lengthening release time. For a slightly longer (up to a minute) delay, a dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape slowly. The time period can be varied by increasing or decreasing the flow rate. For longer time periods, a mechanical clockwork timer is installed.

TRANSFORMER

PRINCIPLE OF THE TRANSFORMER:-

Two coils are wound over a Core such that they are magnetically coupled. The two coils are known as the primary and secondary windings.

In a Transformer, an iron core is used. The coupling between the coils is source of making a path for the magnetic flux to link both the coils. A core as in fig.2 is used and the coils are wound on the limbs of the core. Because of high permeability of iron, the flux path for the flux is only in the iron and hence the flux links both windings. Hence there is very little leakage flux. This term leakage flux denotes the part of the flux, which does not link both the coils, i.e., when coupling is not perfect. In the high frequency transformers, ferrite core is used. The transformers may be step-up, step-down, frequency matching, sound output, amplifier driver etc. The basic principles of all the transformers are same.

MINIATURE TRANSFORMER

CONVENTIONAL POWER TRANSFORMER

WELCOME TO THE WORLD OF THE MICROCONTROLLERS.

Look around. Notice the smart intelligent systems? Be it the T.V, washing machines, video games, telephones, automobiles, aero planes, power systems, or any application having a LED or a LCD as a user interface, the control is likely to be in the hands of a micro controller!

Measure and control, thats where the micro controller is at its best.

Micro controllers are here to stay. Going by the current trend, it is obvious that micro controllers will be playing bigger and bigger roles in the different activities of our lives.

So where does this scenario leave us? Think about it

The world of Micro controllers

What is the primary difference between a microprocessor and a micro controller? Unlike the microprocessor, the micro controller can be considered to be a true Computer on a chip.

In addition to the various features like the ALU, PC, SP and registers found on a microprocessor, the micro controller also incorporates features like the ROM, RAM, Ports, timers, clock circuits, counters, reset functions etc.

While the microprocessor is more a general-purpose device, used for read, write and calculations on data, the micro controller, in addition to the above functions also controls the environment.

We have used a whole lot of technical terms already! Dont get worried about the meanings at this point. We shall understand these terms as we proceed further

For now just be aware of the fact, that all these terms literally mean what they say.

Bits and Bytes

Before starting on the 8051, here is a quick run through on the bits and bytes. The basic unit of data for a computer is a bit. Four bits make a nibble. Eight bits or two nibbles make a byte. Sixteen bits or four nibbles or two bytes make a word.

1024 bytes make a kilobyte or 1KB, and 1024 KB make a Mega Byte or 1MB.

Thus when we talk of an 8-bit register, we mean the register is capable of holding data of 8 bits only.

The 8051

The 8051 developed and launched in the early 80`s, is one of the most popular micro controller in use today. It has a reasonably large amount of built in ROM and RAM. In addition it has the ability to access external memory.

The generic term `8x51` is used to define the device. The value of x defining the kind of ROM, i.e. x=0, indicates none, x=3, indicates mask ROM, x=7, indicates EPROM and x=9 indicates EEPROM or Flash.

A note on ROM

The early 8051, namely the 8031 was designed without any ROM. This device could run only with external memory connected to it. Subsequent developments lead to the development of the PROM or the programmable ROM. This type had the disadvantage of being highly unreliable.

The next in line, was the EPROM or Erasable Programmable ROM. These devices used ultraviolet light erasable memory cells. Thus a program could

be loaded, tested and erased using ultra violet rays. A new program could then be loaded again.

An improved EPROM was the EEPROM or the electrically erasable PROM. This does not require ultra violet rays, and memory can be cleared using circuits within the chip itself.

Finally there is the FLASH, which is an improvement over the EEPROM. While the terms EEPROM and flash are sometimes used interchangeably, the difference lies in the fact that flash erases the complete memory at one stroke, and not act on the individual cells. This results in reducing the time for erasure.

Understanding the basic features of the 8051 core

Lets now move on to a practical example. We shall work on a simple practical application and using the example as a base, shall explore the various features of the 8051 microcontroller.

Consider an electric circuit as follows,

The positive side (+ve) of the battery is connected to one side of a switch. The other side of the switch is connected to a bulb or LED (Light Emitting Diode). The bulb is then connected to a resistor, and the other end of the resistor is connected to the negative (-ve) side of the battery.

When the switch is closed or switched on the bulb glows. When the switch is open or switched off the bulb goes off

If you are instructed to put the switch on and off every 30 seconds, how would you do it? Obviously you would keep looking at your watch and every time the second hand crosses 30 seconds you would keep turning

the switch on and off.

Imagine if you had to do this action consistently for a full day. Do you think you would be able to do it? Now if you had to do this for a month, a year??

No way, you would say!

The next step would be, then to make it automatic. This is where we use the Microcontroller.

But if the action has to take place every 30 seconds, how will the microcontroller keep track of time?

Execution time

Look at the following instruction, clr p1.0

This is an assembly language instruction. It means we are instructing the microcontroller to put a value of zero in bit zero of port one. This instruction is equivalent to telling the microcontroller to switch on the bulb. The instruction then to instruct the microcontroller to switch off the bulb is,

Setb p1.0

This instructs the microcontroller to put a value of one in bit zero of port one.

Dont worry about what bit zero and port one means. We shall learn it in more detail as we proceed.

There are a set of well defined instructions, which are used while communicating with the microcontroller. Each of these instructions requires a standard number of cycles to execute. The cycle could be one or more in number.

How is this time then calculated?

The speed with which a microcontroller executes instructions is determined by what is known as the crystal speed. A crystal is a component connected externally to the microcontroller. The crystal has different values, and some of the used values are 6MHZ, 10MHZ, and 11.059 MHz etc. Thus a 10MHZ crystal would pulse at the rate of 10,000,000 times per second. The time is calculated using the formula

No of cycles per second = Crystal frequency in HZ / 12.

For a 10MHZ crystal the number of cycles would be,

10,000,000/12=833333.33333 cycles.

This means that in one second, the microcontroller would execute 833333.33333 cycles.

Therefore for one cycle, what would be the time? Try it out.

The instruction clr p1.0 would use one cycle to execute. Similarly, the instruction setb p1.0 also uses one cycle.

So go ahead and calculate what would be the number of cycles required to be executed to get a time of 30 seconds!

Getting back to our bulb example, all we would need to do is to instruct the microcontroller to carry out some instructions equivalent to a period of 30 seconds, like counting from zero upwards, then switch on the bulb, carry out instructions equivalent to 30 seconds and switch off the bulb.

Just put the whole thing in a loop, and you have a never ending on-off sequence.

Simple isnt it?

Let us now have a look at the features of the 8051 core, keeping the above example as a reference,

1. 8-bit CPU.( Consisting of the A and B registers)

Most of the transactions within the microcontroller are carried out through the A register, also known as the Accumulator. In addition all arithmetic functions are carried out generally in the A register. There is another register known as the B register, which is used exclusively for multiplication and division.

Thus an 8-bit notation would indicate that the maximum value that can be input into these registers is 11111111. Puzzled?

The value is not decimal 111, 11,111! It represents a binary number, having an equivalent value of FF in Hexadecimal and a value of 255 in decimal.

We shall read in more detail on the different numbering systems namely the Binary and Hexadecimal system in our next module.

2. 4K on-chip ROM

Once you have written out the instructions for the microcontroller, where do you put these instructions?

Obviously you would like these instructions to be safe, and not get deleted or changed during execution. Hence you would load it into the ROM

The size of the program you write is bound to vary depending on the application, and the number of lines. The 8051 microcontroller gives you space to load up to 4K of program size into the internal ROM.

4K, thats all? Well just wait. You would be surprised at the amount of stuff you can load in this 4K of space.

Of course you could always extend the space by connecting to 64K of external ROM if required.

3. 128 bytes on-chip RAM

This is the space provided for executing the program in terms of moving data, storing data etc.

4. 32 I/O lines. (Four- 8 bit ports, labeled P0, P1, P2, P3)

In our bulb example, we used the notation p1.0. This means bit zero of port one. One bit controls one bulb.

Thus port one would have 8 bits. There are a total of four ports named p0, p1, p2, p3, giving a total of 32 lines. These lines can be used both as input or output.

5. Two 16 bit timers / counters.

A microcontroller normally executes one instruction at a time. However certain applications would require that some event has to be tracked independent of the main program.

The manufacturers have provided a solution, by providing two timers. These timers execute in the background independent of the main program. Once the required time has been reached, (remember the time calculations described above?), they can trigger a branch in the main program.

These timers can also be used as counters, so that they can count the number of events, and on reaching the required count, can cause a branch in the main program.

6. Full Duplex serial data receiver / transmitter.

The 8051 microcontroller is capable of communicating with external

devices like the PC etc. Here data is sent in the form of bytes, at predefined speeds, also known as baud rates.

The transmission is serial, in the sense, one bit at a time

7. 5- interrupt sources with two priority levels (Two external and three internal)

During the discussion on the timers, we had indicated that the timers can trigger a branch in the main program. However, what would we do in case we would like the microcontroller to take the branch, and then return back to the main program, without having to constantly check whether the required time / count has been reached?

This is where the interrupts come into play. These can be set to either the timers, or to some external events. Whenever the background program has reached the required criteria in terms of time or count or an external event, the branch is taken, and on completion of the branch, the control returns to

the main program.

Priority levels indicate which interrupt is more important, and needs to be executed first in case two interrupts occur at the same time.

8. On-chip clock oscillator.

This represents the oscillator circuits within the microcontroller. Thus the hardware is reduced to just simply connecting an external crystal, to achieve the required pulsing rate.

Vous aimerez peut-être aussi