EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Biometric fingerprint based voting machine

Biometric fingerprint based voting machine

|

Projects › Projects › Biometric fingerprint based voting machine

  • This topic has 7 replies, 2 voices, and was last updated 12 years, 2 months ago by kishore.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • November 29, 2013 at 2:21 am #2739
    kishore
    Participant

    My project is Biometric fingerprint based voting machine, here i have control unit and ballot unit. iam using SM630 fingerprint module ie interface with control unit and in ballot unit the voter can vote and at last the result is displayed on 16×2 LCD. i want the hard copy of the output or the result which is displayed on LCD. here at present iam using at89c51 in both control unit and ballot unit, i know i have to change the IC what to choose, suggest me. How to connect a printer to the ballot unit or how to send the output to PC for printing the data.

    Code for ballot unit:

     

     

    #include<reg51.h>

    #define msec 50
    #define lcd_data_str_pin P2 
    sbit rs = P3^0;  
    sbit rw = P3^1;  
    sbit en = P3^2;  
    sbit ini_pin = P1^0; 
    sbit stop_pin = P1^5; 
     
    sbit candidate_1=P1^1;  
    sbit candidate_2=P1^2;  
    sbit candidate_3=P1^3; 
    sbit candidate_4=P1^4;
    sbit candidate_5=P1^6;
    sbit candidate_6=P1^7;   
    int max =0;
    int carry = 0;
    int arr[6];
     
    int vote_amt[3],j;
    unsigned int vote_1,vote_2,vote_3,vote_4,vote_5,vote_6;
     
    void delay(int delay_time)  
    {
    int j,k;
    for(j=0;j<=delay_time;j++)
      for(k=0;k<=1275;k++);
    }
     
    void lcd_cmd(unsigned char cmd_addr)  
    {
    lcd_data_str_pin = cmd_addr;
    en = 1;
    rs = 0;
    rw = 0;
    delay(5);
    en = 0;
    return;
    }
     
    void lcd_data_str(char str[50])  
    { 
    int p;
    for (p=0;str[p]!=’’;p++)
    {
      lcd_data_str_pin = str[p];
      rw = 0;
      rs = 1;
      en = 1;
      delay(5);
      en = 0;
    }
    return;
    }
     
    void lcd_data_int(unsigned int vote)  
    { 
    char dig_ctrl_var;
    int p;
    for (j=2;j>=0;j–)
    {
      vote_amt[j]=vote%10;
      vote=vote/10;
    }
    for (p=0;p<=2;p++)
    {
      dig_ctrl_var = vote_amt[p]+48;
      lcd_data_str_pin = dig_ctrl_var;
      rw = 0;
      rs = 1;
      en = 1;
      delay(5);
      en = 0;
    }
    return;
    } 
     
    void vote_count()  
    {
    while (candidate_1==0 && candidate_2==0 && candidate_3==0 && candidate_4==0 && candidate_5==0 && candidate_6==0);
    if (candidate_1==1)
    {
      while (candidate_1 == 1);
       {
        vote_1++;
       }
    }
    if (candidate_2==1)
    {
      while (candidate_2 == 1);
       {
        vote_2++;
       }
    }
    if (candidate_3==1)
    {
      while (candidate_3 == 1);
       {
        vote_3++;
       }
    }
    if (candidate_4==1)
    {
      while (candidate_4 == 1);
       {
        vote_4++;
       }
    }
    if (candidate_5==1)
    {
      while (candidate_5 == 1);
       {
        vote_5++;
       }
    }
    if (candidate_6==1)
    {
      while (candidate_6 == 1);
       {
        vote_6++;
       }
    }
    }
    void lcd_ini()
    {
    lcd_cmd(0x38);
    delay(msec);
    lcd_cmd(0x0E);
    delay(msec);
    lcd_cmd(0x01);
    delay(msec);
    lcd_cmd(0x83);
    delay(msec);
    lcd_data_str(“Welcome!!!”);
    delay(150);
    lcd_cmd(0x01);
    delay(msec);
    lcd_cmd(0x80);
    delay(msec);
    lcd_data_str( “Press” );
    delay(msec);
    lcd_cmd(0x14);
    delay(msec);
    lcd_data_str(“button”);
    delay(msec);
     
    delay(msec);
    lcd_cmd(0xC0);
    delay(msec);
    lcd_data_str(“to”);
    delay(msec);
    lcd_cmd(0x14);
    delay(msec);
    lcd_data_str(“vote”);
    delay(100);
    lcd_cmd(0x01);
    delay(msec);
    lcd_cmd(0x82);
    delay(msec);
    lcd_data_str(“P1”);
    delay(msec);
    lcd_cmd(0x87);
    delay(msec);
    lcd_data_str(“P2”);
    delay(msec);
    lcd_cmd(0x8C);
    delay(msec);
    lcd_data_str(“P3”);
    delay(msec);
    lcd_cmd(0xC2);
    delay(msec);
    lcd_data_str(“P4”);
    delay(msec);
    lcd_cmd(0xC7);
    delay(msec);
    lcd_data_str(“P5”);
    delay(msec);
    lcd_cmd(0xCC);
    delay(msec);
    lcd_data_str(“P6”);
    delay(msec);
     
    vote_count();
    lcd_cmd(0x01);
    delay(msec);
    lcd_cmd(0x83);
    delay(msec);
    lcd_data_str(“Thank”);
    delay(msec);
    lcd_cmd(0x14);
    delay(msec);
    lcd_data_str(“You!!”);
    delay(100);
    }
      
    void results()  
    {
    int i;
    carry = 0;
    lcd_cmd(0x01);
    delay(msec);
    lcd_cmd(0x80);
    delay(msec);
    lcd_data_str(“Results”);
    delay(msec);
    lcd_cmd(0x14);
    delay(msec);
    lcd_data_str(“Are”);
    delay(msec);
    lcd_cmd(0x14);
    delay(msec);
    lcd_data_str(“Out”);
    delay(msec);
     
    lcd_cmd(0x01);
    lcd_cmd(0x80);
    delay(msec);
    lcd_data_str(“P1”);
    delay(msec);
    lcd_cmd(0x83);
    lcd_data_int(vote_1);
    delay(msec);
    lcd_cmd(0x8A);
    delay(msec);
    lcd_data_str(“P2”);
    lcd_cmd(0x8D);
    delay(msec);
    lcd_data_int(vote_2);
    delay(msec);
    lcd_cmd(0xC0);
    lcd_data_str(“P3”);
    delay(msec);
    lcd_cmd(0xC3);
    delay(msec);
    lcd_data_int(vote_3);
    delay(msec);
    lcd_cmd(0xCA);
    delay(msec);
    lcd_data_str(“P4”);
    delay(msec);
    lcd_cmd(0xCD);
    delay(msec);
    lcd_data_int(vote_4);
    delay(250);
    lcd_cmd(0x01);
    lcd_cmd(0x80);
    lcd_data_str(“P5”);
    delay(msec);
    lcd_cmd(0x83);
    delay(msec);
    lcd_data_int(vote_5);
    delay(msec);
    lcd_cmd(0x8A);
    delay(msec);
    lcd_data_str(“P6”);
    delay(msec);
    lcd_cmd(0x8D);
    delay(msec);
    lcd_data_int(vote_6);
    delay(300);
     
    arr[0] = vote_1;
    arr[1] = vote_2;
    arr[2] = vote_3;
    arr[3] = vote_4;
    arr[4] = vote_5;
    arr[5] = vote_6;
    for( i=0; i<6; i++)
    {
      if(arr>=max)
      max = arr;
    }
     
    if ( (vote_1 == max) && ( vote_2 != max) && (vote_3 != max)&& (vote_4 != max)&& (vote_5!= max)&& (vote_6!= max) )
    {
      carry = 1;
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“Hurray!!!”);
      delay(50);
      lcd_cmd(0xC4);
      delay(msec);
      lcd_data_str(“P1”);
      delay(msec);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“wins”);
      delay(msec);
      return;
    }
     
    if ( (vote_2 == max) && ( vote_1 != max) && (vote_3 != max)&& (vote_4 != max&& (vote_5!= max)&& (vote_6!= max)) )
    {
      carry = 1;
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“Hurray!!!”);
      delay(50);
      lcd_cmd(0xC4);
      delay(msec);
      lcd_data_str(“P2”);
      delay(msec);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“wins”);
      delay(msec);
      return;
    }
     
    if ( (vote_3 == max) && ( vote_2 != max) && (vote_1 != max)&& (vote_4 != max)&& (vote_5!= max)&& (vote_6!= max) )
    {
      carry = 1;
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“Hurray!!!”);
      delay(50);
      lcd_cmd(0xC4);
      delay(msec);
      lcd_data_str(“P3”);
      delay(msec);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“wins”);
      delay(msec);
      return;
    }
     
    if ( (vote_4 == max) && ( vote_2 != max) && (vote_3 != max)&& (vote_1 != max)&& (vote_5!= max)&& (vote_6!= max) )
    {
      carry = 1;
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“Hurray!!!”);
      delay(50);
      lcd_cmd(0xC4);
      delay(msec);
      lcd_data_str(“P4”);
      delay(msec);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“wins”);
      delay(msec);
      return;
    }
    if ( (vote_5 == max) && ( vote_2 != max) && (vote_3 != max)&& (vote_1 != max)&& (vote_4!= max)&& (vote_6!= max) )
    {
      carry = 1;
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“Hurray!!!”);
      delay(50);
      lcd_cmd(0xC4);
      delay(msec);
      lcd_data_str(“P5”);
      delay(msec);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“wins”);
      delay(msec);
      return;
    }
    if ( (vote_6 == max) && ( vote_2 != max) && (vote_3 != max)&& (vote_1 != max)&& (vote_4!= max)&& (vote_5!= max) )
    {
      carry = 1;
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“Hurray!!!”);
      delay(50);
      lcd_cmd(0xC4);
      delay(msec);
      lcd_data_str(“P6”);
      delay(msec);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“wins”);
      delay(msec);
      return;
    }
     
    if (carry==0)
    {
      lcd_cmd(0x01);
      delay(msec);
      lcd_cmd(0x82);
      delay(msec);
      lcd_data_str(“clash”);
      delay(50);
      lcd_cmd(0x14);
      delay(msec);
      lcd_data_str(“between!!!”);
      delay(50);
      if(vote_1 == max)
      {
       lcd_cmd(0xC0);
       lcd_data_str(“P1”);
       delay(50);
      }
      if(vote_2 == max)
      {
       lcd_cmd(0xC3);
       lcd_data_str(“P2”);
       delay(50);
      }
      if(vote_3 == max)
      {
       lcd_cmd(0xC6);
       lcd_data_str(“P3”);
       delay(50);
      }
      if(vote_4 == max)
      {
       lcd_cmd(0xC8);
       lcd_data_str(“P4”);
       delay(50);
      }
      if(vote_5 == max)
      {
       lcd_cmd(0xCB);
       lcd_data_str(“P5”);
       delay(50);
      }
      if(vote_6 == max)
      {
       lcd_cmd(0xCE);
       lcd_data_str(“P6”);
       delay(50);
      }
    }
    }
     
    void main()
    {
    ini_pin = stop_pin = 1;
    vote_1 = vote_2 = vote_3 = vote_4= vote_5 = vote_6 = 0;
    candidate_1 = candidate_2 = candidate_3 = candidate_4 = candidate_5 = candidate_6 = 0;
    lcd_cmd(0x38);
    delay(msec);
    lcd_cmd(0x0E);
    delay(msec);
    lcd_cmd(0x01);
    delay(msec);
    delay(100);
    while(1)
    {
      while(ini_pin != 0)
      {
       if (stop_pin == 0)
       break;
      }
      if (stop_pin == 0)
      {
      break;
      }
      lcd_ini();
    }
     
    while(1)
    {
    results();
    }
    }

     

     

     

     Help me for the codes to send the output of µc to pc for printing the data and suggest me which µc i should use because the code size is limited.

    November 30, 2013 at 7:02 am #10676
    AJISH ALFRED
    Participant

    Hi Kishore,

    I wonder why you want to change the IC. This looks like a very small code, there is no large array decleration or any memory related issues. This should be easily fit into your 8051 microcontroller.

    December 2, 2013 at 12:10 am #10684
    kishore
    Participant

    Sir, if we want to send data through SBUF to pc, we just put in an array like p[]=” xyz”;

    but i have 6 variables P1-P6 whose values and max among that is calaulated, i have to send that, but how????

     

     

    December 9, 2013 at 7:09 am #10706
    AJISH ALFRED
    Participant

    Create a charcter array of 6 variables. Use a for loop to loop through the variables of the array and and write to the SBUF inside each looping.

     

    This is to give you an idea,

     

    char x [6] = {‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’};

     

    for (i=0,i<5,i++)

      SBUF = x;

    December 9, 2013 at 1:40 pm #10712
    kishore
    Participant

    Previous comment was helpfull. Another problem iam facing that, in my voting machine i ‘hv P1 to P6 candidates, if i give my vote to P2 then i want to print in a paper that i voted to candidate P2.  like in ATM when we take money, a small piece of paper comes which shows the balance and many info.

    Eg Small Printer used by bus conductor to print ticket. 

    with this idea i want to add a small printer in my Voting machine to print  ” To which candidate i Voted”.

     

    Give me some idea how to do this. Suggest me if there is any module for printing. 

    December 10, 2013 at 5:36 am #10715
    AJISH ALFRED
    Participant

    Yes, its called “mini thermal printer”. You can google it for an  online purchase.

     

    December 12, 2013 at 3:45 am #10722
    kishore
    Participant

    How to interface the mini thermal printer with 8051

    December 12, 2013 at 4:05 am #10723
    kishore
    Participant

    in the above program i made voting machine for 6 candidate, if i increase to 8 some error in showing in Keil like
    Program size: data=54.0 xdata=0 code=2834
    0 warning 0 error
    Fatal error L250: code size limit in restricted version exceeded
    limit 0800h bytes
    Target not created
    what should i do for this error

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • What branch of electronics has easy spare parts sourcing in north africa ? March 6, 2026
  • USING EASYEDA BUT SOMETHING ISN'T RIGHT? March 6, 2026
  • ESP32 Sub Forum March 6, 2026
  • Hello & a Request: Recommendations for obsolete Panasonic filter Capacitors. March 6, 2026
  • Pnp transistor query March 6, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise