Electronic Voting Machine Demo Program

Meghraj Singh Beniwal


Elections in India are conducted almost exclusively using electronic voting machines. These devices are praised for their simple design, ease of use and reliability. Presented here is a demo software that shows how a typical electronic voting machine works.

As shown in Fig. 1, an electronic voting machine has two main components: control unit and ballot unit. Control unit is used by polling officers, and it stores and accumulates votes. Ballot unit is placed inside the election booth and used by voters.

Fig. 1: Typical electronic voting machine

Software program

Fig. 2: Screenshot of electronic voting machine control panel

Despite design features that make the election software complex to extract the information from the control unit processor, a criminal has a variety of options to steal the information from it. These include decapsulating the chip and examining it under a microscope. Here we did not attempt to extract the software using these methods; once the software is extracted, it is straightforward to reverse-engineer it using standard disassembly tools.

The software (evm.cpp) developed here for the demo is tested on Turbo C++ Version 3.0 IDE. When the user runs the program, it displays a real-time voting machine on the screen with the list of the candidates and corresponding buttons to vote for them (refer Fig. 2). The program requires ‘C’ graphics files such as egavga.bgi, goth.chr, lcom.chr and trip.chr for proper display.
In order to vote for a party, the user has to click the respective button using mouse. A beep sounds to confirm successful submission of vote.

At any point of time if you want to check the status of the votes being polled, just click ‘result’ button in the control panel (not shown here). The next screen will display the percentage of votes received by different candidates in the form of a bar chart. To exit the program, click ‘exit’ button.

Download source code: click here


Main functions
Various functions used in the program are:
initmouse( ). Initialises the mouse pointer to default position.

showmouseptr( ). Displays the pointer on the screen.

restrictmouseptr( ). Restricts the pointer within a particular area of display.

getmousepos( ). Receives mouse position in terms of coordinates ‘x’ and ‘y’.

format( ). Creates graphics of the electronic voting machine.

welcome( ). Displays the welcome message.

graph( ). Calculates and displays the percentage of votes in favour of different candidates in the form of a graph.

The author is a B.Tech in electronics & communications engineering with passion for C, C++ and MATLAB programming. He is working as engineer trainee at Tata Communications, Delhi


Please enter your comment!
Please enter your name here