1. 1
ATTENDANCE SYSTEM USING BARCODE SCANNER
INTERNSHIP PROJECT REPORT
By
Prachi Dave (IU1241090010)
Ami Goswami(IU1241090014)
Department of Electronics And Communication Engineering
Indus University
November,2015
2. 2
BONAFIDE CERTIFICATE
This is to certify that this project report entitled “ATTENDANCE SYSTEM
USING BARCODE SCANNER” is submitted to Indus University, is a bonafide
record of work done by “ Ami Goswami and Prachi Dave” under my
supervision from “ July 2015 ” to “ November 2015 ”.
Bhavin Gajjar
(Asst. Prof)
R N. Mutagi
Head of Department
Electronics And Communication Engg.
Place: Indus University
Date: 17th Nov’15
3. 3
Declaration by Author
This is to declare that this report has been written by us. No part of the report is
plagiarized from other sources. All information included from other sources
have been duly acknowledged. We assure that if any part of the report is found
to be plagiarized, we shall take full responsibility for it.
Prachi Dave
(IU1241090010)
Ami Goswami
(IU1241090014)
Place: Indus University
Date: 17th Nov’15
5. 5
Abstract
The attendance kit is developed through which a prof. can easily take attendance of students
present in the class. This consumes less time. This will achieved using prototype called
Arduino uno combined with two connectors ps/2 male and ps/2 female connector and a USB-
host-shoeld to accept USB inputs(barcode reader device). first by writing the program for
barcode reader to read the data from I card then The program was loaded in the Arduino after
adding the program we check and correct the corrections. The output of scanner is USB so
Arduino to read that output we converted it to serial using ps/2 male and female convertor.
Now by interfacing LCD with Arduino uno we can check the output of scanner on the LCD
screen. The application and advantages that can be used in regular classes to take the
attendance and also at the entrance of any industry or hospitals, schools etc. In future
development we can use NFC(Near far communication) technology to take the attendance by
using android mobile devices.
6. 6
Chapters:
1.1 Introduction:
The Barcode Scanner based Attendance System is divided into two forms hardware and
software, in hardware the card is scanned via barcode scanner/reader via which it will
connect to a microcontroller using UART port after which a comparison takes place between
a memory stored in a microcontroller and a card ,if matched it will access including date,
name, time will be display on a LCD , a buzzer is kept where in a case of a mismatched. RTC
sensors are also used in where a particular time is allocated. While in a software part a coding
is written through which a memory can compare.
1.2 Objective:
I. Ps/2 male convertor:- It is used for interfacing USB scanner with any
microcontroller here we use Arduino. In Ps/2 convertor has a USB input and
serial o/p. This ps/2 convertor is then connecting with Ps/2 female convertor.
Fig 1.1 ps/2 male connector
II. Ps/2 female convertor:- It is generally used for serial communication between
any controller to USB devices. Here it will accept the USB data from scanner
and serially that date goes to Arduino Uno board. Here we describe the pin
diagram of Ps/2 female convertor.
Fig 1.2 ps/2 female connector
7. 7
1.3 Circuit connections:
Fig 1.3 circuit connection of a barcode scanner using scanner
Step 1:
Connecting LCD with Arduino.The first think was to connect the LCD to the Arduino.
Circuit:-
RS pin to digital pin 12
E pin to digital pin 11
D4 pin to digital pin 5
D5 pin to digital pin 4
D6 pin to digital pin 3
D7 pin to digital pin 2
Vcc pin to potentiometer (left pin) and to VCC (Arduino)
Vo pin to potentiometer (centre pin)
R/W and GND pins to potentiometer (right pin) and to GND (Arduino)
Step 2:
After doing all the connections properly scanner need to be connected as barcode scanner are
available of many types among which we have selected a usb pinout barcode scanner.
8. 8
Fig 1.4 USB pinout
Here, with an arduino and a lcd screen where scanner should be connected which would first
have to be serially connected via ps/2 male connector and than to ps/2 female connector
where the output of that connector will be connected to a battery so that it can get some
voltage and the actual voltage levels are been converted into a ttl voltage level so that arduino
can access the code, as such the scanner which reads the value are ASCII codes itself , now
the results which are store firstly and are scan via barcode scanner will only access and the
attendance will put in to an consideration if it scan the another number which was not install
in the program than a buzzer is kept where a beep sound occur and a concern faculty will
known that the wrong entry had been arrived.Thus,this was the working of attendance system
using barcode scanner.
1.4 List of Components
Sr no. Components name Usage
1 Arduino uno As micro controller
2 Barcode Scanner Scanning purpose
3 LCD To detect the o/p
4 Ps/2 male To interface scanner with arduino
5 Ps/2 female USB to serial conversation
6 Potentiometer Increase the darkness of LCD
9. 9
1.5 Approaches:
Firstly, we were working on a barcode formation,like how to create a barcode but due to
shortage of time we used a readymade online software.Secondly, after wriitng our code in a
software name Arduino the error came 'avrdude stk500_getsync() not in sync
resp=0x30'which was reolved and concluded that a wire should always come out from pin0,a
proper com port should be selected,drivers should be installed,bootloader should not be
missing.
Our second try was to run the VCC, GRD, CLK, DATA wires from the female connector to
the Arduino pins did power up but when I was uploading the code, it didn't work. For that
reason I decided to make an experiment to see if the hardware has problem or the code I am
using. I wrote a simple code to read the value of clock on digital pin 3. I initialized the clock
pin to 0 and then I run the program on serial monitor. To see if that is working I scanned a
product to forced the clock to go low. The result was that the clock was remaining high (1)
even if I was scanning a product. So the problem was the hardware.
1.6 Results:
The result we obtain is our program,which is been compile but while connecting a scanner
via ps/2 male and female connector the scanner is not in on stage.
Refrences
http://mosaic.cnfolio.com/StudentProjectCN2012Journal08
http://www.scienceprog.com/interfacing-pc-keyboard-to-avr-microcontroller/
http://www.instructables.com/id/A-solution-to-avrdude-stk500getsync-not-in-syn/
10. 10
Appendix
/*
Barcode Scanner
This code reads the input from a ps/2 keyboard or keyboard-like
device (e.g. a barcode scanner), translates the scan-codes into
numbers (only numbers from 0 to 9 can be used at the moment)
It is nowhere near a complete implementation of the ps/2 protocol,
but it should give you a starting point.
mys .// Benjamin Maus ( benjamin.maus <at> allesblinkt.com )
2007
*/
int SCAN_ENTER = 0x5a; int SCAN_BREAK = 0xf0;
int breakActive = 0;
int clockPin = 3; // Clock is only output.
int dataPin = 2; // The data pin is bi-directional
// But at the moment we are only interested
in receiving
int ledPin = 13; // When a SCAN_ENTER scancode is received the LED blink
int clockValue = 0; byte dataValue;
byte scanCodes[10] = {0x45,0x16,0x1e,0x26,0x25,0x2e,0x36,0x3d,0x3e,0x46};
char characters[10] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};
int quantityCodes = 10;
char buffer[64] = {};
int bufferPos = 0;
int bufferLength = 64;
void setup() {
pinMode(dataPin, INPUT);
pinMode(clockPin, INPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
dataValue = dataRead();
// If there is a break code, skip the next byte
if (dataValue == SCAN_BREAK) {
breakActive = 1;
}
// Translate the scan codes to numbers
// If there is a match, store it to the buffer
for (int i = 0; i < quantityCodes; i++) {
byte temp = scanCodes[i];
if(temp == dataValue){
if(!breakActive == 1){
buffer[bufferPos] = characters[i];
bufferPos++;
}
}
}
//Serial.print('*'); // Output an asterix for every byte
// Print the buffer if SCAN_ENTER is pressed.
if(dataValue == SCAN_ENTER){
Serial.print("nbuffer: ");
// Read the buffer
int i=0;
if (buffer[i] != 0) {
while(buffer[i] != 0) {
11. 11
Serial.print( buffer[i] );
buffer[i] = 0;
i++;
}
}
Serial.println(" [Enter]");
bufferPos = 0;
// Blink the LED
digitalWrite(ledPin, HIGH);
delay(300);
digitalWrite(ledPin, LOW);
}
// Reset the SCAN_BREAK state if the byte was a normal one
if(dataValue != SCAN_BREAK){
breakActive = 0;
}
dataValue = 0;
}
int dataRead() {
byte val = 0;
// Skip start state and start bit
while (digitalRead(clockPin)); // Wait for LOW.
// clock is high when idle
while (!digitalRead(clockPin)); // Wait for HIGH.
while (digitalRead(clockPin)); // Wait for LOW.
for (int offset = 0; offset < 8; offset++)
{
while (digitalRead(clockPin)); // Wait for LOW
val |= digitalRead(dataPin) << offset; // Add to byte
while (!digitalRead(clockPin)); // Wait for HIGH
}
// Skipping parity and stop bits down here.
while (digitalRead(clockPin)); // Wait for LOW.
while (!digitalRead(clockPin)); // Wait for HIGH.
while (digitalRead(clockPin)); // Wait for LOW.
while (!digitalRead(clockPin)); // Wait for HIGH.
return 0;
}
For lcd to interface with arduino
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, world!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);