Escolar Documentos
Profissional Documentos
Cultura Documentos
Embedded systems play a vital role in the present world. Embedded systems are getting more and more common in areas like communication, multimedia, process control and consumer electronics. They usually have to fulfil strict requirements in terms of performance, safety, power consumption and cost efficiency. Simultaneously, time-to-market for new products has to be reduced. New design environments have to support the design of such systems from the early design phases, starting with the system specification. Electronic voting machine has now days become an effective tool for voting. It ensures flawless voting and thus has become more widespread. It ensures people about their vote being secured. It avoids any kind of malpractice and invalid votes. Also such kind of system becomes more economical as consequent expenditure incurred on manpower is saved. It is also convenient on the part of voter, as he has to just press one key whichever belongs to his candidates. The Electronic Voting Machine basically consists of three main blocks; these are switches, micro controller and seven segment display. This voting machine is designed for four candidates. The provision of casting vote has been provided by means of four tactile switches. These switches take manual inputs from the user and transfer them to the pins of controller. Based on these inputs, the vote count for different candidates is increased by AT89C51.There will be four switches and each switch specified for one candidate. In voting procedure switch of respective candidate is pressed, the corresponding signal is sensed by the microcontroller. The Microcontroller used here is AT89C51, that senses the signal given from switches and decides the mode of operation in voting mode it increments the data for corresponding switch i.e. respective candidate as well as it sends signal to display block to indicate one switch is pressed. To display the vote count, four seven segment displays are also connected to the microcontroller (refer seven segment interfacing with AT89C51). The count value for each candidate is sent to the corresponding segment. The four counts appear continuously by multiplexing these segments through AT89C51.
Chapter 1 INTRODUCTION
1.1 EMBEDDED SYSTEMS: Embedded systems are electronic devices that incorporate microprocessors with in their implementations. The main purposes of the microprocessors are to simplify the system design and provide flexibility. Having a microprocessor in the device helps in removing the bugs, making modifications, or adding new features are only matter of rewriting the software that controls the device. In other words embedded computer systems are electronic systems that include a microcomputer to perform a specific dedicated application. The computer is hidden inside these products. Embedded systems are ubiquitous. Every week, millions of tiny computer chips come pouring out of factories finding their way into our everyday products. Embedded systems are self-contained programs that are embedded within a piece of hardware. Whereas a regular computer has many different applications and software that can be applied to various tasks, embedded systems are usually set to a specific task that cannot be altered without physically manipulating the circuitry. Another way to think of an embedded system is as a computer system that is created with optimal efficiency, thereby allowing it to complete specific functions as quickly as possible. Embedded systems designers usually have a significant grasp of hardware technologies. They use specific programming languages and software to develop embedded systems and manipulate the equipment. When searching online, companies offer embedded systems development kits and other embedded systems tools for use by engineers and businesses. Embedded system technologies are usually fairly expensive due to the necessary development time and built in efficiencies, but they are also highly valued in specific industries. Smaller businesses may wish to hire a consultant to determine what sort of embedded systems will add value to their organization.
Characteristics:
Two major areas of differences are cost and power consumption. Since many embedded systems are produced in tens of thousands to millions of units range, reducing cost is a major concern. Embedded systems often use a (relatively) slow processor and small memory size to minimize costs. The slowness is not just clock speed. The whole architecture of the computer is often intentionally simplified to lower costs. For example, embedded systems often use peripherals controlled by synchronous serial interfaces, which are ten to hundreds of times slower than comparable peripherals used in PCs. Programs on an embedded system often run with real-time constraints with limited hardware resources: often there is no disk drive, operating system, keyboard or screen. A flash drive may replace rotating media, and a small keypad and LCD screen may be used instead of a PC's keyboard and screen. Firmware is the name for software that is embedded in hardware devices, e.g. in one or more ROM/Flash memory IC chips. Embedded systems are routinely expected to maintain 100% reliability while running continuously for long periods, sometimes measured in years. Firmware is usually developed and tested too much harsher requirements than is general-purpose software, which can usually be easily restarted if problems occur.
Platform:
There are many different CPU architectures used in embedded designs. This in contrast to the desktop computer market which is limited to just a few competing architectures mainly the Intel/AMD x86 and the Apple/Motorola/IBM Power PCs which are used in the Apple Macintosh. One common configuration for embedded systems is the system on a chip, an application-specific integrated circuit, for which the CPU was purchased as intellectual property to add to the IC's design.
Tools:
Like a typical computer programmer, embedded system designers use compilers, assemblers and debuggers to develop an embedded system. Those software tools can come from several sources: Software companies that specialize in the embedded market Ported from the GNU software development tools. Sometimes, 3
development tools for a personal computer can be used if the embedded processor is a close relative to a common PC processor. Embedded system designers also use a few software tools rarely used by typical computer programmers.
Working:
The voting is started by pressing the init switch after which the user is prompted to vote. The count of votes is stored in four different variables. As soon as the user votes for a candidate by pressing one of the switches, the value of the corresponding variable is increased by one .
Like in earlier system, your name is called and you are asked to sign or put
and permits you to vote by pressing the button of the Control Unit of EVM.
You are not given any ballot thereafter, and are sent to the EV Machine
placed behind a card board in a corner. The machine is placed in such a way
that your polled vote will be a secret. On the Balloting Unit of EVM, you press the blue button placed in front of your favourite candidate and release. Some designers keep a utility program to turn data files into code, so that they can include any kind of data in a program. Most designers also have utility programs to add a checksum or CRC to a program, so it can check its program data before executing it. In the recent years, voting equipments which were widely adopted may be divided into five types. (1) Paper-based voting: The voter gets a blank ballot and use a pen or a marker to indicate he want to vote for which candidate. Hand-counted ballots is a time and labor consuming process, but it is easy to manufacture paper ballots and the ballots can be retained for verifying, this type is still the most common way to vote. (2) Lever voting machine: Lever machine is peculiar equipment, and each level is assigned for a corresponding candidate. The voter pulls the level to poll for his favorite candidate. This kind of voting machine can count up the ballots automatically. Because its interface is not user-friendly enough, giving some training to voters is necessary. (3) Direct recording electronic voting machine: This type, which is abbreviated to DRE, integrates with keyboard; touch screen, or buttons for the voter press to poll. Some of them lay in voting records and counting the votes is very quickly. But the other DRE without keep voting records are doubted about its accuracy. (4) Punch card: The voter uses metallic hole-punch to punch a hole on the blank ballot. It can count votes automatically, but if the voters perforation is incomplete, the result is probably determined wrongfully. (5) Optical voting machine: After each voter fills a circle correspond to their favorite candidate on the blank ballot, this machine selects the darkest mark on each ballot for the vote then computes the total result. This kind of machine counts up ballots rapidly. However, if the voter fills over the circle, it will lead to the error result of optical-scan.
3.1 MICROCONTROLLER:
An embedded system is a combination of software and hardware to perform a dedicated task. Some of the main devices used in embedded products are Microprocessors and Microcontrollers. 7
Microprocessors are commonly referred to as general purpose processors as they simply accept the inputs, process it and give the output. In contrast, a microcontroller not only accepts the data as inputs but also manipulates it, interfaces the data with various devices, controls the data and thus finally gives the result. All these tasks are possible with the microcontroller because the microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and timer all on a single chip. This fixed amount of RAM, ROM and number of I/O ports in microcontroller makes them ideal for many applications where cost and space are critical. Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical. The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products. 8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UVEPROM, Flash and NV-RAM. The microcontroller used in this project is AT89C51. Atmel Corporation introduced this 89C51 microcontroller. This microcontroller belongs to 8051 family. This microcontroller had 128 bytes of RAM, 4K bytes of on-chip ROM, two timers, one serial port and four ports (each 8-bits wide) all on a single chip. AT89C51 is Flash type 8051. The present project is implemented on Kiel vision. In order to program the device, preload tool has been used to burn the program onto the microcontroller. The features, pin description of the microcontroller and the software tools used are discussed in the following sections.
3.1.1 Description:
The AT89C51 is a low-voltage, high-performance CMOS 8-bit microcomputer with 4K bytes of Flash programmable memory. The device is manufactured using Atmels high-density non-volatile memory technology and is compatible with the industry-standard MCS-51 instruction set. By combining a versatile 8-bit CPU with Flash on a monolithic chip, AT89C51 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two Software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.
3.1.2 PIN Description: VCC: Pin 40 provides supply voltage to the chip. The voltage source is +5V.
GND: Pin 20 is the ground.
10
Figure 3.4: Oscillator Connections C1, C2 = 30 pF 10 pF for Crystals = 40 pF 10 pF for Ceramic Resonators
11
Reset:
Pin9 is the reset pin. It is an input and is active high. Upon applying a high pulse to this pin, the microcontroller will reset and terminate all the activities. This is often referred to as a power-on reset.
EA (External access):
Pin 31 is EA. It is an active low signal. It is an input pin and must be connected to either Vcc or GND but it cannot be left unconnected. The 8051 family members all come with on-chip ROM to store programs. In such cases, the EA pin is connected to Vcc. If the code is stored on an external ROM, the EA pin must be connected to GND to indicate that the code is stored externally.
PSEN (Program store enable): This is an output pin. ALE (Address latch enable): This is an output pin and is active high. Ports 0, 1, 2 & 3:
The four ports P0, P1, P2 and P3 each use 8 pins, making them 8-bit ports. All the ports upon RESET are configured as input, since P0-P3 have value FFH on them.
Port 0(P0):
Port 0 is also designated as AD0-AD7, allowing it to be used for both address and data. ALE indicates if P0 has address or data. When ALE=0, it provides data D0-D7, but when ALE=1, it has address A0-A7. Therefore, ALE is used for demultiplexing address and data with the help of an internal latch. When there is no external memory connection, the pins of P0 must be connected to a 10K-ohm pull-up resistor. This is due to the fact that P0 is an open drain. With external pull-up resistors connected to P0, it can be used as a simple I/O, just like P1 and P2. But the ports P1, P2 and P3 do not need any pull-up resistors since they already have pullup resistors internally. Upon reset, ports P1, P2 and P3 are configured as input ports.
Port1&Port2:
With no external memory connection, both P1 and P2 are used as simple I/O. With external memory connections, port 2 must be used along with P0 to provide the 16-bit address for the external memory. Port 2 is designated as A8-A15 indicating its dual function. While P0 provides the lower 8 bits via A0-A7, it is the job of P2 to provide bits A8-A15 of the address.
12
Port 3:
Port 3 occupies a total of 8 pins, pins 10 through 17. It can be used as input or output. P3 does not need any pull-up resistors, the same as port 1 and port 2. Port 3 has an additional function of providing some extremely important signals such as interrupts.
Addressing modes:
While operating, processor processes data according to the program instructions. Each instruction consists of two parts. One part describes what should be done and another part indicates what to use to do it. This later part can be data (binary number) or address where the data is stored. All 8051 microcontrollers use two ways of addressing depending on which part of memory should be accessed:
Direct addressing:
On direct addressing, a value is obtained from a memory location while the address of that location is specified in instruction. Only after that, the instruction can process data (how depends on the type of instruction: addition, subtraction, copy). Obviously, a number being changed during operating a variable can reside at that specified address. For example: Since the address is only one byte in size ( the greatest number is 255), this is how only the first 255 locations in RAM can be accessed in this case
13
the first half of the basic RAM is intended to be used freely, while another half is reserved for the SFRs.
Indirect addressing:
On indirect addressing, a register which contains address of another register is specified in the instruction. A value used in operating process resides in that another register. For example: Only RAM locations available for use are accessed by indirect addressing (never in the SFRs). For all latest versions of the microcontrollers with additional memory block (those 128 locations in Data Memory), this is the only way of accessing them. Simply, when during operating, the instruction including @ sign is encountered and if the specified address is higher than 128 (7F hex.), the processor knows that indirect addressing is used and jumps over memory space reserved for the SFRs.
programming mode is compatible with conventional third party Flash or EPROM programmers. The AT89C51 is shipped with either the high-voltage or low-voltage programming mode enabled. The respective top-side marking and device signature codes are listed in the following table.
The AT89C51 code memory array is programmed byte-byte in either programming mode. To program any nonblank byte in the on-chip Flash Memory, the entire memory must be erased using the Chip Erase Mode.
15
major programming vendors offer worldwide support for the Atmel microcontroller series.
16
FEATURES OF AT89C51:
4K Bytes of Re-programmable Flash Memory. RAM is 128 bytes. 2.7V to 6V Operating Range. Fully Static Operation: 0 Hz to 24 MHz Two-level Program Memory Lock. 128 x 8-bit Internal RAM. 32 Programmable I/O Lines. Two 16-bit Timer/Counters. Six Interrupt Sources. Programmable Serial UART Channel.
TRANSFORMER:
Figure 3.8: Basic Diagram of Transformer A transformer consists of two coils also called as WINDINGS namely PRIMARY & SECONDARY. They are linked together through inductively coupled electrical conductors also called as CORE. A changing current in the primary causes a change in the Magnetic Field in the core & this in turn induces an alternating voltage in the secondary coil. If load is applied to the secondary then an alternating current will flow 17
through the load. If we consider an ideal condition then all the energy from the primary circuit will be transferred to the secondary circuit through the magnetic field.
So
The secondary voltage of the transformer depends on the number of turns in the primary as well as in the secondary.
Voltage regulator:
A Voltage regulator is a device which converts varying input voltage into a constant regulated output voltage. Voltage regulator can be of two types 1) Linear Voltage Regulator Also called as Resistive Voltage regulator because they dissipate the excessive voltage resistively as heat. 2) Switching Regulators They regulate the output voltage by switching the Current ON/OFF very rapidly. Since their output is either ON or OFF it dissipates very low power thus achieving higher efficiency as compared to linear voltage regulators. But they are more complex & generate high noise due to their switching action. For low level of output power switching regulators tend to be costly but for higher output wattage they are much cheaper than linear regulators. The most commonly available Linear Positive Voltage Regulators are the 78XX series where the XX indicates the output voltage. And 79XX series is for Negative Voltage Regulators.
18
After filtering the rectifier output the signal is given to a voltage regulator. The maximum input voltage that can be applied at the input is 35V.Normally there is a 2-3 Volts drop across the regulator so the input voltage should be at least 2-3 Volts higher than the output voltage. If the input voltage gets below the Vmin of the regulator due to the ripple voltage or due to any other reason the voltage regulator will not be able to produce the correct regulated voltage.
IC 7805:
7805 is an integrated three-terminal positive fixed linear voltage regulator. It supports an input voltage of 10 volts to 35 volts and output voltage of 5 volts. It has a current rating of 1 amp although lower current models are available. Its output voltage is fixed at 5.0V. The 7805 also has a built-in current limiter as a safety feature. 7805 is manufactured by many companies, including National Semiconductors and Fairchild Semiconductors. The 7805 will automatically reduce output current if it gets too hot. The last two digits represent the voltage; for instance, the 7812 is a 12-volt regulator. The 78xx series of regulators is designed to work in complement with the 79xx series of negative voltage regulators in systems that provide both positive and negative regulated voltages, since the 78xx series can't regulate negative voltages in such a system. The 7805 & 78 is one of the most common and well-known of the 78xx series regulators, as it's small component count and medium-power regulated 5V make it useful for powering TTL devices.
19
Table 3.6. Specifications of IC7805 SPECIFICATIONS Vout Vein - Vout Difference Operation Ambient Temp Output Imax IC 7805 5V 5V - 20V 0 - 125C 1A
Description:
The 14.2 mm (0.56 inch) LED seven segment displays are designed for viewing distances up to 7 meters (23feet). These devices use an industry standard size package and pin out. Both the numeric and 1 overflow devices feature a right hand decimal point. All devices are available as either common anode or common cathode. These displays are ideal for most applications. Pin for pin equivalent displays are also available in a low current design. The low current displays are ideal for
20
portable applications. For additional information see the Low Current Seven Segment Displays data sheet.
21
22
23
24
25
26
Able to play any Wave file when finished programming. Built in automated version checker - helps ensure you always have the latest version. Powerful, flexible Just in Time Code feature. Write your own JIT Modules to generate last minute code for programming. Uses include: 1. Serial number generation 2. Copy protection and copy authorization 3. Storing program date and time - manufacture date 4. Storing program operator and location 5. Lookup table generation 6. Language tables or language selection 7. Centralized record keeping Obtaining latest firmware from the Corporate Web site or project intranet
4.6.2 Requirements:
Flash Magic works on any versions of Windows, except Windows 95. 10Mb of disk space is required. As mentioned earlier, we are automating two different routines in our project and hence we used the method of polling to continuously monitor those tasks and act accordingly.
28
Chapter 5 RESULTS
This chapter shows the different snap shots of Electronic Voting Machine. The following figure shows the various components used to design Electronic voting Machine.
Figure 5.1: Working of Electronic Voting Machine The following figure shows the seven segments used in EVM and also displays the count corresponding to each candidate.
29
AT89C51 microcontroller was used in this project, various components used to design microcontroller board is shown in below diagram.
As per the objective of project, this EVM was designed for four candidaites and the procedure for polling to each candidate is depending on switches. The following snapshot shows the above procedure.
30
The following snap shot shows the interfacing between switches and microcontroller.
31
APPLICATIONS
Fast track voting which could be used in small scale elections, like resident welfare association, panchayat level election and other society level elections. It could also be used to conduct opinion polls during annual share holders meeting. It could also be used to conduct general assembly elections where number of candidates are less than or equal to eight in the current situation.
32
CONCLUSION
The project Electronic Voting Machine has been successfully designed and tested. Integrating features of all the hardware components used have developed it. Presence of every module has been reasoned out and placed carefully thus contributing to the best working of the unit. Secondly, using highly advanced ICs and with the help of growing technology the project has been successfully implemented.
33
BIBILOGRAPHY
The 8051 Microcontroller and Embedded System, MUHAMMAD ALI MAZIDI & JANICE GILLESPIE MAZIDI. Electronic Devices and circuits, JACOB MILLIMAN & CHRISTO C HALKIAS. Embedded Systems, RAJKAMAL www.atmel.com www.microcontroller.com www.wiley.com www.wikipedia.com
34