41-sms rf duplex

Upload: rahul-jolly

Post on 05-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 41-Sms Rf Duplex

    1/24

    RF DATA

    COMMUNICATION

    IN DUPLEX MODE WITH

    ENCRYPTION AND

    ACKNOWLEDGEMENT

    OPTION

    DATA TRANSMISSON THROUGH RADIO FREQUENCY MODULE.

  • 8/2/2019 41-Sms Rf Duplex

    2/24

    In this project we show that how we transfer the data from the one unit to

    second unit with rf module. In this project we transfer the ascii data. First of

    all we type the ascii data with the help of the push to on switch and save this

    data in the unit. This data is display on the lcd screen at the same time. Now

    we send this data via serial communication from one unit to another unit.

    Data send with the address code, if the address code is not match then data is

    not transfer.

    Data send through the encryption code and decrypt by the password only.

    Data send to receiver via serial communication.

    In this project we design a duplex mode transmission

    Data transfer and if not receive then not response message is on the screen.

    If the data is send properally then data send message on the screen.

    Complete project is to be divided into few parts.

  • 8/2/2019 41-Sms Rf Duplex

    3/24

    5 volt regulated power supply.

    Keyboard scanning ( multi code from one key)

    Microcontroller interface.

    Lcd detail.

    Serial communication.

    How to set a baud rate.

    Rf mdule detail.

    Data acknowledgement option.

    In this project we use 5 volt regulated power supply with the help of AC to

    Dc converter circuit. Here we use one step down transformer to step down

    the voltage from 220 volt ac to 9 volt ac. Here we use centre tap transformer.

    Output of the transformer is converted into dc with the help of the full wave

  • 8/2/2019 41-Sms Rf Duplex

    4/24

    rectifier circuit. Output of the rectifier is further converted into pure dc with

    the help of the capacitor filter. Output of the filter circuit is further regulated

    by the 7805 regulator. Output of the regulator is further ic regulated 5 volt

    dc. Here we use 7805 regulator. IC 7805 is a 5 volt regulator. Output of the

    regulator is again filter by the capacitor circuit. Here we use capacitor

    circuit to reduce the noise in the air. Output of the regulator is shown by the

    resistor and led circuit for power indication. This 5 volt supply is must for

    the microcontroller circuit, lcd supply and rf module unit.

    Keyboard scanning. In the keyboard scanning first of all we use push to on

    switches. This type of switch are two pin switch. All the switches are

    connect to microcontroller port p1 and port p3. One point of the all the

    switches are connected to the ground position. In normal condition when the

    power is on all the pins of the controller is on high logic, so when we press a

    switch then that pins become more negative and so we acknowledge the

    pin by sense a 0 on this pin. Here we use 26 letter and some other function

    of keyboard like back slash etc. first of all we sense the switch . we assign

    the switch and insert a a ascii code in particular function. We make one

  • 8/2/2019 41-Sms Rf Duplex

    5/24

    function for one letter. We done all these things by the programming. First

    of all we assign all the keys with rename the bit value. Like key1 is

    connected to the p1.0. pi.o is the pin no 1 of the port p1

    key1 bit p1.0

    key2 bit p1.1

    key3 bit p1.2

    key4 bit p1.3

    key5 bit p1.4

    key6 bit p1.5

    key7 bit p1.6

    key8 bit p1.7

    key9 bit p3.2

    key10 bit p3.3

    key11 bit p3.4

    key12 bit p3.5

    key13 bit p3.6

    key14 bit p3.7

    buz bit p2.4

    buzzer is connected to the pin no 25 which is

    p2.4 of this ic

  • 8/2/2019 41-Sms Rf Duplex

    6/24

    Here we use ic 89s51 as a main controller to done all the function of the

    project. Here we use 89s51 which is a family member of the 8051 family.

  • 8/2/2019 41-Sms Rf Duplex

    7/24

    The 8051 doesnt have any special feature than other microcontroller. The

    only feature is that it is easy to learn. Architecture makes us to know about

    the hardware features of the microcontroller. The features of the 8051 are

  • 8/2/2019 41-Sms Rf Duplex

    8/24

    4K Bytes of Flash Memory

    128 x 8-Bit Internal RAM

    Fully Static Operation: 1 MHz to 24 MHz

    32 Programmable I/O Lines

    Two 16-Bit Timer/Counters

    Six Interrupt Sources (5 Vectored)

    Programmable Serial Channel

    Low Power Idle and Power Down Modes

    The 8051 has a 8-Bit CPU that means it is able to process 8 bit of data at a

    time. 8051 has 235 instructions. Some of the important registers and their

    functions are

    Pin no 40 of the ic is connected to the positive supply. Pin no 20 is

    connected to the negative supply. Pin no 18 and 19 is connected to the 12

  • 8/2/2019 41-Sms Rf Duplex

    9/24

    Mhz crystal. With the help of this crystal we not only control the speed of

    processor but at the same time we use this crystal value to set the baud rate

    also. Pin no 1 to 8 is for the port p1. all this pins are connected to the push to

    switches to enter a code in the processor.

    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.

    Pin no 9 is the reset pin of this ic. On this pin we connect a one capacitor and

    resistor. With the help of this capacitor and resistor we auto reset the

    controller when power is on. One manual switch is also connected across

    the capacitor to produce a manual reset .when we press this switch then pin

    no 9 become positive and negative for 2 microsecond second and ic is to be

    reset. To reset the ic in proper way is very must, because we want to start

    the program every time from start point.

  • 8/2/2019 41-Sms Rf Duplex

    10/24

    Pin no 10 to pin no 17 is our port p3. Pin no 10 and pin no 11 is the rx and

    tx pin of the ic On this tx and rx pin we connect a rf module to send and

    receive the data.. these Rf module are 433 Mhz module. On this pin data is

    available in serial mode. Pin no 18 and 19 is connected to the crystal. Two

    capacitors are grounded from the crystal to reduce the noise in the air. Here

    we use 27 to 33 pf of the capacitor. These capacitors are grounded from the

    crystal.

    Crystals

    Crystals provide the synchronization of the internal function and to the

    peripherals. Whenever ever we are using crystals we need to put the

  • 8/2/2019 41-Sms Rf Duplex

    11/24

    capacitor behind it to make it free from noises. It is good to go for a 33pf

    capacitor.

    pin no 21 to 24 is connected to dip switches. Here we use 4 pin dip switch,

    with the help of this switches we select a address of the data transmission,

    we use this dip switch to select the address. Pin no 21 to 28 is the port p2

    pin. Pin no 25 is connected to the buzzer. This buzzer is activate when the

    data is receive by the rf module.

    21

    22

    23

    24

  • 8/2/2019 41-Sms Rf Duplex

    12/24

    pin no 26,27,28 is connected to the lcd control pins. These pins are very

    important for the lcd to control all the command and data write function.

    LCD DETAIL .

    In this project we use 2 by 16 lcd. It means 2 lines and 16 character on one

    line.

    Frequently, an 8051 program must interact with the outside world using

    input and output devices that communicate directly with a human being. One

    of the most common devices attached to an 8051 is an LCD display. Some

    of the most common LCDs connected to the 8051 are 16x2 and 20x2

    displays. This means 16 characters per line by 2 lines and 20 characters per

    line by 2 lines, respectively.

    Fortunately, a very popular standard exists which allows us to communicate

    with the vast majority of LCDs regardless of their manufacturer. The

    standard is referred to as HD44780U, which refers to the controller chip

    which receives data from an external source (in this case, the 8051) and

    communicates directly with the LCD

  • 8/2/2019 41-Sms Rf Duplex

    13/24

    In this project we use three control lines and 8 data lines, total 11

    lines. * data lines are connected to the port p0, pin no 39 to 32

    The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines

    for the data bus. The user may select whether the LCD is to operate with a 4-

    bit data bus or an 8-bit data bus. If a 4-bit data bus is used, the LCD will

    require a total of 7 data lines (3 control lines plus the 4 lines for the data

    bus). If an 8-bit data bus is used, the LCD will require a total of 11 data lines

    (3 control lines plus the 8 lines for the data bus).

    The three control lines are referred to as EN, RS, and RW.

    The EN line is called "Enable."

    This control line is used to tell the LCD that you are sending it data. To send

    data to the LCD, your program should first set this line high (1) and then set

    the other two control lines and/or put data on the data bus. When the other

    lines are completely ready, bring EN low (0) again. The 1-0 transition tells

    the 44780 to take the data currently found on the other control lines

    andonthe data bus and to treat it as a command.

    The RS line is the "Register Select" line. When RS is low (0), the data is to

    be treated as a command or special instruction (such as clear screen, position

    cursor, etc.). When RS is high (1), the data being sent is text data which

    should be displayed on the screen. For example, to display the letter "T" on

    the screen you would set RS high.

  • 8/2/2019 41-Sms Rf Duplex

    14/24

    The RW line is the "Read/Write" control line. When RW is low (0), the

    information on the data bus is being written to the LCD. When RW is high

    (1), the program is effectively querying (or reading) the LCD. Only one

    instruction ("Get LCD status") is a read command. All others are write

    commands--so RW will almost always be low.

    Finally, the data bus consists of 4 or 8 lines (depending on the mode of

    operation selected by the user). In the case of an 8-bit data bus, the lines are

    referred to as DB0, DB1, DB2, DB3, DB4, DB5, DB6, and DB7.

    Tx pin and rx pins are connected to the Radio frequency module. With the

    help of this module we send and receive the data serially

    In this project we use one 433 mhz transmitter and one 433 mhz receiver in

    both the circuit. This is rf module and use it for the many rf application

    circuit, this type of rf module is available in the market for different

    application. We use one pair of transmitter and receiver in both the circuit.

    Along with this transmitter and receiver we use 89s51 controller circuit.

    Data from the controller is serially connected to the input of the transmitter

    and serially is received. So we use serial communication. In this

    microcontroller there is special buffer for the serial communication. With the

    help of this UART feature we transmit the data and receive the data serially

    with this rf module.

  • 8/2/2019 41-Sms Rf Duplex

    15/24

    The TWS-434 and RWS-434 are extremely small, and are excellentfor applications requiring short-range RF remote controls. Thetransmitter module is only 1/3 the size of a standard postage stamp,and can easily be placed inside a small plastic enclosure.

    TWS-434: The transmitter output is up to 8mW at 433.92MHz with a

    range of approximately 400 foot (open area) outdoors. Indoors, therange is approximately 200 foot, and will go through most walls.....

    TWS-434A

    The TWS-434 transmitter accepts both linear and digital inputs, canoperate from 1.5 to 12 Volts-DC, and makes building a miniature

    hand-held RF transmitter very easy. The TWS-434 is approximatelythe size of a standard postage stamp.

    TWS-434 Pin Diagram

  • 8/2/2019 41-Sms Rf Duplex

    16/24

    Sample Transmitter Application Circuit

    RWS-434: The receiver also operates at 433.92MHz, and has asensitivity of 3uV. The RWS-434 receiver operates from 4.5 to 5.5volts-DC, and has both linear and digital outputs.

    Click on picture for larger image

    RWS-434 Receiver

    http://www.rentron.com/images/rws434med.jpg
  • 8/2/2019 41-Sms Rf Duplex

    17/24

    RWS-434 Pin Diagram

    Sample Receiver Application Circuit

  • 8/2/2019 41-Sms Rf Duplex

    18/24

    The example above shows the receiver section using the HT-12D decoder ICfor a 4-bit RF remote control system. The transmitter and receiver can also usethe Holtek 8-bit HT-640/HT-648L remote control encoder/decoder combinationfor an 8-bit RF remote control system. Here are the schematics for an 8-bit RFremote control system:

    Next part of the project is programming part, for this project we use one

    assembler to type all the code in the assembly language

    For developing embedded application we are having two options.

    Assembler

    C Compiler

    Assembler

  • 8/2/2019 41-Sms Rf Duplex

    19/24

    Using assembler can reduce them memory used abundantly. You can

    have a good control over the code. When you use assembly language you are

    directly programming the microcontroller. The process time can be easily

    calculated. Atmel itself gives a free assembler called asm51.

    But making a application in assembly language will take many man

    hours. Porting is not at all possible in assembly language. Even to port the

    code into another derivative we need to tweak a lot.

    Debugging is really tough. A simple applications code may range from 400

    to 500 lines. It is really tough to map the mistake and rectify it.

    C Compiler

    This is an universal language and so every one know C. The

    application can be rapidly developed in C Compiler. The code can be ported

    into other microcontroller just like that. Debugging is really easy in C.

    On the other hand when we use C we dont have the control over the

    code. The printf is a single statement which takes around 1.2 Kb of code

    memory. The 8051 it self has only 4Kb of memory. The C Compilers are

  • 8/2/2019 41-Sms Rf Duplex

    20/24

    memory hungry. Even the best compilers fix bugs after its release. The

    compilers use the ram just like that. The cost of the compiler is very high.

    We can still use C Compiler because we can make the applications rapidly.

    We dont want to learn another new language. We even dont want to learn

    the whole architecture of the 8051!

    The 8051 has only 127 bytes of ram. The enhanced version 8052 even has

    only 256 bytes of ram. So while programming microcontroller we should

    take care a lot in the usage of the variables.

    A view of the C Compilers available in the market

    SDCC Small Device CCompiler open source Compiler started in

    India.

    RIDE yet another famous C Compiler but ram hungry

    Hitech Famous in Dev. PIC Micro compilers

  • 8/2/2019 41-Sms Rf Duplex

    21/24

    Micro C Rather new compiler

    Keil Very Nice Compiler

    Components used in this project. ( SAME AS A TWO SET)

    Step down transformer 220 volt 9 volt ac.

    Diode in 4007 (2)

    Capacitor 1000mfd (2)

    7805 regulator for 5 volt regulation.

    Push to on switch (15)

    Ic 89s51 ( 8051 family)

    Lcd 2 by 16

    Crystal 12 mhz

    Rf module 433 mhz tx and rx module.

  • 8/2/2019 41-Sms Rf Duplex

    22/24

    Dip switch to select address.

    Dc buzzer

    Resistor:

    10k pull up resistor with port p0.

    1 k oh resistor (4)

    470 ohm resistor (2)

    1o k fixed (2)

    4 .7 k variable resistor with lcd pin no 3

    l.e.d (2)

    NPN TRANSISITOR (20

  • 8/2/2019 41-Sms Rf Duplex

    23/24

  • 8/2/2019 41-Sms Rf Duplex

    24/24