Modeling an Enhanced e- voting system

Embed Size (px)

Citation preview

  • 7/30/2019 Modeling an Enhanced e- voting system

    1/119

    MODELING AN ENHANCED E-VOTING SYSTEM WITH REALTIME DATA COLLATION

    BY

    EGUONO, EGUONO E.

    2009112000

    A PROJECT REPORT SUBMITTED TO THE DEPARTMENT OFELECTRICAL/ELECTRONICS ENGINEERING,

    ANAMBRA STATE UNIVERSITY OF SCIENCE ANDTECHNOLOGY, ULI

    IN PARTIAL FULFILLMENT OF THE REQUIREMENT FORTHE AWARD OF MASTERS DEGREE IN ELECTRICAL

    ENGINEERING

    SUPERVISOR

    DR. P.I. OKWU

    DECEMBER, 2013

  • 7/30/2019 Modeling an Enhanced e- voting system

    2/119

    DECLARATION

    I hereby declare that this report was written by me and it is a

    record of my own research. It has not been presented before in

    any previous application for a Masters Degree. Authors whose

    works have been referred to and reference made to published

    literature have been duly acknowledged.

    _________________________ ___________________

    EGUONO, EGUONO EGUONO Date

    Student

    Above declaration is confirmed

    ____________________ _____________________

    DR.P.I. OKWU Date

    Project Supervisor

  • 7/30/2019 Modeling an Enhanced e- voting system

    3/119

    CERTIFICATION

    This project titled: MODELING AN ENHANCED E-VOTINGSYSTEM WITH REAL TIME DATA COLLATION BY EGUONOEGUONO EGUONO meets the regulations governing the awardof Masters Degree in Electrical Engineering at Anambra StateUniversity of Science and Technology, Uli and is approved forits contribution to knowledge and literature presentation.

    ________________________ ____________________DR. P.I. OKWU DateProject supervisor

    _____________________ _____________________PROF. S.S.S. OKEKE DateHead of Department

    _____________________ ___________________External Examiner Date

    This is to certify that the thesis has been examined and

    approved for the award of the degree of masters in

    Telecommunication Engineering (M.Eng).

  • 7/30/2019 Modeling an Enhanced e- voting system

    4/119

    _____________________ ___________________External Examiner Date

    _____________________ _____________________Supervisor Date

    _____________________ ___________________Head of Department Date

    _____________________ _____________________Dean of Faculty of DateEngineering

    _____________________ ___________________Dean of School of DatePostgraduate Studies

  • 7/30/2019 Modeling an Enhanced e- voting system

    5/119

    DEDICATION

    This project report is dedicated to the Almighty God, whose

    boundless mercies and love has made this research project a

    huge success.

    ACKNOWLEDGEMENTS

  • 7/30/2019 Modeling an Enhanced e- voting system

    6/119

    I will always owe my unreserved gratitude to my lecturers: Dr.

    P.I. Okwu my Project Supervisor, and Programme Coordinator

    who worked relentlessly to make me what I have become

    today, and for his readiness to help at all time, despite tight

    schedules; Mal. Sanni Abdullahi, my HOD, for his painstaking

    efforts towards making the Department one of the best. Special

    thanks to Engr. Toyin Taiwo, Abebayo B. Michael, and Ishaya

    Hope Joshua for their kind support throughout the period of this

    Programme.

    I must not forget my mother: Mrs. Eunice Anagwu, and Lady,

    Florence Ulasi, whose love and belief in me always soured me

    to go for higher achievements. I will not forget my brothers ad

    sisters: Joy, Ngozi Anagwu, Mr. and Mrs. Chinedu Anagwu, Mr.

    and Mrs. Felix Chikodi Reginald, Mr. and Mrs. Chuwkunonso

    Anagwu, Pharm, & Mrs. Chimezie Anagwu, Okwudili, Nnamdi,

    your prayers have really been fruitful.

    To my friends and colleagues: Obinna Obi, Ikechukwu Igboebisi,

    Kelechi Mbagwu, Ya u, Mrs. Gloria Ndubueze and others whose

    name I may not be able to mention, know that your memories

    shall always remain with me.

  • 7/30/2019 Modeling an Enhanced e- voting system

    7/119

    TABLE OF CONTENT

    Title . . . . . . . . . i

    Declaration . . . . . . . . ii

    Certification . . . . . . . .

    iii

    Acknowledgement . . . . . . .

    iv

    Dedication . . . . . . . . v

    Table of Contents . . . . . . .

    Vi-viii

    List of Figures . . . . . . . .

    ix

    List of Tables . . . . . . . .

    x

    Abstract . . . . . . . . .

    xi

    CHAPTER ONE: INTRODUCTION

    1.1 Project Background . . . . . .

    1

  • 7/30/2019 Modeling an Enhanced e- voting system

    8/119

    1.2 Aims of Objectives . . . . . .

    4

    1.3 Significance of the Study . . . . .

    5

    1.4 Scope of the Work . . . . . .

    11

    1.5 Block Diagram overview of the Project stages

    13

    1.6 Project Report Organization . . . .

    15

    CHAPTER TWO: REVIEW OF RELATED LITERATURES

    2.1 Review of work on temperature controllers .. . 17

    2.1.1Principle of Operation . . . . 17

    2.1.2Technologies available . . . . .

    19

    2.1.3 New Trends . . . . . . .

    22

    2.2 Set-up overview . . . . . . 25

    2.2.1Temperature Measurement and Sensors . . .

    25

    2.2.2Microcontroller . . . . . . 32

  • 7/30/2019 Modeling an Enhanced e- voting system

    9/119

    2.2.3 Serial Communication RS 232 Technology .

    33

    CHAPTER THREE: METHODOLOGY AND SYSTEM ANALYSIS

    3.1 Methodology. . . . . . .

    37

    3.1.1Structured Analysis and Design method .. .. ..

    .. 37

    3.1.2Top-Down Design . . . . . .

    41

    3.1.3 Bottom Up Design . . . . . .

    42

    3.1.4 Choice Design Approach . . . . .

    42

    3.2 Limitations of the existing system .. . .

    43

    CHAPTER FOUR: SYSTEM DESIGN

    4.1 System Specification . . . . . 45

    4.2 Hardware Subsystem design . . . .

    46

    4.2.1Input interface . . . . . . 46

  • 7/30/2019 Modeling an Enhanced e- voting system

    10/119

    4.2.2 The Control System design . . . .

    51

    4.2.3 Interfacing relay drivers to the microcontroller

    output port . 55

    4.3 Software Subsystem design . . . .

    61

    4.3.1Program block diagram and Control Algorithm .

    61

    4.3.2 Configuring the serial port of the microcontroller

    63

    4.3.3 Configuring the PC serial port . . . .

    66

    4.4 The input/output arrangement of the Project

    68

    4.5 The Project Block Diagram . .

    69

    5.1 Hardware Subsystem Implementation .

    70

    5.1.1The Input Interface Implementation . 70

    5.1.2The Control System Implementation .

    72

    5.1.3. The Output Interface Implementation .

    74

    5.2 System Testing . . 75

  • 7/30/2019 Modeling an Enhanced e- voting system

    11/119

    5.2.1 Test Plan . . . .

    75

    5.2.2 Hardware Subsystem Testing .

    76

    5.2.2 Software Subsystem Testing .

    77

    5.3 Performance Evaluation . .

    77

    CHAPTER FIVE: SUMMARY AND CONCLUSION AND

    RECOMMENDADTION

    5.1 Summary of Achievement . .

    79

    5.2 Problems Encountered and Solution .

    79

    5.3 Conclusion . . . . 82

    5.4 Recommendation . . 80

    5.5 Suggestion for Further Improvement .

    81

    REFERENCES. . 83

    APPENDIX A: Full Schematic Diagram .

    84

    APPENDIX B: Software Details . .

    85

    LIST OF FIGURES

  • 7/30/2019 Modeling an Enhanced e- voting system

    12/119

    1. Fig. 1.1: Block diagram of a PC-Based temperature

    controller

    2. Fig. 2.2.1: A 2 wire thermocouple

    3. Fig. 2.2.2. A typical picture of a thermistor

    4. Fig. 2.2.3 A graph of resistance versus temperature for a

    typical thermistor

    5. Fig. 3.1.1: A structural approach to system analysis

    6. Fig. 3.1.2: A block diagram showing the existing system of

    temperature monitoring and control system.

    7. Fig. 3.1.3: A block diagram model of a PC based 4 point

    temperature monitoring and control.

    9. Fig. 3.2.1: Modularized approach to system design

    10. Fig. 4.2.1: 5/12 Vdc power supply

    11. Fig. 4.2.3: Pin-out diagram of ADC0804.

    12. Fig. 4.2.4: Diagram showing a minimum configuration of

    89C52 microcontroller.

    1.3 Fig. 4.2.5: Relay interface to microcontroller

    1.4 Fig. 4.2.6 Diagram showing a MAX232 pin-out.

    15. Fig. 4.2.7: Connection arrangement of the microcontroller,

    MAX232 and DB-9 connector

    16. Fig. 4.2.8: Block diagram showing the operation of the

    microcontroller

    17. Fig. 4.2.9: Project Block Diagram.

    LIST OF TABLES

  • 7/30/2019 Modeling an Enhanced e- voting system

    13/119

    1. Table 1: Reference table showing the relationship between

    baud rate and length of cable for MAX232.

    2. Table 4.1: Vref / 2 relationship with Vin range.

    3. Table 5.1: Test result for the analog MUX

    ABSTRACT

  • 7/30/2019 Modeling an Enhanced e- voting system

    14/119

    This project is aimed at designing a temperature monitoring

    and controlling system which can be used to monitor the

    temperature of industrial processes. This system relies upon

    controller, which is connected to temperature, or set point, and

    provides an output to a control element. Mostly the control

    element is a heater. The controller is connected to a personal

    computer using RS232 protocol. The current temperature can

    be seen on the PC. This system offers flexibility to controlling

    operations because the temperature set point can also be

    changed through the user input. It is believed that this project

    will remove rigorous and unnecessary monitoring and

    controlling activities and hence ensure cheaper and faster

    product output. A temperature monitoring system which can be

    used to monitor the temperature of industrial processes has

    been designed and implemented in the course of this project.

    CHAPTER ONE: INTRODUCTION

    1.1 Background of the Project

    In a typical manufacturing industry, temperature

    monitoring makes use of analog temperature controllers.

    Such controllers can accept thermocouple input and offer

  • 7/30/2019 Modeling an Enhanced e- voting system

    15/119

    imprecise temperature control over a range such as 75 0C

    to 1000C. This seemed to pose no disadvantage to them

    since their products still sell in the market. However, this

    type of controllers used by these industry, unknowingly,

    possess no readable display, lack of sophistication for

    more challenging control tasks, and no communication

    ability, all of which most often expose the industry to the

    following problems:

    Non-uniform heating rate for a point that requires more

    than one heating element, thus causing delay in start-

    up of production.

    Wastage of raw materials in test-running the line to

    ensure that the temperature had reached the minimum

    required value

    Poor package outlook because the sealers are not

    heated

    uniformly.

    Extra man-power for each extrusion line- one at the

    take- off and another at the panel- to ensure that

    machine is stopped immediately there is a sign of poor

    quality due to failure of one more of the heaters.

  • 7/30/2019 Modeling an Enhanced e- voting system

    16/119

    Frequent damage of heating elements as a result of no

    precision in control which often leads to over- heating

    the elements beyond upper temperature range.

    In view of the above limitations, and more, a pc-based

    automatic multi- point temperature monitoring and control is

    hereby proposed to remove the limitations of analog controllers

    and even add flexibility to the control process.

    Today, with the continuous price erosion and performance

    increase of pc, industrial control is moving from an expensive,

    proprietary hardware base to one with foundation of pc-based

    software. Pc-based temperature control runs on personal or

    industrial hardened computers and provides answers to

    initiatives for lean control program.

    With the inherent advantages of a pc-based control include

    flexibility, high performance, customization, convenience,

    easier development, better integration with existing hard

    wares, portability and access, the proposed system should be

    able to help manufacturing industries solve their problems by

    providing uniform heated, precision in measurement and

  • 7/30/2019 Modeling an Enhanced e- voting system

    17/119

    control, self monitoring and extension of usage to remote,

    inaccessible locations in the manufacturing floor.

    1.2 Aims and Objectives

    This project PC- based automatic multipoint temperature

    monitoring and control is aimed at designing a temperature

    monitoring device which can be used to monitor and control the

    temperatures of industrial machines. Thus, the complete work

    can be viewed as a system having three main features which

    serve as the objectives of the work.

    PC- based temperature monitoring and control.

    Automation facility, which enables the system to be self

    monitoring.

    Multi-point approach, a feature that makes it possible

    for more than one point to be monitored.

    Hence, this project is meant to offer flexibility to

    monitoring operations by allowing or providing a PC-

    interfacing feature

    Which allows an operator to monitor the ongoing

    process from his PC location at a more convenient and

    easy-accessible place, It is believed that this project will

  • 7/30/2019 Modeling an Enhanced e- voting system

    18/119

    be able to remove the rigorous activities of monitoring

    temperatures by personnel, and engaged him with

    other production activities, all aimed at ensuring

    cheaper and fast product output.

    1.3 Significance of the Study

    The beginning of a sweeping change is upon the control

    and instrumentation world with the availability of robust

    hardware, open technology and real-time, window-based

    operating system. PC-based control is emerging as a new

    control paradigm for increasing manufacturing

    productivity. PC base automatic multi-point temperature

    monitoring and control offers open and more intuitive

    traditional solutions at a lower total system cost and

    easier migration to future technologies. Easier

    development, integration, portability, and access, ensure

    a flexible and efficient solution. Some of the inherent

    advantages of PC-based automatic multipoint temperature

    monitoring and control include the following:

    Custom User-Interface for Supervisory Control.

  • 7/30/2019 Modeling an Enhanced e- voting system

    19/119

    For low-end PID (Proportional Integral-Derivative)

    controllers to high end programmable logic controllers

    (PCL) system, visualizing the control application can be

    very challenging. Many stand-alone controllers have fixed

    digital displays for configuring control set-points and

    viewing I/O values. PC-based automatic multipoint

    temperature controller, being an advanced system, on the

    other hand, has a display and typically requires a separate

    software package and human machine interface (HMI) to

    view and interact with automation systems.

    Easy Integrating with Existing System

    One may already have a control system that works well for

    most needs but could benefit from additional

    measurement or advanced control functionality to

    optimize certain specialized tasks. A big advantage to

    using data acquisition hardware and an open PC platform

    is the number of options you have for connecting to

    existing equipment. Whether you are communicating with

    process instrument, PLC, or single loop controllers, you

  • 7/30/2019 Modeling an Enhanced e- voting system

    20/119

    have a variety of ways to integrate a PC-based control

    system with existing hardware, this is exactly what a PC-

    based automatic multipoint temperature monitoring and

    control does in the case of temperature measurement.

    Software-defined Control Flexibility.

    A PC-based automatic multipoint control system offers you

    complete flexibility in defining system functionality and I/O

    operations. In addition, even without prior technical skill in

    wiring a temperature controller, PC-based automatic

    multipoint control system enables an operator to carry out

    initial installation since the system just requires relocating

    it to another sight without rewiring process (5). Also such

    unskilled operator makes changes in the initial setting

    using the window-based control interface.

    Multipoint Monitoring and Control for Performance

    and Reliability.

    Beside single point digital temperature controllers which

    can control only one process, multipoint digital

    temperature controllers control more than one point,

    meaning they can accept more than one input variable.

    Generally speaking a multipoint controller can be thought

  • 7/30/2019 Modeling an Enhanced e- voting system

    21/119

    of a device with many individual temperature controllers

    inside one chassis. These are typically mounted behind

    the panel in some industrial applications, as opposed to

    the front-to-panel (FTP) (9). Multipoint temperature

    controllers provide a compact more modular system that

    operates either within a stand alone system or in a PLC

    environment. They provide a single point of software to

    access all control loops.

    Enhance Security

    PC-based automatic multipoint temperature monitoring

    and control systems also have enhance security such as

    not having buttons for a person to use and change critical

    settings. By having complete control over the information

    being read from or written to the multipoint controller, the

    machine builder can limit the information that any given

    operator can read or change, preventing undesirable

    conditions from occurring, such as setting a set point too

    high to a range that may damage products or the

    machine.

    Today, manufacturers around the world look to PC to play

    a bigger role in their control system. PCs are already an

  • 7/30/2019 Modeling an Enhanced e- voting system

    22/119

    accepted platform for supervisory control, monitoring and

    reporting, as well as off-line data management and

    analysis. Manufacturers have already realized the

    flexibility of the PC and the easy-to-use open architecture

    of window-base software applications for manufacturing

    environment.

    Following the trend, PC-based automatic multipoint

    temperature monitoring and control has emerged to

    facilitate efficient monitoring and control process for

    manufacturing industries. Such temperature controllers

    are used in a wide variety of industries to manage

    manufacturing processes or operations. Some common

    applications include the following.

    Heat Treat/Oven

    Temperature controllers are used in ovens and in heat

    treating applications within furnace, ceramic kilns, boilers

    and heat exchangers.

    Packaging

  • 7/30/2019 Modeling an Enhanced e- voting system

    23/119

    Temperature controllers must maintain a uniform level at

    designated temperatures and process time length. This

    helps to ensure a high quality product output.

    Plastics

    Temperature control in the plastic industry is common on

    portable chillers, hoppers and dryers, and molding and

    extruding equipment, temperature controllers are mused

    to precisely monitor and control temperatures at different

    critical points in the production of plastics.

    Health Care

    Temperature control is required in laboratory and test

    equipment, autoclaves, incubators, refrigeration

    equipment and crystallization growing chambers and test

    chambers where specimens must be kept or test must be

    run within specific temperature parameters.

    Food and Beverage

    Common food processing applications involving

    temperature control include: brewing, blending,

    sterilization and cooking and baking ovens. Controllers

    regulate and/or process time to ensure optimum

    performance.

  • 7/30/2019 Modeling an Enhanced e- voting system

    24/119

    Cable Manufacturing

    Insulation materials require as specific temperature which

    must be maintained uniformly throughout the barrel and

    nozzle zones to ensure good quality of product. Efficient

    temperature monitoring and control systems are required

    to achieve this.

    Finally, the steps taken to incorporate PC to temperature

    monitoring and control is one of the many steps required

    for a complete computer automation of industrial

    processes. Thus, other parameters such as pressure,

    colour, texture and so on, can be computerized, providing

    a platform for a unified process control.

    1.4 Scope of the Work

    This work covers the following areas:

    Temperature Measurement

    Temperature sensors are reviewed and choice made on

    the most applicable sensors. The sensor measures the

    temperature of the points and converts the reading to a

    voltage value. This value is then sent to the

  • 7/30/2019 Modeling an Enhanced e- voting system

    25/119

    microcontroller which compares it with the set-point value,

    takes appropriate action in order to restore tolerable

    limits.

    Hardware Programming

    High level C-programming language is used to develop

    codes for the microcontroller to enable it read the values

    sent by the sensors and take appropriate actions. The

    Visual Basic Window-based software will be used to

    communicate with the PC operating system and the C-

    program running on the hardware in order to read the

    user set-point values and current temperatures.

    Window-based Software Programming

    Communication between the hardware and the PC (serial

    communication) is facilitated by programming the PC to

    be able to communicate with the serial port. The Visual

    Basic Window-based software will be used to

    communicate with the PC operating system and the C-

    program running on the hardware in order to read the

    user set-point values and current temperatures.

    Level Conversion

  • 7/30/2019 Modeling an Enhanced e- voting system

    26/119

    In order to ensure a compatible voltage level between the

    hardware and the PC, the MAX 232 technology is

    employed. This converts the hardware voltage level to a

    voltage which can be handled by the serial port in the PC.

    1.5 Block Diagram Overview of the Project Stages

    Fig.1.2: Block diagram of a PC-based temperature

    controller

    A temperature control system relies upon a controller,

    which is connected to a temperature sensor. It compares

    the actual temperature to the desired control

    temperature, or set-point, and provides an output to a

    RS232 Interface

    PC-based application

    MicrocontrollerUnit

    Temperature

    Sensors

    Analog to Digital

    Interface

    Liquid CrystalDisplay Keypad

  • 7/30/2019 Modeling an Enhanced e- voting system

    27/119

    control element. Mostly the control element is a heater.

    The controller is connected to a Personal Computer using

    RS232 protocol. The Current Temperature can be on the

    PC, whereas the Temperature Set-point can also be

    changed through the PC or embedded buttons. The

    different sections of this project are:

    1. Microcontroller

    2. Analog to Digital Converter (ADC)

    3. Temperature Sensor

    4. Relay

    5. MAX 232

    Microcontroller:

    It is the heart of the unit. It performs all the functions like

    getting data from ADC, comparing the current

    temperature to set-temperature, turning ON/OFF the relay

    and communicating with the PC.

    Analog to Digital Converter:

    The ADC converts the Analog voltage received from the

    Temperature Sensor into digital format and gives it to the

    microcontroller.

    Temperature Sensor:

  • 7/30/2019 Modeling an Enhanced e- voting system

    28/119

    The temperature sensor measures the current

    temperature and sends value in for of voltage to the

    microcontroller. Some IC (e.g. LM35) sensors have output

    proportional to the input temperatures.

    MAX 232:

    Communication with the PC is done through the SERIAL

    PORT. The protocol of serial port is RS-232, for interfacing

    the controller to the PC using RS-232 protocol, we require

    MAX 232 IC.

    1.6 Project Report Organization

    The design and simulation of the project, PC-based

    automatic multipoint temperature monitoring and control

    system, followed a systematic approach which reveals a

    step-by-step analysis of an existing system, until a

    realizable, better system is arrived at. This report covers

    the entire steps followed to arrive at the complete

    envisaged system. Diagrams and tables are employed,

    where necessary, to illustrate facts and results.

    Chapter one of this report is an introduction to the project.

    It covers the following areas: the project background, aims

  • 7/30/2019 Modeling an Enhanced e- voting system

    29/119

    and objectives of the work, justification and scope of the

    work and the block diagram overview of the project

    stages.

    Chapter two is a literature review of related works. In this

    chapter, the general concept of temperature control is x-

    rayed; different technologies of relevant components are

    also reviewed.

    In the third chapter, the temperature control technique as

    used in an industry is analyzed and shortcomings of the

    existing system outlined. Different methods of achieving a

    better system are also explored. Then, choice is made

    among all the available options. The option chosen is

    basically dependent on the nature of the envisaged

    system.

    Chapter four describes the proper system design. The

    input, output and software interfaces are systematically

    modularized and designed. The block diagram of the

    modules (put together) is also towards the end of this

    chapter.

  • 7/30/2019 Modeling an Enhanced e- voting system

    30/119

    The whole of chapter five is concerned with the

    implementation of the designed system. This involves the

    wiring schedules, full schematic diagram and integration

    of the different modular designs and schematics,

    simulation, testing and performance evaluation, costing

    and deployment of the achieved work.

    Finally, the last chapter deals with the summary of

    achievement, problems encountered during the project

    design and implementation stages and the solution

    proffered. Recommendations and suggestions for further

    improvement are also included.

    CHAPTER TWO

    REVIEW OF RELATED LITERATURES

    2.1 Review of work on Temperature Controllers

    2.1.1 . Principle

    A temperature controller is a device used to hold a desired

    temperature value (2). The simplest example of a temperature

    is common thermostat found in homes. All controllers, from the

    basic to the most complex, work on the same way. There are

  • 7/30/2019 Modeling an Enhanced e- voting system

    31/119

    two variables required by the controller; actual input and

    desired set-point value. The input signal is also known as the

    process value. The input to the controller is sampled many

    times per second, depending on the controller. This input or

    process value is then compared with the setpoint value, if the

    actual value does not match with the set point, the controller

    generates an output signal change based on the difference

    between the set-point and the process value, and whether or

    not the process value is approaching the set-point or deviating

    farther from the set-point. This output signal then initiates

    some type of response to correct the actual value so that it

    matches the set-point. Usually the control algorithm updates

    power value which is then applied to the output.

    The control action depends on the type of controller. For

    instance, if the controller is an ON/OFF control. The controller

    decides if the output needs to be turned on, turned off, or left

    in its present state. A temperature controller set control the

    temperature inside a room may have its set-point at 68oC and

    the actual temperature 67oC. The controller would then send a

    signal to increase the applied heat to raise the temperature

    back to the set-point of 68oC.

  • 7/30/2019 Modeling an Enhanced e- voting system

    32/119

    When analog output is used, the output driver is proportional to

    the output power value.

    However, if the output is binary output type such as a relay,

    SSR driver, or triac, then the output must be time proportioned

    to obtain an analog representation.

    A time proportioned system uses a cycle time to proportion the

    output value. If the cycle time is set to 8 seconds, a system

    calling for 50% power will have the output ON for the 4 seconds

    and OFF for 4 seconds, while one for 25% power for the same 8

    seconds cycle time, will be ON for seconds and OFF for 6

    seconds. All things being equal, a shorter cycle time is

    desirable because the controller can react quickly and change

    the state of the ouput for a given changes on the process. Due

    to the mechanics of a relay, a shorter cycle time can shorten

    the life of a relay, and is not recommended to be less than 8

    seconds. For solid switching devices like SSR driver or triac,

    faster switching times are better. The general rule is that, only

    if the process will allow it, when a relay ouput is used, a longer

    cycle time is desired. (2).

  • 7/30/2019 Modeling an Enhanced e- voting system

    33/119

    Typically, all controllers have input and ouput parts. In the case

    of a temperature controller, the measured input variable is the

    temperature. Temperature controller can have several types of

    inputs. The type of input sensors include thermocouples,

    resistive thermal devices (RTDs) and integrated circuits (e.g.

    LM35). Sensors are treated later in this chapter.

    In addition to inputs, every controller also have an output.

    Typical outputs provides with temperature controllers include

    relay outputs, solid state relay (SSR) drivers, triac and linear

    analog outputs. In some cases, the output signal may be

    required to retransmit the process to a programmable logic

    controller (PLC), recorded or personal computer (PC). In the

    case of a PC- based temperature controller, the controller is

    connected to a personal computer using the RS 232 protocol. A

    software program running on the PC can be used to display the

    values on the PC while the set-point can still be changed using

    the PC.

    2.1.2 Technologies Available

    Temperature controllers come in different styles with a vast

    array of features and capabilities. There is also plenty of ways

  • 7/30/2019 Modeling an Enhanced e- voting system

    34/119

    of categorize controllers according to their functionality. In

    general, temperature controllers and either single loop or multi-

    loop. Single loop controllers have one input and one or more

    outputs to control a thermal system. On the hand, multi-loop

    controllers have multiple inputs and outputs, ad capable of

    controlling several loops in a process. More control loops permit

    controlling more process system functions. Thus, major

    development in control technology revolves around increasing

    the control capabilities of the controllers.

    Reliable single loop controllers range from basic devices that

    requires single manual set point changes to sophisticated

    profiler that can automatically execute up to eight set-point

    changes over time period (2), (9).

    The simplest basic controller type is analog controller. Analog

    controllers are low cost, simple controllers that are versatile

    enough for rugged, reliable process control in harsh industrial

    environments including those with significant electrical noise.

    Controller display is typically a knob dial. Analog controllers are

    synonymous to relay controllers which emerged in the early

    60s (9).

  • 7/30/2019 Modeling an Enhanced e- voting system

    35/119

    Basic analog controllers are used mostly in non-critical or

    unsophisticated thermal systems to provide simple ON/OFF

    temperature control for direct or reverse acting application.

    Such controllers accept thermocouple or RTD as input sensors,

    and they offer imprecise measurement.

    Limit controller is another type of controller. It provides safety

    limit control over process temperature. They have no ability to

    control temperature on their own. Put simply, limit controllers

    are independent safety to be alongside an existing control loop.

    Limit control is latching and part of redundant control circuitry

    to positively shut a thermal system down in output must be

    reset by an operator, it will not reset by itself once the limit

    condition does not exist.

    By early 70s (9), the programmable Logic Controller emerged

    with a promising higher control capability. The PLC belongs to

    the general- purpose temperature controller and is used to

    control most typical processes in industries. Typical, they come

    in a range of DIN sizes; have multiple outputs and

  • 7/30/2019 Modeling an Enhanced e- voting system

    36/119

    programmable output function. These controllers can also

    perform PID control for excellent general control situations.

    They are traditionally placed in the front panel with the display

    for easy operator accessibility.

    Value Motor Drive temperature controllers are specifically

    designed to control valve motors used in manufacturing

    applications such as gas burner control on a production line.

    Special tuning algorithms give accurate control and fast output

    reaction without the need for slide ware feedback or excessive

    knowledge of three-term PID tuning algorithms-proportional

    derivative. Valve motor drive digital controllers are used to

    control the position of the valve, somewhere between 0% open

    to 0% open, depending on the energy needs of the process at

    any given time. They use of ON/OFF Duplex function which is a

    very simple algorithm and like its counterpart, ON/OFF control,

    is another low cost controller with fast output reaction but low

    accuracy.

    2.1.3 New Trends

  • 7/30/2019 Modeling an Enhanced e- voting system

    37/119

    Modern temperature controllers came out as the need for

    automatic calculation of PID parameters for optimal thermal

    system performance arose. The PC-based controllers followed

    the introduction of MMI/SCADA in the mid 80s (8), replaces the

    traditional and proprietary controllers such as PLC, with

    standard PC-based hardware and software. PC-based control

    runs on personal or industrial hardened computers and

    provides answers to initiatives for lean control program. This

    PC-based control approach provides end-users and machine

    builders with a platform to dramatically reduce control system

    design time and maintenance cost by reducing down-time with

    built in diagnostic, real time simulation, and consolidation of

    data into a single database. Some estimates indicate the PC-

    based control market is growing at a rate of over 70 percent a year!

    (8).

    The PC and desktop software industries are also participating in

    this evolution of control with the evolution of window NT.

    Window NT version 4.0 is the first Window-based operation

    system (6) that provides a truly deterministic, real time

    operating system. The advent of many software OS lends PC-

    based control more facilities for developing better functionality.

  • 7/30/2019 Modeling an Enhanced e- voting system

    38/119

    For example, even without any prior programming experience,

    you can use NI LabVIEW graphical development environment to

    define custom control functionality and meet your unique

    needs. You can build onto the basic LabVIEW application to add

    features (6) such as

    - Signal processing functions like filtering and averaging;

    - Configurable dead banding and hysteresis;

    - Data Collection and report generations; and

    - Additional input and output channels.

    Some manufacturers of temperature controllers have extended

    the advantages of PC-based control in designing more

    sophisticated controllers such as the profiling digital controllers

    or profilers. Profiling digital controllers, also called Ramp-Soak

    controllers are controllers that will allow the operator to

    program a number of setpoints and the time to sit at each set-

    point. The changing of the setpoint is called Ramp and the

    time to sit at each set point is called Soak or Dwell. One

    remp and one soak are considered to be one segment. A

    profiler offers the ability to enter a number of segments to

    allow complex temperature profiles. There are many

    applications for a profiling controller. The profiles are often

  • 7/30/2019 Modeling an Enhanced e- voting system

    39/119

    referred to as recipes by the operator and are often kept on a

    computer and downloaded via a communications channel

    directly into the controller as needed. Most profilers allow

    storage of multiple recipes for later use. Smaller profilers may

    allow for 4 recipes with 16 segments each while more

    advanced profilers would allow for more. Profile temperature

    controllers are able to execute ramp-and-soak profiles such as

    temperature changes over time, along with hold and soak/cycle

    duration, all the while being unattended by an operator,

    allowing the operator to perform other tasks. Typical

    applications for profile temperature controllers include heat

    treating, annealing, environmental chambers, and in complex

    process furnaces.

    2.2 Set-up Overview

    In this section, the different technologies of the major

    components used in this project are explored.

    2.2.1 Temperature Measurement and Sensors

    Temperature monitoring is central to the majority of data

    acquisition systems, be it to save energy costs, increase safety,

  • 7/30/2019 Modeling an Enhanced e- voting system

    40/119

    testing time whatever your reasons, you will need a device to

    measure the temperature a sensor. Thermocouples,

    resistance temperature device (RTDs), thermistors and infrared

    thermometers are all types of temperature sensor. Which can

    choose depends on factors like your expected maximum and

    minimum temperatures, the accuracy you need and your

    environmental conditions. The most popular sensors are

    thermocouples, RTDs, thermistors and ICs. These are discussed

    below, pointing at potential problems when using some of them

    in computerized temperature measurement.

    Thermocouples

    Thermocouples are popular temperature sensors because they

    are cheap, versatile and sturdy. They consist of two dissimilar

    metals joined together, making a continuous circuit. If one

    junction has a different temperature to the other, an

    electromotive force (voltage) is set up. This voltage varies with

    the temperature difference between the junctions. If the

    temperature at one junction is known, the temperature at the

    other junction can be calculated.

  • 7/30/2019 Modeling an Enhanced e- voting system

    41/119

    Types of Thermocouple

    There are several types of thermocouple, labeled with letters

    according to their constituent metals. A K-type thermocouple,

    for example, is made up of chrome and Alumel. The metals give

    the thermocouples differing properties, such as temperature

    ranges and accuracy.

    Figure 2.2-1: A 2 wire thermocouple

    Potential Pitfalls in a Computerized Thermocouple

    System

    The Cold Junction Reference Measurement. The

    system depends on knowing the temperature of one of the

    thermocouple junctions (the cold junction). Housing this

    junction in an isothermal box will keep the temperature

    constant, and a cold junction sensor in the box will tell the

    system the temperature. In our plug-in card example, the

    VoltmeterCopper wire

    Thermocouple

    Wires (2 Types)

    SensingJunction

    ReferenceTemperature

  • 7/30/2019 Modeling an Enhanced e- voting system

    42/119

    isothermal box sits outside the computer. You would

    connect the thermocouple wires to screw terminals in the

    box, and connect the terminals to the card with a ribbon

    cable.

    Attaching the Thermocouples to Metal Surfaces. if

    the thermocouples are directly to a metal surface,

    particularly one carrying its own voltage such as heating

    element, you need to isolate the signals. This will prevent

    high voltages in the monitored item damaging the data

    acquisition equipment. It will also make the

    measurements floating, letting you record the small

    thermocouple voltage in the presence of high voltages.

    Linearization. The voltage produced by a thermocouple

    does not change linearly with temperature presenting a

    problem for the data acquisition system. A good solution is

    to use software (7) to obtain the correct temperature in,

    say, 0C or 0F. Some custom-made software kits, e.g.

    Windmill, can do this automatically for B, E, J, K, N, R, S

    and T type thermocouples.

    Using the Wrong Type of Thermocouple Lead.

  • 7/30/2019 Modeling an Enhanced e- voting system

    43/119

    You need to connect the thermocouple to the data

    acquisition equipment using the correct type of extension

    or compensation lead. This is made of either the same

    material as the thermocouple metals, or material with

    similar characteristics.

    Long Thermocouple Leads Noisy Signals and

    Added Wiring Costs.

    Thermocouple leads are often many metres long, and

    have a higher resistance than normal copper wire. This

    means that the lead can act as aerials, picking up

    environmental electrical noise that contaminates the

    voltage signal. It might also mean expensive wiring costs.

    In this case you need either to take precautions against

    nose, or distribute data acquisition units placing them

    close to the thermocouples on Modubus, RS485 or

    Ethernet networks for example.

    RESISTANCE TEMPERATURE DEVICES (RTDs)

    Resistance temperature devices (or detectors) rely on the

    principle that the resistance of a metal increases with

    temperature. When made a platinum, they may be known as

  • 7/30/2019 Modeling an Enhanced e- voting system

    44/119

    platinum resistance thermometers (PRTs), and when specified

    to have a resistance of 100 ohm at 00C, as Pt 100.

    Potential Pitfalls in a Computerized RTD System

    Errors Arising from Lead Resistance.

    When the resistance to be measured in small, the

    resistance in the leads to the RTD can significantly affect

    accuracy. Several methods exist for monitoring RTDs,

    which address the problems associated with lead

    resistance. These methods include balanced bridges and

    constant current sources.

    Constant current source measurements give

    excellent results for all wiring configurations,

    including 2-wire, 3 wire, 4-wire and 4 wire

    compensated.

    The most accurate results are obtained using a 4 wire

    arrangement. Each RTD requires the data acquisition

    hardware to provide a constant current source. The

    current flows through the RTD and the voltage drop the

    RTD is measured. Using Ohms law the value of the

    resistance of the RTD can be calculated.

    Converting the Resistance to a Temperature.

  • 7/30/2019 Modeling an Enhanced e- voting system

    45/119

    Software like Windmill automatically converts the resistance

    measurement to a temperature in your choice of engineering

    units (7).

    Thermistors

    Thermistors are inexpensive, easily-obtainable temperature

    sensors. They are easy to use and adaptable. Circuits with

    thermistors can have reasonable output voltages not the

    millivolt outputs thermocouples have. Because of these

    qualities, thermistors are widely used for simple temperature

    measurements. Theyre not used for high temperatures, but in

    the temperature ranges where they work they are widely used.

    Thermistoers are temperature sensitive resistors. All resistors

    vary with temperature, but thermistors are constructed of

    semiconductor material with a resistivity that is especially

    sensitive to temperature. However, unlike most other resistive

    devices, the resistance of a thermistor decreases with

    increasing temperature. Thats due to the properties of the

    semiconductor material that the thermistor is made from.

    Figure 2.2-3 is a graph of resistance as a function of

    temperature for a typical thermistor. Notice how the resistance

    drops from 100000 ohms, to a very small value in a range

  • 7/30/2019 Modeling an Enhanced e- voting system

    46/119

    around room temperature. Not only is the resistance change in

    the opposite direction from what you expect, but the

    magnitude of the percentage resistance change is substantial.

    R

    104

    102

    0 100 200 300 400 500 T (0K)

    Fig 2.2-3 Graph of resistance versus temperature for a typical

    thermistor.

    Sensor (LM 35)

    The LM 35 is an integrated circuit sensor that can be used to

    measure temperature with an electrical output signal

    Fig 2.2-2: A typical picture of a thermistor

  • 7/30/2019 Modeling an Enhanced e- voting system

    47/119

    proportional to the temperature in degree Celsisu. Actually IC

    temperature sensors consist of integrated temperature

    dependent resistors whose output voltage increases

    proportionally with increase in temperature due to increased

    output resistance. A brief summary of its advantages over

    other sensors include:

    - more accurate and precise temperature measurement;

    - scaled sensor circuitry so that it is not subject to oxidation

    and other environmental factors;

    - output conditioning of LM35 is simpler when compared to

    that of thermocouples, thermistors, etc.

    The above inherent properties of IC temperature have made

    the more desirable in computerized applications.

    2.2.2 Microcontroller

    A microcontroller is a single chip microprocessor system which

    contains data and program memory, serial and parallel 1/O,

    timers, and internal interrupts, all integrated into a single chip.

    First microcontrollers were developed in the mid 70s (4). These

    were basically calculator-based processors with small ROM

    program memories, very limited RAM data memories, and a

  • 7/30/2019 Modeling an Enhanced e- voting system

    48/119

    handful of input/output ports. More powerful 8 bit

    microcontrollers were later developed. In addition to their

    improved instruction sets, these microcontrollers included on-

    chi counters/timers, interrupt, 1/O, on-chip ultra-violet erasable

    EPROM memory.

    The 8051 family was introduced in the early 80s by Intel.

    Currently this family of microcontroller has many versions and

    some types of included on-chip analog-to-digital converters. In

    the 90s, the recent microcontroller, Intel 8951 evolved with all

    the features and instruction set of the other trends to

    microprocessors. This gives it the ability to be used more easily

    with minimum cascading, or even without additional memory

    devices. Still in this twenty first century, another Intel 8952,

    which is an advanced form of Intel 8951, has been introduced.

    Today, microcontrollers have moved into other more powerful,

    16 bit market. They are high performance processors that find

    application in real-time and computer intensive fields (e.g. in

    digital signal processing or real-time control).

    2.2.3 Serial Communication

  • 7/30/2019 Modeling an Enhanced e- voting system

    49/119

    Communication is essential in electronics system. It can be in

    the form or wired or wireless, serial or parallel. The main idea is

    to transfer information from one system to another system,

    communication in one direction is call a simplex communication

    system, and duplex means communication is in both direction

    at the same time. Half duplex means that communication is

    taking place in both direction but only one direction

    communication is taking place at any one time.

    Communication between electronics devices usually deals with

    logic Is and 0s. a typical electronic system uses the concept of

    voltage or frequency. The choice of signal varies.

    Voltage/frequency changes can be produced and detected

    using simple electronics, so it is relative a easier type of signal

    to implement. The information from the sender can be in the

    form of voltage. By detecting the voltage, the receiving device

    is able to interpret the information. The common understanding

    or interpretation of both the sending and receiving device is

    known as the communication protocol. The information

    conversion to a suitable transmission signal is also known as

    encoding. Decoding is the other way round.

  • 7/30/2019 Modeling an Enhanced e- voting system

    50/119

    In todays wired communication system, there are a wide

    variety of serial communication standard from RS232, RS485,

    USB, CAN, and many more. They are simply the standard

    defined for communication hardware. Today, various serial

    communication interface USART are present. They are TTL

    version of the serial communication, represented by 5V/0V. It is

    similar to RS232 physical format represented by -/+IOV in the

    voltage.

    USART is not design for distance communication. To enable

    longer communication distance, USART signal will need further

    encoding into RS232 signal format before transmission. Other

    common names for USART (Universal Synchronous

    Asynchronous Receiver Transmitter) are UART or SCI (Serial

    Communications Interface). Serial data in TTL format is the very

    basic serial communication interface to understand. RS232 is

    the encoded version of USART. The encoded signal allows the

    data to be deployed for longer communication distance. Some

    article may have defined a maximum communication distance

    of 15m for RS232 signal. You can try pulling the

    communication distance further, it should still works actually.

    15rn is only a general guideline.

  • 7/30/2019 Modeling an Enhanced e- voting system

    51/119

    If the data transmission rate is low, the distance can even go

    further. There have been reports from the internet that some

    users have achieved 50m to 200m without any problem. In this

    project, I have tried baud rate of 9600bps over 100m without

    any problem. Baud-rate is presented in bps (data bits per

    second). The higher the value the more the data can be

    transmitted in a given time period. The higher the speed, the

    shorter the communicationdistance.

    The data transmission length of the cable can be determined

    by many factors. The factors include the following:

    - Data transmission speed

    - Quality of the cable, noise (unwanted signal)

    - Transmitted voltage '

    - Receiver sensitivity

    - Etc.

    Communication distance using RS232 can be increased further

    if the cable is of better quality, a shield or coaxial cable for

    example.

    The most significant factor is the data transmission speed. The

    following is a reference diagram showing regarding the

    relationship between data baud rate and cable length.

  • 7/30/2019 Modeling an Enhanced e- voting system

    52/119

    Baud-rate Length (distance)

    19200bps 15m

    9600bps 150m

    4800bps . 300m

    2400bps . 900m

    Table 1: Reference table showing relationship between

    baud-rate and length of cable, for MAX232.

    1C chip maker has come up with the integrated circuit for

    interfacing RS232 with TTL logic (5V for logic 1, 0V for logic 0),

    making the interfacing work very simple. MAX232 is one of the

    many 1C in the market which helps to convert betweenRS232

    -/+10V and TTL +/-5V. The charge pump design allows the

    circuit to generate +/-10V from a 5V supply. (See fig. 4.2.7).

  • 7/30/2019 Modeling an Enhanced e- voting system

    53/119

    CHAPTER THREE:

    METHODOLOGY AND SYSTEM ANALYSIS

    3.1

    Methodology

    Before the inception of the idea that a PC-based system can be

    employed to facilitate efficient monitoring and control of

    temperatures of industrial processes, a number of steps was

    explored in arriving at a conceptual model of the new system.

    3.1.1 Structured analysis and design

    The steps began with investing and understanding the

    current/existing physical system.

    The various steps are summarized the diagram below.

    EXISTING PHYSICAL SYSTEM

    EXISTING LOGICAL SYSTEM

    REQUIRED LOGICAL SYSTEM

  • 7/30/2019 Modeling an Enhanced e- voting system

    54/119

    REQUIRED PHYSICAL SYSTEM

    Figure 3.1-1: Astructured approach to system analysis

    Existing Physical/Logical System

    As earlier mentioned, Cutix Pic Nnewi, like most other

    manufacturing industries, make use of analog temperature

    controllers with thermocouple sensors as Inputs. The

    concept/logical model of the existing system can be viewed as

    shown below:

    POWER SUPPLY

    CONTROLLER 1

    ON/OFF

    R1

    HEATER1

    SENSOR1

    HEATER2

    HEATER4

    HEATER3

    SENSOR2

    SENSOR3

    SENSOR4

    R2 R3 R4

    CONTROLLER 2

    ON/OFF

    CONTROLLER 3

    ON/OFF

    CONTROLLER 4

    ON/OFF

  • 7/30/2019 Modeling an Enhanced e- voting system

    55/119

    Figure 3.1-2: Existing physical system of temperature

    control

    and monitoring system.

    Considering a four-point temperature control and monitoring

    requirement which already was implemented using a separate,

    stand alone temperature controllers. Such control can be

    achieved using analog controllers or even stand alone PLC.

    Each control unit is independent of the other. A problem

    statement was formulated after attempting to provide answers

    to the following questions:

    1. How can the temperature be measured more accurately so

    that quality control can be optimized?

    2. Can there be a possibility of bringing the control under the

    supervision of only one hardware so that easy supervision

    an4 surveillance can be made on the process?

    3. Can there be a means of establishing a common

    communication interface and display so that monitoring can

    be done more effectively and abnormality noticed on time

    before having 'any damaging effect on the machine or

  • 7/30/2019 Modeling an Enhanced e- voting system

    56/119

    product. For instance, when a thermocouple or controller

    fails, how can we get a timely notice for its replacement?\

    4. How can more security be implemented so that somebody

    does not tamper with the set-point on the controller and reset

    the knob at a wrong setting.

    5. How can the installation process be simplified so that much

    time is not devoted to mounting the system in a new place of

    interest?

    The problem statement can now be formulated: "a need to

    design and construct an automatic multipoint temperature

    monitoring and control system". Such systemshould have the

    following features:

    - ability to provide precise and accurate temperature

    measurement.

    - ability to handle the control of all the four temperatures

    that need

    to be controlled.

    - communication user interface with dip hardware for

    monitoring and

    controlling the four points almost simultaneously.

    - ease of installation without requiring the whole production

  • 7/30/2019 Modeling an Enhanced e- voting system

    57/119

    process

    be shut down.

    - room for integration with other systems if need be.

    The Proposed Logical/Physical System

    Looking at the deficiencies of the existing system and the

    features required of the required system,, a PC-based approach

    to system control seems to meet the requirements for the new

    system. A physical representation of the proposed model is as

    shown below.

    CPU

    R1

    HEATER1

    SENSOR1

    HEATER2

    HEATER4

    HEATER3

    SENSOR2

    SENSOR3

    SENSOR4

    R2 R3 R4

    SINGLE CONTROLLER HARDWARE

    SCREEN

    POWER SUPPLY

  • 7/30/2019 Modeling an Enhanced e- voting system

    58/119

    Figure 3. 1-3: A Block Diagram model of a pc-based 4-

    point temperature monitoring and control3.1.2 Top-down Design

    Top-down design is the technique of beginning with a complex

    project and breaking it down into its constituents. For a supra

    system which consists oF several systems and subsystems, a

    top-down design approach of such system can be represented

    as follows:

    SUPRA SYSTEM

    SYSTEM

    SUBSYSTEM

    PROGRAM MODULES

    Hence, the project "PC-based automatic multipoint

    temperature monitoring and control" is a supra system with

    components system as

    - temperature controller system, made up of data acquisition

  • 7/30/2019 Modeling an Enhanced e- voting system

    59/119

    (or temperature measurement.) unit and control unit; and

    - temperature monitoring system, made up of hardware inlet-

    facing with PC and user program (Window-base program)

    development.

    Each of the individual system has its other subsystem and

    program modules.

    3.1.3 Bottom-up Design

    This is a situation where one starts with simple subsystem or

    program modules and proceeds to constitute the main system

    and subsequently supra system, as the case may be.

    3.1.4 Choice Design Approach

    The design approach used in this project design is the top-down

    design. The whole system is broken down into different smaller

    modules.

    MODULE 1: Design of the data acquisition system.

    This comprises wiring and interconnecting tlic sensors, ADC,

    and multiplexers to the microcontroller.

    MODULE 2: Configuration of the microcontroller 89C52 and its

    control program using C programming language. The MAX232

    protocol is also configured at this stage.

  • 7/30/2019 Modeling an Enhanced e- voting system

    60/119

    MODULE 3: Design of the PC monitoring Window-based

    interface. Here, the Visual Basic (VB 6.0) programming

    languagc.is used to write a program that will enable the PC to

    communicate with the hardware (controller).

    Fig.3.2-1: Modularized approach to the project systemdesign

    The final step is integration of the different modules to form the

    system required. It is important to note that any of the above

    modules can be tackled first and important information that

    can be used for the other recorded appropriately for reference

    purpose.

    3.2 Limitations of the Existing System

    It seems appropriate at this point to explicitly enumerate the

    major deficiencies of the existing system, which prompted the

    MODULE 1

    MODULE 2

    MODULE3

  • 7/30/2019 Modeling an Enhanced e- voting system

    61/119

    design of the new system. From the on-going discussions and

    the analysis carried out ab initio, it will be discovered that;

    - the old system does not provide a precise temperature

    measurement due to the inherent characteristics of the

    sensors used;

    - monitoring and controlling the temperatures of more than

    one point at the same time, using the old system is more

    cumbersome and demanding since there are different

    controller for each temperature;

    - with the old system, a staff should always go round to

    observe the controllers at all time to know the one which

    is malfunctioning or not functioning at all. This task would

    be made easier using a PC-based multipoint temperature

    monitoring and control where all events are observed at

    a time from one point PC screen.

    - Also, there is the possibility of all point being interfered

    with by an intruder thereby distorting normal production

    parameter settings. Such is minimized with PC-based

    system.

  • 7/30/2019 Modeling an Enhanced e- voting system

    62/119

    CHAPTER FOUR

    SYSTEM DESIGN, SIMULATION AND PERFORMANCE

    EVALUATION

    4.1 System Specification

  • 7/30/2019 Modeling an Enhanced e- voting system

    63/119

    The PC-based automatic multipoint temperature monitoring

    and control system is a system that helps users to continuously

    monitor the temperaturesof different points of interest at the

    same time with the help of a personal computer (PC). The

    system will be able to maintain a desired temperature set by

    the user at a stable value.

    During operation, the maximum value is keyed in by the user.

    The current value of the point being monitored must not go

    above the maximum set-point. A stable set-point range is

    maintained by the microcontroller-based hardware which turns

    ON a respective heater for each point whenever the current

    temperature reading tends to go below the maximum set-point,

    and turns OFF the heater whenever the maximum set- point is

    reached. Thus the required temperature is maintained by the

    hardware for optimum production operation.

    For this project, the range of temperature measurable by the

    system is from OC to 100C;

    i.e. the maximum set-point must not be any value outside the

    range of 0 - 100,

  • 7/30/2019 Modeling an Enhanced e- voting system

    64/119

    (0oC < Tmax < 100oC). This system is capable of monitoring

    and controlling up to four different points of interest

    concurrently but independently.

    4.2 Hardware Subsystem

    4.2.1 Input Interface

    MODULE 1: Design of the data acquisition system. Mere, the

    following parts of the project are designed and configured.

    - Power supply

    - Sensor configuration with the ADC.

    Power Supply Design

    The power supply requirement for all the components used in

    this falls within the 5VDC and 12VDC supplies. Therefore, a

    suitable 5V/12DC supply is designed using the following

    components: 240/12VAC step-down transformer, a bridge

    rectifier 1C, 7505-5V and IN4742 12V voltage regulators and

    capacitors of varying specification.

  • 7/30/2019 Modeling an Enhanced e- voting system

    65/119

    Fig. 4.1.1: A 5V/12VDc Power Supply Circuit.

    The input voltage to the power is to be within the range of 7 to

    20 VAC. Here a step-down (240/15VAC) transformer is used to

    supply 15VAC to the circuit. The MC7505 5-V regulator and

    zener diode 1N4742 are used in the circuit to provide a fixed

    5vDcand 12vDc outputs respectively for the system

    components. The power supply circuit can handle up to 1A of

    current, provided that the transformer can handle the current.

    The voltage regulator is provided with heat-sink for easy heat

    dissipation.

  • 7/30/2019 Modeling an Enhanced e- voting system

    66/119

    Sensor (LM 35)

    The LM 35 is an integrated circuit sensor that can be used to

    measure temperature with an electrical output signal

    proportional to the temperature in degree Celsius. The

    summary of its advantages over other sensors have been

    discussed in chapter two.

    The operational characteristics ofLM35 temperature sensor

    includes the following:

    - Output voltage that is proportional to the Celsius

    temperature;

    - accuracy of about +/- 0.4C at room temperature and +/-

    0.8C over a range 0C to 100C;

    - It draws only about 60uA from its supply and possesses

    allow self-heating capability (the sensor self-heating

    causes less than 0.1C temperature rise in still air.

    Calibrating the LM35 with respect to ADC step output

  • 7/30/2019 Modeling an Enhanced e- voting system

    67/119

    The ADC0808 has 8-bit resolution with a maximum of 256 steps

    and the LM35 produces l0mV for every degree rise of

    temperature. The calibration of LM35 sensor will be such that

    for output of 0C to 100C, the input to the ADC ranges from 0to

    256 x l0mV, i.e, 0 - 2560mV or 0 - 2.56V.

    ADC CONFIGURATIONThe ADC used is ADC0808. It has the frequency

    F = 1 HzI.IRC

    Where R = 10K, C = 150pF

    F = 606 KHz.

    Fig 4.2.3: Pin-out diagram of ADC0808

  • 7/30/2019 Modeling an Enhanced e- voting system

    68/119

    Vcc: this is +5V power supply pin or a reference voltage pin

    when Vref/2 input pin is open.

    Vin(+) is used as the only input to be converted when Vin (-) is

    connected to the ground.

    WR (start conversion) is used to signal the ADC0808 to start

    converting the analog input of Vin to an 8-bit digital number,

    whenever the pin makes a low-to-high transition.

    CS is an active low input used to activate the ADC808.

    RD (output enable): A high-to-low RD pulse is used to read the

    converted data output of the ADC.

    Another parameter to consider in configuring the ADC is the

    Vref/2. This determines the step-size of the ADC and

    subsequently the digital output of the ADC. The following table

    shows Vref/2 relation to Vin range.

    VrcI/2(V)

    Vin(V) Stepsize(mV)

    1

    Not 0 to 5 5/256 -19.53

  • 7/30/2019 Modeling an Enhanced e- voting system

    69/119

    connected

    2.0 0 to 4 4/256=15.62

    .i.5 0 to 3 3/256-11.71

    1.28 0 to2.56

    2.56/256=10.0

    1.0 0 to 2 2/256 = 7.81

    0.5 0 to 1 1/256 = 3.90

    Table 4.1:Vref/2 relationship with Vin range

    From the table above, to get a l0.0mV stepsize of the LM35

    Vref/2 of value 1.28 is required. This value is achieved by

    connecting potentiometer to fix the voltage across the 10K pot

    at 25 volts. This should overcome any fluctuations in the power

    supply.

    Digital output of the ADC is given by;

    Dout = VinStepsize

  • 7/30/2019 Modeling an Enhanced e- voting system

    70/119

    For example, when the LM35 inputs 250mV to the ADC, the

    digital output, from the ADC after conversion should be

    Dout = 250mVl0mV

    = 25C as temperature reading.

    4.2.2 The Control System Design

    MODULE 2: The microcontroller is the central control unit in

    this project. The microcontroller used in 89C52. The diagram

    below shows the pin-out of 89C52.

  • 7/30/2019 Modeling an Enhanced e- voting system

    71/119

    Fig. 4.2.4: Pin-out diagram of 89C52 with minimum

    configuration

    RST: This is the reset input. This input should normally be at

    logic 0. A reset is accomplished by holding the RST pin high for

    at least two machine cycles.

    Power on-reset is normally performed by connecting an

    external capacitor and a resistor to this pin. (See fig...)

    XTAL1 and XTAL2; These pins are where an external crystal

    should be connected for the operation of internal oscillation

    device.

    P3.0(bit 0 of port 3): This is a bi-directional 1/0 pin with an

    internal pull-up resistor. It is also used as the data receive

    input (RXD) when the device is used as an asynchronous UART

    to receive serial data.

    P3.1 (bit 1 of port 3):This is also a bi-directional 1/0 pin with

    an internal pull-up resistor. This pin also acts as the data

    transmit output (DXT) on the 8051 family when the device is

    used as an asynchronous UART to transmit serial data.

  • 7/30/2019 Modeling an Enhanced e- voting system

    72/119

    P3.2 (bit 2 of port 3): This is a bi-directional 1/0 pin with an

    internal pull-up resistor. This pin is also the external interrupt 0

    (INTO) pin.

    P3.3 (pin 3 of port 3): This is a bi-directional 1/0 pin with an

    internal pull-up resistor. This pin is also the interrupt (1NT1)

    pin.

    P3.4 (bit 4 of port 3): This is a bi-directional 1/0 pin with an

    internal pull-up resistor. This is also the counter 0 input (TO)

    pin.

    P3.5 (bit 5 of port 3): This is a bi-directional 1/O pin with an

    internal pull-up resistor. This pin is also the counter 1 input (TI)

    Pin.

    GND: This is the ground Pin.

    P3.6 (bit 6 of port 3): This is a bi-directional 1/O pin. This pin

    is not available on the 89C2025. It is also the external data

    memory write (WR) pin.

    P3.7 (bit 7 of port 3): This is a bi-directional/1/O pin. On the

    standard 8951, this pin is also the external data memory read

    (RD) pin.

    P1.0 (bit 0 of Port 1): This is also bi-directional 1/O pin. This

  • 7/30/2019 Modeling an Enhanced e- voting system

    73/119

    pin has no internal pull-up resistor on the 20 pin devices. It is

    also used as the positive input of the analog comparator (AIN0)

    on the 20-pin device.

    P1.1 (bit 1 of Port 1): This is a bi-directional 1/O pin. This pin

    has no internal pull-up resistor on the 20-pin devices. It is also

    used as the positive input of the analog comparator (AINI) on

    the 20-pin device.

    P1.1 (bit 1 of port 1): This is a bi-directional 1/O pin. This pin

    has no internal pull-up resistor on the 20-pin devices. It is also

    used as the positive input of the analog comparator (AINI) on

    the 20-pin device.

    P1.2 to P1.7: These are the remaining bi-directional 1/O pins

    of port 1. These pins have internal pull-up resistors.

    Vcc: This is the voltage supply pin.

    Fig.4.2.4 shows that the following external components are

    required to have a working microcontroller.

    XI-. Crystal (e.g. 12MHz)

    Cl.C2:33pF capacitor

  • 7/30/2019 Modeling an Enhanced e- voting system

    74/119

    C3; l0uF / 10V electrolytic

    capacitor R1:8.2K,0.125W

    resistor.

    Programming requirement

    The microcontroller used in this project was programmed

    using the following:

    1. Suitable C compiler which generates machine codes for the

    microcontroller. The M1DE-51 editor software was used in

    this project due to its wide compatibility with C compilers.

    4.2.3 Interfacing relay driver to the microcontroller

    output port.

    The four points being monitored by this system, each has a

    sensor and a heater. When the maximum temperature is

    exceeded or the minimum temperature more than the current

    temperature, a control signal is sent to the respective output

    port of the microcontroller for switching ON or OFF a

    corresponding heater-as the case may be. Four separate output

    pins (P2.0 to P2.3) are used as output to the relay drivers. A

  • 7/30/2019 Modeling an Enhanced e- voting system

    75/119

    typical design for interfacing a relay to a microcontroller is

    done here.

    Fig. 4.2.6: design of relay interface to a microcontroller.

    The function of the relay driver is to provide the necessary

    current typically 25 to 70mA to energize the relay coil. AN NPN

    is used to drive the relay. The transistor is driven to saturation

  • 7/30/2019 Modeling an Enhanced e- voting system

    76/119

    (turned ON) when logic 1 is written on the port pin thus turning

    ON the relay. The relay is turned OFF by writing logic 0 on the

    port.

    A diode is connected across the relay coil to protect the

    transistor from damage due to back emf generated in the

    relay's inductive coil when the transistor is turned OFF. When

    the transistor is switched off, the energy stored in the inductor

    is dissipated through the diode and the internal resistance of

    the relay coil. A pull-up resistor is used at the base of the

    transistor. The microcontroller 8052 has an internal pull up

    resistor of 10K, so when the pin is pulled high (logic 1), the

    current flows through tins resistor. The maximum output

    current is

    5V = 0.5mA10K

    BC547 has a DC current gain of 100, so the maximum collector

    current is

    0.5x100-50mA

    This value is not enough to turn the transistor to saturation.

    Therefore, an external pull-up resistor is used. When the

    controller pin is high, current flows through the controller pin as

    well as through the pull-up resistor. For the circuit shown, a

  • 7/30/2019 Modeling an Enhanced e- voting system

    77/119

    4.7K pull-up resistor is used; so the current added to the base

    current is

    5V = 1.1mA4.7K

    Hence, the total base current is (0.5+1.1) mA = 1.6mA.

    The maximum collector current is I.6mAxlOO = 160mA, which

    is enough to turn ON the relay driver- BC547.

    NB: The same arrangement is connected to each of the four

    output pins connected to the four different heaters,

    Interfacing aMAX232 technology to a Microcontroller

    The MAX232 diagram below shows that it has two sets of line

    drivers: Rl, Tl and R2,T2. The communication cable from the

    hardware through the MAX232 is connected to the PC port

    using the DB-9 connector.

  • 7/30/2019 Modeling an Enhanced e- voting system

    78/119

    Fig. 4.2.7: Diagram showing a MAX232 pin-out

    The diagram below shows the pin connections(pin-outs) of a 9-

    way serial port. Each pin has a two of three letter mnemonic as

    follows:

    GND 5

    DTR 4 RI 9

    TXD 3 CTS 8

    RXD 2 RTS 7

    CD 1 DSR 6

  • 7/30/2019 Modeling an Enhanced e- voting system

    79/119

    Pin # Mnemonic Meaning

    1 CD - Carrier

    Detect

    2 RXD -

    Receive Data

    3 TXD - Transmit

    Data

    4 DTR - Data Terminal Ready

    5 GND - Ground

    6 DSR - Data Set Ready

    7 RTS - Request To Send

    8 CTS - Clear To Send

    9 RI - Ring Indicator

    For a simple serial communication there are three pins that are

    important. Data is transmitted over one pin (Transmit Data or

    TXD for short) and received over another pin (Receive Data or

    RXD). The third wire that's needed is the Ground wire (GND) -

    serving as a return path for the electrical signal. It is important

    to ensure that the TXD and RXD of the two computers are

  • 7/30/2019 Modeling an Enhanced e- voting system

    80/119

    interchanged during wiring. That is, the RXD pin of one port

    must be connected to the TXD pin of the second and so on. This

    means that when COMI transmits data (on TXD) controller

    hardware will receive data on RXD, and vise versa. The

    complete wiring between the two connectors looks like this:

    COMI CONTROLLER

    RXD 2 TXD 3

    TXD 3 RXD 2

    GND 5 GND 5

    Also, in order to allow data transfer between the PC and a

    microcontroller- based system without any error, there is need

    to make sure that the baud rate of the PCs COM port matches

    the baud rate of the microcontroller. This should be taken care

    of during software programming.

  • 7/30/2019 Modeling an Enhanced e- voting system

    81/119

    4.3: Software Subsystem Design

    4.3.1 Program Block Diagram and Control Algorithm

    Program Block Diagram:

    Various steps taken in programming the microcontroller using C

    programming language are shown in the following block

    diagram.

    Initialize ADC

    InitializeSerial-port

    Update threshold

    Controller Addresschange

    Start Conversion

    ReceiveTemperature

    Monitor and ControlTemp.

    Send temperature

  • 7/30/2019 Modeling an Enhanced e- voting system

    82/119

    Fig. 4.2.8: Block diagram showing the operation of themicrocontrollerThe Control Algorithm

    The control algorithm is implemented in the control sub-

    program and is used by the microcontroller to control the entire

    system when the temperatures (Tmax) are sensed, converted

    to volts, digitized and displayed by the microcontroller.

    BEGIN

    DO

    GET Tmax

    IF T < Tmax THEN

    Turn ON heater

    ELSE

    TURN OFF HEATER

    LOOP

    4.3.2: Configuring the serial ports

    Before the microcontroller serial port can be used it is

    necessary to set various registers.

  • 7/30/2019 Modeling an Enhanced e- voting system

    83/119

    SCON: this is the serial port control register. It should be set to

    hexadecimal 0x50 for 8-bit data mode.

    TMOD: This register controls the timers for baud rate

    generation, and it should be set to hexadecimal 0x20 to enable

    timer 1 to operate in 8-bit auto-reload mode.

    TH1: This register should be loaded with a constant so that the

    required baud rate can be generated. A method for determining

    the values to be loaded into THI is discussed later.

    TR1: This register starts/stops the timer and it should be set to

    1 to start timer 1. T1: This register should be set 1 to indicate

    ready to transmit signal.

    Determining TH1 value

    The value of be loaded into the TH1 register is dependent on

    the crystal oscillator value and the required baud rate. Dividing

    1/12 of the crystal frequency by 32 gives the default value

    upon activation of the 8052 RESET pin. With XTAL = 12.00MHz,

    we can determine the TH1 value needed to have 9600 baud

    rate as follows

    XTALOSCILLATOR

    12 32 BAUDRATE

    TH1VALUE

  • 7/30/2019 Modeling an Enhanced e- voting system

    84/119

    Give a machine cycle frequency of 8052 as 12.00MHz. We

    determine the TH1 value:

    12.00MHz/12 = 1000 KHz;

    1000 KHz/32 = 31250: the freq. of UART to timer 1 to

    set baud rate.

    31250.9600 = 3.255: TH1 value

    Hence, setting TH1 value to 3(=FD hex) gives an error of 7%

    In programming the 8952 to transfer character byte serially;

    1. TMOD register is loaded with the value 20H, indicating the

    use of timer 1 in mode 2 (8-bit auto-reload to set baud

    rate).

    2. The TH1 is loaded with the value 0xFD to set baud rate for

    serial data transfer.

    3. The SCON register is loaded with the value 50H, indicating

    serial mode 1, where an 8-bit data is framed with start and

    stop bits.

    4. TR1 is set to 1 to start timer 1

    5. T1 is cleared by CLR T1 instruction.

    6. The character byte to be transferred serially is written into

    SBUF register.

  • 7/30/2019 Modeling an Enhanced e- voting system

    85/119

    7. The T1 flag bit is monitored with the use of instruction JNB

    T1, xx to see if the character has been transferred

    completely.

    8. To transfer the next byte, go to step 5.

    Steps 1-4 indicate how to initialize the serial port for 9600 baud

    rate. Using C programming language, steps 1-4 are shown

    below.

    Void serial init0

    SCON = 0x50;

    TMOD = 0x20.

    TH1 = 0xFD;

    TR1 = 1;

    T1 = 1;

    Also, in programming the 89C52 to receive character byte

    serially, the same steps 1-4, except step 5, are to be followed.

    At step 5, R1 register is cleared by CLR R1 instruction. The

    same R1 flag bit is monitored with the use of JNB R1, xx

    instruction to see if an entire character has been received yet.

    When R1 is raised, SBUF has the byte. Its contents are moved

    into a safe place.

    4.3.3 Configuring the PC Serial port using Visual Basic

  • 7/30/2019 Modeling an Enhanced e- voting system

    86/119

    MODULE 3:

    Visual Basic (VB) comes with a ready-made component for

    handling communication ports, the MsComm control. MsComm

    is a simplification of the underlying API call for controlling a

    communication port. In programming for serial communication

    using MsComm in VB, one has to initialize button that opens the

    ports and configure the settings for baud rate, parity, data bits

    and stop bits and sets off a polling loop. Here I have used baud

    rate of 9600, data bits of 8, no parity, i.e. parity (none) and one

    stop bit. One can initially set COM1 (and COM2) up with both

    RTS and DTR set off:

    With MSComm 1

    .MsComm1-settings = 9600, 8, N, 1

    .DTREnable = False

    .RTSEnable = False

    .CommPort = 1

    .PortOpen = True

    End With

    One set up the program just polls for input and rest of the

    program can be written as shown below. The complete program

    is attached as part of appendix B.

  • 7/30/2019 Modeling an Enhanced e- voting system

    87/119

    Do While MSComm1. PortOpen

    S1 = MSComm 1. Input

    (Program body)

    :

    :

    :

    Else

    DoEvents

    End If

    Loop

    Program Description

    When microcontroller changes address and send address code

    to the PC serial port, the Vb program understands it to mean

    ready and it activates the object, say Temperature 1, and it

    sends the Tmax for the object. The microcontroller receives the

    value and stores in SBUF of the microcontroller. Then it

    initializes the ADC to start conversion. After, it reads and sends

    the value of PC as Current temperature. The VB obtains the

    value and displays it in the TEMP box. The microcontroller

    performs control operation with the current temperature,

    comparing it with Tmax. It then takes the required action

  • 7/30/2019 Modeling an Enhanced e- voting system

    88/119

    depending on the outcome of the comparison. After the control

    operation, the microcontroller changes address and sends code

    to the Vb on the PC to activate another object, say

    Temperature 2. It then repeats the whole steps taken for

    temperature 1. Such steps are also taken for the Temperatures

    3 and 4, and cycle repeats continuously.

    4.4 The Input / Output arrangement

    The whole system, made up of the microcontroller-based data

    acquisition hardware, the PC-interface and the relay outputs, is

    arranged having the microcontroller-based hardware as the

    central system. This system receives inputs from both the

    temperature sensors and the PC interface. The outputs that go

    out of the microcontroller include the following:

    - Current temperature for display

    - Control signal to the relay drivers to switch ON or OFF

    the respective heaters.

    - Control signal to ADC to start conversion of the next

    temperature after processing the previous reading.

    - Control address bits to the MUX to switch to next

    sensor.

    4.5 Project Block Diagram

    Liquid

    POWER SUPPLY

    ANALOGTO

    DIGITALCONVERTER

    SENSOR 1

    SENSOR 2

    SENSOR 3

    SENSOR 4

    RELAY

    MICRO-CONTROLLER

    MAX232

    PC

  • 7/30/2019 Modeling an Enhanced e- voting system

    89/119

    Fig.4.2.9: Block diagram of the project

    4.6 SIMULATION OF THE SYSTEM

    Having successfully completed the designs, the block diagram,

    system specification and design, the actual implementation

    was done using simulation software. Proteus ISIS is a suitable

    simulation tool for microcontroller based designs. So the

    microcontroller hardware is implemented with proteus

    application software. This involves integration of different

    components of the system to achieve a complete working

    system.

    4.6.1 Input interface implementation

  • 7/30/2019 Modeling an Enhanced e- voting system

    90/119

    The input interface, with respect to the microcontroller-

    based hardware, is made up of:

    1. temperature sensor circuitry

    2. 4-channel analog-to-digital converter (ADC)

    Temperature sensor circuitry

    Four LM35 temperature sensors are connected to four input

    channels of the ADC0808. The diagram below illustrates the

    wiring diagram of the sensors and the ADC.

    Fig. 5.1.2: Circuit diagram showing the wiring schedule

    of the input interface to the Microcontroller.

    4.6.2 The Control System Implementation

  • 7/30/2019 Modeling an Enhanced e- voting system

    91/119

    The microcontroller is configured for normal operation, i.e.

    connecting the power-on-reset, the crystal oscillator.

    Then, the controller is connected to the input interface of

    figure 5.1.2.

    4.6.3 The Output Interface Implementation

    The output of the system includes the signal that triggers

    the relay drivers to switch a corresponding heater ON or

    OFF. This signal comes from the output port 1 (p1.0 - p1.3)

    of the 8952 microcontroller. The implementation of the

    output interface connected to the input section is shown in

    the diagram below.

  • 7/30/2019 Modeling an Enhanced e- voting system

    92/119

    Fig. 5.1.4: Diagram showing output and input interfaces

    to microcontroller

    4.7 System simulation test

    The PC-based automatic multipoint temperature

    monitoring and control system essentially comprises two

    basic parts, namely: the hardware and the software parts.

    So far, the hardware has been implemented. A systematic

    test of the hardware on proteus is to be done. At this

    point, the embedded software is loaded to the

    microcontroller and every aspect of the hardware tested.

  • 7/30/2019 Modeling an Enhanced e- voting system

    93/119

    The temperature inputs are simulated while the variation

    in the temperature is observed on the LCD. The serial

    virtual tool is used to view what the m