Sunday, December 22, 2024

Electronic Voting Machine Demo Program

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 (EVM) 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 EVM
Fig. 1: Typical EVM

Software program of the EVM

ADC_Fig_2
Fig. 2: Screenshot of EVM 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.

- Advertisement -

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.

- Advertisement -

Download source code: click here

evm.cpp

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 article was published in July 2012 and has been recently updated. Feel interested? Check out other electronics projects.

6 COMMENTS

SHARE YOUR THOUGHTS & COMMENTS

EFY Prime

Unique DIY Projects

Truly Innovative Electronics

Electronics News

Latest DIY Videos

Electronics Components

Electronics Jobs

Calculators For Electronics