In: Electrical Engineering
Design a Digital Voting Machine using microcontroller based device which can be performed in election electronic voting system. (You can allow five candidates and 50 users. The overall result of the election should be displayed after all.)
Create an algorithm to design a solution
Write a programme to implement the given specification selecting an appropriate microcontroller. (Use Assembly or C languages)
Please attach schematic diagrams (Circuit diagram).
Design of Digital voting machine using microcontroller (8051) AT89C51 kit.
A voting machine is device which counts the number of votes for a particluar party. By considering election electronic voting machine we design voting machine by using assembly language instructions in 8051 micro controller kit.
Algorithm is a step by step process of the design of the machine that is shown clearly in below flow chart.
Program in assembly language:
#include<reg51.h>
#definemsec 50
#define lcd_data P2
sbit rs = P3.0;
sbit en = P3.1;
sbit rw = P3.6;
sbit ini_pin= P1.0;
sbit fin_pin = P1.5 // all values are taken as per circuit
diagram//
sbit candidate_1 = P1.1;
sbit candidate_2 = P1.2;
sbit candidate_3 = P1.3;
sbit candidate_4 = P1.4;
sbit candidate_5 = P1.5; // given 5 candidates to be selected in
question
ASSUME CS:CODE
MOV AX,[P1.1] // the number of votes of candidate 1 is stored in
AX register
INC AX
JZ SKIP
ADD [AX],[AX+1] //previous vote stored in AX register and present
vote will be added and result will be stored in AX register
MOV BX,[P1.2]// the number of votes of candidate 2 is stored in BX
register
INC BX
JZ SKIP
ADD [BX],[BX+1] // previous vote stored in BX register and present
vote will be added and result will be stored in BX register
MOV CX,[P1.3]// the number of votes of candidate 3 is stored in
CX register
INC CX
JZ SKIP
ADD {CX],[CX+1] //previous vote stored in CXregister and present
vote will be added and result will be stored in CX register
MOV DX,[P1.4]// the number of votes of candidate 4 is stored in DX
register
INC DX
JZ SKIP
ADD [DX],[DX+1] // previous vote stored in DX register and present
vote will be added and result will be stored in DX register
MOV SI,[P1.5]// the number of votes of candidate 5 is stored in SI
register
INC SI
JZ SKIP
ADD [SI+1],[SI] // previous vote stored in SI register and present
vote will be added and result will be stored in SI register
SKIP: INT 03H
CODE ENDS