merged report

Author: parveen-jaat

Post on 02-Jun-2018

219 views

Category:

Documents


0 download

Embed Size (px)

TRANSCRIPT

  • 8/11/2019 Merged Report

    1/31

    1

    CHAPTER 1

    INTRODUCTION TO ORGANISATION

    1.1 CETPA INFOTECH:

    CETPA Infotech, an ISO 9001:2008 Certified Company is a renowned name among

    Engineering Students and MCA/BCA professionals for providing quality education in the

    forms of 6 Months,6 weeks Summer, Industrial & Winter Training. CETPA has formed a

    group of enthusiastic and well competent professionals, having a unique training

    methodology which makes CETPA Northern India No-1 Training Company with a bright

    history of training more than 35,000 engineers and professionals.CETPA Infotech has

    designed a curriculum for 6 Weeks and 6 Months training which incorporates a blending

    learning approach by integrating classroom, hands on lab exercise and team projects to

    provide students both the theoretical & practical training, needed to build strong technical

    skills.Cetpa Infotech provides Training/Internship/ Winter Training Programs cum

    Placement on .NET, C & C++, VHDL,Verilog HDL, Embedded System, Advance

    Embedded System using pic,avr microcontroller, Mechanical Designing

    (CATIA,CREO),Advance Networking(CCNA and MCIP),J2EE,Software Testing,VLSI

    design for Engineering Students at CETPA Noida, Greater Noida, Lucknow,

    Roorkee,Mohali, Kyiv(Ukraine) & Schwerin (Germany). Company goal is to achieve

    highest possible recognition through professionalism, technological contributions,

    industry oriented education & training, research & development.We are very experienced

    Software development company providing high quality and cost effective Software

    development serivces using latest technologies .

  • 8/11/2019 Merged Report

    2/31

    2

    CHAPTER 2

    INTRODUCTION TO EMBEDDED SYSTEMS

    2.1 INTRODUCTION:

    An embedded system is a special-purpose system in which the computer is completely

    encapsulated by the device it controls. Unlike a general-purpose computer, such as a

    personal computer, an embedded system performs pre-defined tasks, usually with very

    specific requirements. Since the system is dedicated to a specific task, design engineers

    can optimize it, reducing the size and cost of the product. Embedded systems are often

    mass-produced, so the cost savings may be multiplied by millions of items.

    Handheld computers or PDAs are generally considered embedded devices because of the

    nature of their hardware design, even though they are more expandable in software terms.

    This line of definition continues to blur as devices expand.

    Physically, embedded systems range from portable devices such as digital

    watches and MP3 players, to large stationary installations like traffic lights, factory

    controllers. Complexity varies from low, with a single microcontroller chip, to very high

    with multiple units, peripherals and networks mounted inside a large chassis or enclosure.

    Embedded systems contain processing cores that are either microcontrollers or digital

    signal processors (DSP). The key characteristic, however, is being dedicated to handle a

    particular task. Since the embedded system is dedicated to specific tasks, design

    engineers can optimize it to reduce the size and cost of the product and increase the

    reliability and performance. Some embedded systems are mass-produced, benefiting

    from economies of scale.

    Robotics and automation are a part of embedded systems itself. Robot development and

    automation needs study of embedded systems.

  • 8/11/2019 Merged Report

    3/31

    3

    Examples of Embedded System are

    1. automatic teller machines (ATMs)

    2. avionics, such as inertial guidance systems, flight control hardware/software and

    other integrated systems in aircraft and missiles

    3. cellular telephones and telephone switches

    4. computer equipment such as routers and printers

    5. engine controllers and antilock brake controllers for automobiles

    6. home automation products, like thermostats, air conditioners, sprinklers, and

    security monitoring systems

    7. handheld calculators

    8.

    household appliances, including microwave ovens, washing machines, television

    sets

    9. medical equipment

    10.handheld computers

    11.videogame consoles

    2.2 CHARACTERISTICS OF EMBEDDED SYSTEMS:

    Embedded systems are designed to do some specific task, rather than be a general-

    purpose computer for multiple tasks. Some also have real-timeperformance constraints

    that must be met, for reasons such as safety and usability; others may have low or no

    performance requirements, allowing the system hardware to be simplified to reduce costs.

    The program instructions written for embedded systems are referred to as firmware, and

    are stored in read-only memory or Flash memory chips. They run with limited computer

    hardware resources: little memory, small or non-existent keyboard or screen.

    Many embedded systems consist of small, computerized parts within a larger device that

    serves a more general purpose. For example- a line follower autonomous robot which

    follows a specific path and moves accordingly to the path.

  • 8/11/2019 Merged Report

    4/31

    4

    The embedded systems are special purpose computer systems designed to perform only

    the specific purposes. For Example- a system designed to display numbers cannot be used

    to operate motors.

    Embedded systems range from no user interface at alldedicated only to one taskto

    complex graphical user interfaces that resemble modern computer desktop operating

    systems. Simple embedded devices use buttons, LEDs, graphic or character LCDs (for

    example popular HD44780 LCD) with a simple menu system.

    2.3 MICROCONTROLLER

    Microcontrollers are single chip computers. The Intel 8051 is a single chip

    microcontroller (C) which was developed by Intel in 1980 for use in embedded systems.

    Intel's original versions were popular in the 1980s and early 1990s, but has today largely

    been superseded by a vast range of faster and/or functionally enhanced 8051-compatible

    devices manufactured by more than 20 independent manufacturers including Atmel,

    Infineon Technologies (formerly Siemens AG), Maxim Integrated Products (via its Dallas

    Semiconductor subsidiary), NXP (formerly Philips Semiconductor), Winbond, ST

    Microelectronics, Silicon Laboratories (formerly Cygnal), Texas Instruments and Cypress

    Semiconductor. Intel's official designation for the 8051 family of Cs is MCS 51.Intel's

    original 8051 family was developed using NMOS technology, but later versions,

    identified by a letter "C" in their name, e.g. 80C51, used CMOS technology and were less

    power-hungry than their NMOS predecessors - this made them eminently more suitable

    for battery-powered devices.

    IMPORTANT FEATURES:

    It provides many functions (CPU,RAM,ROM,I/O, interrupt logic, timer, etc.) in

    a single package .

    8-bit data bus - It can access 8 bits of data in one operation (hence it is an 8-bit

    microcontroller).

    http://en.wikipedia.org/wiki/Central_processing_unithttp://en.wikipedia.org/wiki/Random_access_memoryhttp://en.wikipedia.org/wiki/Read-only_memoryhttp://en.wikipedia.org/wiki/Read-only_memoryhttp://en.wikipedia.org/wiki/Random_access_memoryhttp://en.wikipedia.org/wiki/Central_processing_unit
  • 8/11/2019 Merged Report

    5/31

    5

    16-bit address bus - It can access 216

    memory locations - 64kB each of RAM and

    ROM.

    On-chip RAM - 128 bytes ("Data Memory")

    On-chip ROM - 4 kb ("Program Memory").

    Four byte bi-directional input/output port.

    UART (serial port).

    Two 16-bit Counter/timers.

    Two-level interrupt priority.

    2.4 PROCESSORS IN EMBEDDED SYSTEMS

    Embedded processors can be broken into two broad categories. Ordinary microprocessors

    (P) use separate integrated circuits for memory and peripherals. Microcontrollers (C)

    have many more peripherals on chip, reducing power consumption, size and cost. In

    contrast to the personal computer market, many different basic CPU architectures are

    used, since software is custom-developed for an application and is not a commodity

    product installed by the end user. RISC as well as non-RISC processors are found. Word

    lengths vary from 4-bit to 64-bits and beyond, although the most typical remain 8/16-bit.

    2.5 MICROCONTROLLERS AND MICROPROCESSORS

    Table 2.1: Difference between Microprocessor and Microcontroller

    Microcontrollers Microprocessors

    1. A Microcontroller (sometimes

    abbreviated C, uC or MCU) is a small

    computer on a single integrated

    circuit containing a processor core,

    memory, and

    programmable input/output peripherals.

    1. A Microprocessor is an IC which has

    only the CPU inside them i.e. only the

    processing powers such as Intels

    Pentium 1,2,3,4, core 2 duo, i3, i5 etc.

    http://en.wikipedia.org/wiki/Kilobytehttp://en.wikipedia.org/wiki/Kilobyte
  • 8/11/2019 Merged Report

    6/31

    6

    2. Microcontrollers are designed to

    perform specific tasks. Specific means

    applications where the relationship of

    input and output is defined. Depending

    on the input, some processing needs to

    be done and output is delivered. For

    example, keyboards, mouse, washing

    machine, digicam, pen drive, remote,

    microwave, cars, bikes, telephone,

    mobiles, watches, etc.

    2. Microprocessor find applications

    where tasks are unspecific like

    developing software, games, websites,

    photo editing, creating documents etc.

    3. Since the applications are very

    specific, they need small resources like

    RAM, ROM, I/O ports etc. and hence

    can be embedded on a single chip.

    3. In such cases the relationship

    between input and output is not defined.

    They need high amount of resources like

    RAM, ROM, I/O ports etc. So needs

    external RAM, ROM and Memory.

    4. The microcontrollers operate from a

    few MHz to 30 to 50 MHz

    4. The microprocessor operates above

    1GHz as they perform complex tasks.

    5.The microcontroller is designed for

    embedded applications. Microcontrollersare used in automatically controlled

    products and devices, such as

    automobile engine control systems,

    implantable medical devices, remote

    controls, office machines, appliances,

    power tools, toys and other embedded

    systems.

    5. The microprocessors are used

    in personal computers or other generalpurpose applications such as for laptops

    and heavy applications where

    complexity is more and memory

    requirements are high.

  • 8/11/2019 Merged Report

    7/31

    7

    2.6 MICROCONTROLLER FAMILIES

    8051- These microcontrollers are old but still trendy and most of the companies fabricate

    these microcontrollers. The older types of 8051 have 12 clocks per instruction that make

    it sluggish whereas the recent 8051 have 6 clocks per instruction. The 8051

    microcontroller does not have an in built memory bus and A/D converters. In 1980, Intel

    fabricated the single chip microcontroller 8051 with Harvard architecture.

    PIC- Programmable Interface Controller is usually referred as PIC. They are slightly

    older than 8051 microcontrollers but excel cause of their small low pin count devices.They perform well and are affordable. The Microchip technology fabricated the single

    chip microcontroller PIC with Harvard architecture. The programming part is very

    tedious and hence it is not recommended for beginners.

    AVR (Advanced Version RISC) - In 1996, Atmel fabricated this single chip

    microcontroller with a modified Harvard Architecture.

    2.7 8051 MICROCONTROLLER

    The most commonly used microcontroller is 8051 families AT89C51 microcontroller

    which is produced by Atmel. It is widely used in most of the application for having an

    advantage of simple programming and low cost.

    2.7.1 AT89C51

    AT89C51 is an 8-bit, 40 pin microcontroller that belongs to Atmel's 8051

    family. ATMEL 89C51has 4KB of Flash programmable and erasable read only memory

    (PEROM) and 128 bytes of RAM. It can be erased and program to a maximum of 1000

    times.

  • 8/11/2019 Merged Report

    8/31

    8

    In 40 pin AT89C51, there are four ports designated as P1, P2, P3and P0. All these ports

    are 8-bit bi-directional ports, i.e., they can be used as both input and output ports. Except

    P0which needs external pull-ups, rest of the ports have internal pull-ups. When 1s are

    written to these port pins, they are pulled high by the internal pull-ups and can be used as

    inputs. These ports are also bit addressable and so their bits can also be accessed

    individually

    .

    2.7.2 SALIENT FEATURES OF AT89C51-

    4K Bytes of In-System Reprogrammable Flash Memory

    Fully Static Operation: 0 Hz to 24 MHz

    Three-level Program Memory Lock

    28 x 8-bit Internal RAM

    32 Programmable I/O Lines

    Two 16-bit Timer/Counters

    Six Interrupt Sources

    Programmable Serial Channel

    Low-power Idle and Power-down Modes

    40-pin DIP

    8051 BLOCK DIAGRAM:

  • 8/11/2019 Merged Report

    9/31

    9

    Fig.2.1: 8051 Block diagram

    2.7.3 USES OF MICROCONTROLLERS

    Microcontrollers are used in automatically controlled products and devices, such as

    automobile engine control systems, implantable medical devices, remote controls, office

    machines, appliances, power tools, and toys. By reducing the size and cost compared to a

    design that uses a separate microprocessor, memory, and input/output devices,

    microcontrollers make it economical to digitally control even more devices and

    processes. Mixed signal microcontrollers are common, integrating analog componentsneeded to control non-digital electronic systems.Even pulses generated by the oscillator

    enable harmonic and synchronous operation of all circuits within the microcontroller. It is

    usually configured as to use quartz-crystal or ceramics resonator for frequency

    stabilization. It can also operate without elements for frequency stabilization (like RC

    oscillator). It is important to say that program instructions are not executed at the rate

  • 8/11/2019 Merged Report

    10/31

    10

    imposed by the oscillator itself, but several times slower. It happens because each

    instruction is executed in several steps. For some microcontrollers, the same number of

    cycles is needed to execute any instruction, while it's different for other microcontrollers.

    Accordingly, if the system uses quartz crystal with a frequency of 20MHz, the execution

    time of an instruction is not expected 50nS, but 200, 400 or even 800 nsec, depending on

    the type of the microcontroller.

    Timers/Counters

    Most programs use these miniature electronic "stopwatches" in their operation. These are

    commonly 8- or 16-bit SFRs the contents of which is automatically incremented by each

    coming pulse. Once the register is completely loaded, an interrupt is generated.If these

    registers use an internal quartz oscillator as a clock source, then it is possible to measure

    the time between two events (if the register value is T1 at the moment measurement has

    started, and T2 at the moment it has finished, then the elapsed time is equal to the result

    of subtraction T2-T1 ). If the registers use pulses coming from external source, then such

    a timer is turned into a counter. This is only a simple explanation of the operation itself.

    Its somehow more complicated in practice.

    Input/output ports (I/O Ports)

    In order to make the microcontroller useful, it is necessary to connect it to peripheral devices.

    Each microcontroller has one or more registers (called a port) connected to the microcontroller

    pins.

    Special Function Registers (SFR)

    Special function registers are part of RAM memory. Their purpose is predefined by the

    manufacturer and cannot be changed therefore. Since their bits are physically connected

    to particular circuits within the microcontroller, such as A/D converter, serial

    communication module etc., any change of their state directly affects the operation of the

  • 8/11/2019 Merged Report

    11/31

    11

    microcontroller or some of the circuits. For example, writing zero or one to the SFR

    controlling an input/output port causes the appropriate port pin to be configured as input

    or output. In other words, each bit of this register controls the function of one single pin.

    Program Counter

    Program Counter is an engine running the program and points to the memory address

    containing the next instruction to execute. After each instruction execution, the value of

    the counter is incremented by 1. For this reason, the program executes only one

    instruction at a time just as it is written. However the value of the program counter can be

    changed at any moment, which causes a jump to a new memory location. This is how

    subroutines and branch instructions are executed. After jumping, the counter resumes

    even and monotonous automatic counting +1, +1, +1

    Central Processor Unit (CPU)

    As its name0 suggests, this is a unit which monitors and controls all processes within the

    microcontroller and the user cannot affect its work. It consists of several smaller subunits,

    of which the most important are:

    Instruction decoder

    It is a part of the electronics which recognizes program instructions and runs other

    circuits on the basis of that. The abilities of this circuit are expressed in the "instruction

    set" which is different for each microcontroller family.

    Arithmetical Logical Unit (ALU)performs all mathematical and logicaloperations upon data.

  • 8/11/2019 Merged Report

    12/31

    12

    PIN DIAGRAM

    Fig.2.2: pins 32-39(8051 microcontroller)

    Fig 2.3: pins 1-7 (8051 microcontroller)

  • 8/11/2019 Merged Report

    13/31

    13

    Fig 2.4: Various pins (8051 microcontroller)

    ALE/PROG:

    Address Latch Enable output pulse for latching the low byte of the address during

    accesses to external memory. ALE is emitted at a constant rate of 1/6 of the oscillator

    frequency, for external timing or clocking purposes, even when there are no accesses to

    external memory. (However, one ALE pulse is skipped during each access to external

    Data Memory.) This pin is also the program pulse input (PROG) during EPROM

    programming.

    PSEN:

    Program Store Enable is the read strobe to external Program Memory. When the device is

    executing out of external Program Memory, PSEN is activated twice each machine cycle

    (except that two PSEN activations are skipped during accesses to external Data Memory).

    PSEN is not activated when the device is executing out of internal Program Memory.

  • 8/11/2019 Merged Report

    14/31

    14

    EA:

    When EA is held high the CPU executes out of internal Program Memory (unless the

    Program Counter exceeds 0FFFH in the 80C51). Holding EA low forces the CPU to

    execute out of external memory regardless of the Program Counter value. In the 80C31,

    EA must be externally wired low. In the EPROM devices, this pin also receives the

    programming supply voltage (VPP) during EPROM programming.

    XTAL1:

    Input to the inverting oscillator amplifier. The quartz crystal oscillator connected to

    XTAL1 also needs a capacitor of 30 pf value as shown in figure2.One side of a

    capacitor is grounded.

    XTAL2:

    Output from the inverting oscillator amplifier. The quartz crystal oscillator connected to

    XTAL2 also needs a capacitor of 30 pf value as shown in figure2.One side of a

    capacitor is grounded.

    Fig 2.5: Crystal Diagram

    RST:

    Pin 9 is the RESET pin. It is an input and is active high (normally low). Upon applying a

    high pulse to this pin, the microcontroller will reset and terminate all activities. This is

  • 8/11/2019 Merged Report

    15/31

    15

    often referred to as a poweron reset. Activating a power-on reset will cause all values in

    the registers to be lost. It will set program counter to all 0s.

    RESET values of some 8051 registers

    Table 2.2: RESET values of some 8051 registers

    Register RESET values

    PC 0000

    ACC 0000

    B 0000

    PSW 0000

    SP 0007

    DPTR 0000

    Port 0(pins 32 to 39):

    Port 0 is an 8-bit open drain bidirectional port. As an open drain output port, it can sink

    eight LS TTL loads. Port 0 pins that have 1s written to them float, and in that state will

    function as high impedance inputs. Port 0 is also the multiplexed low-order address and

    data bus during accesses to external memory. In this application it uses strong internal

    pull-ups when emitting 1s. Port 0 emits code bytes during program verification. In this

    application, external pull-ups are required.

  • 8/11/2019 Merged Report

    16/31

    16

    Port 1(Pins 1 to 8):

    Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. Port 1 pins that have 1s

    written to them are pulled high by the internal pull-ups, and in that state can be used as

    inputs. As inputs, port 1 pins that are externally being pulled low will source current

    because of the internal pull-ups.

    Port 2(Pins 1 to 8):

    Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. Port 2 emits the high-order

    address byte during accesses to external memory that use 16-bit addresses. In this

    application, it uses the strong internal pull-ups when emitting 1s.Port 2 is also designated

    as A8-A15, indicating its dual function. When the 8051 is connected to external memory,

    P2 is used for the upper 8 bits of the 16-bit address

    .Port 3(pins 32 to 39):

    Port 3 occupies a total of 8 pins, pins 10 through 17.It can be used as input or output. Port

    3 is an 8-bit bidirectional I/O port with internal pull-ups. It also serves the functions of

    various special features of the 80C51. Port 3 has the additional function of providingsome extremely important signals such as interrupts.

  • 8/11/2019 Merged Report

    17/31

    17

    CHAPTER 3

    PROJECT WORK

    3.1 INTERFACING DEVICES WITH

    8051 MICROCONTROLLER

    3.2 LCD INTERFACING

    A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this

    LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers. For

    interfacing an LCD with 8051, we give VCC to pins 2 and 15 and a Gnd to pins 1 and 16.

    A pot (Variable resistor) is connected to pin no 3 or VEE by which we can control the

    contrast of the LCD. The RS pin is the Register select pin if we give a logical 0 from our

    8051 microcontroller to this pin we can send command to the LCD. If we give a Logical

    1 from our 8051 microcontroller to this pin we can send data to the LCD.

    1.Command/Instruction Register

    Stores the command instructions given to the LCD. A command is an instruction given to

    LCD to do a predefined task like

    Initializing, clearing the screen, setting the cursor position, controlling display etc.

    2.Data Register- stores the data to be displayed on the LCD. The data is the

    ASCII value of the character to be displayed on the LCD.

  • 8/11/2019 Merged Report

    18/31

    18

    Fig 3.4 LCD Interfacing With 8051

    3.2.1 CODE:

    #include

    sbit RS= P3^0;

    sbit RW= P3^1;

    sbit EN= P3^2;

    void delay(unsigned int time)

    {

    int k,m;

    for(k=0;k

  • 8/11/2019 Merged Report

    19/31

    19

    RS=1;

    RW=0;

    EN=1;

    delay(10);

    EN=0;

    }

    void Lcmd (unsigned char y)

    {

    P2=y;

    RS=0;

    RW=0;

    EN=1;

    delay(10);

    EN=0;

    }

    unsigned char f[5] = {"CETPA"};

    unsigned char s[8] ={"INFOTECH"};

    int i,j;

    void main()

    {

    while(1)

    {

    Lcmd(0x38);

    Lcmd(0x01);

    Lcmd(0x0e);

    Lcmd(0x06);

    Lcmd(0x85);

    Lcmd(0x04);

    for(i=4;i>=0;i--)

    {

    Ldata(f[i]);

  • 8/11/2019 Merged Report

    20/31

    20

    delay(10);

    }

    Lcmd(0x87);

    for(j=7;j>=0;j--)

    {

    Ldata(s[j]);

    delay(10);

    }

    }

    }

    3.4LCD BASED TEMPERATURE SENSOR USING

    MICROCONTROLLER (AT89C51)

    3.4.1 DESCRIPTION:

    This project is design for the student to make them understand the technology used in a

    now a days Temperature Sensor system, which is used in whole world. The Temperature

    Sensor is programmed for the specific operation. Every operation on the Temperature

    Sensor is defined is display on the monitor.

    3.4.2 PROJECT SUMMARY:

    In this project we try to give the Idea of prototype voting machines. We are using micro

    controller AT89C51 for controlling the voting operation. The Temperature Sensor is

    designed for Four Political parties. There is a LCD display for showing the status of

    voting by interfacing the Temperature Sensor with the PC.

    http://www.engineersgarage.com/microcontroller/8051projects/LCD-based-digital-clock-AT89C51-circuithttp://www.engineersgarage.com/microcontroller/8051projects/LCD-based-digital-clock-AT89C51-circuithttp://www.engineersgarage.com/microcontroller/8051projects/LCD-based-digital-clock-AT89C51-circuithttp://www.engineersgarage.com/microcontroller/8051projects/LCD-based-digital-clock-AT89C51-circuithttp://www.engineersgarage.com/microcontroller/8051projects/LCD-based-digital-clock-AT89C51-circuit
  • 8/11/2019 Merged Report

    21/31

    21

    3.4.3 FEATURES:

    Easy to use for day to day operation.

    Stand alone deviceno computer or any other hardware required.

    Needs to be programmed only once. Easy to program.

    3.4.4 BENEFITS:

    No need to assign a person

    No manual intervention

    Saves man power and money

    Easy programming with the help of manual.

    Table 3.1 Components Used

    Sr. no. Component used Quantity

    1. AT 89c51 Micro controller (base +IC) 1

    2. Rectifier(12 volt 1 ampere) 1

    3. Resistance (1kohm) 1

    4. Resistance (4.7kohm) 1

    5. Resistance(8.2kohm) 1

    6. Transformer (220v-909) 1

    7. LEDs 1

    8. Electrolytic capacitor (10 microfarad) 1

    9. Electrolytic capacitor (1000 microfarad) 1

    10. Electrolytic capacitor (33 pico farad) 2

    11. 3-Pin connector 1

  • 8/11/2019 Merged Report

    22/31

    22

    12. 8-pin connector 1

    13. Push switches 7

    14. Cello tape (for electrical use) 1

    15. Potentiometer (10k value) 1

    16. LCD(2*16) 1

    17. Crystal oscillator (11.0592Mhz frequency) 1

    18. L7805CN (voltage regulator) 1

    3.4.5 SOURCE CODE://Program to display temperature in Celsius and Farenheit scale.

    #include

    #define port P3

    #define adc_input P1

    #define dataport P0

    #define sec 100

    sbit rs = port^0;

    sbit rw = port^1;

    sbit e = port^2;

    sbit wr= port^3;

    sbit rd= port^4;

    sbit intr= port^5;

    int test_intermediate3=0,

    test_final=0,test_intermediate1[10],test_intermediate2[3]={0,0,0};

    void delay(unsigned int msec )

  • 8/11/2019 Merged Report

    23/31

    23

    {

    int i ,j ;

    for(i=0;i

  • 8/11/2019 Merged Report

    24/31

    24

    while(str[i]!='\0')

    {

    lcd_data(str[i]);

    i++;

    delay(10);

    }

    return;

    }

    void shape() // Function to make the shape of degree symbol

    {

    lcd_cmd(64);

    lcd_data(2);

    lcd_data(5);

    lcd_data(2);

    lcd_data(0);

    lcd_data(0);

    lcd_data(0);

    lcd_data(0);

    lcd_data(0);

    }

    void convert() // Function to convert the values of ADC into numeric value to be sent

    to LCD

    {

    int s;

    lcd_cmd(0x81);

    delay(2);

    lcd_data_string("TEMP:");

    test_final=(((9*test_intermediate3)/5)+32);

    s=test_final/100;

  • 8/11/2019 Merged Report

    25/31

    25

    test_final=test_final%100;

    lcd_cmd(0x88);

    if(s!=0)

    lcd_data(s+48);

    else

    lcd_cmd(0x06);

    s=test_final/10;

    test_final=test_final%10;

    lcd_data(s+48);

    lcd_data(test_final+48);

    lcd_data(0);

    lcd_data('F');

    lcd_data(' ');

    test_final=test_intermediate3;

    lcd_cmd(0xc1); //Setting cursor to first position of first line

    delay(2);

    lcd_data_string("TEMP:");

    s=test_final/100;

    test_final=test_final%100;

    lcd_cmd(0xc8);

    if(s!=0)

    lcd_data(s+48);

    else

    lcd_cmd(0x06);

    s=test_final/10;

    test_final=test_final%10;

    lcd_data(s+48);

    lcd_data(test_final+48);

    lcd_data(0);

    lcd_data('c');

  • 8/11/2019 Merged Report

    26/31

    26

    lcd_data(' ');

    delay(2);

    }

    void main()

    {

    int i,j;

    adc_input=0xff;

    lcd_cmd(0x38); //2 Line, 5X7 Matrix display

    lcd_cmd(0x0c); //Display On, Cursor blinking

    delay(2);

    lcd_cmd(0x01); // clear screen

    delay(2);

    while(1)

    {

    for(j=0;j

  • 8/11/2019 Merged Report

    27/31

    27

    }

    for(i=0;i

  • 8/11/2019 Merged Report

    28/31

    28

    The purpose of our project was to create an inexpensive and high-efficient electronic

    Temperature Sensor . In the conclusion of this report, the machine was able to display to

    us which candidate has won ,how much votes did he received whether it was tie or not.

    The specific work we have finished are as follows:

    We successfully modified the electronic Temperature Sensor with a few

    components to add two more functions to the main body, namely the LCD display

    and led.

    We tested and optimized the AT89C51 development board designed and

    produced by Cetpa lab in a large scale, which was used to control the voting

    smoothly.

    We choose the LCD, switches at a relatively low cost, fixed them and adjusted

    them on the development board.

    Currently an EVM can record a maximum of 999 votes, which is sufficient for a

    polling station .

    It is not possible to vote more than once by pressing the button again and again

    .As soon as a initialize button is pressed, the vote is recorded for that particular

    candidate.

    Future Scope

    Currently an EVM can record a maximum of 999 votes, which is not sufficient for a

    polling station therefore we can maximize this voting number upto thousands so that the

    voting number should be increased and some type of security should be introduced so

    that no theft will be taken with the number of votes.

  • 8/11/2019 Merged Report

    29/31

    29

    BOOKS REFERENCES

    [1] SEDRA SMITH, MICROELECTRONIC CIRCUITS (2002), 5TH

    EDITION

    [2] INTRODUCTION TO 8051 MICROCONTROLLER, Author Mazidi.

    Publisher, Pearson Education, 2007

    [3] INTRODUCTION TO 8051 MICROCONTROLLER, Author AYALA

    (3RD

    EDITION)

    [4] KJ.AYALA, The 8051 Microcontroller -. Pen rams International.

    [5] Intel's manual on EmbeddedMicrocontrollers"

  • 8/11/2019 Merged Report

    30/31

    30

    The LM35 - An Integrated Circuit Temperature Sensor

    Why Use LM35s To Measure Temperature?

    o You can measure temperature more accurately than a

    using a thermistor.o The sensor circuitry is sealed and not subject to

    oxidation, etc.

    o 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?

    o

    Here it is.

    What Does an LM35 Do? How does it work?

    o It has an output voltage that is proportional to the

    Celsius temperature.

    o The scale factor is .01V/oC

    o The LM35 does not require any external calibration or

    trimming and maintains an accuracy of +/-0.4

    o

    C at roomtemperature and +/- 0.8 oC over a range of 0 oC to

    +100oC.

    o Another important characteristic of the LM35DZ is that

    it draws only 60 micro amps from its supply and

    possesses a low self-heating capability. The sensor self-

  • 8/11/2019 Merged Report

    31/31

    heating causes less than 0.1 oC temperature rise in still

    air.