Sie sind auf Seite 1von 43

INTRODUCTION

Wireless operations permit services, such as long range communications, that are impossible or impractical to implement with the use of wires. The term is commonly used in the telecommunications industry to refer to telecommunications systems (e.g. radio transmitters and receivers, remote controls, computer networks, network terminals, etc.) which use some form of energy (e.g. radio frequency (RF),acoustic energy, etc.) to transfer information without the use of wires. Information is transferred in this manner over both short and long distances Radio frequency (RF) is a rate of oscillation in the range of about 3 kHz to 300 GHz, which corresponds to the frequency of radio waves, and the alternating currents which carry radio signals. RF usually refers to electrical rather than mechanical oscillations, although mechanical RF systems do exist In order to receive radio signals an antenna must be used. However, since the antenna will pick up thousands of radio signals at a time, a radio tuner is necessary to tune in to a particular frequency (or frequency range). This is typically done via a resonator in its simplest form, a circuit with a capacitor and an inductor forming a tuned circuit. The resonator amplifies oscillations within a particular frequency band, while reducing oscillations at other frequencies outside the band. Nowadays, many electrical appliances are equipped with controllers that allow the user to turn them on or off from a remote site. Among the existing control techniques, radio remote control plays an important role since this technique provides a reliable and flexible way to control appliances. Moreover, by combining this technique with the telephone line network or with the GSM network, one can control these appliances from a long distance, providing a means to send control commands from almost any place.

PROJECT DESCRIPTION

In our modern day life providing security to the data which is being transferred has a great importance. The data is encoded to provide security and its also called encryption of data The RF module, as the name suggests, operates at Radio Frequency. The corresponding frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is represented as variations in the amplitude of carrier wave. This kind of modulation is known as Amplitude Shift Keying (ASK). Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals through RF can travel through larger distances making it suitable for long range applications. Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is an obstruction between transmitter & receiver. Next, RF transmission is more strong and reliable than IR transmission. RF communication uses a specific frequency unlike IR signals which are affected by other IR emitting sources.

This RF module comprises of an RF Transmitter and an RF Receiver. The transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz. An RF transmitter receives serial data and transmits it wirelessly through RF through its antenna connected at pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received by an RF receiver operating at the same frequency as that of the transmitter.

The RF module is often used along with a pair of encoder/decoder. The encoder is used for encoding parallel data for transmission feed while reception is decoded by a decoder. HT12E-HT12D, HT640-HT648, etc. are some commonly used encoder/decoder pair ICs. HT12D is a decoder integrated circuit that belongs to 212 series of decoders. This series of decoders are mainly used for remote control system applications, like burglar alarm, car door controller, security system etc. It is mainly provided to interface RF and infrared circuits. They are paired with 212 series of encoders. The chosen pair of encoder/decoder should have same number of addresses and data format.

In simple terms, HT12D converts the serial input into parallel outputs. It decodes the serial addresses and data received by, say, an RF receiver, into parallel data and sends them to output data pins. The serial input data is compared with the local

addresses three times continuously. The input data code is decoded when no error or unmatched codes are found. A valid transmission in indicated by a high signal at VT pin.

HT12D is capable of decoding 12 bits, of which 8 are address bits and 4 are data bits. The data on 4 bit latch type output pins remain unchanged until new is received.HT12E is an encoder integrated circuit of 212 series of encoders. They are paired with 212 series of decoders for use in remote control system applications. It is mainly used in interfacing RF and infrared circuits. The chosen pair of encoder/decoder should have same number of addresses and data format.

Simply put, HT12E converts the parallel inputs into serial output. It encodes the 12 bit parallel data into serial for transmission through an RF transmitter. These 12 bits are divided into 8 address bits and 4 data bits.

HT12E has a transmission enable pin which is active low. When a trigger signal is received on TE pin, the programmed addresses/data are transmitted together with the header bits via an RF or an infrared transmission medium. HT12E begins a 4-word transmission cycle upon receipt of a transmission enable. This cycle is repeated as long as TE is kept low. As soon as TE returns to high, the encoder output completes its final cycle and then stops.

2.1 BLOCK DIAGRAM:

FIG 2.1(a) TRANSMITTER SECTION

FIG 2.1(b) RECEIVER SECTION:

MICROCONTROLLER

3.1 A Brief History of 8051 and Description


In 1981, Intel Corporation introduced an 8 bit microcontroller called 8051. This microcontroller had 128 bytes of RAM, 4K bytes of chip ROM, two timers, one serial port, and four ports all on a single chip. At the time it was also referred as A SYSTEM ON A CHIP The 8051 is an 8-bit processor meaning that the CPU can work only on 8 bits data at a time. Data larger than 8 bits has to be broken into 8 bits pieces to be processed by the CPU. The 8051 has a total of four I\O ports each 8 bit wide. There are many versions of 8051 with different speeds and amount of on-chip ROM and they are all compatible with the original 8051. This means that if you write a program for one it will run on any of them. The 8051 is an original member of the 8051 family. There are two other members `1in the 8051 family of microcontrollers. They are 8052 and 8031. All the three microcontrollers will have the same internal architecture, but they differ in the following aspects. The AT89S52 provides the following standard features: 8Kbytes of Flash, 256 bytes of RAM, 32 I/O lines, three 16-bit timer/counters, six-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt system to continue functioning. The Power down Mode saves the RAM contents but freezes the oscillator, disabling all other chip functions until the next hardware reset. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the AT89S52 is a powerful microcomputer which provides a highly flexible and cost effective solution to many embedded control applications.

3.2 Features of Microcontroller (89S52)


Compatible with MCS-51 Products

8 Kbytes of In-System Reprogrammable Flash Memory Endurance: 1,000 Write/Erase Cycles Fully Static Operation: 0 Hz to 24 MHz Three-Level Program Memory Lock 256 x 8-Bit Internal RAM 32 Programmable I/O Lines Three 16-Bit Timer/Counters Eight vector two level Interrupt Sources Programmable Serial Channel Low Power Idle and Power Down Modes In addition, the AT89S52 is designed with static logic for operation down to zero

frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The Power down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

Fig3.1Block diagram of 89S52

3.3 Pin Configurations

Figure 3.2 Pin Diagram of 89S52

Pin Description

VCC Pin 40 provides Supply voltage to the chip. The voltage source is +5v GND. Pin 20 is the grounded Port 0 Port 0 is an 8-bit open drain bidirectional I/O port from pin 32 to 39. As an output

port each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can

be used as high-impedance inputs. Port 0 may also be configured to be the multiplexed low-order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull-ups. Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups from pin 1 to 8. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups from pin 21 to 28. The Port 2 output buffers can sink / source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. . Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups from pin 10 to 17. The Port 3 output buffers can sink / source four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C52 as listed below:

Table 3.1 Special Features of port3

Port 3 also receives some control signals for Flash programming and programming verification. RST Pin 9 is the Reset input. It is active high. Upon applying a high pulse to this pin, the microcontroller will reset and terminate all activities. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG Address Latch is an output pin and is active high. Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable is the read strobe to external program memory. When the AT89C52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP External Access Enable EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming when 12-volt programming is selected. circuit. XTAL2 Output from the inverting oscillator amplifier. Oscillator Characteristics XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on chip oscillator, as shown in Figure 5.3. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure Figure 3.3 Crystal connections

Figure External clock drive configuration

There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Idle Mode In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the

10

special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hardware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory.

Power down Mode


In the power down mode the oscillator is stopped, and the instruction that invokes power down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power down mode is terminated. The only exit from power down is a hardware reset. Reset redefines the SFRs but does not change the onchip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize.

Table 3.2 Status of External Pins during Idle and Power down Mode Program Memory Lock Bits On the chip are three lock bits which can be left un programmed (U) or can be programmed (P) to obtain the additional features listed in the table 5.4. When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched during reset.It is necessary that the latched value of EA be in agreement with the current logic level at that pin in order for the device to function properly.

11

Table 3.3 Lock Bit Protection Modes

TIMERS
Timer 0 and 1 Timer 0 and Timer 1 in the AT89C52 operate the same way as Timer 0 and Timer 1 in the AT89C51. Register pairs (TH0, TL1), (TH1, TL1) are the 16-bit counter registers for timer/counters 0 and 1. Timer 2

Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON. Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON, as shown in Table 5.2. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.

Table 3.4 Timer 2 Operating Modes In the Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0

12

transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. There are no restrictions on the duty cycle of external input signal, but it should for at least one full machine to ensure that a given level is sampled at least once before it changes.

Capture Mode In the capture mode, two options are selected by bit EXEN2 in T2CON. If

EXEN2 = 0, Timer 2 is a 16-bit timer or counter which upon overflow sets bit TF2 in T2CON.This bit can then be used to generate an interrupt. IfEXEN2 = 1, Timer 2 performs the same operation, but a 1-to-0 transition at external input T2EX also causes the current value in TH2 and TL2 to be captured into RCAP2H andRCAP2L, respectively. Auto-reload (Up or Down Counter) Timer 2 can be programmed to count up or down when configured in its 16-bit auto-reload mode. This feature is invoked by the DCEN (Down Counter Enable) bit located in the SFR T2MOD (see Table 4). Upon reset, the DCEN bit is set to 0 so that timer 2 will default to count up. When DCEN is set, Timer 2 can count up or down, depending on the value of the T2EX pin. Table2.5: T2MOD-Timer 2 Mode Control Register

3.4 Interrupts
The AT89C52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure 2.5

13

Fig 3.5 Interrupts source Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Note that Table 4.3 shows that bit position IE.6 is unimplemented. In the AT89C51, bit position IE.5 is also unimplemented. User software should not write 1s to these bit positions, since they may be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be cleared in software. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows.

3.5 Special function registers:


Special function registers are the areas of memory that control specific functionality of the 89c52 microcontroller. a) Accumulator (0E0h) As its name suggests, it is used to accumulate the results of large no. of instructions. It can hold 8 bit values.

14

b) B registers (0f0H) The B register is very similar to accumulator. It may hold 8-bit value. The B register is only used by MUL AB and DIV AB instructions. In MUL AB the higher byte of the products gets stored in B register. In DIV AB the quotient gets stored in B with the remainder in A. c) Stack pointer (081h) The stack pointer holds 8-bit value. This is used to indicate where the next value to be removed from the stack should be taken from. When a value is to be pushed on to the stack, the 8052 first store the value of SP and then store the value at the resulting memory location. When a value is to be popped from the stack, the 8052 returns the value from the memory location indicated by SP and then decrements the value of SP. d) Data pointer (Data pointer low/high, address 82/83h) The SFRs DPL and DPH work together to represent a 16-bit value called the data pointer. The data pointer is used in operations regarding external RAM and some instructions code memory. It is a 16-bit SFR and also an addressable SFR. e) Program counter The program counter is a 16 bit register, which contains the 2 byte address, which tells the next instruction to execute to be found in memory. When the 8052 is initialized PC starts at 0000h and is incremented each time an instruction is executes. It is not addressable SFR. f) PCON (power control, 87h) The power control SFR is used to control the 8052s power control modes. Certain operation modes of the 8052 allow the 8052 to go into a type of sleep mode which consumes low power.

SMOD control, 88h)

----

---

----

GF1

GF0 G) TCON (Timer

The timer mode control SFR is used to configure and modify the way in which the 8052s two timers operate. This SFR controls whether each of the two timers is running or stopped and contains a flag to indicate that each timer has overflowed. Additionally, some non-timer related bits are located in TCON SER. These bits are used to configure

15

the way in which the external interrupt flags are activated, which are set when an external interrupt occur.

TF1

TR1

TF0

TR0

IE1

IT1

IE0

IT0

H) TMOD(Timer Mode, 89h) The timer mode SFR is used to configure the mode of operation of each of the two timers. Using this SR your program may configure each timer to be a 16-bit timer, or 13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally you may configure the timers to only count when an external pin is activated or to count events that are indicated on an external pin. Gate C/ T M1 M0 Gate C/ T M1 M0

TIMER1 i) T0 (Timer 0 low/ high, address 8A/ 8C h)

TIMER0

These two SFRs together represent timer 0. Their exact behavior depends on how the timer is configured in the TMOD SFR; however, these timers always count up. What is configurable is how and when they increment value. j) T1 (Timer 1 low/ high, address 8B/ 8D h) These two SFRs together represent timer 1. Their exact behavior depends on how the timer is configured in the TMOD SFR; however, these timers always count up. What is configurable is how and when they increment in value. k) P0 (Port 0, address 80h, bit addressable) This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin P0.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.

16

l) P1(Port 1, address 90h, bit addressable) This is port 1 latch. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 1 is first written on P1 register. For e.g., bit 0 of port 1 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level.

m) P2 (Port 2, address 0A0h, bit addressable) This is port 2 latch. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 2 is first written on P2 register. For e.g., bit 0 of port 2 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level. n) P3 (Port 3, address 0B0h, bit addressable) This is port 3 latch. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 3 is first written on P3 register. For e.g., bit 0 of port 3 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level. o) IE (Interrupt Enable, 0A8h) The interrupt enable SFR is used to enable and disable specific interrupts. The low 7 bits of the SFR are used to enable/disable the specific interrupts, where the MSB bit is used to enable or disable all the interrupts. Thus, if the high bit of IE 0 all interrupts are disabled regardless of whether an individual interrupt is enabled by setting a lower bit. ___ EA ET2 ES ET1 EX1 ET0 EX0

p) IP (Interrupt Priority, 0B8h) The interrupt priority SFR is used to specify the relative priority of each interrupt. On 8052, an interrupt may be either low or high priority. An interrupt may interrupt interrupts. For e.g., if we configure all interrupts as low priority other than serial interrupt. The serial interrupt always interrupts the system; even if another interrupt is currently executing no other interrupt will be able to interrupt the serial interrupt routine since the serial interrupt routine has the highest priority. ___ ___ PT2 PS PT1 PX1 PT0 PX0

17

q)PSW (Program Status Word, 0D0h) The Program Status Word is used to store a number of important bits that are set and cleared by 8052 instructions. The PSW SFR contains the carry flag, the auxiliary carry flag, the parity flag and the overflow flag. Additionally, it also contains the register bank select flags, which are used to select, which of the R register banks currently in

CY use.

AC

F0

RS1

RS0

OV

----

r) SBUF (Serial Buffer, 99h) SBUF is used to hold data in serial communication. It is physically two registers. One is writing only and is used to hold data to be transmitted out of 8052 via TXD. The other is read only and holds received data from external sources via RXD. Both mutually exclusive registers use address 99h.S

REGULATED POWER SUPPLY


4.1 Description:
A variable regulated power supply, also called a variable bench power supply, is one where you can continuously adjust the output voltage to your requirements. Varying the output of the power supply is the recommended way to test a project after having double checked parts placement against circuit drawings and the parts placement guide. This type of regulation is ideal for having a simple variable bench power supply. Actually this is quite important because one of the first projects a hobbyist should undertake is the construction of a variable regulated power supply. While a dedicated supply is quite

18

handy e.g. 5V or 12V, it's much handier to have a variable supply on hand, especially for testing. Most digital logic circuits and processors need a 5 volt power supply. To use these parts we need to build a regulated 5 volt source. Usually you start with an unregulated power supply ranging from 9 volts to 24 volts DC (A 12 volt power supply is included with the Beginner Kit and the Microcontroller Beginner Kit.). To make a 5 volt power supply, we use a LM7805 voltage regulator IC .

The LM7805 is simple to use. You simply connect the positive lead of your unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply from the Output pin.

4.2 Circuit Features:


Brief description of operation: Gives out well regulated +5V output, output current capability of 100 mA Circuit protection: Built-in overheating protection shuts down output when

regulator IC gets too hot Circuit complexity: Very simple and easy to build Circuit performance: Very stable +5V output voltage, reliable operation

19

components

Availability of components: Easy to get, uses only very common basic

Design testing: Based on datasheet example circuit, I have used this circuit

successfully as part of many electronics projects Applications: Part of electronics devices, small laboratory power supply Power supply voltage: Unregulated DC 8-18V power supply Power supply current: Needed output current + 5 mA Component costs: Few dollars for the electronics components + the input

transformer cost

4.3 Block Diagram:

Fig 4.1 BLOCK DIAGRAM OF REGULATED POWER SUPPLY

4.4 Circuit Diagram:

20

Fig4.2 CIRCUIT DIAGRAM OF REGULATED POWER SUPPLY

4.5 Basic Power Supply Circuit:


Above is the circuit of a basic unregulated dc power supply. A bridge rectifier D1 to D4 rectifies the ac from the transformer secondary, which may also be a block rectifier such as WO4 or even four individual diodes such as 1N4004 types. (See later re rectifier ratings). The principal advantage of a bridge rectifier is you do not need a centre tap on the secondary of the transformer. A further but significant advantage is that the ripple frequency at the output is twice the line frequency (i.e. 50 Hz or 60 Hz) and makes filtering somewhat easier. As a design example consider we wanted a small unregulated bench supply for our projects. Here we will go for a voltage of about 12 - 13V at a maximum output current (IL) of 500ma (0.5A). Maximum ripple will be 2.5% and load regulation is 5%. Now the RMS secondary voltage (primary is whatever is consistent with your area) for our power transformer T1 must be our desired output Vo PLUS the voltage drops across D2 and D4 (2 * 0.7V) divided by 1.414. This means that V sec = [13V + 1.4V] / 1.414 which equals about 10.2V. Depending on the VA rating of your transformer, the secondary voltage will vary

21

considerably in accordance with the applied load. The secondary voltage on a transformer advertised as say 20VA will be much greater if the secondary is only lightly loaded. If we accept the 2.5% ripple as adequate for our purposes then at 13V this becomes 13 * 0.025 = 0.325 V rms. The peak to peak value is 2.828 times this value. V rip = 0.325V X 2.828 = 0.92 V and this value is required to calculate the value of C1. Also required for this calculation is the time interval for charging pulses. If you are on a 60Hz system it 1/ (2 * 60) = 0.008333 which is 8.33 milliseconds. For a 50Hz system it is 0.01 sec or 10 milliseconds. Remember the tolerance of the type of capacitor used here is very loose. The important thing to be aware of is the voltage rating should be at least 13V X 1.414 or 18.33. Here you would use at least the standard 25V or higher (absolutely not 16V).With our rectifier diodes or bridge they should have a PIV rating of 2.828 times the V sec or at least 29V. Don't search for this rating because it doesn't exist. Use the next highest standard or even higher. The current rating should be at least twice the load current maximum i.e. 2 X 0.5A or 1A. A good type to use would be 1N4004, 1N4006 or 1N4008 types. These are rated 1 Amp at 400PIV, 600PIV and 1000PIV respectively. Always be on the lookout for the higher voltage ones when they are on special.

4.6 IC Voltage Regulators:


Voltage regulators comprise a class of widely used ICs. Regulator IC units contain the circuitry for reference source, comparator amplifier, control device, and overload protection all in a single IC. Although the internal construction of the IC is somewhat different from that described for discrete voltage regulator circuits, the external operation is much the same. IC units provide regulation of either a fixed positive voltage, a fixed negative voltage, or an adjustably set voltage. A power supply can be built using a transformer connected to the ac supply line to step the ac voltage to desired amplitude, then rectifying that ac voltage, filtering with a capacitor and RC filter, if desired, and finally regulating the dc voltage using an IC regulator. The regulators can be selected for operation with load currents from hundreds of mill amperes to tens of amperes, corresponding to power ratings from mill watts to tens of watts.

22

Three-Terminal Voltage Regulators:

23

IN 78XX GND

OUT

24

V in C1 C2

V out

Fig 4.3 Fixed Positive Voltage Regulators Fig shows the basic connection of a three-terminal voltage regulator IC to a load. The fixed voltage regulator has an unregulated dc input voltage, Vi, applied to one input terminal, a regulated output dc voltage, Vo, from a second terminal, with the third terminal connected to ground. While the input voltage may vary over some permissible voltage range, and the output load may vary over some acceptable range, the output voltage remains constant within specified voltage variation limits. A table of positive voltage regulated ICs is provided in table. For a selected regulator, IC device specifications list a voltage range over which the input voltage can vary to maintain a regulated output voltage over a range of load current. The specifications also list the amount of output voltage change resulting from a change in load current (load regulation) or in input voltage (line regulation).

TABLE 4.1: Positive Voltage Regulators in 7800 series

IC No.

Output voltage(v)

Maximum input voltage(v)

7805 7806 7808 7810 7812 7815

+5 +6 +8 +10 +12 +15 35V

25

7818 7824

+18 +24 40V

RF TX AND RX MODULES
TX433andRX433RFmodules

This compact radio frequency (RF) receiver module is suitable for remote control or telemetry applications. The double sided circuit board is pre-populated with Surface Mount Devices (SMD) and is tuned to 433MHz. No module assembly or adjustments are

26

required. RF receiver module RX433 receives RF control signals from the 8 channel RF remote control transmitter K8058 and performs as an RF receiver interface when used on the 8 channel remote control relay board K8056. (Only one RX433 RF receiver is needed for full RF remote control operation of the 8 channel relay board K8056). RF receiver module RX433 is a highly sensitive passive design that is easy to implement with a low external parts count. (Download datasheet with hook-up schematic below) RF remote receiver module RX433 can also be used with 433MHz RF Transmitter TX433N for your custom remote control or telemetry requirements. (However, the FCC has restrictions on the sale of the TX433N transmitter module in the U.S., so we don't have these transmitters available).

5.1 RF Receiver Module Features and Specifications


no RF receiver module adjustments required stable output suitable for RF remote controls, telemetry, ...

Specifications
RF receiver frequency: 433MHz receiver range: 220 yards (200m) in open air modulation: AM modulate mode: ASK circuit shape: LC sensitivity: 3Vrms power supply: 4.5 - 5.5V DC data rate: 4800 bps receiver selectivity: -106 dB channel spacing: 1 MHz digital and linear output RF receiver module pin numbers

27

1: gnd 2: digital output 3: linear output 4: Vcc 5: Vcc 6:Gnd 7: gnd 8: antenna: 11.8" - 13.77" (30cm - 35cm)

5.2 RF Transmitter Module Features and Specifications


Frequency: 433MHz modulation: AM RF output: 8mW power supply: 3 - 12Vdc Circuit Shape: SAW Data Rate: 8 kbps

pin numbers: 1: GND 2: Data IN 3: Vcc 4: ANT

28

KEIL SOFTWARE
SOFTWARE DESCRIPTION:

1. 2.

Click on the Keil uVision Icon on Desktop The following fig will appear

3. 4.

Click on the Project menu from the title bar Then Click on New Project

29

5.

Save the Project by typing sited in either C:\ or D:\suitable project

name with no extension in u r own folder

6. 7.

Then Click on save button above. Select the component for u r project. I.e. Atmel Click on the + Symbol beside of Atmel

8.

30

9.

Select AT89C51 as shown below

10. 11.

Then Click on OK

The Following fig will appear

31

12. 13. 14.

Then Click either YES or NOmostly NO

Now your project is ready to USE Now double click on the Target1, you would get another option Source group 1 as shown in next page.

15.

Click on the file option from menu bar and select new

32

The next screen will be as shown in next page, and just maximize it by double clicking on its blue boarder.

16.
17.

Now start writing program in either in C or ASM 99For a program written in Assembly, then save it with extension . asm and for C based program save it with extension .C

33

18.

Now right click on Source group 1 and click on Add files to Group Source

19.

Now you will get another window, on which by default C files will appear.

34

20. 21. 22.

Now select as per your file extension given while saving the file Click only one time on option ADD Now Press function key F7 to compile. Any error will appear if so happen.

23. 24.

If the file contains no error, then press Control+F5 simultaneously. The new window is as follows

35

25. 26.

Then Click OK Now Click on the Peripherals from menu bar, and check your required port as shown in fig below

Drag the port a side and click in the program file.

36

27.

Now keep Pressing function key F11 slowly and observe.

You are running your program successfully

PROGRAM
// Program for Reciever #include <reg51.H> #define d P0 void main() { char rxdata; char info; // this variable recieves data // selecting Timer 1, with mode 8bit auto reload. // setting baud rate = 4800 unsigned int i; TMOD=0x20; TH1=0xFA; SCON=0x50; TR1=1; while(1) { while(RI==0); // this line will wait for the data to come if(SBUF==0x55)

37

{ Rx data=SBUF; // as soon as the data is received its transferred to a variable so that the next variable does not overwrite the data just received } RI=0; // clearing the flag.

if(rx data==0x55) { info=rxdata%0xF; d=0x01; for(i=0;i<10000;i++); d=0x00; for(i=0;i<10000;i++); } } } // Program for transmitter #include <REGX51.H> void main() { int sig=0x55; // signal to be transmitted; TMOD=0x20; // selecting Timer 1, with mode 8bit auto reload. TH1=0xFA; // setting baud rate = 4800 SCON=0x50; // setting the 8bit Control reg which control the SBUF with RC5 TR1=1; // starting the timer while(1) // thios point onwards the code is sending 0x55 all the time { SBUF=sig; while(TI==0); TI=0; } }

38

RESULT

39

transmitter

receiver

40

CONCLUSION
Embedded systems are emerging as a technology with high potential. In the past decades micro processor based embedded system ruled the market. The last decade witnessed the revolution of Microcontroller based embedded systems. This project basically deals with how many number of persons are in the room very accurately with the help of Microcontroller. With regards to the requirements gathered the manual work and the complexity in counting can be achieved with the help of electronic devices.

FUTURE SCOPE
This system is a rapidly growing field and there are new and improved strategies popping up all the time. For the most part these systems are all built around the

41

same basic structure, a central box that monitors several detectors and perimeter guards and sounds an alarm when any of them are triggered. This system is best for guiding the perimeter of a house or a business center the points where an intruder would enter the building. In this system IR sensor is used to detect the intrusion. Similarly the vibration and temperature sensors recognize vibration disturbances and accidental fires respectively. This project provides an efficient and economical security system. This system finds applications in industries, banks and homes. Incorporating the features discussed below can further enhance the system

This system can detect intrusion only at

discrete points. This system

detection feature can be extended to scanning a complete area. Thus the intrusion into the building can be detected with much more efficiently. The redialing feature can also be incorporated such that if the call is not put forward the first time, the auto dialer will dial the same number until the call is successfully completed. A pre-recorded voice message can delivered to the owner notifying him about the intrusion into the premises. The addition of the above discussed advancements certainly builds this project into a much flexible and reliable security system.

BIBLIOGRAPHY
1. The 8051 Microcontroller and Embedded Systems by Muhammad Ali Mazidi, 2nd edition 2. Fundamentals of Embedded Software by Daniel W Lewis, 4th edition 3. www.howsstuffworks.com\microcontroller 4. www.alldatasheets.com\rf Rx and Tx module 5. www.electronicsforu.com 6. www.knowledgebase.com

42

7. www.8051 projectsinfo.com8 8. Datasheets of Microcontroller AT89C52 9. Datasheets of 555 timers 10. Datasheets of TSAL 6200 11. Datasheets of TSOP 1356 12. Datasheets of BC 547

43

Das könnte Ihnen auch gefallen