Friday, June 12, 2015

Token number display system using microcontroller

Bank token number display project is build using ATmega8 Microcontroller and ULN2003 for driving large LED display, PCB layout, Circuit diagram are self explanatory. It is capable to display three digits, its simple project using microcontroller.

Token issue systems are ideal for banks, airports, public dealing offices, hospitals,doctor’s clinics, restaurants and other such places where people have to wait in line for their turn. These systems allow customers to wait without having to stand in line, oncetheir number is displayed then only will they have to get in line for their turn. No need tomake your customers stand in long queues in sunlight or rain and wasting time. Justdistribute tokens on first come first serve basis and as soon as any counter is ready to provide services the person there just has to press one push switch to show the tokennumber in displays. All models are easy to install, operate & maintain. Any ordinaryelectrician can do the installation quickly.“A digital token is issued by cashier in bank to display the token number (etched on thetokens) which is issued to the customers against cheques for facilitating cash withdrawnfrom the bank. The cashier operates the display to show the token number against whichhe is ready to make the payment. The customer having the displayed token number canreport to the cashier’s counter to receive the payment. In this way payment is madesystematically to all desire customers without letting chaos to be created at the paymentwindow. In this way the device serve the purpose of improving the performance of the banking system.



Token Number Display Circuit Diagram

Step 1: Components Required
1. Atmega 8 Microcontroller
2. LM7805
3. 1000uf/16V Capacitor
4. LEDs
5. BC558
6. 100,10K Ohm Resistors
7. Tectile Switches

Step 2: Circuit Design and PCB Manufacturing
Download Requires Files
1. Try Simulation Click Here to Download Proteus Simulation File
2. Download pdf PCB Layout


PCB Layout
3. Assemble components on PCB
Step 3: Programming the controller
Download Hex File

AVR Studio C Code

/***************************************************************/
/*                     Token Number Display                    */
/*                     blog.circuits4you.com                   */
/***************************************************************/
#include <avr/io.h>
#include <string.h>
#include <avr/interrupt.h>

//Segment Connection
#define D0   PC1
#define D1   PB1
#define D2   PB2
#define D3   PB3
#define D4   PB4
#define D5   PC0
#define D6   PB5


//Scan Line Connection
#define S1  PC3
#define S2  PC4
#define S3  PC5

//Keypad Connections
#define W0  PD3
#define W1  PD6
#define W2  PD4
#define W3  PD2

#define W4  PB0
#define W5  PB7

#define W6  PD1
#define W7  PD7

#define W8  PB6

#define W9  PD0

//Declaration
void Display(char f);
void delay();
char dat[3];

/***************************************************************/
/*                     Main                                    */
/***************************************************************/
int main(void)
{

 DDRB = 0b00111110; 
 DDRD = 0b00000000;
 DDRC = 0b00111011;

 PORTB = 0b00000000; 
 PORTC = 0b00111000;
 
 dat[0]=0x00;
 dat[1]=0x00;
 dat[2]=0x00;

 while(1)
 {

  if((PIND & 0x08) == 0x08)
  {
   delay();
   if((PIND & 0x08)==0x08)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x00;
    while((PIND & 0x08)==0x08); 
   }
  }
  if((PIND & 0x40) == 0x40)
  {
   delay();
   if((PIND & 0x40)==0x40)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x01;
    while((PIND & 0x40)==0x40); 
   }
  }

  if((PIND & 0x10) == 0x10)
  {
   delay();
   if((PIND & 0x10)==0x10)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x02;
    while((PIND & 0x10)==0x10); 
   }
  }

  if((PIND & 0x04) == 0x04)
  {
   delay();
   if((PIND & 0x04)==0x04)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x03;
    while((PIND & 0x04)==0x04); 
   }
  }

  if((PINB & 0x01) == 0x01)
  {
   delay();
   if((PINB & 0x01)==0x01)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x04;
    while((PINB & 0x01)==0x01); 
   }
  }

  if((PINB & 0x80) == 0x80)
  {
   delay();
   if((PINB & 0x80)==0x80)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x05;
    while((PINB & 0x80)==0x80); 
   }
  }
  if((PIND & 0x02) == 0x02)
  {
   delay();
   if((PIND & 0x02)==0x02)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x06;
    while((PIND & 0x02)==0x02); 
   }
  }

  if((PIND & 0x80) == 0x80)
  {
   delay();
   if((PIND & 0x80)==0x80)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x07;
    while((PIND & 0x80)==0x80); 
   }
  }

  if((PINB & 0x40) == 0x40)
  {
   delay();
   if((PINB & 0x40)==0x40)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x08;
    while((PINB & 0x40)==0x40); 
   }
  }
  if((PIND & 0x01) == 0x01)
  {
   delay();
   if((PIND & 0x01)==0x01)
   {
    dat[0]=dat[1];
    dat[1]=dat[2];
    dat[2]=0x09;
    while((PIND & 0x01)==0x01); 
   }
  }

  PORTC &=~(1<<S1);
  PORTC |=(1<<S2);
  PORTC |=(1<<S3);
  Display(dat[0]);
  delay();

  PORTC |=(1<<S1);
  PORTC &=~(1<<S2);
  PORTC |=(1<<S3);
  Display(dat[1]);
  delay();

  PORTC |=(1<<S1);
  PORTC |=(1<<S2);
  PORTC &=~(1<<S3);
  Display(dat[2]);
  delay();
 }
}
/***************************************************************/
/*                     7-Segment Display Decoding Logic        */
/***************************************************************/
void Display(char f)
{
 if(f==0x00)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);
  PORTB &=~(1<<D6);
 }

 if(f==0x01)
 {
  PORTC &=~(0x03);
  PORTB &=~(0x3E);
  PORTB |=(1<<D1);
  PORTB |=(1<<D2);
 }

 if(f==0x02)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);
  PORTC &=~(1<<D5);
  PORTB &=~(1<<D2);
 }

 if(f==0x03)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);
  PORTC &=~(1<<D5);
  PORTB &=~(1<<D4);
 }

 if(f==0x04)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);

  PORTC &=~(1<<D0);
  PORTB &=~(1<<D3);
  PORTB &=~(1<<D4);
 }

 if(f==0x05)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);

  PORTB &=~(1<<D1);
  PORTB &=~(1<<D4);
 }

 if(f==0x06)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);

  PORTB &=~(1<<D1);
 }

 if(f==0x07)
 {
  PORTC &=~(0x03);
  PORTB &=~(0x3E);
  PORTC |=(1<<D0);
  PORTB |=(1<<D2);
  PORTB |=(1<<D1);
 }

 if(f==0x08)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);
 }

 if(f==0x09)
 {
  PORTC |=(0x03);
  PORTB |=(0x3E);

  PORTB &=~(1<<D4);
 }


}

/***************************************************************/
/*                     Display Refresh delay                   */
/***************************************************************/
void delay()
{
int i;
for (i=1;i<450;i++)
{}
}

Download TokenNumber.C

Step 4: Test the code and Hardware
1. Press the keys and observe display changes
2. Follow us on Google+
3. You Did it Yourself
4. Refer Tutorials from this site for more understanding of code and Circuits


4 comments: