+ All Categories
Home > Engineering > Technical seminar project stalin babu m 116_f1a0471

Technical seminar project stalin babu m 116_f1a0471

Date post: 17-Jul-2015
Category:
Upload: stalin-babu
View: 129 times
Download: 2 times
Share this document with a friend
Popular Tags:
50
Development of Anti-Rigging Voting System Using Smart Card Technology CHAPTER 1 1. INTRODUCTION 1.1 INTRODUCTION .The main objective of this project is anti-rigging voting system which is implemented using smart card technology. A smart card is used as a voter id card which provides authentication and identification for a person. In this project microcontroller is used which forms the control unit. Every citizen of India is given with a smart card. Whenever user wants to vote he needs to insert his smart card in smart card reader while voting. Then the voter is asked to vote for his favorite candidate through keypad. So, user need to press the key corresponding to his favorite candidate. This system even allows the election commission to see the no. of votes given for each candidate and is displayed in LCD which got interfaced to microcontroller. This project finds its place in places where one wants to provide authentication with great security. 1.2 AIM OF THE PROJECT. The main purpose of this project is providing the security for elections time which is implementing using smartcard technology. 1.3 ORGANIZATION OF REPORT Chapter 1 gives brief introduction to anti-rigging voting system using smartcard technology and aim of the project. Chapter 2 gives block diagram and its explanation. Chapter 3 explains schematic and its description. Chapter 4 explains hardware description of voting system. Chapter 5 gives working of hardware Chapter 6 gives introduction to software, flowchart & program. Chapter 7 gives conclusion and future scope. Dept. of E.C.E, NITS, HYD 1 M.STALIN BABU (116F1A0471)
Transcript
Page 1: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

CHAPTER 1

1. INTRODUCTION

1.1 INTRODUCTION

.The main objective of this project is anti-rigging voting system which is implemented using

smart card technology. A smart card is used as a voter id card which provides authentication and

identification for a person. In this project microcontroller is used which forms the control unit.

Every citizen of India is given with a smart card. Whenever user wants to vote he needs to insert his

smart card in smart card reader while voting. Then the voter is asked to vote for his favorite

candidate through keypad. So, user need to press the key corresponding to his favorite candidate.

This system even allows the election commission to see the no. of votes given for each candidate

and is displayed in LCD which got interfaced to microcontroller.

This project finds its place in places where one wants to provide authentication with great

security.

1.2 AIM OF THE PROJECT.

The main purpose of this project is providing the security for elections time which is implementing using smartcard technology.

1.3 ORGANIZATION OF REPORT

Chapter 1 gives brief introduction to anti-rigging voting system using smartcard technology and

aim of the project.

Chapter 2 gives block diagram and its explanation.

Chapter 3 explains schematic and its description.

Chapter 4 explains hardware description of voting system.

Chapter 5 gives working of hardware

Chapter 6 gives introduction to software, flowchart & program.

Chapter 7 gives conclusion and future scope.

Dept. of E.C.E, NITS, HYD 1

M.STALIN BABU (116F1A0471)

Page 2: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

CHAPTER 2

2. BLOCK DIAGRAM & DESCRIPTION

2.1 BLOCK DIAGRAM:

Fig:2.1.1 block diagram

2.2 BLOCK DIAGRAM DESCRIPTION:

The application of the project is to access the different provided to vote using the smart

cards. Whenever we insert the smartcard into card driver it reads the data and send it to the

microcontroller. The microcontroller is used to monitor all the control operations. When the smart

card is read successfully the keys will be activated and permission to vote will be given. So rigging

is eliminated using the smartcards.

Dept. of E.C.E, NITS, HYD 2

M.STALIN BABU (116F1A0471)

Micro controller

Power supply

Smart card reader

BUZZER

Keypad

LCD

EEPROM

Page 3: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

CHAPTER 3

3. SCHEMATIC & EXPLANATION

3.1 SCHEMATIC:

Fig:3.1.1 schematic

3.2 SCHEMATIC DESCRIPTION

Dept. of E.C.E, NITS, HYD 3

M.STALIN BABU (116F1A0471)

Page 4: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Power Supply:

The main aim of this power supply is to convert the 230V AC into 5V DC in order to give

supply for the TTL or CMOS devices. In this process we are using a step down transformer, a

bridge rectifier, a smoothing circuit and the RPS.

The bridge rectifier converts the AC coming from the secondary of the transformer into

pulsating DC. The output of this rectifier is further given to the smoother circuit which is capacitor

in our project. The smoothing circuit eliminates the ripples from the pulsating DC and gives the

pure DC to the RPS to get a constant output DC voltage. The RPS regulates the voltage as per our

requirement.

Microcontroller:

Port 1 is used to interface the keypad as shown in the diagram.p3.0 and p3.1 are connected to the

transmit and receive pin are max 232(12.11)

MAX232:

This is used to convert the voltage levels from TTL/CMOS to RS level and vice versa. It

consists of TTL/CMOS input and output pins to TTL devices and RS input and output pins to

connect smartcard .MAX232 TTL input pin (i.e. pin11) is connected to pin11 namely TX of

microcontroller and RS output pin (i.e. pin12) is connected to pin10 namely RX of microcontroller.

And the supply connections are given from the Power supply output 7805 to the VCC and

VSS pins of the MAX232.

EEPROM:

EEPROM will be connected to the port P2.0,P2.1.

DB-9 connector:

It is a 9-pin connector consists of transmit and receive pins along with some hand-shaking

lines.

LCD:

Dept. of E.C.E, NITS, HYD 4

M.STALIN BABU (116F1A0471)

Page 5: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

The data pins(pin no 7 to 14) are connected to the port 0 through the pull up resistances

respectively as shown in the figure.Now the command pins(4,5,6)pin n1 and 3 of LCD are

connected to preset.are connected to the port p2.5,p2.6,p2.7 respectively.

KEYS:

KEYS are connected to the port P1.0 to P1.7 &P3.5 to P3.7.

BUZZER:

Buzzer is connected to the port P2.4

CHAPTER 4

4. HARDWARE COMPONENTS

Dept. of E.C.E, NITS, HYD 5

M.STALIN BABU (116F1A0471)

Page 6: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

3.1 MICROCONTROLLER

AT89S51 Features:

• Compatible with MCS-51® Products

• 4K Bytes of In-System Programmable (ISP) Flash Memory

• 4.0V to 5.5V Operating Range

• 128 x 8-bit Internal RAM

• 32 Programmable I/O Lines

• Two 16-bit Timer/Counters

• Six Interrupt Sources

• Full Duplex UART Serial Channel

• Low-power Idle and Power-down Modes

Description

The AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K 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 AT89S51 is a powerful microcontroller which

provides a highly-flexible and cost-effective solution to many embedded control applications.

The AT89S51 provides the following standard features:

4K bytes of Flash, 128 bytes of RAM, 32 I/O lines, Watchdog timer, two data pointers, two 16-bit

timer/counters, a five vector two-level interrupt architecture, a full duplex serial port, on-chip

Dept. of E.C.E, NITS, HYD 6

M.STALIN BABU (116F1A0471)

Page 7: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

oscillator, and clock circuitry. In addition, the AT89S51 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 external interrupt or hardware reset.

Fig.4.1.1 pin diagram

Dept. of E.C.E, NITS, HYD 7

M.STALIN BABU (116F1A0471)

Page 8: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Fig: 4.1.2 block diagram of microcontroller

Pin Description

VCC Supply voltage.

GND Ground.

Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight

TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedance inputs. Port

0 can also be configured to be the multiplexed low-order address/data bus during accesses to

external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the

code bytes during Flash programming and outputs the code bytes during program verification.

External pull-ups are required during program verification.

Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can

sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal

Dept. of E.C.E, NITS, HYD 8

M.STALIN BABU (116F1A0471)

Page 9: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will

source current (IIL) because of the internal pull-ups. Port 1 also receives the low-order address

bytes during Flash programming and verification.

Table 4.1.1: port 1 pin connection

Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can

sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal

pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will

source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during

fetches from external program memory and during accesses to external data memory that use 16-bit

addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting

1s. During accesses to external data memory that use 8-bit addresses (MOVX @ RI), Port 2 emits

the contents of the P2 Special

Function Register. Port 2 also receives the high-order address bits and some control signals during

Flash programming and verification.

Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can

sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal

pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will

source current (IIL) because of the pull-ups. Port 3 receives some control signals for Flash

programming and verification. Port 3 also serves the functions of various special features of the

AT89S51, as shown in the following table.

RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets

the device. This pin drives High for 98 oscillator periods after the Watchdog times out. The

DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of

bit DISRTO, the RESET HIGH out feature is enabled.

Dept. of E.C.E, NITS, HYD 9

M.STALIN BABU (116F1A0471)

Page 10: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the

address during accesses to external memory. This pin is also the program pulse input (PROG)

during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the

oscillator frequency and may be used for external timing or clocking purposes. Note, however, that

one ALE pulse is skipped during each access to external data memory. If desired, ALE operation

can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a

MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit

has no effect if the microcontroller is in external execution mode.

PSEN Program Store Enable (PSEN) is the read strobe to external program memory. When the

AT89S51 is executing code from external program memory, PSEN is activated twice each machine

cycle, except that two PSEN activations are skipped during each access to external data memory.

EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to

fetch code from external program memory locations starting at 0000H up to FFFFH. Note,

however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be

strapped to VCC for internal program executions. This pin also receives the 12-volt programming

enable voltage (VPP) during Flash programming.

XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2 Output from the inverting oscillator amplifier

Special Function Registers

A map of the on-chip memory area called the Special Function Register (SFR)

Note that not all of the addresses are occupied, and unoccupied addresses may not be implemented

on the chip. Read accesses to these addresses will in general return random data, and write accesses

will have an indeterminate effect.

Dept. of E.C.E, NITS, HYD 10

M.STALIN BABU (116F1A0471)

Page 11: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

User software should not write 1s to these unlisted locations, since they may be used in future

products to invoke new features. In that case, the reset or inactive values of the new bits will always

be 0.

Interrupt Registers: The individual interrupt enable bits are in the IE register. Two priorities can

be set for each of the five interrupt sources in the IP register.

Table: 4.1.2 auxiliary register

Dual Data Pointer Registers: To facilitate accessing both internal and external data memory, two

banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H- 83H and

DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1. The user

should always initialize the DPS bit to the appropriate value before accessing the respective Data

Pointer Register.

Power off Flag: The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR. POF is

set to “1” during power up. It can be set and rest under software control and is not affected by reset.

Memory Organization

MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes

each of external Program and Data Memory can be addressed.

Dept. of E.C.E, NITS, HYD 11

M.STALIN BABU (116F1A0471)

Page 12: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Program Memory If the EA pin is connected to GND, all program fetches are directed to external

memory. On the AT89S51, if EA is connected to VCC, program fetches to addresses 0000H

through

FFFH are directed to internal memory and fetches to addresses 1000H through FFFFH are directed

to external memory.

Data Memory The AT89S51 implements 128 bytes of on-chip RAM. The 128 bytes are accessible

via direct and indirect addressing modes. Stack operations are examples of indirect addressing, so

the 128 bytes of data RAM are available as stack space.

Watchdog Timer (One-time Enabled with Reset-out)

The WDT is intended as a recovery method in situations where the CPU may be subjected to

software upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST)

SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT, a user must write

01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H). When the WDT is

enabled, it will increment every machine cycle while the oscillator is running. The WDT timeout

period is dependent on the external clock frequency. There is no way to disable the WDT except

through reset (either hardware reset or WDT overflow reset). When WDT overflows, it will drive

an output RESET HIGH pulse at the RST pin.

Using the WDT To enable the WDT, a user must write 01EH and 0E1H in sequence to the

DTRST register (SFR location 0A6H). When the WDT is enabled, the user needs to service it by

writing 01EH

and 0E1H to WDTRST to avoid a WDT overflow. The 14-bit counter overflows when it reaches

16383 (3FFFH), and this will reset the device. When the WDT is enabled, it will increment every

machine cycle while the oscillator is running. This means the user must reset the WDT at least

every 16383 machine cycles. To reset the WDT the user must write 01EH and 0E1H to WDTRST.

WDTRST is a write-only register. The WDT counter cannot be read or written. When WDT

overflows, it will generate an output RESET pulse at the RST pin. The RESET pulse duration is

98xTOSC, where TOSC=1/FOSC. To make the best use of the WDT, it should be serviced in those

sections of code that will periodically be executed within the time required to prevent a WDT reset.

WDT During Power-down and Idle

Dept. of E.C.E, NITS, HYD 12

M.STALIN BABU (116F1A0471)

Page 13: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

In Power-down mode the oscillator stops, which means the WDT also stops. While in

Powerdownmode, the user does not need to service the WDT. There are two methods of exiting

Power-down mode: by a hardware reset or via a level-activated external interrupt, which is enabled

prior to entering Power-down mode. When Power-down is exited with hardware reset, servicing the

WDT should occur as it normally does whenever the AT89S51 is reset. Exiting Power-down with

an interrupt is significantly different. The interrupt is held low long enough for the oscillator to

stabilize. When the interrupt is brought high, the interrupt is serviced. To prevent the WDT from

resetting the device while the interrupt pin is held low, the WDT is not started until the interrupt is

pulled high.

UART The UART in the AT89S51 operates the same way as the UART in the AT89C51.

Timer 0 and 1 Timer 0 and Timer 1 in the AT89S51 operate the same way as Timer 0 and Timer 1

in the AT89C51.

Interrupts The AT89S51 has a total of five interrupt vectors: two external interrupts (INT0 and

INT1), two timer interrupts (Timers 0 and 1), and the serial port interrupt. Each of these interrupt

sources can be individually enabled or disabled by setting or clearing a bit in Special Function

Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. Note

that Table 4 shows that bit position IE.6 is unimplemented. In the AT89S51, bit position IE.5 is also

unimplemented. User software should not write 1s to these bit positions, since they may be used in

future AT89 products. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in

which the timers overflow. The values are then polled by the circuitry in the next cycle.

Dept. of E.C.E, NITS, HYD 13

M.STALIN BABU (116F1A0471)

Page 14: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Table: 4.1.3 interrupt enable register

Oscillator Characteristics

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can

be configured for use as an on-chip oscillator, as shown in Figure 2. Either a quartz crystal or

ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should

be left unconnected while XTAL1 is driven, as shown in Figure 3. There are no requirements on the

duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a

divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must

be observed

Idle Mode

In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active.

The mode is invoked by software. The content of the on-chip RAM and all the special function

registers remain unchanged during this mode. The idle mode can be terminated by any enabled

interrupt or by a hardware reset. Note that when idle mode is terminated by a hardware reset, the

device normally resumes program execution from where it left off, up to two machine cycles

before the internal reset algorithm takes control.

Power-down Mode: In the Power-down mode, the oscillator is stopped, and the instruction that

invokes Power down is the last instruction executed. The on-chip RAM and Special Function

Registers retain their values until the Power-down mode is terminated. Exit from Power-down

mode can be initiated either by a hardware reset or by activation of an enabled external interrupt

into INT0 or INT1. Reset redefines the SFRs but does not change the on-chip RAM. The reset

should not be activated before VCC is restored to its normal operating level and must be held active

long enough to allow the oscillator to restart and stabilize.

Programming the Flash – Parallel Mode

The AT89S51 is shipped with the on-chip Flash memory array ready to be programmed.

The programming interface needs a high-voltage (12-volt) program enable signal and is compatible

Dept. of E.C.E, NITS, HYD 14

M.STALIN BABU (116F1A0471)

Page 15: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

with conventional third-party Flash or EPROM programmers. The AT89S51 code memory array is

programmed byte-by-byte.

Programming the Flash – Serial Mode

The Code memory array can be programmed using the serial ISP interface while RST is

pulled to VCC. The serial interface consists of pins SCK, MOSI (input) and MISO (output). After

RST is set high, the Programming Enable instruction needs to be executed first before other

operations can be executed. Before a reprogramming sequence can occur, a Chip Erase operation is

required.

The Chip Erase operation turns the content of every memory location in the Code array into

FFH. Either an external system clock can be supplied at pin XTAL1 or a crystal needs to be

connected across pins XTAL1 and XTAL2. The maximum serial clock (SCK) frequency should be

less than 1/16 of the crystal frequency. With a 33 MHz oscillator clock, the maximum SCK

frequency is 2 MHz.

Programming Interface – Parallel Mode

Every code byte in the Flash array can be programmed by using the appropriate combination of

control signals. The write operation cycle is self-timed and once initiated, will automatically time

itself to Completion.

4.2 LIQUID CRYSTAL DISPLAY

Introduction to LCD:

In recent years the LCD is finding widespread use replacing LED s (seven-segment LED or other

multi segment LED s). This is due to the following reasons:

1. The declining prices of LCD s.

2. The ability to display numbers, characters and graphics. This is in

contract to LED s, which are limited to numbers and a few characters.

Dept. of E.C.E, NITS, HYD 15

M.STALIN BABU (116F1A0471)

Page 16: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

3. Incorporation of a refreshing controller into the LCD, there by relieving the CPU of the task

of refreshing the LCD. In the contrast, the LED must be refreshed by the CPU to keep

displaying the data.

4. Ease of programming for characters and graphics.

S p e c i f i c a t i o n s

• Number of Characters: 16 characters x 2 Lines

• Character Table: English-European (RS in Datasheet)

• Module dimension: 80.0mm x 36.0mm x 13.2mm(MAX)

• View area: 66.0 x 16.0 mm

• Active area: 56.2 x 11.5 mm

• Dot size: 0.56 x 0.66 mm

• Dot pitch: 0.60 x 0.70 mm

• Character size: 2.96 x 5.46 mm

• Character pitch: 3.55 x 5.94 mm

• LCD type: STN, Positive, Transflective, Yellow/Green

• Duty: 1/16

• View direction: Wide viewing angle

• Backlight Type: yellow/green LED

• RoHS Compliant: lead free

• Operating Temperature: -20°C to + 70°C

LCD PIN DIAGRAM:

Dept. of E.C.E, NITS, HYD 16

M.STALIN BABU (116F1A0471)

Page 17: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Fig:4.2.1 pin diagram of LCD

LCD INTERFACING

Sending commands and data to LCDs with a time delay:

Fig: 4.2.2 LCD interfacing

To send any command from table 2 to the LCD, make pin RS=0. For data, make RS=1.Then place a

high to low pulse on the E pin to enable the internal latch of the LCD.In this project we are using

LCD to display the number of votes gained by the each party.

3.3 MAX-232

Logic Signal Voltage

Dept. of E.C.E, NITS, HYD 17

M.STALIN BABU (116F1A0471)

Page 18: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Serial RS-232 (V.24) communication works with voltages (between -15V ... -3V and used to

transmit a binary '1' and +3V ... +15V to transmit a binary '0') which are not compatible with today's

computer logic voltages. On the other hand, classic TTL computer logic operates between 0V ...

+5V (roughly 0V ... +0.8V referred to as low for binary '0', +2V ... +5V for high binary '1' ).

Modern low-power logic operates in the range of 0V ... +3.3V or even lower.

So, the maximum RS-232 signal levels are far too high for today's computer logic electronics.

RS-232 TTL Logic

--------------------------------------------------------

-15V ... -3V <-> +2V ... +5V <-> 1

+3V ... +15V <-> 0V ... +0.8V <-> 0

All this can be done with conventional analog electronics, e.g. a particular power supply and a

couple of transistors or the once popular 1488 (transmitter) and 1489 (receiver) ICs.

The MAX232 & MAX232A

Fig: 4.3.1 A MAX232 integrated circuit.

The MAX232 from Maxim was the first IC which in one package contains the necessary

drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It

became popular, because it just needs one voltage (+5V) and generates the necessary RS-232

Dept. of E.C.E, NITS, HYD 18

M.STALIN BABU (116F1A0471)

Page 19: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry.

Circuitry designers no longer need to design and build a power supply with three voltages (e.g.

-12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with the help of a simple

78x05 voltage converter.

The MAX232 has a successor, the MAX232A. The ICs are almost identical, however, the

MAX232A is much more often used than the original MAX232, and the MAX232A only needs

external capacitors 1/10th the capacity of what the original MAX232 needs. It should be noted that

the MAX232 (A) is just a driver/receiver. It does not generate the necessary RS-232 sequence of

marks and spaces with the right timing, it does not decode the RS-232 signal, it does not provide a

serial/parallel conversion. All it does is to convert signal voltage levels. Generating serial data with

the right timing and decoding serial data has to be done by additional circuitry, e.g. by a 16550

UART or one of these small micro controllers (e.g. Atmel AVR, Microchip PIC) getting more and

more popular.

The MAX232 and MAX232A were once rather expensive ICs, but today they are cheap. It has also

helped that many companies now produce clones (ie. Sipex). The MAX233 is also between three

and ten times more expensive in electronic shops than the MAX232A because of its internal

capacitors. It is also more difficult to get the MAX233 than the garden variety MAX232A.

A similar IC, the MAX3232 is nowadays available for low-power 3V logic.

V+(2) is also connected to VCC via a capacitor (C3). V-(6) is connected to GND via a capacitor

(C4). And GND(16) and VCC(15) are also connected by a capacitor (C5), as close as possible to

the pins.

A Typical Application

Dept. of E.C.E, NITS, HYD 19

M.STALIN BABU (116F1A0471)

Page 20: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

The MAX232 (A) has two receivers (converts from RS-232 to TTL voltage levels) and two drivers

(converts from TTL logic to RS-232 voltage levels). This means only two of the RS-232 signals can

be converted in each direction. The old MC1488/1498 combo provided four drivers and receivers.

Typically a pair of a driver/receiver of the MAX232 is used for

• TX and RX

• CTS and RTS.

Fig :pin connection of max232

The circuitry is completed by connecting five capacitors to the IC as it follows. The MAX232 needs

1.0µF capacitors, the MAX232A needs 0.1µF capacitors. MAX232 clones show similar

differences. At least 16V capacitor types should be used. If electrolytic or tantalic capacitors are

used, the polarity has to be observed. The first pin as listed in the following table is always where

the plus pole of the capacitor should be connected to.

The 5V power supply is connected to

• +5V: Pin 16

• GND: Pin 15

4.4 EEPROM

Dept. of E.C.E, NITS, HYD 20

M.STALIN BABU (116F1A0471)

Page 21: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

EEPROM which stands for electrically erasable programmable read-only memory, is a type of non-

volatile memory used in computers and other electronic devices t store small amounts of data that

must be saved when power is removed, e.g., calibration tables or device configuration. When larger

amounts of more static data are to be stored(such as in USB flash drives) other memory types like

flash memory are more economical. EEPROMs are realized as arrays of floating-gate transistors.

3.5 LINEAR KEYPAD

This section basically consists of a linear keypad. Basically a Keypad can be

Classified into 2 categories.

1. Matrix keypad

2. Linear keypad

1. Matrix keypad:

This keypad got keys arranged in the form of Rows and columns. That is why the name

Matrix keypad. According to this keypad, In order to find the key being pressed the keypad

need to be scanned by making rows as i/p and columns as o/p or vice versa. This keypad is

used in places where one needs to connect more no of keys with less no of data lines.

2. Linear keypad:

This keypad got ‘n’ no. of keys connected to ‘n’ data lines of microcontroller. This keypad

is used in places where one needs to connect less no. of keys. In this project linear keypad is

used with 3 switches being connected because the no. of switches is less (less than 8).

Generally, in linear keypads one end of the switch is connected to microcontroller

(Configured as i/p) and other end of the switch is connected to the common ground. So

whenever a key of linear keypad is pressed the logic on the microcontroller pin will go

LOW.

Dept. of E.C.E, NITS, HYD 21

M.STALIN BABU (116F1A0471)

Page 22: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

4.6 SMARTCARD

INTRODUCTION

A smart card, chip card, or integrated circuit card (ICC), is any pocket-sized card with

embedded integrated circuits which can process data or Memory. This implies that it can receive

input which is processed — by way of the ICC applications — and delivered as an output.

A smart card resembles a credit card in size and shape, but inside it is completely different. First of

all, it has an inside -- a normal credit card is a simple piece of plastic. The inside of a smart card

usually contains an Embedded Microprocessor or EEPROM (memory) or some times both. The

microprocessor is under a gold contact pad on one side of the card. Think of the microprocessor as

replacing the usual magnetic stripe on a credit card or debit card.

SMART CARD

In either type of smart card, the storage capacity of its memory content is much larger than

that in magnetic stripe cards. The total storage capacity of a magnetic stripe card is 125 bytes while

the typical storage capacity of a smart card ranges from 1K bytes to 64K bytes. In other words, the

memory content of a large capacity smart card can hold the data content of more than 500 magnetic

stripe cards.

SMART CARD READER

Smart Card Readers are also known as Card Programmers (because they can write to a

card), card terminals, card acceptance device (CAD) or an interface device (IFD). When the smart

card and the card reader come into contact, each identifies itself to the other by sending and

receiving information. If the messages exchanged do not match, no further processing takes place.

Dept. of E.C.E, NITS, HYD 22

M.STALIN BABU (116F1A0471)

Page 23: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Fig3.6.1:smartcard reader

Smart Card Reader Working:

Smart Card Readers are also known as card programmers (because they can write to a card), card

terminals, card acceptance device (CAD) or an interface device (IFD). There is a slight difference

between the card reader and the terminal. The term 'reader' is generally used to describe a unit that

interfaces with a PC for the majority of its processing requirements. In contrast, a 'terminal' is a

self-contained processing device.

The reader provides a path for your application to send and receive commands from the card. There

are many types of readers available, such as serial, PC Card, and standard keyboard models.

Unfortunately, the ISO group was unable to provide a standard for communicating with the readers

so there is no one-size-fits-all approach to smart card communication.

Each manufacturer provides a different protocol for communication with the reader.

• First you have to communicate with the reader.

• Second, the reader communicates with the card, acting as the intermediary before

sending the data to the card.

• Third, communication with a smart card is based on the APDU format. The card will

process the data and return it to the reader, which will then return the data to its originating

source.

The following classes are used for communicating with the reader:

• ISO command classes for communicating with 7816 protocol

• Classes for communicating with the reader

• Classes for converting data to a manufacturer-specific format

Dept. of E.C.E, NITS, HYD 23

M.STALIN BABU (116F1A0471)

Page 24: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

• An application for testing and using the cards for an intended and specific purpose

Communicating with a Smart Card Reader

The reader provides a path for your application to send and receive commands from the card. There

are many types of readers available, such as serial, PC Card, and standard keyboard models.

Unfortunately, the ISO group was unable to provide a standard for communicating with the readers

so there is no one-size-fits-all approach to smart card communication.

Each manufacturer provides a different protocol for communication with the reader.

• First you have to communicate with the reader.

• Second, the reader communicates with the card, acting as the intermediary before sending

the data to the card.

• Third, communication with a smart card is based on the APDU format. The card will

process the data and return it to the reader, which will then return the data to its originating

source

SMARTCARD HISTORY

TYPES

According to the definitions of “smart card” in the Smart card technology], the word smart card has

three different meanings:

Basically, based on their physical characteristics, IC cards can be categorized into 4 main

types, memory card, contact CPU card, contact-less card and combi card.

In our project the Smart Card used is of the type Contact type cards. Basically this type of Smart

Cards got SIM like Structure Embedded on a Plastic card for Physical Structure and Strength. Some

of them are shown below.

These Contact type Smart cards have a contact area, comprising several gold-plated contact pads,

that is about 1cm square. When inserted into a reader, the chip makes contact with electrical

connectors that can read information from the chip and write information back.

Dept. of E.C.E, NITS, HYD 24

M.STALIN BABU (116F1A0471)

Page 25: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Electrical signals description

Fig:3.6.2 Smart Card pin-out

VCC: Power supply input

RST: Either used it (reset signal supplied from the interface device) or in combination with an

internal reset control circuit (optional use by the card). If internal reset is implemented, the voltage

supply on Vcc is mandatory.

CLK: Clocking or timing signal (optional use by the card).

GND: Ground (reference voltage).

VPP: Programming voltage input (deprecated / optional use by the card).

I/O: Input or Output for serial data to the integrated circuit inside the card.

Contact type Smart Card Reader

Contact smart card readers are used as a communications medium between the smart card and a

host, e.g. a computer, a point of sale terminal, or a mobile telephone.

Since the chips in the financial cards are the same as those used for mobile phone Subscriber

Identity Module (SIM) cards, just programmed differently and embedded in a different shaped

piece of PVC, the chip manufacturers are building to the more demanding GSM/3G standards. So,

for instance, although EMV allows a chip card to draw 50 mA from its terminal, cards are normally

well inside the telephone industry's 6mA limit. This is allowing financial card terminals to become

smaller and cheaper.The reader provides a path for your application to send and receive commands

from the card. There are many types of readers available, such as serial, PC-Card, and standard

keyboard models. Unfortunately, the ISO group was unable to provide a standard for

communicating with the readers so there is no one-size-fits-all approach to smart card

communication.

Dept. of E.C.E, NITS, HYD 25

M.STALIN BABU (116F1A0471)

Page 26: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Each manufacturer provides a different protocol for communication with the reader.

• First you have to communicate with the reader.

• Second, the reader communicates with the card, acting as the intermediary before sending

the data to the card.

• Third, communication with a smart card is based on the APDU format. The card will

process the data and return it to the reader, which will then return the data to its originating source.

Smart card readers are also used as smart card programmers to configure and personalize

integrated circuit cards. This means that not only CPU based smart cards, but also simple memory

cards can be programmed using a smart card reader. Of course the card reader must support the

appropriate protocol such as the asynchronous T=0, T=1 or synchronous I2C protocols

COMMUNICATION PROTOCOLS

Name Description

T=0 Asynchronous half-duplex byte-level transmission protocol.

T=1 Asynchronous half-duplex block-level transmission protocol.

T=2 Reserved for future full-duplex operations.

T=3 Reserved for future full-duplex operations.

T=CL APDU transmission via contactless interface ISO 14443.

Table 4.6.1communication protocols

The smart card reader here in this project used is the supports the T=0, T=1 protocols. The smart

card here used is of 256 bytes of memory (SLE 4442). The following section gives the some sort of

information about the smart card memory and its interfacing commands.

Features:

• 256 ´ 8-bit EEPROM organization

• Byte-wise addressing

• Irreversible byte-wise write protection of lowest 32 addresses (Byte 0 ... 31)

• 32 ´ 1-bit organization of protection memory

• Two-wire link protocol

• End of processing indicated at data output

• Answer-to-Reset acc. to ISO standard 7816-3

• Programming time 2.5 ms per byte for both erasing and writing

Dept. of E.C.E, NITS, HYD 26

M.STALIN BABU (116F1A0471)

Page 27: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

• Minimum of 104 write/erase cycles1)

• Data retention for minimum of ten years1)

• Contact configuration and serial interface in accordance with ISO standard 7816

(synchronous transmission)

In our project, the Smart Card Reader communicates with microcontroller through 2 pins

namely RX and TX with the help of a Serial Driver. These 2 pins are pin 2, 3 of the 9-pin connector

of Smart Card Reader.

APPLICATIONS OF SMARTCARD

With the rapid expansion of Internet technology and electronic commerce, smart cards

are now more widely accepted in the commercial market as stored-value and secure storage cards.

Moreover, it has also been widely used as an identity card.

The applications can be classified into 6 main categories: Electronic Payment, Security and

Authentication, Transportation, Telecommunications, Loyalty Program and Health Care

Applications.

1. ELECTRONIC PAYMENT

Electronic Purse

The Electronic Purse is also known as electronic cash. Funds can be loaded onto a card for use as

cash.

2. SECURITY AND AUTHENTICATION

Identity card

Access control card

Digital certificate

Computer login

TRANSPORTATION APPLICATIONS

The smart card can act as electronic money for car drivers who would need to pay a fee before

being able to use a road or tunnel. It would then contain a balance that can be increased at payment

stations or in the pre-paid process, and is decreased for each use.

Dept. of E.C.E, NITS, HYD 27

M.STALIN BABU (116F1A0471)

Page 28: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

TELECOMMUNICATION APPLICATIONS

With this card, subscribers could make calls from any portable telephone. Moreover, through the IC

card, any calls through the mobile phone could be encrypted, and thus ensure privacy. In the future,

more and more value-added services, such as electronic banking, could be supported by using this

microprocessor card.

HEALTH CARE APPLICATIONS

Due to the level of security provided for data storage, IC cards offer a new perspective for

healthcare applications. Medical applications of smart cards can be used for storing information

including personal data, insurance policy, emergency medical information, hospital admission data

and recent medical records.

4.7 REGULATED POWER SUPPLY

The power supplies are designed to convert high voltage AC mains electricity to a suitable

low voltage supply for electronics circuits and other devices. A RPS (Regulated Power Supply) is

the Power Supply with Rectification, Filtering and Regulation being done on the AC mains to get a

Regulated power supply for Microcontroller and for the other devices being interfaced to it.

For example a 5V regulated power supply system as shown below:

Fig4.7.1:regulated power supply

Transformer:

A transformer is an electrical device which is used to convert electrical power from

one Electrical circuit to another without change in frequency. Transformers convert AC electricity

from one voltage to another with little loss of power. Most power supplies use a step-down

transformer to reduce the dangerously high mains voltage to a safer low voltage. The input coil is

called the primary and the output coil is called the secondary.

Turns ratio = Vp/ VS = Np/NS

Dept. of E.C.E, NITS, HYD 28

M.STALIN BABU (116F1A0471)

Page 29: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Power Out= Power In

VS X IS=VP X IP

Vp = primary (input) voltage

Np = number of turns on primary coil

Ip = primary (input) current

RECTIFIER:

A circuit which is used to convert AC to DC is known as RECTIFIER. The process of conversion

a.c to d.c is called “rectification”

TYPES OF RECTIFIERS:

• Half wave Rectifier

• Full wave rectifier

1. Centre tap full wave rectifier.

2. Bridge type full bridge rectifier.

Bridge Rectifier: A bridge rectifier makes use of four diodes in a bridge arrangement to achieve

full-wave rectification.

Operation:

During positive half cycle of secondary, the diodes D2 and D3 are in forward biased while D1 and

D4 are in reverse biased.

During negative half cycle of secondary voltage, the diodes D1 and D4 are in forward biased while

D2 and D3 are in reverse biased

Filter

A Filter is a device which removes the a.c component of rectifier output but allows the d.c

component to reach the load.

Capacitor Filter:

Dept. of E.C.E, NITS, HYD 29

M.STALIN BABU (116F1A0471)

Page 30: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

We have seen that the ripple content in the rectified output of half wave rectifier is 121% or that of

full-wave or bridge rectifier or bridge rectifier is 48% such high percentages of ripples is not

acceptable for most of the applications.

Filtering is performed by a large value electrolytic capacitor connected across the DC

supply to act as a reservoir, supplying current to the output when the varying DC voltage from the

rectifier is falling. To calculate the value of capacitor(C),

C = ¼*√3*f*r*Rl

Where,

f = supply frequency,

r = ripple factor,

Rl = load resistance

Note: In our circuit we are using 1000µF hence large value of capacitor is placed to reduce

ripples and to improve the DC component.

Regulator:

Voltage regulator ICs is available with fixed (typically 5, 12 and 15V) or variable output voltages.

The maximum current they can pass also rates them. Negative voltage regulators are available,

mainly for use in dual supplies. Most regulators include some automatic protection from excessive

current ('overload protection') and overheating ('thermal protection'). Many of the fixed voltage

regulators ICs have 3 leads and look like power transistors, such as the 7805 +5V 1A regulator

shown on the right. The LM7805 is simple to use. You simply connect the positive lead of your

unregulated DC power supply (anything from 9VDC to 24VDC) to the Input pin, connect the

negative lead to the Common pin and then when you turn on the power, you get a 5 volt supply

from the output pin.

Fig 4.7.2 A Three Terminal Voltage Regulator

78XX:

Dept. of E.C.E, NITS, HYD 30

M.STALIN BABU (116F1A0471)

Page 31: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

The Bay Linear LM78XX is integrated linear positive regulator with three terminals. The

LM78XX offer several fixed output voltages making them useful in wide range of applications.

When used as a zener diode/resistor combination replacement, the LM78XX usually results in an

effective output impedance improvement of two orders of magnitude, lower quiescent current. The

LM78XX is available in the TO-252, TO-220 & TO-263packages,

Features:

• Output Current of 1.5A

• Output Voltage Tolerance of 5%

• Internal thermal overload protection

• Internal Short-Circuit Limited

• Output Voltage 5.0V, 6V, 8V, 9V, 10V, 12V, 15V, 18V, 24V.

4.8 BUZZER

Dept. of E.C.E, NITS, HYD 31

M.STALIN BABU (116F1A0471)

Page 32: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

The "Piezoelectric sound components" introduced herein operate on an innovative principle

utilizing natural oscillation of piezoelectric ceramics. These buzzers are offered in lightweight

compact sizes from the smallest diameter of 12mm to large Piezo electric sounders. Today,

piezoelectric sound components are used in many ways such as home appliances, OA equipment,

audio equipment telephones, etc. And they are applied widely, for example, in alarms, speakers,

telephone ringers, receivers, transmitters, beep sounds, etc.

Oscillating System:

Basically, the sound source of a piezoelectric sound component is a piezoelectric diaphragm. A

piezoelectric diaphragm consists of a piezoelectric ceramic plate which has electrodes on both sides

and a metal plate (brass or stainless steel, etc.).

Applying D.C. voltage between electrodes of a piezoelectric diaphragm causes mechanical

distortion due to the piezoelectric effect. For a misshaped piezoelectric element, the distortion of the

piezoelectric element expands in a radial direction. And the piezoelectric diaphragm bends toward

the direction The metal plate bonded to the piezoelectric element does not expand. Conversely,

when the piezoelectric element shrinks, the piezoelectric diaphragm bends .

CHAPTER 5

Dept. of E.C.E, NITS, HYD 32

M.STALIN BABU (116F1A0471)

Page 33: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

5. HARDWARE WORKING

The Smart Card Reader is an electronic device that reads smart cards. Communication is done via

protocols and you can read and write to a fixed address on the card.

The main objective of this project is anti-rigging voting system which is implemented using smart

card technology. A smart card is used as a voter id card which provides authentication and

identification for a person. In this project microcontroller is used which forms the control unit.

Every citizen of India is given with a smart card. Whenever user wants to vote he needs to insert his

smart card in smart card reader while voting. Then the voter is asked to vote for his favorite

candidate through keypad. So, user need to press the key corresponding to his favorite candidate.

This system even allows the election commission to see the no. of votes given for each candidate

and is displayed in LCD which got interfaced to microcontroller.

This project finds its place in places where one wants to provide authentication with great

security.

CHAPTER 6

6. SOFTWARE & PROGRAM

Dept. of E.C.E, NITS, HYD 33

M.STALIN BABU (116F1A0471)

Page 34: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

6.1 SOFTWARE

About Keil

1. Click on the Keil u Vision Icon on Desktop

2. The following fig will appear

3. Click on the Project menu from the title bar

4. Then Click on New Project

5. Save the Project by typing suitable project name with no extension in u r own folder

sited in either C:\ or D:\

6. Then Click on Save button above.

7. Select the component for u r project. i.e. Atmel……

8. Click on the + Symbol beside of Atmel

9. Select AT89C51

10. Then Click on “OK”

11. Then Click either YES or NO………mostly “NO”

Dept. of E.C.E, NITS, HYD 34

M.STALIN BABU (116F1A0471)

Page 35: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

12. Now your project is ready to USE

13. Now double click on the Target1, you would get another option “Source group 1” as

shown in next page.

14. Click on the file option from menu bar and select “new”

15. The next screen will be as shown in next page, and just maximize it by double clicking

on its blue boarder.

16. Now start writing program in either in “C” or “ASM”

17. For a program written in Assembly, then save it with extension “. asm” and for “C”

based program save it with extension “ .C”

18. Now right click on Source group 1 and click on “Add files to Group Source”

19. Now you will get another window, on which by default “C” files will appear.

20. Now select as per your file extension given while saving the file

21. Click only one time on option “ADD”

22. Now Press function key F7 to compile. Any error will appear if so happen.

23. If the file contains no error, then press Control+F5 simultaneously.

24. The new window is as follows

25. Then Click “OK”

26. Now Click on the Peripherals from menu bar, and check your required port as shown in

fig below

Dept. of E.C.E, NITS, HYD 35

M.STALIN BABU (116F1A0471)

Page 36: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Drag the port a side and click in the program file.

27. Now keep Pressing function key “F11” slowly and observe.

28. You are running your program successfully.

6.2 PROGRAM

// TITLE:: wireless voting machine

Dept. of E.C.E, NITS, HYD 36

M.STALIN BABU (116F1A0471)

Page 37: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

// LCD CONN: P0-DATA LINES, RS-P2.7, RW-P2.6, EN-P2.5

// KEY PAD:: port 1

#include<reg51.h>

#include<lcd.h>

#include<serial.h>

#include<smartcard.h>

sbit key1 = P1^0;

sbit key2 = P1^1;

sbit key3 = P1^2;

sbitkey_enter = P1^3;

sbit candate1 = P1^4;

sbit candate2 = P1^5;

sbit candate3 = P1^6;

sbit candate4 = P1^7;

sbitbuzzar = P2^4;

sbitvalid_led = P2^3;

sbit enable = P2^2;

sbitec_exit = P2^1;

sbitec_enter = P2^0;

bit key_ok,str_flag,r1_flag,r2_flag,r3_flag,r4_flag,r5_flag,r6_flag,r7_flag,r8_flag,r9_flag,chk_flag;

bit d1=0,d2=0,serial_flag;

Dept. of E.C.E, NITS, HYD 37

M.STALIN BABU (116F1A0471)

Page 38: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

unsignedint count1, count2, count3, count4;

unsignedint count1_l,count1_h,count2_l,count2_h,count3_l,count3_h,count4_l,count4_h;

voidkey_scan();

void delay(unsigned int);

voidConvert_disp(unsigned char);

void password();

void main()

{

LCD_Cmd(0x80);

r1_flag = 0;

r2_flag = 0;

key_ok = 0;

count1=0;count2=0;count3=0;count4=0;

Disp_Str(" smart card ");

LCD_Cmd(0xC0);

Disp_Str(" VOTING MACHINE ");

delay(100);

LCD_Cmd(0x80);

Disp_Str("PRESS ENABLE SW "); LCD_Cmd(0xC0);

Disp_Str(" ");

Dept. of E.C.E, NITS, HYD 38

M.STALIN BABU (116F1A0471)

Page 39: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

while(1)

{

if (enable == 0)

{

chk_flag=1;

LCD_Cmd(0x80);

Disp_Str("ENTER P-WORD: ");

}

if (chk_flag == 0)

{

if(key1==0 &&key_ok==0)

{

key_scan();

}

if(key_ok == 1)

{

key_ok = 0;chk_flag=0;

LCD_Cmd(0x80);

Disp_Str("PRESS ENABLE SW ");

}

delay(10);

}

Dept. of E.C.E, NITS, HYD 39

M.STALIN BABU (116F1A0471)

Page 40: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

if (ec_enter==0)

{

while (1)

{

LCD_Cmd(0x80);

Disp_Str("CD1 CD2 CD3 CD4 ");

LCD_Cmd(0xc0);

LCD_Cmd(0xC1);LCD_Data(count1+0x30);

LCD_Cmd(0xC5);LCD_Data(count2+0x30);

LCD_Cmd(0xC9);LCD_Data(count3+0x30);

LCD_Cmd(0xCd);LCD_Data(count4+0x30);

if (serial_flag==0)

{

Send(" ****** RESULT ******");

SBUF=0x0D;while(!TI);TI=0;SBUF=0x0A;while(!TI);TI=0;

SBUF=0x0D;while(!TI);TI=0;SBUF=0x0A;while(!TI);TI=0;

Send("CD1 = ");

SBUF = count1+0x30;

while(TI==0);TI=0;

SBUF=0x0D;while(!TI);TI=0;SBUF=0x0A;while(!TI);TI=0;

Send("CD2 = ");

SBUF = count2+0x30;

Dept. of E.C.E, NITS, HYD 40

M.STALIN BABU (116F1A0471)

Page 41: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

while(TI==0);TI=0;

SBUF=0x0D;while(!TI);TI=0;SBUF=0x0A;while(!TI);TI=0;

Send("CD3 = ");

SBUF = count3+0x30;

while(TI==0);TI=0;

SBUF=0x0D;while(!TI);TI=0;SBUF=0x0A;while(!TI);TI=0;

Send("CD4 = ");

SBUF = count4+0x30;

while(TI==0);TI=0;

}

if (ec_exit==0)

{

password();

serial_flag=0;

break;

} }}}}

voidkey_scan()

{

unsigned char key1_code=0,key2_code=0,key3_code=0;

while(1)

{

Dept. of E.C.E, NITS, HYD 41

M.STALIN BABU (116F1A0471)

Page 42: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

if(key1==0) {if(key1_code>=0x09) key1_code = 0; LCD_Cmd(0x8D); delay(50);

key1_code++; Convert_disp(key1_code); }

if(key2==0) {if(key2_code>=0x09) key2_code = 0; LCD_Cmd(0x8E); delay(50);

key2_code++; Convert_disp(key2_code); }

if(key3==0) {if(key3_code>=0x09) key3_code = 0; LCD_Cmd(0x8F); delay(50);

key3_code++; Convert_disp(key3_code); }

if(key_enter == 0)

{

delay(30);

if(key1_code == 1 && key2_code == 2 && key3_code == 3 )

{

if (r1_flag==0)

{

valid_led=0;

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-1 ");

key1_code = 0; key2_code = 0; key3_code = 0;

while(1){

key_ok = 1;r1_flag=1;valid_led=1;

}

else

{

LCD_Cmd(0x80);

Dept. of E.C.E, NITS, HYD 42

M.STALIN BABU (116F1A0471)

Page 43: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

Disp_Str(" VALID PERSON-1 ");

LCD_Cmd(0xC0);

Disp_Str(" voter disable ");

delay(100); key_ok = 1;

}

break;

}

else

if(key1_code == 2 && key2_code == 3 && key3_code == 4 )

{

if (r2_flag==0)

{

valid_led=0;

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-2 ");

key1_code = 0; key2_code = 0; key3_code = 0;

while(1){

}

key_ok = 1; r2_flag=1; valid_led=1;

}

else

{

Dept. of E.C.E, NITS, HYD 43

M.STALIN BABU (116F1A0471)

Page 44: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-2 ");

LCD_Cmd(0xC0);

Disp_Str(" voter disable ");

delay(100); key_ok = 1;

}

break;

}

else

if(key1_code == 3 && key2_code == 4 && key3_code == 5 )

{

if (r3_flag==0)

{

valid_led=0;

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-3 ");

key1_code = 0; key2_code = 0; key3_code = 0;

while(1){

key_ok = 1; r3_flag=1; valid_led=1;

}

else

{

Dept. of E.C.E, NITS, HYD 44

M.STALIN BABU (116F1A0471)

Page 45: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-3 ");

LCD_Cmd(0xC0);

Disp_Str(" voter disable ");

delay(100); key_ok = 1;

}

password();

break;

}

else

if(key1_code == 4 && key2_code == 5 && key3_code == 6 )

{

if (r4_flag==0)

{

valid_led=0;

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-4 ");

key1_code = 0; key2_code = 0; key3_code = 0;

while(1){

}

key_ok = 1; r4_flag=1; valid_led=1;

}

Dept. of E.C.E, NITS, HYD 45

M.STALIN BABU (116F1A0471)

Page 46: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

else

{

LCD_Cmd(0x80);

Disp_Str(" VALID PERSON-4 ");

LCD_Cmd(0xC0);

Disp_Str(" voter disable ");

}}

else

if(key1_code == 5 && key2_code == 6 && key3_code == 7 ) }

else

{

LCD_Cmd(0x80); Disp_Str("WRONG PASSWORD");

delay(400);

}

key_ok = 1;

break;

}

delay(5); }

}

voidConvert_disp(unsigned char key_value)

{

LCD_Data(key_value+0x30);

Dept. of E.C.E, NITS, HYD 46

M.STALIN BABU (116F1A0471)

Page 47: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

}

void delay(unsigned intitime)

{

inti,j;

for (i=0;i<itime;i++)

for (j=0;j<1275;j++);

}

void password()

{

LCD_Cmd(0x80);

Disp_Str("PRESS ENABLE SW ");

LCD_Cmd(0xc0);

Disp_Str(" ");

}

6.3 FLOW CHART

Dept. of E.C.E, NITS, HYD 47

M.STALIN BABU (116F1A0471)

Page 48: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

CHAPTER 7

Dept. of E.C.E, NITS, HYD 48

M.STALIN BABU (116F1A0471)

Page 49: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

7. CONCLUTION & FUTURE SCOPE

7.1 CONCLUTION

The project “DEVELOPMENT OF ANTI-RIGGING VOTING SYSTEM USING

SMARTCARD TECHNOLOGY” has been successfully designed and tested. It has been

developed by integrating features of all the hardware components used. Presence of every

module has been reasoned out and placed carefully thus contributing to the best working of the

unit.

Secondly, using highly advanced IC’s and with the help of growing technology the

project has been successfully implemented.

Finally we conclude that “DEVELOPMENT OF ANTI-RIGGING VOTING SYSTEM

USING SMARTCARD TECHNOLOGY” is an emerging field and there is a huge scope for

research and development.

7.2 FUTURE ENHANCEMENT

The present project can be further enhanced by providing more security like with finger

print module, IRIS etc,

REFERENCES:

1.The 8051 Micro controller and Embedded Systems

Dept. of E.C.E, NITS, HYD 49

M.STALIN BABU (116F1A0471)

Page 50: Technical seminar project stalin babu m 116_f1a0471

Development of Anti-Rigging Voting System Using Smart Card Technology

-Muhammad Ali Mazidi

Janice GillispieMazidi

2.The 8051 Micro controller Architecture, Programming & Applications

-Kenneth J.Ayala

3.Fundamentals Of Micro processors and Micro computers

-B.Ram

4.Micro processor Architecture, Programming & Applications

-Ramesh S. Gaonkar

5.Electronic Components

-D.V. Prasad

6.Wireless Communications

- Theodore S. Rappaport

7.Mobile Tele Communications

- William C.Y. Lee

References on the Web:

www.national.com

www.atmel.com

www.microsoftsearch.com

Dept. of E.C.E, NITS, HYD 50

M.STALIN BABU (116F1A0471)


Recommended