We use cookies to give you the best experience possible. By continuing we’ll assume you’re on board with our cookie policy

See Pricing

What's Your Topic?

Hire a Professional Writer Now

The input space is limited by 250 symbols

What's Your Deadline?

Choose 3 Hours or More.
Back
2/4 steps

How Many Pages?

Back
3/4 steps

Sign Up and See Pricing

"You must agree to out terms of services and privacy policy"
Back
Get Offer

Electronic Voting Machine Using 8051 Microcontroller

Hire a Professional Writer Now

The input space is limited by 250 symbols

Deadline:2 days left
"You must agree to out terms of services and privacy policy"
Write my paper

GOKARAJU RANGARAJU INSTITUTE OF ENGINEERING AND TECHNOLOGY Hyderabad, Andhra Pradesh. DEPARTMENT OF ELECTRICAL & ELECTRONICS ENGINEERING ELECTRONIC VOTING MACHINE USING 8051 MICROCONTROLLER By: G. CHAKRADHAR REDDY (07241A0263) R S R GAUTAM (07241A0268) P. KIRAN KUMAR REDDY (07241A0274) B. NAGA TULASI RAM (07241A0280) 1 List of Contents Abstract 1. Background 2. Microcontroller 2. 1 Introduction 2. 2 History 2. 3 Definition of a Microcontroller 2. 4 Microcontrollers vs Microprocessors 2. 5 Memory Unit 2. 6 Central Processing Unit 2. 7 Bus 2. 8 Input Output Unit 2. Serial Communication 2. 10 Timer Unit 2. 11 Watch Dog 2. 12 Analog to Digital Converter 3. Introduction to 16X2 LCD Display 3. 1 Pin description 3.

2 DDRAM – Display Data RAM 3. 3 BF – Busy Flag 3. 4 Instruction Register (IR) and Data Register (DR) 3. 5 Commands and Instruction set 3. 6 Sending Commands to LCD 4. Project Description 4. 1 Block diagram 4. 2 General working 4. 3 C language code 5. Project Methodology 5. 1 Components 5. 1(a) Ballot unit 5. 1(b) Control unit 5. 2 Software used 5. 3 Equipments used 5. 4 Procedure of building the EVM 5. Using the Electronic Voting Machine 5. 6 Hardware schematic 4 5 10 10 10 12 13 14 15 16 16 16 17 18 19 23 23 24 24 24 24 24 25 25 26 30 34 34 34 34 34 34 35 35 37 2 6. Result and Conclusion 7. Applications 8. Future Scope 9. References and Bibliography 38 39 40 41 3 ABSTRACT India is world’s largest democracy. It is perceived to be charismatic one as it accommodates cultural, regional, economical, social disparities and still is able to stand on its own.

Don't use plagiarized sources. Get Your Custom Essay on
Electronic Voting Machine Using 8051 Microcontroller
Just from $13,9/Page
Get custom paper

Fundamental right to vote or simply voting in elections forms the basis of Indian democracy.

In India all earlier elections be it state elections or centre elections a voter used to cast his/her vote to his/her favorite candidate by putting the stamp against his/her name and then folding the ballot paper as per a prescribed method before putting it in the Ballot box. This is a long, time-consuming process and very much prone to errors. This situation continued till election scene was completely changed by electronic voting machine. No more ballot paper, ballot boxes, stamping, etc. all this condensed into a simple box called ballot unit of the electronic voting machine.

EVM is capable of saving considerable printing stationery and transport of large volumes of electoral material. It is easy to transport, store, and maintain. It completely rules out the chance of invalid votes. Its use results in reduction of polling time, resulting in fewer problems in electoral preparations, law and order, candidates expenditure, etc. and easy and accurate counting without any mischief at the counting centre. It is also eco friendly. Our EVM consists of one microcontroller AT89S52. The unit consists of one LCD, 6 push buttons, couple of switches, an LED and a buzzer, etc.

The port 0 of microcontroller is used for interfacing the led, port 2 is used for control switches, port 3 is used for interfacing push buttons for voting. This project is based on C language programming. The software platform used in this project is Keil uVision3 and PROTEUS. 4 1. BACKGROUND Democracy and Voting Democracy has come to be accepted as the most preferred form of political system all over the world. However, the success of a democratic structure is to be judged by the successes that can be solely attributed to this system. There are various challenges before democracy.

These are foundational challenges, challenge of expansion and deepening of democracy. All of these are dependent on how the democracy is perceived by people who form the government, participate in formation of government and are benefited by it. As we all know that India is world’s largest democracy. It is perceived to be charismatic one as it accommodates cultural, regional, economical, social disparities and still is able to stand on its own. India follows a federal form of government. It means that governance power is not residing with one authority, but is distributed at various levels.

In India power is distributed between states and central authority. What forms the basis of such vast and complex system of governance? One needs not to be an Einstein to guess the answer. It is fundamental right to vote or simply voting in elections. Indian constitution provide every adult above the age of 18 years irrespective of his/her religion, region, caste, creed, color, economic status, education and sex the essential right to vote and elect her/his candidate to represent her/him. Hence voting can be termed as backbone of not just democracy in India but all around the world.

Voting can be done in various ways. In early Roman Empire voting used to be done by raising hands in favor or against. In board rooms voting is done in similar way, some write their vote down, some choose to speak, some choose to cast vote using latest technology. Voting Techniques In India all earlier elections be it state elections or centre elections a voter used to cast his/her vote to his/her favorite candidate by putting the stamp against his/her name and then folding the ballot paper as per a prescribed method before putting it in the Ballot box.

This is a long, time-consuming process and very much prone to errors. This method wanted voters to be skilled voters to know how to put a stamp, and methodical folding of ballot paper. Millions of paper would be printed and heavy ballot boxes would be loaded and unloaded to and from ballot office to polling station. All this continued till election scene was completely changed by electronic voting machine. No 5 more ballot paper, ballot boxes, stamping, etc. all this condensed into a simple box called ballot unit of the electronic voting machine.

The marking system of voting was introduced in 1962 to make it possible for a substantial number of illiterate voters to indicate easily their preferences in choosing their representatives. Over the years, there was a pronounced increase in the volume of work: crores of ballot papers had to be printed and lakhs of ballot boxes had to be prepared, transported, and kept in storage; and a great amount of time was taken up by the conduct of elections. To overcome these difficulties, the Election Commission of India (ECI) thought of electronic gadgets.

The Electronics Corporation of India Ltd. (ECIL), Hyderabad, and Bharat Electronics Ltd. (BEL), Bangalore, developed the electronic voting machine in 1981. The Electronic Voting Machine The complete EVM consists mainly of two units – (a) Control Unit and (b) Balloting Unit with cable for connecting it with Control unit. A Balloting Unit caters upto 16 candidates. Four Balloting Units linked together catering in all to 64 candidates can be used with one control unit. The control unit is kept with the Presiding Officer and the Balloting Unit is used by the voter for polling.

The Balloting Unit of EVM is a small Box-like device, on top of which each candidate and his/her election symbol is listed like a big ballot paper. Against each candidate’s name, a red LED and a blue button is provided. The voter polls his vote by pressing the blue button against the name of his desired candidate. How the Vote is cast with this EVM? The entire process is very easy to understand: • • • • • • Like in earlier system, your name is called and you are asked to sign or put your thumb impression in a register. After your identification is done by Election Officer, an ink mark is put on your finger, same as earlier.

Then the Election Officer gives you a slip that bears the Voter register number where you signed or put your thumb impression. You hand over this slip to the presiding officer who confirms the serial number 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 button placed in front of your favorite candidate and release. • • • • As soon as the button is pressed, the LED indicator lights off and a whistle sound comes from the machine. This signifies that your vote has been casted rightly. Now you can come out. In case of LED not not being turned off, press the button firmly again. If finding it difficult, consult the Presiding Officer. Your vote is complete safe and secret and there is no room for error as well. You can rest assured that your vote is not going to be invalid in any case. The Voting Machine is attached to the ‘Control Unit’.

When the user presses the button, his vote is registered in the control unit and the number of votes for the respective candidates is calculated automatically. . Booth Capture A remarkable advantage is that rigging is not possible with the EVMs. In the ballot paper system, the intruders can mark hundreds of ballots and put them into the ballot box in a matter of a few minutes. This is not possible in voting machines as the machine is designed to cast only one vote and for the next vote to be casted the presiding officer should make it ready by pressing the related button.

Thus the presiding officer can have a complete control of voting and avoid any kind of malpractices The EVMs have following advantages: • the saving of considerable printing stationery and transport of large volumes of electoral material, • easy transportation, storage, and maintenance, • no invalid votes, • reduction in polling time, resulting in fewer problems in electoral preparations, law and order, candidates’ expenditure, etc. and • easy and accurate counting without any mischief at the counting centre • eco friendly. 7 Compare and Contrast: Paper Voting and EVM We have so far discussed three different voting systems.

These systems are being used or considered obsolete because of certain positive and negative points. These are summarized as follows: Device type Ballot paper EVM : Papers and boxes : Embedded system with Assembly code Visual Output Ballot paper EVM : Stamp on paper : Single LED against each candidate’s name Operating System/ Software Ballot paper : No operating system EVM : None, the Assembly code to register number of votes is all it has Hence it is simple automation of voting, no complexities. Records/ Audits Ballot paper EVM : Manual counting to be done by officials, lengthy, time consuming Process. Inaccurate due to human errors. The Voting unit doesn’t store anything, the control unit records the number of votes cast for each candidate against his serial number. No record to link person-to-vote. Control and Operation Ballot paper : Manual operation EVM : Automatic operation. The control Unit accumulates the votes, it is a device with flash storage and seven segment LED displays. The ballot unit has a button to issue a ballot for a voter. Security Issues Ballot paper EVM : No security provided by the system, neither during polling nor during voting. : During polling, a facility is provided to seal the machine in case of booth capturing.

No further voting can be done afterwards. 8 Ballot Issue Ballot paper EVM : Ballot paper is issued by Electoral officer on which voter could cast his vote. : Ballot is issued by Electoral officer by pressing a button on the control Unit. It allows the voter to press any button on the ballot unit to cast his vote. Storage of Votes Ballot paper EVM : In ballot boxes assigned for the purpose of storing votes, highly insecure method of storage. : In Internal Non removable memory of the Control Units. No transfer over network. Security increases with this feature.

Moreover these results cant be accessed by authorized personnel only at commissioned offices.. Cost of the System Ballot paper : High cost of paper printing in millions and low speed of the whole process. EVM : About 12000 INR (300$) for one EVM. Power Supply Ballot paper EVM : No power supply required. : 6V alkaline batteries or electricity. Capacity Ballot paper EVM : As much a ballot box can hold. : 3840 Votes . Existing System But this electronic voting machine has its disadvantages too. These areas of deficiency are not much of a concern to a layman, but for an intelligent voter this must be eliminated for a secure election.

The few technical disadvantages are given as: • Microprocessor based design, which requires a no. of supporting components like memory, peripheral interface, etc. • No security against illegal viewing of results, as presiding officer can view the results without any difficulty. • Less user friendly due to two seven segment displays • Existing system costs high. 9 Proposed System All these faults motivated us to make this new enhanced EVM. The faults which are eliminated are summarized as follows: • Microcontroller replaced microprocessor, which made the EVM closer to real time operation making it faster, more reliable and unique. More user friendly and interactive LCD display • Proposed system costs less. • 2. MICROCONTROLLERS 2. 1 Introduction Circumstances that we find ourselves in today in the field of microcontrollers had their beginnings in the development of technology of integrated circuits. This development has made it possible to store hundreds of thousands of transistors into one chip. That was a prerequisite for production of microprocessors, and the first computers were made by adding external peripherals such as memory, input-output lines, timers and other.

Further increasing of the volume of the package resulted in creation of integrated circuits. These integrated circuits contained both processor and peripherals. That is how the first chip containing a microcomputer, or what would later be known as a microcontroller came about. 2. 2 History It was year 1969, and a team of Japanese engineers from the BUSICOM Company arrived to United States with a request that a few integrated circuits for calculators be made using their projects. The proposition was set to INTEL, and Marcian Hoff was responsible for the project.

Since he was the one who has had experience in working with a computer (PC) PDP8, it occurred to him to suggest a fundamentally different solution instead of the suggested construction. This solution presumed that the function of the integrated circuit is determined by a program stored in it. That meant that configuration would be simpler, but that it would require far more memory than the project that was proposed by Japanese engineers would require. After a while, though Japanese engineers tried finding an easier solution, Marcian’s idea won, and the first microprocessor was born.

In transforming an idea into a ready made product, Frederico Faggin was a major help to INTEL. He transferred to INTEL, and in only 9 months had succeeded in making a product from its first conception. INTEL obtained the rights to sell this integral block in 1971. First, they bought the license from the BUSICOM Company who had no idea what treasure they had. During that year, there appeared on the market a microprocessor called 4004. That was the first 4-bit microprocessor with the speed of 6 000 operations per 10 second.

Not long after that, American company CTC requested from INTEL and Texas Instruments to make an 8-bit microprocessor for use in terminals. Even though CTC gave up this idea in the end, Intel and Texas Instruments kept working on the microprocessor and in April of 1972, first 8-bit microprocessor appeared on the market under a name 8008. It was able to address 16Kb of memory, and it had 45 instructions and the speed of 300 000 operations per second. That microprocessor was the predecessor of all today’s microprocessors.

Intel kept their developments up in April of 1974, and they put on the market the 8-bit processor under a name 8080 which was able to address 64Kb of memory, and which had 75 instructions, and the price began at $360. In another American company Motorola, they realized quickly what was happening, so they put out on the market an 8-bit microprocessor 6800. Chief constructor was Chuck Peddle, and along with the processor itself, Motorola was the first company to make other peripherals such as 6820 and 6850.

At that time many companies recognized greater importance of microprocessors and began their own developments. Chuck Peddle leaved Motorola to join MOS Technology and kept working intensively on developing microprocessors. At the WESCON exhibit in United States in 1975, a critical event took place in the history of microprocessors. The MOS Technology announced it was marketing microprocessors 6501 and 6502 at $25 each, which buyers could purchase immediately. This was so sensational that many thought it was some kind of a scam, considering that competitors were selling 8080 and 6800 at $179 each.

As an answer to its competitor, both Intel and Motorola lowered their prices on the first day of the exhibit down to $69. 95 per microprocessor. Motorola quickly brought suit against MOS Technology and Chuck Peddle for copying the protected 6800. MOS Technology stopped making 6501, but kept producing 6502. The 6502 was an 8-bit microprocessor with 56 instructions and a capability of directly addressing 64Kb of memory. Due to low cost, 6502 becomes very popular, so it was installed into computers such as: KIM-1, Apple I, Apple II, Atari, Commodore, Acorn, Oric, Galeb, Orao, Ultra, and many others.

Soon appeared several makers of 6502 (Rockwell, Sznertek, GTE, NCR, Ricoh, and Comodore takes over MOS Technology) which was at the time of its prosperity sold at rate of 15 million processors a year! Others were not giving up though. Frederico Faggin leaves Intel, and starts his own Zilog Inc. In 1976 Zilog announced the Z80. During the making of this microprocessor, Faggin made a pivotal decision. Knowing that a great deal of programs have been already developed for 8080, Faggin realized that many would stay faithful to that microprocessor because of great expenditure which redoing of all of the programs would result in.

Thus he decided that a new processor had to be compatible with 8080, or that it had to be capable of performing all of the programs which had already been written for 8080. Beside these characteristics, many new ones have been added, so that Z80 was a very powerful microprocessor in its time. It was able to address directly 64 Kb of memory, it had 176 instructions, a large number of registers, a built in option for refreshing the dynamic RAM memory, single-supply, greater speed of work etc. Z80 was a great success and everybody converted from 8080 to Z80.

It could be said that Z80 was 11 without a doubt commercially most successful 8-bit microprocessor of that time. Besides Zilog, other new manufacturers like Mostek, NEC, SHARP, and SGS also appeared. Z80 was the heart of many computers like Spectrum, Partner, TRS703, Z-3. In 1976, Intel came up with an improved version of 8-bit microprocessor named 8085. However, Z80 was so much better that Intel soon lost the battle. Although a few more processors appeared on the market (6809, 2650, SC/MP etc. ), everything was actually already decided.

There weren’t any more great improvements to make manufacturers convert to something new, so 6502 and Z80 along with 6800 remained as main representatives of the 8-bit microprocessors of that time. 2. 3 Definition of a Microcontroller Microcontroller, as the name suggests, are small controllers. They are like single chip computers that are often embedded into other systems to function as processing/controlling unit. For example, the remote control you are using probably has microcontrollers inside that do decoding and other controlling functions. They are also used in automobiles, washing machines, microwave ovens, toys … etc, where utomation is needed. The key features of microcontrollers include: • • • • High Integration of Functionality Microcontrollers sometimes are called single-chip computers because they have on-chip memory and I/O circuitry and other circuitries that enable them to function as small standalone computers without other supporting circuitry. Field Programmability, Flexibility Microcontrollers often use EEPROM or EPROM as their storage device to allow field programmability so they are flexible to use. Once the program is tested to be correct then large quantities of microcontrollers can be programmed to be used in embedded systems.

Easy to Use Assembly language is often used in microcontrollers and since they usually follow RISC architecture, the instruction set is small. The development package of microcontrollers often includes an assembler, a simulator, a programmer to “burn” the chip and a demonstration board. Some packages include a high level language compiler such as a C compiler and more sophisticated libraries. Most microcontrollers will also combine other devices such as: • • • A Timer module to allow the microcontroller to perform tasks for certain time periods.

A serial I/O port to allow data to flow between the microcontroller and other devices such as a PC or another microcontroller. 12 • An ADC to allow the microcontroller to accept analogue input data for processing. Figure 2. 1: Showing a typical microcontroller device and its different subunits The heart of the microcontroller is the CPU core. In the past this has traditionally been based on an 8-bit microprocessor unit. 2. 4 Microcontrollers versus Microprocessors Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality.

In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, we save the time and space needed to construct devices. 13 2. 5 Memory unit Memory is part of the microcontroller whose function is to store data. The easiest way to explain it is to describe it as one big closet with lots of drawers.

If we suppose that we marked the drawers in such a way that they can not be confused, any of their contents will then be easily accessible. It is enough to know the designation of the drawer and so its contents will be known to us for sure. Figure2. 2: Simplified model of a memory unit Memory components are exactly like that. For a certain input we get the contents of a certain addressed memory location and that’s all. Two new concepts are brought to us: addressing and memory location. Memory consists of all memory locations, and addressing is nothing but selecting one of them.

This means that we need to select the desired memory location on one hand, and on the other hand we need to wait for the contents of that location. Besides reading from a memory location, memory must also provide for writing onto it. This is done by supplying an additional line called control line. We will designate this line as R/W (read/write). Control line is used in the following way: if r/w=1, reading is done, and if opposite is true then writing is done on the memory location. Memory is the first element, and we need a few operation of our microcontroller.

The amount of memory contained within a microcontroller varies between different microcontrollers. Some may not even have any integrated memory (e. g. Hitachi 6503, 14 now discontinued). However, most modern microcontrollers will have integrated memory. The memory will be divided up into ROM and RAM, with typically more ROM than RAM. Typically, the amount of ROM type memory will vary between around 512 bytes and 4096 bytes, although some 16 bit microcontrollers such as the Hitachi H8/3048 can have as much as 128 Kbytes of ROM type memory. ROM type memory, as has already been mentioned, is used to store the program code.

ROM memory can be ROM (as in One Time Programmable memory), EPROM, or EEPROM. The amount of RAM memory is usually somewhat smaller, typically ranging between 25 bytes to 4 Kbytes. RAM is used for data storage and stack management tasks. It is also used for register stacks (as in the microchip PIC range of microcontrollers). 2. 6 Central Processing Unit Let add 3 more memory locations to a specific block that will have a built in capability to multiply, divide, subtract, and move its contents from one memory location onto another. The part we just added in is called “central processing unit” (CPU).

Its memory locations are called registers. Figure2. 3: Simplified central processing unit with three registers Registers are therefore memory locations whose role is to help with performing various mathematical operations or any other operations with data wherever data can be found. Look at the current situation. We have two independent entities (memory and CPU) 15 which are interconnected, and thus any exchange of data is hindered, as well as its functionality. If, for example, we wish to add the contents of two memory locations and return the result again back to memory, we would need a connection between memory and CPU.

Simply stated, we must have some “way” through data goes from one block to another. 2. 7 Bus That “way” is called “bus”. Physically, it represents a group of 8, 16, or more wires. There are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the microcontroller. Figure2. : Showing connection between memory and central unit using buses As far as functionality, the situation has improved, but a new problem has also appeared: we have a unit that’s capable of working by itself, but which does not have any contact with the outside world, or with us! In order to remove this deficiency, let’s add a block which contains several memory locations whose one end is connected to the data bus, and the other has connection with the output lines on the microcontroller which can be seen as pins on the electronic component. 16 2. 8 Input-output unit Those locations we’ve just added are called “ports”.

There are several types of ports: input, output or bidirectional ports. When working with ports, first of all it is necessary to choose which port we need to work with, and then to send data to, or take it from the port. Figure2. 5: Simplified input-output unit communicating with external world When working with it the port acts like a memory location. Something is simply being written into or read from it, and it could be noticed on the pins of the microcontroller. 2. 9 Serial communication Beside stated above we’ve added to the already existing unit the possibility of communication with an outside world.

However, this way of communicating has its drawbacks. One of the basic drawbacks is the number of lines which need to be used in order to transfer data. What if it is being transferred to a distance of several kilometers? The number of lines times’ number of kilometers doesn’t promise the economy of the project. It leaves us having to reduce the number of lines in such a way that we don’t lessen its functionality. Suppose we are working with three lines only, and that one line is used for sending data, other for receiving, and the third one is used as a reference line for both the input and the output side.

In order for this to work, we need to set the rules of exchange of data. These rules are called protocol. Protocol is therefore defined in advance so there wouldn’t be any misunderstanding between the sides that are communicating with each other. For example, if one man is speaking in French, and the other in English, it is highly unlikely that they will quickly and effectively understand each other. Let’s suppose we have the following protocol. The logical unit “1” is set up on the transmitting line until transfer begins.

Once the transfer starts, we lower the transmission line to logical “0” for a period of time (which we will designate as T), so the 17 receiving side will know that it is receiving data, and so it will activate its mechanism for reception. Let’s go back now to the transmission side and start putting logic zeros and ones onto the transmitter line in the order from a bit of the lowest value to a bit of the highest value. Let each bit stay on line for a time period which is equal to T, and in the end, or after the 8th bit, let us bring the logical unit “1” back on the line which will mark the end of the transmission of one data.

The protocol we’ve just described is called in professional literature NRZ (Non-Return to Zero). Figure2. 6: Serial unit sending data through three lines only As we have separate lines for receiving and sending, it is possible to receive and send data (info. ) at the same time. So called full-duplex mode block which enables this way of communication is called a serial communication block. Unlike the parallel transmission, data moves here bit by bit, or in a series of bits what defines the term serial communication comes from.

After the reception of data we need to read it from the receiving location and store it in memory as opposed to sending where the process is reversed. Data goes from memory through the bus to the sending location, and then to the receiving unit according to the protocol. 18 2. 10 Timer unit Since we have the serial communication explained, we can receive, send and process data. Figure2. 7: Timer unit generating signals in regular time intervals However, in order to utilize it in industry we need a few additionally blocks.

One of those is the timer block which is significant to us because it can give us information about time, duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a register whose numeric value increments by one in even intervals, so that by taking its value during periods T1 and T2 and on the basis of their difference we can determine how much time has elapsed. This is a very important part of the microcontroller whose understanding requires most of our time. 2. 11 Watchdog One more thing is requiring our attention is a flawless functioning of the microcontroller during its run-time.

Suppose that as a result of some interference (which often does occur in industry) our microcontroller stops executing the program, or worse, it starts working incorrectly. Figure2. 8: Watchdog Of course, when this happens with a computer, we simply reset it and it will keep working. However, there is no reset button we can push on the microcontroller and thus solve our problem. To overcome this obstacle, we need to introduce one more block called watchdog. This block is in fact another free-run counter where our program needs to write a zero in every time it executes correctly.

In case that program gets “stuck”, zero will not be written in, and counter alone will reset the microcontroller upon achieving its maximum value. This will result in executing the program again, and correctly this time 19 around. That is an important element of every program to be reliable without man’s supervision. 2. 12 Analog to Digital Converter As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one), they have to be converted into a pattern which can be comprehended by a microcontroller.

This task is performed by a block for analog to digital conversion or by an ADC. This block is responsible for converting an information about some analog value to a binary number and for follow it through to a CPU block so that CPU block can further process it. Figure2. 9: Block for converting an analog input to digital output Finally, the microcontroller is now completed, and all we need to do now is to assemble it into an electronic component where it will access inner blocks through the outside pins.

The picture below shows what a microcontroller looks like inside. Figure2. 10: Physical configuration of the interior of a microcontroller Thin lines which lead from the center towards the sides of the microcontroller represent wires connecting inner blocks with the pins on the housing of the microcontroller so called bonding lines. Chart on the following page represents the center section of a microcontroller. 20 Figure2. 11: Microcontroller outline with basic elements and internal connections For a real application, a microcontroller alone is not enough.

Beside a microcontroller, we need a program that would be executed, and a few more elements which make up interface logic towards the elements of regulation (which will be discussed in later chapters). The microcontroller used for this project is AT89S52. This microcontroller is discussed in the following units. 21 2. 13 AT89S52 microcontroller: The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pinout.

The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip, the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. 22 3. INTRODUCTION TO 16X2 LCD DISPLAY LCD stands for Liquid Crystal Display. The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have only 1 controller and support at most of 80 characters. . 1 Pin Description Most LCDs with two controllers has 16 Pins. Pin description is shown in the table below. Pin No. Pin no. 1 Pin no. 2 Pin no. 3 Pin no. 4 Pin no. 5 Pin no. 6 Pin no. 7 Pin no. 8 Pin no. 9 Name Description D7 D6 D5 D4 D3 D2 D1 D0 EN1 Data bus line 7 (MSB) Data bus line 6 Data bus line 5 Data bus line 4 Data bus line 3 Data bus line 2 Data bus line 1 Data bus line 0 (LSB) Enable signal for row 0 and 1 (1stcontroller) 0 = Write to LCD module 1 = Read from LCD module 0 = Instruction input 1 = Data input Pin no. 10 R/W Pin no. 11 RS Pin no. 12 VEE Contrast adjust Pin no. 3 VSS Pin no. 15 EN2 Pin no. 16 NC Power supply (GND) Enable signal for row 2 and 3 (2ndcontroller) Not Connected Pin no. 14 VCC Power supply (+5V) Table No. 3. 1: Pin description of the LCD 23 3. 2 DDRAM – Display Data RAM Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever you send on the DDRAM is actually displayed on the LCD. 3. 3 BF – Busy Flag Busy Flag is a status indicator flag for LCD.

When we send a command or data to the LCD for processing, this flag is set (i. e. BF =1) and as soon as the instruction is executed successfully this flag is cleared (BF = 0). This is helpful in producing and exact amount of delay. For the LCD processing. To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy and will not accept next command or data and BF = 0 means LCD is ready for the next command or data to process. 3. 4 Instruction Register (IR) and Data Register (DR) There are two 8-bit registers controller Instruction and Data register.

Instruction register corresponds to the register where you send commands to LCD e. g. LCD shift command, LCD clear, LCD address etc. and Data register is used for storing data which is to be displayed on LCD. When send the enable signal of the LCD is asserted, the data on the pins is latched in to the data register and data is then moved automatically to the DDRAM and hence is displayed on the LCD. 3. 5 Commands and Instruction set Only the instruction register (IR) and the data register (DR) of the LCD can be controlled by the MCU.

Before starting the internal operation of the LCD, control information is temporarily stored into these registers to allow interfacing with various MCUs, which operate at different speeds, or various peripheral control devices. The internal operation of the LCD is determined by signals sent from the MCU. 3. 6 Sending Commands to LCD To send commands we simply need to select the command register. Everything is same as we have done in the initialization routine. But we will summarize the common steps and put them in a single subroutine. Following are the steps: • Move data to LCD port 24 • • • •

Select command register Select write operation Send enable signal Wait for LCD to process the command 4. PROJECT DESCRIPTION 4. 1 Block Diagram: R3(1) LCD? LM016L Congress D1 LED-GREEN VSS VDD VEE RS R W E 4 5 6 R3 R2 1k R1 1k U1 19 XTAL1 P0. 0/AD0 P0. 1/AD1 P0. 2/AD2 P0. 3/AD3 P0. 4/AD4 P0. 5/AD5 P0. 6/AD6 P0. 7/AD7 P2. 0/A8 P2. 1/A9 P2. 2/A10 P2. 3/A11 P2. 4/A12 P2. 5/A13 P2. 6/A14 P2. 7/A15 P3. 0/RXD P3. 1/TXD P3. 2/INT0 P3. 3/INT1 P3. 4/T 0 P3. 5/T 1 P3. 6/WR P3. 7/RD 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 CP(M&I) (1) 18 XTAL2 9 RST TDP 29 30 31 PSEN ALE EA

PRP 1 2 3 4 5 6 7 8 P1. 0 P1. 1 P1. 2 P1. 3 P1. 4 P1. 5 P1. 6 P1. 7 AT89C51 BUZ? (NO) BUZZER RL? 5V D? LED-GREEN RL? (COM) 25 7 8 9 10 11 12 13 14 1 2 3 BJP 1k D0 D1 D2 D3 D4 D5 D6 D7 4. 2 General Working: 1. Initially when the switch is closed, allows the evm to take the vote. The vote is taken only when push button is pressed and the led D1 is switched ON. R3(1) LCD? LM016L Congress D1 LED-GREEN VSS VDD VEE RS R W E 4 5 6 R3 R2 1k R1 1k U1 19 XTAL1 P0. 0/AD0 P0. 1/AD1 P0. 2/AD2 P0. 3/AD3 P0. 4/AD4 P0. 5/AD5 P0. 6/AD6 P0. 7/AD7 P2. 0/A8 P2. 1/A9 P2. 2/A10 P2. 3/A11 P2. 4/A12 P2. 5/A13 P2. /A14 P2. 7/A15 P3. 0/RXD P3. 1/TXD P3. 2/INT0 P3. 3/INT1 P3. 4/T 0 P3. 5/T 1 P3. 6/WR P3. 7/RD 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 CP(M&I) (1) 18 XTAL2 9 RST TDP 29 30 31 PSEN ALE EA PRP 1 2 3 4 5 6 7 8 P1. 0 P1. 1 P1. 2 P1. 3 P1. 4 P1. 5 P1. 6 P1. 7 AT89C51 BUZ? (NO) BUZZER RL? 5V D? LED-GREEN RL? (COM) 26 7 8 9 10 11 12 13 14 1 2 3 BJP 1k D0 D1 D2 D3 D4 D5 D6 D7 2. A push button is assigned to each party. When the push button of the desired party is pressed,the led is switched off which indicates that the vote is cast and the buzzer gives a beep.

R3(1) LCD? LM016L Congress D1 LED-GREEN VSS VDD VEE RS R W E 4 5 6 R3 R2 1k R1 1k U1 19 XTAL1 P0. 0/AD0 P0. 1/AD1 P0. 2/AD2 P0. 3/AD3 P0. 4/AD4 P0. 5/AD5 P0. 6/AD6 P0. 7/AD7 P2. 0/A8 P2. 1/A9 P2. 2/A10 P2. 3/A11 P2. 4/A12 P2. 5/A13 P2. 6/A14 P2. 7/A15 P3. 0/RXD P3. 1/TXD P3. 2/INT0 P3. 3/INT1 P3. 4/T 0 P3. 5/T 1 P3. 6/WR P3. 7/RD 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 CP(M&I) (1) 18 XTAL2 9 RST TDP 29 30 31 PSEN ALE EA PRP 1 2 3 4 5 6 7 8 P1. 0 P1. 1 P1. 2 P1. 3 P1. 4 P1. 5 P1. 6 P1. 7 AT89C51 BUZ? (NO) BUZZER RL? 5V D? LED-GREEN RL? (COM)

Again the push button is pressed so that the evm is ready to take the next vote which is indicated through the led D1. The same process is repeated until all the voters cast their votes. 27 7 8 9 10 11 12 13 14 1 2 3 BJP 1k D0 D1 D2 D3 D4 D5 D6 D7 3. To view the results of each respective party, the switch must be opened. R3(1) LCD? LM016L Congress D1 LED-GREEN VSS VDD VEE RS R W E 4 5 6 R3 R2 1k R1 1k U1 19 XTAL1 P0. 0/AD0 P0. 1/AD1 P0. 2/AD2 P0. 3/AD3 P0. 4/AD4 P0. 5/AD5 P0. 6/AD6 P0. 7/AD7 P2. 0/A8 P2. 1/A9 P2. 2/A10 P2. 3/A11 P2. 4/A12 P2. 5/A13 P2. 6/A14 P2. 7/A15 P3. 0/RXD P3. 1/TXD P3. /INT0 P3. 3/INT1 P3. 4/T 0 P3. 5/T 1 P3. 6/WR P3. 7/RD 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 CP(M&I) (1) 18 XTAL2 9 RST TDP 29 30 31 PSEN ALE EA PRP 1 2 3 4 5 6 7 8 P1. 0 P1. 1 P1. 2 P1. 3 P1. 4 P1. 5 P1. 6 P1. 7 AT89C51 BUZ? (NO) BUZZER RL? 5V D? LED-GREEN RL? (COM) 28 7 8 9 10 11 12 13 14 1 2 3 BJP 1k D0 D1 D2 D3 D4 D5 D6 D7 4. To know the result of the party, the push button of the respective party must be pressed so that the number of votes cast for the party is displayed on the lcd screen. This process is repeated to know the results of each party. 9 4. 3 C LANGUAGE CODING: #include sfr input=0x90; sfr ldata=0xa0; sbit rs=P0^7; sbit rw=P0^6; sbit en=P0^5; sbit m=P3^0; sbit n=P3^1; sbit buzz=P3^2; sbit on=P3^3; void delay(int ); void lcdcmd(char ); void lcddata1(char *); void lcddata(char); void lcd(); int i1,i11,i12,i2,i21,i22,i3,i31,i32,i4,i41,i42,i5,i51,i52=0; void main() { on=0; P1=0;P3=0; while(1) { lcdcmd(0x38); delay(10); lcdcmd(0x0e) ; delay(10); lcdcmd(0x01); lcdcmd(0x06) ; delay(20) ; lcddata1(“Vote”); if(n==1) on=1; if(m==1&on==1) { if (input==0x01) { buzz=1; while (input == 0x01); i1=i1 + 1; if(i1>=10) i11=i1/10; 0 i12=i1%10; on=0; buzz=0; //ready=0; } if (input==0x02) {buzz=1; while (input == 0x02); { i2=i2 + 1; if(i2>=10) i21=i2/10; i22=i2%10; on=0; buzz=0; } } if (input==0x04) { buzz=1; while (input ==0x04); { i3=i3 + 1; if(i3>=10) i31=i3/10; i32=i3%10; on=0; buzz=0; } } if (input==0x08) { buzz=1; while (input == 0x08); { i4=i4 + 1; if(i4>=10) i41=i4/10; i42=i4%10; on=0; buzz=0; } } if (input==0x10) { buzz=1; 31 hile (input == 0x10); { i5=i5 + 1; if(i5>=10) i51=i5/10; i52=i5%10; on=0; buzz=0; } }} if(m==0)//else { if (input==0x01) { lcddata1(” CONGRESS=”); lcddata(i11+0x30); lcddata(i12+0x30); delay(100); } if (input==0x02) { lcdcmd(0x01); lcddata1(” BJP=”); lcddata(i21+0x30); lcddata(i22+0x30); delay(100); } if (input==0x04) { lcdcmd(0x01); lcddata1(” CPM&CPI=”); lcddata(i31+0x30); lcddata(i32+0x30); delay(100); } if (input==0x08) { lcdcmd(0x01); lcddata1(” TDP=”); lcddata(i41+0x30); lcddata(i42+0x30); delay(100); } if(input==0x10) { lcdcmd(0x01); 2 lcddata1(” PRP=”); lcddata(i51+0x30); lcddata(i52+0x30); delay(100); } else{ //lcdcmd(0x01); lcddata1(“result”); delay(100) ; }} }} void delay(int time) { int i,j; for(i=0;i

Cite this Electronic Voting Machine Using 8051 Microcontroller

Electronic Voting Machine Using 8051 Microcontroller. (2016, Sep 16). Retrieved from https://graduateway.com/electronic-voting-machine-using-8051-microcontroller/

Show less
  • Use multiple resourses when assembling your essay
  • Get help form professional writers when not sure you can do it yourself
  • Use Plagiarism Checker to double check your essay
  • Do not copy and paste free to download essays
Get plagiarism free essay

Search for essay samples now

Haven't found the Essay You Want?

Get my paper now

For Only $13.90/page