EVM by PIC

  • Upload
    jmadh

  • View
    222

  • Download
    0

Embed Size (px)

Citation preview

  • 8/4/2019 EVM by PIC

    1/36

    FINGERPRINT BASED VOTING MACHINE

    1. INTRODUCTIONIndia is worlds largest democracy. It is perceived to be charismatic one as it accommodatescultural, regional, economical, social disparities and still is able to stand on its own. Fundamental

    right to vote or simply voting in elections forms the basis of Indian democracy. In India allearlier 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, timeconsuming

    process and very much prone to errors. This situation continued till election scene wascompletely 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 chanceof 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 Voting Machineconsists mainly of two units - (a) Control Unit (CU) and (b) Ballot Unit (BU) with cable for

    connecting it with Control unit. It consists of one LCD, a fingerprint module, a votecast panel, a

    candidate panel, a buzzer and a couple of switches etc. This project is based on C languageprogramming. The software platform used in this project are Hi-Tech C Compiler and

    HyperTerminal.

    Fingerprint Based Voting Machine

    The complete Voting machine consists mainly of two units - (a) Control Unit and (b) BallotingUnit with cable for connecting it with Control unit. A Balloting Unit caters upto 3 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 thevoter 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 button is provided. The voter polls his vote by pressing the button against the name ofhis desired candidate.

    These utilize fingerprint recognition technology to allow access to only those whose fingerprints

    you choose. It contains all the necessary electronics to allow you to store, delete, and verify

    fingerprints with just the touch of a button. Stored fingerprints are retained even in the event ofcomplete power failure or battery drain. These eliminates the need for keeping track of keys or

    remembering a combination password, or PIN. It can only be opened when an authorized user is

    present, since there are no keys or combinations to be copied or stolen, or locks that can bepicked.

    The main aim in designing this product is to provide the concept of the personal identity for each

    individual. This is extended to a special case of electronic voting machine concept. The summary

  • 8/4/2019 EVM by PIC

    2/36

    of the design can be briefly explained diagrammatically as follows. As a pre-poll procedure the

    finger prints of all the voters are collected and stored in a database initially at time of distributingcards. At the time of voting, the option of the voter is taken along with the finger print. The

    finger print taken by the scanner is sent to the pc through an in-built A/D converter. The

    processed image is transferred to hard disk. The option entered by the voter is transferred to chip

    through DEMUX and is stored in the memory. If the transferred image is matched with any ofthe records in the data base, then the interrupt is given by the HARD DISK to pc. Then the

    option is considered in the count.

    2. MICROCONTROLLER DESCRIPTIONPIC16F73 8-Bit CMOS Flash Microcontroller

    2.1 Features

    -cycle

    - 20 MHz clock input DC - 200 ns instruction cycle

    Peripheral Features:-bit timer/counter with 8-bit prescaler

    -bit timer/counter with prescaler, can be incremented during SLEEP via externalcrystal/clock

    -bit timer/counter with 8-bit period register, prescaler and postscaler

    -Capture is 16-bit, max. resolution is 12.5 ns

    - Compare is 16-bit, max. resolution is 200 ns - PWM max. resolution is 10-bit

    8-bit, up to 8-channel Analog-to-Digital converter

    synchronous Receiver Transmitter (USART/SCI).

    2.2 Block Diagram

  • 8/4/2019 EVM by PIC

    3/36

    2.3 Pin Diagram :

  • 8/4/2019 EVM by PIC

    4/36

    2.4 MCLR:PIC16F7X devices have a noise filter in the MCLR Reset path. The filter will detect and ignoresmall pulses. It should be noted that a WDT Reset does not drive MCLR pin low. The behavior

    of the ESD protection on the MCLR pin has been altered from previous devices of this family.Voltages applied to the pin that exceed its specification can result in both MCLR Resets and

    excessive current beyond the device specification during the ESD event. For this reason,Microchip recommends that the MCLR pin no longer be tied directly to VDD.

    Fig no. 2.1

    2.5Pin Description:

  • 8/4/2019 EVM by PIC

    5/36

  • 8/4/2019 EVM by PIC

    6/36

  • 8/4/2019 EVM by PIC

    7/36

    3. INTRODUCTION TO 16X2 LCD DISPLAYLCD 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.

    3.1 Description

    The HD44780U dot-matrix liquid crystal display controller and driver LSI displaysalphanumerics, Japanese kana characters, and symbols. It can be configured to drive a dot-matrixliquid crystal display under the control of a 4- or 8-bit microprocessor. Since all the functions

    such as display RAM, character generator, and liquid crystal driver, required for driving a

    dotmatrix liquid crystal display are internally provided on one chip, a minimal system can beinterfaced with this controller/driver. A single HD44780U can display up to one 8-character line

    or two 8-character lines. The HD44780U has pin function compatibility with the HD44780S

    which allows the user to easily replace an LCD-II with an HD44780U. The HD44780U character

    generator ROM is extended to generate 208 5 8 dot character fonts and 32 5 10 dot characterfonts for a total of 240 different character fonts. The low power supply (2.7V to 5.5V) of the

    HD44780U is suitable for any portable battery-driven product requiring low power dissipation.

    3.2 Pin DescriptionMost LCDs with two controllers has 16 Pins. Pin description is shown in the table below.Pin No. Name Description

    Pin no. 1 D7 Data bus line 7 (MSB)Pin no. 2 D6 Data bus line 6

    Pin no. 3 D5 Data bus line 5

    Pin no. 4 D4 Data bus line 4Pin no. 5 D3 Data bus line 3

    Pin no. 6 D2 Data bus line 2

    Pin no. 7 D1 Data bus line 1

    Pin no. 8 D0 Data bus line 0 (LSB)Pin no. 9 EN1 Enable signal for row 0 and 1 (1stcontroller)

    Pin no. 10 R/W 0 = Write to LCD module

    1 = Read from LCD module

    Pin no. 11 RS 0 = Instruction input

    1 = Data input

    Pin no. 12 VEE Contrast adjustPin no. 13 VSS Power supply (GND)Pin no. 14 VCC Power supply (+5V)

    Pin no. 15 EN2 Enable signal for row 2 and 3 (2ndcontroller)

    Pin no. 16 NC Not Connected

    Table No.3.1: Pin description of the LCD

    3.3 DDRAM - Display Data RAM

  • 8/4/2019 EVM by PIC

    8/36

    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) thatis 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.4 BF - Busy FlagBusy Flag is a status indicator flag for LCD. When we send a command or data to the LCD forprocessing, 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 acceptnext command or data and BF = 0 means LCD is ready for the next command or data to process.

    3.5 Instruction Register (IR) and Data Register (DR)There are two 8-bit registers controller Instruction and Data register. Instruction registercorresponds 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 thedata register and data is then moved automatically to the DDRAM and hence is displayed on the

    LCD.

    3.6 Commands and Instruction setOnly 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 differentspeeds, or various peripheral control devices. The internal operation of the LCD is determined by

    signals sent from the MCU.

    3.7 Sending Commands to LCDTo 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

    Select command registerSelect write operation

    Send enable signalWait for LCD to process the command

    4. BASIC COMPONENTSElectronic components are classed into either being Passive devices or Active devices.

    A Passive Device is one that contributes no power gain (amplification) to a circuit or system. Ithas not control action and does not require any input other than a signal to perform its function.

    In other words, A component with no brain!. Examples are Resistors, Capacitors and

    Inductors.

    Active Devices are components that are capable of controlling voltagesor currents and can create

    a switching action in the circuit. In otherwords, Devices with smarts! Examples are Diodes,Transistors and Integrated circuits. Most active components are semiconductors.

    4.1 Resistors:

  • 8/4/2019 EVM by PIC

    9/36

    This is the most common component in electronics. It is used mainly to control current and

    voltage within the circuit. You can identify a simple resistor by its simple cigar shape with a wirelead coming out of each end. It uses a system of color coded bands to identify the value of the

    component (measured in Ohms). A surface mount resistor is in fact mere millimeters in size but

    performs the same function as its bigger brother, the simple resistor. A potentiometer is a

    variable resistor. It lets you vary the resistance with a dial or sliding control in order toaltercurrent or voltage on the fly. This is opposed to the fixed simple resistors.

    Fig. 4.1 resistor

    Variable ResistorsVariable resistors are also common components. They have a dial or a knob that allows you to

    change the resistance. This is very useful for many situations. Volume controls are variableresistors. When you change the volume you are changing the resistance which changes the

    current. Making the resistance higher will let less current flow so the volume goes down.

    Makingthe resistance lower will let more current flow so the volume goes up. The value of a

    variable resistor is given as its highest resistance value. For example, a 500 ohm variable resistor

    can have a resistance of anywhere between 0 ohms and 500 ohms. A variable resistor may alsobe called a potentiometer (pot for short).

    4.2 Condensors/Capacitors:Capacitors, or "caps", vary in size and shape - from a small surface mount model up to a huge

    electric motor cap, the size of paint can. It stores electrical energy in the form of electrostatically

    determines how much charge it can store. A small surface mount or ceramic cap will only hold aminuscule charge. A cylindrical electrolytic cap will store a much larger charge. Some of the

    large electrolytic caps can store enough charge to

    kill a person. Another type, called Tantalum Capacitors, store a larger charge in a smaller

    package.Fig. 4.2 Capacitor

  • 8/4/2019 EVM by PIC

    10/36

    4.3 Diodes:Diodes are basically a one-way valve for electrical current. They let it flow in one direction

    (from positive to negative) and not in the other direction. This is used to perform rectification

    orconversion of AC current to DC by clipping off the negative portion of a AC waveform. The

    diode terminals are cathode and anode and the arrow inside the diode symbol points towardsthecathode, indicating current flow in that direction when the diode is forward biased and

    conducting current. Most diodes are similar in appearance to a resistor and will have a paintedline on one end showing the direction or flow (white side is negative). If the negative side is onthe negative end of the circuit, current will flow. If the negative is on the positive side of the

    circuit, no current will flow.

    Fig. 4.3 Diodes

    4.3(a) LEDs (Light Emitting Diodes)LEDs are simply diodes that emit light of one form or another. They are used as indicator

    devices. Example: LED lit equals machine on. The general purpose silicon diode emits excessenergy in the form of heat when conducting current. If a different semiconductor material such as

    gallium, arsenide phosphide is used, the excess energy can be released at a lower wavelengthvisible to human eye. This is the composition of LED. They come in several sizes and colors.

    Some even emit Infrared Light which cannot be seen by the human eye.

  • 8/4/2019 EVM by PIC

    11/36

    Fig 4.3(a) LED

    4.4 Switch:This is a mechanical part which when pressed makes the current to flow through it. If the switch

    is released, the current stops flowing through it. This helps to control a circuit.

    Fig. 4.4 Switch

    4.5 PCB:PCB stands for printed circuit board which are used for wiring up of the components of a circuit.

    PCBs are made of paper phenolic FR2 grade (low cost, for low frequency and low power circuit

    assembly) and glass epoxy FR4 grade (for high frequency, high power circuits) copper cladlaminates (available in 1.6mm, 2.4mm and 3.6mm thickness). Single sided PCBs have copper

    foil only on one side while double-sided PCBs have copper foil on both side of the laminate.

    Thickness of copper foil is 35 micrometer minimum on cheaper PCBs and 70 micrometer on

    slightly costlier PCBs. Tracks (conductive paths) are made by masking (covering) the track partof copper with etch-resist enamel paint (you can even use nail polish) and later dipping the

    laminate in ferric chloride solutions to dissolve all copper except under the masked part. Holes in

    PCBs are drilled after etching is over. The tracks on two sides of a PCB are joined using printedthrough hole (PTH) technique, which is equivalent to using slotted copper rivets for joining

    tracks on both sides. On cheaper PCBs, PTH are not provided, only Pads (i.e. circular copper

    land with centre hole) are provided and you have to join the tracks on both sides by soldering acopper wire to the pads with a copper wire. In single sided PCB components are mounted on the

  • 8/4/2019 EVM by PIC

    12/36

    side which has no track (called component side). In a double-sided PCB the component side is

    defined (marked before hand) or it will show component outline (also called silk screen) Greenmasking is the process of applying a layer of green colour insulation varnish on all parts of tracks

    except near the holes, to protect the tracks from exposure to atmosphere and thus prolong its life

    and reliability.

    4.6 Batteries:Symbol of batteries shows positive (+) terminal by a longer line than the negative (-) terminal.For low power circuit dry batteries are used.

    4.7 Relays:A relay is usually an electromechanical device that is actuated by an electrical current.Thecurrent flowing in one circuit causes the opening or closing of another circuit. Relays are like

    remote control switches and are used in many applications because of their relative simplicity,

    long life, and proven high reliability. They are used in a wide variety of applications throughout

    industry, such as in telephone exchanges, digital computers and automation systems.

    How do relays work?

    All relays contain a sensing unit, the electric coil, which is powered by AC or DC current. Whenthe applied current or voltage exceeds a threshold value, the coil activates the armature, whichoperates either to close the open contacts or to open the closed contacts. When a power is

    supplied to the coil, it generates a magnetic force that actuates the switch mechanism. The

    magnetic force is, in effect, relaying the action from one circuit to another. The first circuit iscalled the control circuit; the second is called the load circuit. A relay is usually an

    electromechanical device that is actuated by an electrical current. The current flowing in one

    circuit causes the opening or closing of another circuit.

    Fig 4.7 Relay

    Types of RelaysThere are two basic classifications of relays:

    1. Electromechanical Relay

    2. Solid State Relay.

    Electromechanical relays have moving parts, whereas solid state relays have no moving parts.

    Advantages of Electromechanical relays include lower cost, no heat sink is required, multiplepoles are available, and they can switch AC or DC with equal ease.

    1.Electromechanical Relays

    General Purpose Relay: The general-purpose relay is rated by the amount of current its switch

    contacts can handle. Most versions of the general-purpose relay have one to eight poles and can

    be single or double throw. These are found in computers, copy machines, and other consumerelectronic equipment and appliances.

  • 8/4/2019 EVM by PIC

    13/36

    Power Relay: The power relay is capable of handling larger power loads 10-50 amperes or

    more.They are usually single-pole or double-pole units.

    Fig. 4.8 Power Relay

    Contactor: A special type of high power relay, its used mainly to control high voltages andcurrents in industrial electrical applications. Because of these high power equirements,

    contactors always have double-make contacts.

    Time-Delay Relay: The contacts might not open or close until some time interval after the coilhas been energized. This is called delay-on-operate. Delay-on-release means that the contacts

    will remain in their actuated position until some interval after the power has been removed from

    the coil.

    A third delay is called interval timing. Contacts revert to their alternate position at a specificinterval of time after the coil has been energized. The timing of these actions may be a fixed

    parameter of the relay, or adjusted by a knob on the relay itself, or remotely adjusted through anexternal circuit.

    2. Solid State RelaysThese active semiconductor devices use light instead of magnetism to actuate a switch. The light

    comes from an LED, or light emitting diode. When control power is applied to the devices

    output, the light is turned on and shines across an open space.On the load side of this space, apart of the device senses the presence of the light, and triggers a solid state switch that either

    opens or closes the circuit under control. Often, solid state relays are used where the circuit under

    control must be protected from the introduction of electrical noises. Advantages of Solid StateRelays include low EMI/RFI, long life, no moving parts, no contact bounce, and fast response.

    The drawback to using a solid state relay is that it can only accomplish single pole switching.

    5. LINE SENSOR COMMAND ACCESS FINGERPRINT

    MODULE5.1 IntroductionLine Sensor Command Access Fingerprint Module API References Programmers Guideintroduces you to Line Sensor Command Access Fingerprint Unit (LCAFU), product from

    BeyondLSI. LCAFU, which contains Line Sensor Command Access Fingerprint Module

    (BL215M_DL Series) inside, performs fingerprint authentication functions and management offingerprint data (template). LCAFU stores up to 10/30/50 template fingers depend on type of

    LCAFU (BL215M001_DL / BL215M003_DL/ BL215M005_DL). In this manual, we provide

    information about the usage of Line Sensor Command Access Fingerprint Module API for

    writing an application program using LCAFU. The following tables summarize the commandssupported in Line Sensor Command Access Fingerprint Module API into the following

    categories: open / close, registration / matching commands, template management commands,

    setting commands and miscellaneous functions.

    5.1.1 Open and Close Functions

  • 8/4/2019 EVM by PIC

    14/36

    Registration and Matching Functions

    Template Management Functions

    Setting Functions

  • 8/4/2019 EVM by PIC

    15/36

    Miscellaneous Functions

    API FunctionsCommand Access Fingerprint Module API is a programming API that provides developers a

    common interface for writing C/C++ applications which use LCAFU for fingerprint

    authentication. Developers need not to be concerned with the intricacies of operating LCAFU at

    lower level. Two kinds of Command Access Fingerprint Module APIs , which basically Win32

    API, are provided for developer. The first one is provided if you want to make applications withC language (BLModuleAPI.h, BLModuleAPI.lib and BLModuleAPI.dll). The other one is

    provided if you want to make applications which use API class for C++ then Command AccessFingerprint Module API Class CBLModuleAPI.h, CBLModuleAPI.lib and CBLModuleAPI.dll)

    can be used.

    Detail of API FunctionsIn this section, we introduce detail descriptions of each command in Command AccessFingerprint Module API. Correct syntax and parameters of each command are introduced. Each

    function returns a value as given in the table at previous sections after the execution. Call open

    module function to connect the LCAFU. Then LCAFU related instructions can be performed.

    After performing the functions, call close module function to close connection with LCAFU.Note: Throughout this manual BYTE is equal to unsigned charOpen ModuleThe BLM_OpenModule function establishes the communication with LCAFU. Call this function

    if application want to make transactions with LCAFU.

    Syntax:

    int BLM_OpenModule(const char *comPortIn, int* versionNumOut, int* userMaxOut)

  • 8/4/2019 EVM by PIC

    16/36

    Parameter Input:

    comPortIn :communication port string (COM1, COM2, ) where LCAFU is connected.

    5.3.2 Close Module

    The BLM_CloseModule function closes the communication with LCAFU. Use this function ifapplication wants to end transactions with LCAFU.

    Syntax:int BLM_CloseModule()

    5.3.3 Power OffThe BLM_PowerOff function gives instruction to LCAFU for doing power OFF. Use this

    function to power OFF the LCAFU. Use Power ON button on LCAFU to activate the LCAFU

    again.

    Syntax:int BLM_PowerOff()

    5.3.4 VerifyThe BLM_Verify function gives instruction to LCAFU for verifying an input finger on sensor

    with specified templates stored in LCAFUs database. Use mask table to specify templates forverification. If owner handle window is not equal to NULL then windows message

    WM_WAIT_FINGER is sent to this window handle after received fingerprint input ready signal

    from LCAFU.

    Syntax:int BLM_Verify(unsigned char * maskIn, int* resultCodeOut, int* templateNumOut)

    Parameter Input:maskIn : (note *: do not care)

    Description on functions

    1st byte : template # *, *, *, 8, 6, 4, 2, 0

    if bit #x =1 , do verify with template # (x x 2)

    2nd byte : template # *, *, *, 9, 7, 5, 3, 1if bit #x =1, do verify with template(x x 2+1)

    5.3.5 Identify

    The BLM_Identify function gives instruction to LCAFU for identifying an input finger on sensoramong all templates stored in LCAFUs database. If owner handle window is not equal to NULLthen windows message WM_WAIT_FINGER is sent to this window handle after received

    fingerprint input ready signal from LCAFU.

    Syntax:

    int BLM_Identify(int* resultCodeOut, int* templateNumOut)

  • 8/4/2019 EVM by PIC

    17/36

    5.3.6 RegisterThe BLM_Register function gives instruction to LCAFU for registering an input finger on sensor

    and save the template at specified location in LCAFUs database. Use input template number (0 -

    max template number) to specify location of template on LCAFU. Template with good quality

    image will be registered on LCAFU if the location for template is empty. LCAFU overwrites oldtemplate if the input finger has been registered previously at other location. If owner handle

    window is not equal to NULL then windows message WM_WAIT_FINGER is sent to this

    window handle after received fingerprint input ready signal from LCAFU.

    Syntax:int BLM_Register(int templateNumIn, int* resultCodeOut, int* templateNumOut)

    Parameter Input:templateNumIn :template number to store registered fingerprint (0 to 9/29/49)

    5.3.7 Get All Template Status

    The BLM_GetallTemplateStatus function gives instruction to LCAFU for sending status of all

    templates.

    Syntax:int BLM_GetAllTemplateStatus(int* statusCodeArrayOut)

    Parameter Output:statusCodeArrayOut :status code of template number from 0 to 9/29/49 (array of int with size

    10/30/50)

    0: empty

    1: valid2: on pending

    5.3.8 Get Template Status

    The BLM_GetTemplateStatus function gives instruction to LCAFU for sending status of thetemplate. Use input variable template number to specify which template status will be sent by

    LCAFU.

    Syntax:int BLM_GetTemplateStatus(int templateNumIn, int* statusCodeOut)

    Parameter Input:templateNumIn :template number to get status 0 to 9/29/49

    5.3.9 Clear TemplateThe BLM_ClearTemplate function gives instruction to LCAFU for deleting template. Use input

    variable template number to specify which template will be cleared. Only valid/pending template

    will be deleted by LCAFU.

    Syntax:int BLM_ClearTemplate(int templateNumIn, int* statusCodeOut)

  • 8/4/2019 EVM by PIC

    18/36

    Parameter Input:

    templateNumIn :template number to clear (0 to 9/29/49)

    5.3.10 Read Template

    The BLM_ReadTemplate function gives instruction to LCAFU for sending template data. Use

    input variable template number to specify which template data will be sent by LCAFU. Onlyvalid/pending template will be sent by LCAFU.

    5.3.11 Write TemplateThe BLM_WriteTemplate function gives instruction to LCAFU for writing template data. Use

    input variable template number to specify in which location the template will be written. LCAFU

    write the template on database only if this location is empty and no other template matches withthe template given as the parameter.

    5.3.12 Set PIN

    The BLM_SetPIN function gives instruction to LCAFU for setting PIN stored in LCAFU. Use

    this function to store 8-digit PIN at LCAFU.

    Syntax:int BLM_SetPIN(unsigned char *PINIn)

    6. IC ULN- 2003

    6.1 Features

    Output current 500ma per driver(600ma peak)

    6.2 DescriptionThe ULN2001A, ULN2002A, ULN2003 andULN2004A are high voltage, high current

    Darlington arrays each containing seven open collector darlington pairs with common emitters.

    Each channel rated at 500mA and can withstand peak currents of600mA. Suppression diodes are

    included for inductive load driving and the inputs are pinned opposite the outputs to simplifyboard layout. The four versions interface to all common logic families

    ULN2001A General Purpose, DTL, TTL, PMOS,CMOSULN2002A 14-25V PMOS

    ULN2003A 5V TTL, CMOS

    ULN2004A 615V CMOS, PMOSThese versatile devices are useful for driving a wide range of loads including solenoids, relays

    DC motors, LED displays filament lamps, thermal print heads and high power buffers. The

  • 8/4/2019 EVM by PIC

    19/36

    ULN2001A/2002A/2003A and 2004A are supplied in 16 pin plastic DIP packages with a copper

    leadframe to reduce thermal resistance. They are available also in small outline package (SO-16)as ULN2001D/2002D/2003D/2004D.

    6.3 Pin Connection

    7. IC MAX-232

    7.1 Features-232-F and ITURecommendation V.28

    Operates From a Single 5-V Power Supply With 1.0-_F Charge-Pump Capacitors

    Operates Up To 120 kbit/s

    30-V Input Levels

    Low Supply Current - 8 mA Typical

    ESD Protection Exceeds JESD 22

    - 2000-V Human-Body Model (A114-A)Upgrade With Improved ESD (15-kV HBM) and 0.1-_F Charge-Pump Capacitors is

    Available With the MAX202

    TIA/EIA-232-F, Battery-Powered Systems, Terminals, Modems, and Computers.

    7.2 Description

  • 8/4/2019 EVM by PIC

    20/36

    The MAX232 is a dual driver/receiver that includes a capacitive voltage generator to supply

    TIA/EIA-232-Fvoltage levels from a single 5-V supply. Each receiver converts TIA/EIA-232-Finputs to 5-V TTL/CMOS levels. These receivers have a typical threshold of 1.3 V, a typical

    hysteresis of 0.5 V, and can accept 30-V inputs. Each driver converts TTL/CMOS input levels

    into TIA/EIA-232-F levels.

    7.3 Pin Diagram

    7.4 Function Tables

    7.5 Logic Diagram

  • 8/4/2019 EVM by PIC

    21/36

    7.6 Application Information

    8. INTERFACING THE SERIAL / RS232 PORT8.1 Introduction

    The Serial Port is harder to interface than the Parallel Port. In most cases, any device youconnect to the serial port will need the serial transmission converted back to parallel so that it canbe used. This can be done using a UART. On the software side of things, there are many more

    registers that you have to attend to than on a Standard Parallel Port. (SPP) So what are the

    advantages of using serial data transfer rather than parallel?1. Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -25 volts

    and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as 5v. Therefore

    the serial port can have a maximum swing of 50V compared to the parallel port which has a

  • 8/4/2019 EVM by PIC

    22/36

    maximum swing of 5 Volts. Therefore cable loss is not going to be as much of a problem for

    serial cables than they are for parallel.2. You don't need as many wires than parallel transmission. If your device needs to be mounted a

    far distance away from the computer then 3 core cable (Null Modem Configuration) is going to

    be a lot cheaper that running 19 or 25 core cable. However you must take into account the cost of

    the interfacing at each end.3. Infra Red devices have proven quite popular recently. You may of seen many electronic

    diaries and palmtop computers which have infra red capabilities build in. However could you

    imagine transmitting 8 bits of data at the one time across the room and being able to (from thedevices point of view) decipher which bits are which? Therefore serial transmission is used

    where one bit is sent at a time. IrDA-1 (The first infra red specifications) was capable of 115.2k

    baud and was interfaced into a UART.4. Microcontroller's have also proven to be quite popular recently. Many of these have in built

    SCI (Serial Communications Interfaces) which can be used to talk to the outside world. Serial

    Communication reduces the pin count of these MPU's. Only two pins are commonly used,

    Transmit Data (TXD) and Receive Data (RXD) compared with at least 8 pins if you use a 8 bit

    Parallel method (You may also require a Strobe).

    8.2 Hardware PropertiesDevices which use serial cables for their communication are split into two categories. These are

    DCE (Data Communications Equipment) and DTE (Data Terminal Equipment.) Data

    Communications Equipment are devices such as your modem, TA adapter, plotter etc while DataTerminal Equipment is your Computer or Terminal. The electrical specifications of the serial

    port is contained in the EIA (Electronics Industry Association) RS232C standard. It states many

    parameters such as

    1. A "Space" (logic 0) will be between +3 and +25 Volts.2. A "Mark" (Logic 1) will be between -3 and -25 Volts.

    3. The region between +3 and -3 volts is undefined.4. An open circuit voltage should never exceed 25 volts. (In Reference to GND)5. A short circuit current should not exceed 500mA. The driver should be able to handle this

    without damage.

    Above is no where near a complete list of the EIA standard. Line Capacitance, Maximum BaudRates etc are also included. For more information please consult the EIA RS232-E standard. It is

    interesting to note however, that the RS232C standard specifies a maximum baud rate of 20,000

    BPS!,which is rather slow by today's standards. Revised standards, EIA-232D & EIA-232E werereleased, in 1987 & 1991 respectively. Serial Ports come in two "sizes", There are the D-Type 25

    pin connector and the D-Type 9 pin connector both of which are male on the back of the PC, thus

    you will require a female connector on your device. Below is a table of pin connections for the 9

    pin and 25 pin D-Type connectors.

    8.3 Serial Pinouts (D25 and D9 Connectors)

  • 8/4/2019 EVM by PIC

    23/36

  • 8/4/2019 EVM by PIC

    24/36

    8.4 Pin Functions

    The use of miniaturization and sub miniaturization in electronic equipment design has been

    responsible for the introduction of a new technique in inters component wiring and assembly that

    is popularly known as printed circuit.

    The printed circuit boards (PCBs) consist of an insulating substrate material with metalliccircuitry photo chemically formed upon that substrate. Thus PCB provides sufficient mechanical

    support and necessary electrical connections for an electronic circuit. Advantages of printedcircuit boards: -

    1) Circuit characteristics can be maintained without introducing variations inter

    circuit capacitance.2) Wave soldering or vapour phase reflow soldering can mechanize component

    wiring and assembly.

    3) Mass production can be achieved at lower cost.4) The size of component assembly can be reduced with corresponding decrease

    in weight.

    5) Inspection time is reduced as probability of error is eliminated.

    Types of PCBs: -There are four major types of PCBs: -

    1) Single sided PCB: - In this, copper tracks are on one side of the board, and are the

    simplest form of PCB. These are simplest to manufacture thus have low production cost.

  • 8/4/2019 EVM by PIC

    25/36

    2) Double sided PCB:- In this, copper tracks are provided on both sides of the substrate. To

    achieve the connections between the boards, hole plating is done, which increase themanufacturing complexity

    3) Multilayered PCB: - In this, two or more pieces of dielectric substrate material with

    circuitry formed upon them are stacked up and bonded together. Electrically connections are

    established from one side to the other and to the layer circuitry by drilled holes, which aresubsequently plated through copper.

    4) Flexible PCB: - Flexible circuit is basically a highly flexible variant of the conventional

    rigid printed circuit board theme.

    PCB Manufacturing Process: -

    There are a number of different processes, which are used to manufacture a PCB, which is readyfor component assembly, from a copper clad base material. These processes are as follows

    9. PRINTED CIRCUIT BOARDSPreprocessing: - This consists of initial preparation of a copper clad laminate ready for

    subsequent processing. Next is to drill tooling holes. Passing a board through rollersperforms cleaning operation.

    Photolithography: - This process for PCBs involves the exposure of a photo resist

    material to light through a mask. This is used for defining copper track and land patterns.Etching: - The etching process is performed by exposing the surface of the board to an etchant

    solution which dissolves away the exposed copper areas .The different solutions used are: FeCl,

    CuCl, etc.Drilling: - Drilling is used to create the component lead holes and through holes in a PCB .The

    drilling can be done before or after the track areas have been defined.

    Solder Masking: - It is the process of applying organic coatings selectively to those areas

    where no solder wettings is needed .The solder mask is applied by screen-printing.

    Metal Plating: - The plating is done to ensure protection of the copper tracks andestablish connection between different layers of multiplayer boards. PCBs are stacked

    before being taken for final assembly of components .The PCB should retain its solderability.

    Bare-Board Testing: - Each board needs to ensure that the required connections exist, that

    there are no short circuits and holes are properly placed .The testing usually consists of visual

    inspection and continuity testing.

    10. POWER SUPPLYPower supply can be defined as electronic equipment, which is a stable source of D.C. power for

    electronic circuits.Power supply can be classified into two major categories: -

    Unregulated power supply

    Regulated power supply

  • 8/4/2019 EVM by PIC

    26/36

    10.1 Unregulated Power Supply : -These power supplies, supply power to the load but do not take into variation of power supply

    output voltage or current with respect to the change in A.C. mains voltage, load current ortemperature variations. In other words, we can say that the output voltage or current of an

    unregulated power supply changes with the change in A.C.mains voltage, load current andtemperature. A block diagram as shown below can represent unregulated power supply:

    10.2 Regulated Power Supply: -These power supplies are regulated over the change in source voltage or load current i.e. its

    output remain stable.

    Regulated power supplies are of two types: -

    CURRENT REGULATED POWER SUPPLIES

    These are constant current supplies in spite of change in load or input voltage.

    VOLTAGE REGULATED POWER SUPPLIES

    These supplies supply constant output voltage with respect to the variation in load or sourceinput voltage.

    Circuit of regulated power supply with half wave rectifier

    Here diode D1, D2, D3 and D4 forms half wave rectifier. Capacitor C1 is filtering capacitor. IC-

    7809 is used for voltage regulation. Capacitor C2 is used for bypassing, if any ripples are presentthen it eliminates those ripples.

    As IC-7809 is used so it gives 9v dc regulated voltage ideally. If we take 16 volts transformerthen we will get 8.97v at output. Thus voltage is regulated.

    11. PROJECT DESCRIPTIONThe Fingerprint Based Voting Machine consist of two units: ballot unit (BU) and control unit

    (CU) and a fingerprint module for the verification of the user. Firstly the database of the voters is

    being stored in the fingerprint sensor for creating a database which authenticates the voter at thetime of voting.

    11.1 Ballot Unit:

  • 8/4/2019 EVM by PIC

    27/36

    11.1(a) BLOCK DIAGRAM:

    Figure 11.1 Block diagram of ballot unit

    11.1(b) GENERAL WORKING:

    1. When the power of Ballot unit is turned on, the ballot unit awaits a MATCH FOUND

    from control unit.2. After getting MATCH FOUND, ballot becomes ready to accept a new vote from its

    candidate panel.3. Once the voter presses the button corresponding to the candidate of her/his choice, a fourbit

    code is generated and sent to the control unit.

    4. The ballot unit waits for the VOTE SIGNAL to become low from control unit, whichindicate that control unit has counted that for respective candidate.

    5. After VOTE SIGNAL goes low, the ballot unit shows the number of votes of each

    candidate on the LCD screen.At this time, the buzzer also generates a beep sound. This indicates

    to the voter that her/his vote has been processed.6. The machine returns to the step 1 and starts all over again for next voting.

    11.2 Control Unit:The control unit comprises of the fingerprint module where the fingerprint is being sensed and if

    a match is found then a signal is being generated on the LCD screen for the casting of vote

    Working steps:1. The power is turned on and the fingerprint module is turned on.

    2. Then the fingerprint of the voter is put on the sensor for matching with the database

  • 8/4/2019 EVM by PIC

    28/36

    3. If the fingerprint matches with the database then a signal is given on the LCD to

    CASTE A VOTE

    4. If the fingerprint does not match then NO MATCH FOUND signal is being displayed.

    12. PROJECT METHODOLOGY12.1 Components:Component Name Quantity

    1. Microcontroller SectionMicrocontroller IC (PIC16F7X) 1

    Crystal Oscillator (3.57 MHz) 1

    Ceramic Capacitor (0.1uF) 14

    Ceramic Capacitor (22pF) 2Electrolytic Capacitor (2200uF) 2

    Electrolytic Capacitor (1000uF) 2

    2. Candidate Panel

    Push-to-On Switches 3Resistors (10Kohm) 1

    3. Machine Ready LED

    LED 1Resistor (1Kohm) 1

    4. LCD PANEL

    LCD (16X2 characters) 1Resistors (10Kohm) 1

    5. Power supply

    LED 1

    Resistor (1Kohm) 1Diodes-1N4007 4

    6. ICs

    ULN -2003 1MAX-232 1

    7. Relay 1

    8. Buzzer 1

    Softwares used:1. Hi-Tech C Compiler2. HyperTerminal

    Equipments used:1. Soldering iron, solder, flux.

    2. Personal computer.3. DB9 connector.

    12.2 Procedure for building the Fingerprint Based Voting MachineStep 1: Block diagram and layout of the proposed system is designed and finalized.

    Step 2: All the components and software platform to be used are selected which are also

    mentioned above.

  • 8/4/2019 EVM by PIC

    29/36

    Step 3: All the hardware components are soldered on their respective printed circuit boards with

    the help of soldering iron, solder and flux according to the hardware schematicStep 4: The logic flow of the whole system is decided and accordingly flow-charts are being

    created

    Step 5: According to the flow-charts drawn, code/program of the proposed system is developed

    using C language with the help of software platform (Keil u vision3).Step 6: The hex code of the program being created by the software platform is burnt into the

    flash code memory of our microcontroller IC.

    Step 7: Testing is done at various levels to finalize the appropriate program for the most properworking of the system.

    12.3 Circuit Diagram

  • 8/4/2019 EVM by PIC

    30/36

  • 8/4/2019 EVM by PIC

    31/36

    12.4 Circuit DescriptionThe above circuit shows that firstly coming to the power supply section , the 230V A.C. coming

    is being converted to 12 V supply using a step down transformer. Then the 12 V A.C. is

    converted to unregulated 12 v D.C. by using a bridge rectifier and filter capacitors. The

    unregulated D.C. voltage is being converted into regulated supply by using a 7812 voltage

    regulator.12 v supply is being required by the IC which is used for interfacing microcontrollerwith the relay. A 5 V A.C. is being obtained by the 7805 voltage regulator required for the

    working of the microcontroller which turns on the power LED. IC PIC16F73 is being used whichhave reset at pin1 which is an active low signal ie MCLR.Clock frequency is being provided at

    pin 9 and pin 10 which has an inbuilt crystal oscillator. An LCD is being interfaced at the port B

    of the microcontroller . Here we are using a 4- bit LCD and thus 4 data pins are being connectedand two control pins with the port B. For the connection of the fingerprint module and thus the

    serial communication a DB-9 connector needs to be inter faced with the PIC and for that we

    require a MAX232 IC which is used for conversion of logics as the PIC is based on TTL logic.

    So pin no. 17 and 18 are used for transmission and for receiving of data.For providing indication signals a buzzer is being connected with the relay and foe the

    interfacing of the relay with the PIC we require IC ULN2003 which has 8 darlington pairs whichreduces the current thereby maintaining the gain which is connected at the port C. At port A

    three switches are connected which are used for casting a vote.

  • 8/4/2019 EVM by PIC

    32/36

    12.5 Pcb Layout

  • 8/4/2019 EVM by PIC

    33/36

    12.6 Codingliv

    void main()

    {

    unsigned int i,j,k,l;

    unsigned short count1,count2,count3;char txt[5];

    PORTC.bit3=0;count1=0;count2=0;

    count3=0;

    Lcd_Initialize(&PORTB);Lcd_Command(Lcd_CLEAR);

    Lcd_Command(Lcd_CURSOR_OFF);

    Lcd_Output(1, 1, "FINGRPRINTVOTING");

    Lcd_Output(2, 1, "Init............");

    delay_ms(2000);Usart_Initialize(9600);

    while(1){

    Lcd_Command(Lcd_CLEAR);

    Lcd_Output(1, 1, "Swipe Finger");shorttostr(count1,txt);

    Lcd_Output(2, 1,txt);

    shorttostr(count2,txt);

    Lcd_Output(2, 6,txt);lv

    shorttostr(count3,txt);

    Lcd_Output(2, 11,txt);

    if(Usart_Data_Ready()){

    i=Usart_read();

    while(!Usart_Data_Ready()){

    }

    j=Usart_Read();while(!Usart_Data_Ready())

    {

    }

    k=Usart_Read();while(!Usart_Data_Ready())

    {

    }l=Usart_Read();

    if(i>7)

    {lvi

  • 8/4/2019 EVM by PIC

    34/36

    Lcd_Command(Lcd_CLEAR);

    Lcd_Output(1,1,"NoMatch");PORTC.bit3=1;

    delay_ms(100);

    PORTC.bit3=0;

    delay_ms(500);PORTC.bit3=1;

    delay_ms(100);

    PORTC.bit3=0;delay_ms(2000);

    }

    else{

    Lcd_Command(Lcd_CLEAR);

    Lcd_Output(1,1,"Welcome!");

    Lcd_Output(2,1,"Cast Vote....");

    PORTC.bit3=1;delay_ms(100);

    PORTC.bit3=0;while(PORTA.bit0==0 && PORTA.bit1==0 &&

    PORTA.bit2==0)

    {}

    if(PORTA.bit0==1)

    {

    while(PORTA.bit0==1){

    }

    count1=count1+1;

    }if(PORTA.bit1==1)

    {

    while(PORTA.bit1==1){lvii

    }

    count2=count2+1;}

    if(PORTA.bit2==1)

    {

    while(PORTA.bit2==1){

    }

    count3=count3+1;}

    }

    }

  • 8/4/2019 EVM by PIC

    35/36

    delay_ms(100);

    }}

    12.7 Software description

    Here firstly the counter and the PORTC bit 3 is initialized as 0.the LCD is being initialized atport b and displays FINGERPRINT VOTING.

    An infinite loop is made and displays the message swipe finger. The fingerprint sensor takes thedata in the form of 4 bits which are entered into the integer.when the portc bit is high then buzzer

    blows . if a match is found then buzzer blows one time and if the match is not found then it

    blows two times. At port A switches are connected so. So the counter of the candidate increasesaccording to the bit corresponding to that switch becomes high.

    13. APPLICATIONSFast track voting which could be used in small scale elections, like resident welfare

    association, panchayat level election and other society level elections.It could also be used to conduct opinion polls during annual share holders meeting.

    It could also be used to conduct general assembly elections where number of candidates are

    less than or equal to eight in the current situation.

    14. FUTURE SCOPENumber of candidates could be increased by using other microcontroller or an 8255 IC.It could be interfaced with printer to get the hard copy of the result almost instantly from the

    machine itself.

    It could also be interfaced with the personal computer and result could be stored in the central

    server and its backup could be taken on the other backend servers.Again, once the result is on the server it could be relayed on the network to various

    offices of the election conducting authority. Thus our project could make the resultavailable any corner of the world in a matter of seconds

    CONCLUSION

    Engineering is a way of education in which we see a clear balance between theoretical

    andpractical aspects of anything. The theoretical work done in the college during B.E. is not

    sufficient, therefore it is essential to go under Practical Project work.Fingerprint Based Voting Machine is designed to make the procedure of voting easier and more

    convenient as it is a modified system.it has proved to be very advantageous in providing security

    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. In total, the complete system (including all the hardware components andsoftware routines) is working as per the initial specifications and requirements of our project. So

    certain aspects of the

    system can be modified as operational experience is gained with it. As the users work with thesystem, they develop various new ideas for the development and enhancement of the project.

  • 8/4/2019 EVM by PIC

    36/36

    THANK YOU