You are on page 1of 40

SIDDAGANGA INSTITUTE OF TECHNOLOGY, TUMAKURU-572103

(An Autonomous Institute under Visvesvaraya Technological University, Belagavi)

A Project Report on
“IOT Based Smart Public Distribution System”

Sponsored by Karnataka State Council for Science and Technology


(Project Reference Number:40S BE 0366)
submitted in partial fulfillment of the requirement for the award of the
degree of
BACHELOR OF ENGINEERING
in
ELECTRONICS & COMMUNICATION ENGINEERING
Submitted by

Anil (1SI13EC010)
Bindushree M S (1SI13EC019)
Mallikarjun B S (1SI13EC046)
Meghana R V (1SI13EC050)

under the guidance of


Mrs. S Mala
Assistant Professor
Department of E&CE
SIT, Tumakuru-03

DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING


2016-17
SIDDAGANGA INSTITUTE OF TECHNOLOGY, TUMAKURU-572103
(An Autonomous Institute under Visvesvaraya Technological University, Belagavi)
DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

CERTIFICATE

Certified that the project work entitled “IOT BASED SMART PUBLIC DISTRIBU-
TION SYSTEM” is a bonafide work carried out by Anil (1SI13EC010), Bindushree M S
(1SI13EC019), Mallikarjun B S (1SI13EC046) and Meghana R V (1SI13EC050) in partial
fulfillment for the award of degree of Bachelor of Engineering in Electronics & Commu-
nication Engineering from Siddaganga Institute of Technology, an autonomous institute
under Visvesvaraya Technological University, Belagavi during the academic year 2016-17.
It is certified that all corrections/suggestions indicated for internal assessment have been
incorporated in the report deposited in the department library. The Project report has
been approved as it satisfies the academic requirements in respect of project work pre-
scribed for the Bachelor of Engineering degree.

Mrs. S Mala Head of the Department Principal


Assistant Professor Dept. of E&CE SIT,Tumakuru-03
Dept. of E&CE SIT,Tumakuru-03
SIT,Tumakuru-03

External viva:
Names of the Examiners Signature with date
1.
2.
ACKNOWLEDGEMENT

We offer our humble pranams at the lotus feet of His Holiness, Dr. Sree Sree Sivaku-
mara Swamigalu, Founder President and His Holiness, Sree Sree Siddalinga Swami-
galu, President, Sree Siddaganga Education Society, Sree Siddaganga Math for bestowing
upon their blessings.

We deem it as a privilege to thank Dr. M N Channabasappa, Director, SIT, Tu-


makuru and Dr. Shivakumaraiah, Principal, SIT, Tumakuru for fostering an excellent
academic environment in this institution, which made this endeavor fruitful.

We would like to express our sincere gratitude to Dr. K V Suresh, Professor and Head,
Department of E&CE, SIT, Tumakuru for his encouragement and valuable suggestions.

We thank our guide Mrs. S Mala, Assistant Professor, Department of Electronics &
Communincation Engineering, SIT, Tumakuru for the valuable guidance, advice and en-
couragement.

We thank non teaching staff members of Department of Electronics and Communication


for their support during this project work.

Above all, we would like to thank our parents for their support all along.

Anil (1SI13EC010)
Bindushree M S (1SI13EC019)
Mallikarjun B S (1SI13EC046)
Meghana R V (1SI13EC050)
Abstract
The system of providing basic domestic commodities on subsidy to poor families in developing
countries like India is an important aspect to meet fundamental requirement of people. The
existing public distribution system in Ration shops requires manual measurement of quantity
and maintenance of record of transactions. Many problems are encountered by the existing
system such as,

1. Ration distribution to unauthenticated card holders.

2. Card holders wasting time in queues for collecting ration for hours.

3. Lots of malpractices such as hoarding, black marketing and overcharging.

4. Human intervention in updating transactions and maintenance of records in ledger is


difficult.

The project titled IOT based smart public distribution system proposes an automatic
method of distribution of commodities to authenticated card holders. Also, the details of
transactions made are maintained in a database. The users need to access to their account
through the Smart phone by entering their ID and password. Once they are successfully
logged in, they can view the stock availability. This system uses Raspberry-pi as controller
and it is implemented with Minutiae extraction based fingerprint matching algorithm which
efficiently works with greater accuracy score. Automatic distribution of commodities is
achieved by using DC motors controlled directly by Raspberry pi to open and close the
valves.

Initially, one of the family members need to enter unique username and password. Once
user is logged in, he/she can view commodities that is available for that particular family
account. To dispense the commodities, user is expected to provide fingerprint for next
level of authentication. Once user is verified, the system dispenses a threshold quantities of
commodities for the particular family. After dispensing user is asked to signout or view the
dispensed commodities.

i
Contents
Abstract i

Contents ii

List of Figures iv

List of Tables v

1 Introduction 1
1.1 Objective and Motivation of the project . . . . . . . . . . . . . . . . . . . . 2
1.2 Organization of the report . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Literature Survey 3
2.1 Previous Work on Smart PDS . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Previous work on fingerprint identification system . . . . . . . . . . . . . . . 4
2.2.1 Direct Matching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.2 Minutiae Based Matching . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.3 Ratio of Relational Distance Matching . . . . . . . . . . . . . . . . . 8

3 System Overview 9
3.1 Hardware Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 System Hardware 11
4.1 Raspberry pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2 Fingerprint Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4.3 DC motor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4.4 Hydraulic valve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

5 System Software 14
5.1 Android Studio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.2 Raspbian . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
5.3 Flowchart of minutiae based matching . . . . . . . . . . . . . . . . . . . . . 15

ii
IOT based Smart public distribution system 2016-17
6 Results 17
6.1 Snapshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6.2 MATLAB Results on fingerprint matching . . . . . . . . . . . . . . . . . . . 21
6.3 Quantity Analysis: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

7 Conclusion and Future Work 25

Bibliography 26

Dept.of ECE, S.I.T.,Tumakuru iii


List of Figures
3.1 Block diagram of IOT based smart public distribution system. . . . . . . . . 9

4.1 Raspberry pi embedded board. . . . . . . . . . . . . . . . . . . . . . . . . . 11


4.2 Cross sectional view of Hydraulic valve. . . . . . . . . . . . . . . . . . . . . . 13

5.1 Flowchart of IOT based smart public distribution system. . . . . . . . . . . . 14


5.2 Steps involved in fingerprint recognition. . . . . . . . . . . . . . . . . . . . . 16

6.1 Snapshot showing the dispensing containers. . . . . . . . . . . . . . . . . . . 17


6.2 Snapshot showing an overview of android app. . . . . . . . . . . . . . . . . . 18
6.3 Snapshot shows user enrolling fingerprint. . . . . . . . . . . . . . . . . . . . 18
6.4 Snapshot shows Fingerprint matching. . . . . . . . . . . . . . . . . . . . . . 19
6.5 Snapshot showing types of commodities. . . . . . . . . . . . . . . . . . . . . 19
6.6 Snapshot showing rice of 1 Kg being dispensed. . . . . . . . . . . . . . . . . 19
6.7 Snapshot showing sugar of 1 Kg being dispensed. . . . . . . . . . . . . . . . 20
6.8 Snapshot showing fluid of 1 liter being dispensed. . . . . . . . . . . . . . . . 20
6.9 Snapshot showing transaction details of user. . . . . . . . . . . . . . . . . . . 20
6.10 Figure showing histogram equalization of input fingerprint. . . . . . . . . . . 21
6.11 Figure showing FFT applied to equalized image. . . . . . . . . . . . . . . . . 21
6.12 Figure showing Adaptive Binarization. . . . . . . . . . . . . . . . . . . . . . 21
6.13 Figure showing Block direction estimation. . . . . . . . . . . . . . . . . . . . 22
6.14 Figure showing selection of Region of Interest. . . . . . . . . . . . . . . . . . 22
6.15 Figure showing ridge thinning and removal of H breaks. . . . . . . . . . . . . 22
6.16 Figure showing extraction of minutiae points. . . . . . . . . . . . . . . . . . 23

iv
List of Tables
6.1 Analysis of quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
6.2 Similarity and number of minutiae points . . . . . . . . . . . . . . . . . . . . 24
6.3 Accuracy analysis of database . . . . . . . . . . . . . . . . . . . . . . . . . . 24

v
Chapter 1
Introduction
Government provides food, oil and fuel to economically challenged people at subsidized rates
which are distributed to the public through ration shops. The stocks for these ration shops
will be bought from the farmers and then sold at subsidized rates. Every month fresh stock
arrives at these shops and that needs to be distributed to public. The owner of most of
the ration shops resort to malpractices and the allotted amount of ration is not distributed
to authorized people. To counter these fraudulent activities this system is developed which
incorporates the following features.

1. Fingerprint authentication system used to identify a particular user making the system
secure.

2. The commodity and it’s quantity needs to be selected using android application.

3. Predefined information about the amount of ration to be distributed.

4. Automatic ration distributing mechanism.

Public distribution system in the country has undergone organic changes from the ra-
tioning system introduced during World War II to an important social safety program to
ensure food security of the country. Under the public distribution System (PDS), the cen-
tral government procures and supplies special essential commodities to fair price at fixed
central issue prices. In the past, a number of items like iodized salt, palm oil, candles, ghee,
cloth etc. have been distributed through the PDS, however at present department of food
and supplies have confined the fair price distribution to few cereals, wheat, rice, sugar and
kerosene oil. At present India has 4,78,000 ration stores operating across many localities,
villages, towns and cities in the country making it the largest distribution network in the
world. Department of food and supplies is providing ration cards to the citizens based on
their economic conditions. There are mainly two types of cards:

1. Below poverty line (BPL) cards

2. Above poverty line (APL) cards

1
IOT based Smart public distribution system 2016-17

Against the essential commodities act there are many fraudulent activities going on unfair
price shops. Users are forced to wait in long queues for hours together to purchase the essen-
tial commodities. Card holders and their family member’s details are stored in a notebook.
Hence each time transaction is made by the card holder, entry had to be made manually
in the book. Maintenance of record in book is difficult. Thus, an efficient and automated
system is required to minimize the misappropriations.
Quantity of ration to be given for these cards is fixed based on the number of members in the
card holders family. The Department of food and supplies enforces control over these provi-
sions under the orders by the Essential Commodities Act, 1955 regulating trade in specified
essential commodities by keeping a close watch on stocks, passage, quality and availability
of these commodities. Enforcement consists of collection of information and evidence of con-
travention of provisions of the relevant control orders and action taken against them under
the provisions of Essential Commodities Act.

1.1 Objective and Motivation of the project


The aim of this system is to build an automatic and convenient system to protect the
interests of the public by countering the malpractices. The main purpose of the system is
to implement fingerprint matching algorithm for authentication of the user, which in turn
reduces the widespread corruption, misuses of cards and to reduce the time complexity of
the manual data entries. The system is used to protect the products of fair price shop in
black markets.

1.2 Organization of the report


Chapter 2 deals with the literature survey. The block diagram of the system is explained
in Chapter 3, giving an overall view of the techniques used in the system. Chapter 4 deals
with System hardware and Chapter 5 with system software and flowcharts. Chapter 6
contains result which is explained through snapshots and quantity analysis. Chapter 7
contains conclusion and scope for future work.

Dept.of ECE, S.I.T.,Tumakuru 2


Chapter 2
Literature Survey
Evolution of public distribution of basic commodities in India had its origin in the rationing
system introduced by the British during the World War II. The system was started in 1939
in Bombay and gradually extended to other cities and towns. By the end of 1943, 13 cities
had been brought under the coverage of rationing and approximately 771 cities or towns were
covered in 1946. Some rural areas, suffering from chronic shortage were also covered. Since
there PDS is following the same pattern. There are only little modification is happening in
the field of PDS.

2.1 Previous Work on Smart PDS


Initially the user is asked to swipe the RFID card. The Raspberry pi compares the
unique tag ID with the data base. If the tag ID matches, the user is asked to scan the finger.
Once the user identity is authenticated, the commodity and quantity can be selected through
voice commands. If the commodity and quantity are valid, the system dispenses the valid
commodity. A message is sent to the user giving the details of the transaction. However, if
the authentication fails the system waits for valid authentication [1].
Sana et.al [2] presents a transparent and highly scalable Ration Distribution system with
biometric authentication. The conventional paper based ration card is replaced by smart
card. The system is connected to the server through web. Every time before ration collection
each user has to login into the system. The user need not to pay the cash money as the
appropriate balance is deducted from users bank account, so there is no direct involvement
of ration shop owner in transaction. The transaction details are send to users mobile.
Bhalekar et.al [3], this paper proposes online smart ration card system using RFID and
biometrics. RFID tag will contain the information about family members. RFID tag given
to a particular customer needs show to the RFID reader. It will check whether the card is
valid or not and if yes, then by using biometrics the customer authentication is performed.
If the customer is authenticated then the monthly quota will get displayed according to the
family members. After delivery of ration, records are maintained in the online database.
Ashok Kumar et.al [4], a Comparative Study on Fingerprint Matching Algorithms for EVM.
The three matching techniques are direct matching, minutiae matching and matching based

3
IOT based Smart public distribution system 2016-17

on Ratios of distance. By conducting the evaluation on the FVC-2000 datasets and the
results were observed by conducting election with the help of these matching techniques and
the best matching technique is found.
Sharath et.al [5], this paper address the problem of fingerprint individuality by quantify-
ing the amount of information available in minutiae features to establish a correspondence
between two fingerprint images.

2.2 Previous work on fingerprint identification system


Fingerprint processing includes two steps: fingerprint enrollment and fingerprint match-
ing. At the time of enrollment, user needs to provide two samples of his/her fingerprint.
Using these two samples of fingerprint images, the system generates a template of the finger-
print which is used to authenticate the user later. The generated template of the fingerprint
is compared with the templates of the finger library. System will return the matching result
as success or failure. This fingerprint comparison is done in the controller using an algorithm
for matching of fingerprints [6].
There are many techniques presented previously based on fingerprint matching techniques.
Most of the techniques undertaken in previous researches are based on the biometric authen-
tication like fingerprint. Fuzzy vault system is one of the most important mechanisms for
secure biometric authentication based on fingerprint minutiae in which a secret key is pro-
duced, selecting chaff points from minutiae template. Fingerprint matching using a Gabor
filter is one more technique which uses fingerprint matching using a 16 Gabor filter from the
template which results in designing a new method. It compares two ridge pattern maps of
images using adaptive filter method. Several methods already exists for enhancement of fin-
gerprint images which are based on image normalization, Gabor filtering (Hongs algorithm)
and Binarization method.
Common fingerprint matching algorithms are based on,

2.2.1 Direct matching

2.2.2 Minutiae based matching

2.2.3 Ratio of relational distance matching

2.2.1 Direct Matching


In this matching, the input and template images are read, the matching is performed by
comparing the two images pixel wise [7].

Dept.of ECE, S.I.T.,Tumakuru 4


IOT based Smart public distribution system 2016-17

2.2.2 Minutiae Based Matching


This is the most popular and widely used in commercial applications, because of its good
performance and low computation time, specially for good quality images. This method tries
to align the minutiae of the input image (query template) and stored templates (reference
template) and find the number of matched minutiae. After alignment, two minutiae are
considered in matching if the spacial distance and direction difference between them are
smaller that a given tolerance [8]. A correct aligning of fingerprint is very important in
order to maximize the number of matched minutiae, this requires the computing of the
translation and rotation information, as well as other geometrical transformations such as
scale and distortion. Each segment contains following information: segment length and
the angles formed by the segment and the minutiae direction.Minutiae based fingerprint
matching algorithm is helpful in certain application for privacy protection.

1. Fingerprint Image Preprocessing


• Fingerprint Image Enhancement:
Fingerprint Image enhancement is to make the image clearer for easy further opera-
tions. The fingerprint images acquired from sensors or other medians are not assured
with better quality, those enhancement methods, for increasing the contrast between
ridges and furrows and for connecting the false broken points of ridges due to insuffi-
cient amount of ink, are very useful for keep a better accuracy to fingerprint recognition.

1. Histogram Equalization:
Histogram is a process that attempts to spread out the gray levels in an image so that
they are evenly distributed across their range. It basically reassigns brightness value
of each pixel based on the image histogram. Histogram equalization is to expand the
pixel value distribution of an image so as to increase the perceptional information.

2. Fingerprint Enhancement by Fourier Transform:


The image is divided into small processing blocks (32 by 32 pixels) and perform the
Fourier transform according to it. the Equation(2.1) used for computing FFT is given
by
M −1 N −1
X X ux vy
F (u, v) = f (x, y) exp(−2jπ( M + N )) (2.1)
x=0 y=0

In order to enhance a specific block by its dominant frequencies, we multiply the FFT of

Dept.of ECE, S.I.T.,Tumakuru 5


IOT based Smart public distribution system 2016-17

the block by its magnitude a set of times. Where the magnitude of the original FFT is
abs(F (u, v)) = |F (u, v)|. So we get the enhanced block according to the Equation(2.2):

g(x, y) = F −1 (F (u, v) ∗ |F (u, v)|k ) (2.2)

where F −1 (F (u, v)) is given by Equation(2.3) :


M −1 N −1
1 XX ux vy
f (x, y) = exp(2jπ( M + N )) (2.3)
M N x=0 y=0

The k in Equation(2.2) is an experimentally determined constant, which we choose


k=0.45 to calculate. A high value of k improves the appearance of the ridges by filling
up small holes in ridges, but too high value of k can result in false joining of ridges
which might lead to a termination become a bifurcation. The enhanced image after
FFT has the improvements as some falsely broken points on ridges get connected and
some spurious connections between ridges get removed.
• Fingerprint Image Binarization:
Fingerprint Image Binarization is to transform the 8-bit Gray fingerprint image to a
1-bit image with 0-value for ridges and 1-value for furrows. After the operation ridges
in the fingerprint are highlighted with black colour while furrows are white. A locally
adaptive binarization method is performed to binarize the fingerprint image. Locally
adaptive binarization method comes from the mechanism of transforming a pixel value
to 1 if the value is larger than the mean intensity value of the current block (16x16)
to which the pixel belongs. Local adaptive thresholding is applied to the directionally
filtered image, which produces the final enhanced binary image. This involves calcu-
lating the average of the grey level values within an image window at each pixel, and if
the average is greater than the threshold, then the pixel value is set to a binary value
of one; otherwise, it is set to zero.
• Fingerprint Image Segmentation To extract the region of interest (ROI):
In this a two-step method is used. The first step in this method is block direction
estimation and direction variety check, while the second is intrigued from some Mor-
phological methods.

1. Block Direction Estimation:


The fingerprint image is divided into blocks of size 16 x 16 pixels (W x W) after which
the block direction of each block is calculated according to the algorithm:

Dept.of ECE, S.I.T.,Tumakuru 6


IOT based Smart public distribution system 2016-17

I. Calculate the gradient values along x-direction (gx) and y-direction (gy) for each
pixel of the block. Two Sobel filters are used to fulfill the task.

II. For each block, use Equation(2.4) to get the Least Square approximation of the
block direction. PP
2 (gx ∗ gy)
tan 2β = P P 2 (2.4)
(gx − gy 2 )
for all the pixels in each block The formula is easy to understand by regarding gradient
values along x-direction and y-direction as cosine value and sine value. So the tangent
value of the block direction is estimated nearly the same as the way illustrated by the
following Equation(2.5).
2 sin θ cos θ
tan 2θ = (2.5)
cos2 θ − sin2 θ
After finished with the estimation of each block direction, those blocks without sig-
nificant information on ridges and furrows are discarded based on the following Equa-
tion(2.6) PP 2
(gx − gy 2 )
PP
2 (gx ∗ gy) +
E= PP 2 (2.6)
W ∗W ∗ (gx + gy 2 )

2. ROI Extraction by Morphological Operations:


Two Morphological operations called OPEN and CLOSE are adopted. The OPEN
operation can expand images and remove peaks introduced by background noise. The
CLOSE operation can shrink images and eliminate small cavities.

2. Minutiae Extraction
• Fingerprint Ridge Thinning:
Ridge Thinning is to eliminate the redundant pixels of ridges till the ridges are just
one pixel wide uses an iterative, parallel thinning algorithm. In each scan of the full
fingerprint image the algorithm marks down redundant pixels in each small image win-
dow (3x3). And finally removes all those marked pixels after several scans.
• Minutiae Marking After the fingerprint ridge thinning:
Marking minutiae points is relatively easy. In general for each (3x3) window, if the
central pixel is 1 and has exactly 3 one-value neighbors then the central pixel is a ridge
branch. If the central pixel is 1 and has only 1 one-value neighbor, then the central
pixel is known as ridge ending.

Dept.of ECE, S.I.T.,Tumakuru 7


IOT based Smart public distribution system 2016-17

3. Minutiae Postprocessing
• False Minutiae Removal :
At this stage false ridge breaks due to insufficient amount of ink and ridge cross con-
nections due to over inking are not totally eliminated. Also some of the earlier methods
introduce some spurious minutia points in the image. So to keep the recognition sys-
tem consistent these false minutiae need to be removed. first calculate the inter ridge
distance D which is the average distance between two neighboring ridges. For this scan
each row to calculate the inter ridge distance.All we label all thinned ridges in the fin-
gerprint image with a unique ID for further operation using a MATLAB morphological
operation BWLABEL [8].
• Minutiae Match
1. Alignment stage:
Given two fingerprint images to be matched, choose any one minutiae from each image
and calculate the similarity of the two ridges associated with the two referenced minu-
tiae points. If the similarity is more than a threshold transform each set of minutiae
to a new coordination system whose origin is at the referenced point and whose x axis
is coincident with the direction of the referenced point.
2. Match stage :
After geting two set of transformed minutiae points,they were used in the elastic match
algorithm to count the matched minutiae pairs by assuming two minutiae having nearly
the same position and direction are identical. If the minutiae is to be matched is within
the rectangle box placed and the direction discrepancy between them is very small, then
the two minutiae are regarded as matched minutia pair. Each minutiae in template
image either has no matched minutiae or has only one corresponding minutiae.

2.2.3 Ratio of Relational Distance Matching


The methodology is to obtain the common minutiae point set (minutiae points present in
both the base and the input image).The prime purpose of this phase is to find the number
of common minutiae points available in a pair of fingerprint images. Given two fingerprint
images with N1 and N2 identified minutiae points respectively (where N1 need not be equal
to N2), this phase outputs the M common minutiae points, which would be available in both
the images. If both are common then reference and input images are the same.

Dept.of ECE, S.I.T.,Tumakuru 8


Chapter 3
System Overview
This section includes a brief overview of all the components used in the system. Figure 3.1
describes the system in brief in the form of block diagram.

Figure 3.1: Block diagram of IOT based smart public distribution system.

3.1 Hardware Tools


Following components are used to achieve desired functionality.

1. Finger print module: A fingerprint module is interfaced with the Raspberry- pi. A
minutiae algorithm is used to process the fingerprint obtained from the module. Fin-
gerprint processing includes two parts: fingerprint enrollment and fingerprint matching.
During enrolling, user needs to enter the finger two times. The system will process the
two time finger images, generate a template of the finger based on processing results
and store the template.

9
IOT based Smart public distribution system 2016-17

2. Raspberri pi: The details of each user of the family are enrolled in the database.
Raspberry pi takes the serial number from reader and access corresponding record in
the database in accordance with the thumbprint identification.

3. Motor and Relay circuit: The motors are used to control the valve arrangement (i.e.to
open and close the valve). These motors are controlled by relay(timer) circuit. Relay
circuit is used for weight measurement as the grain falls through the funnel and when
it reaches the required amount the valve will close automatically.

4. Hydraulic Valve: The purpose of flow control in a hydraulic system is to regulate speed.
This valve controls the speed of an actuator by regulating the flow rate.The valve is
controlled by electric current which passes through a DC motor. The motor operates
the hydraulic valve to dispense the oil to the cardholders.

Dept.of ECE, S.I.T.,Tumakuru 10


Chapter 4
System Hardware
System hardware is the collection of physical parts of the project module. It includes various
modules like controllers, regulators and relay circuits.

4.1 Raspberry pi
The details of each card holder of the family are enrolled in the database. Raspberry
pi takes the serial number from reader and access corresponding record in the database in
accordance with the thumb-print identification.The Raspberry Pi is a credit-card-sized single-
board computer developed in the UK by the Raspberry Pi Foundation with the intention of
promoting the teaching of basic computer science in schools. Figure 4.1 shows the Raspberry
pi embedded board.

Figure 4.1: Raspberry pi embedded board.

1. processor: The heart of the Raspberry Pi is the processor. This chip is a 32 bit,
700 MHz System on a Chip, which is built on the ARM11 architecture. ARM chips
come in a variety of architectures with different cores configured to provide different
capabilities.

2. Secure Digital (SD) Card slot: There is no hard drive on the Pi. Everything is stored
on an SD Card. The minimum requirement for the SD card to store the Operating
System, programs, softwares and database must be 8GB.

11
IOT based Smart public distribution system 2016-17

3. USB port: On the Model B there are two USB 2.0 ports, but only one on the ModelA.
Some of the early Raspberry Pi boards were limited in the amount of current that they
could provide. Some USB devices can draw up 500mA.

4. Ethernet port: The model B has a standard RJ45 Ethernet port. The Model A does
not, but can be connected to a wired network by a USB Ethernet adapter (the port
on the Model B is actually an on-board USB to Ethernet adapter). Wi-fi connectivity
via a USB dongle is another option.

5. HDMI connector: The HDMI port provides digital video and audio output. 14different
video resolutions are supported, and the HDMI signal can be converted to DVI (used
by many monitors), composite (analog video signal usually carried over a yellow RCA
connector), or SCART (a European standard for connecting audio-visual equipment)
with external adapters.

6. Analog Audio output: This is a standard 3.5mm mini analog audio jack, intended
to drive high impedance loads (like amplified speakers). Headphones or unpowered
speakers wont sound very good.

7. Power input: This microUSB connector is used to supply power (this isnt an additional
USB port; its only for power).

4.2 Fingerprint Module


Fingerprint module is used for enrollment and authentication purpose. It needs to get
an image of the finger. The method employed to scan the image is optical scanning. The
heart of an optical scanner is a charge coupled device (CCD). A CCD is simply an array
of light-sensitive diodes called photosites, which generate an electrical signal in response to
light photons. Each photosite records a pixel, a tiny dot representing the light that hit that
spot Collectively, the light and dark pixels form an image of the scanned scene (a finger,
for example). Typically, an analog-to-digital converter in the scanner system processes the
analog electrical signal to generate a digital representation of this image.
The scanning process starts when a person places the finger on a glass plate, and a CCD
camera takes a picture. The scanner has its own light source, typically an array of light-
emitting diodes, to illuminate the ridges of the finger. The CCD system actually generates
an inverted image of the finger, with darker areas representing more rejected light and lighter
areas representing less rejected light (the valleys between the ridges).It checks the average

Dept.of ECE, S.I.T.,Tumakuru 12


IOT based Smart public distribution system 2016-17

pixel darkness, or the overall values in a small sample, and rejects the scan if the overall
image is too dark or too light. If the image is rejected, the scanner adjusts the exposure
time to let in more or less light, and then tries the scan again.

4.3 DC motor
Three DC motor system is used to open and close the valves for automatic distribution
of rice, sugar and oil. The initial valve arrangement is made to prevent fall of grains and oil.
The three DC motors, each having specifications 12 V, 60 RPM and 0.37 A are used for this
purpose.

4.4 Hydraulic valve


The purpose of flow control in a hydraulic system is to regulate speed. These valves

Figure 4.2: Cross sectional view of Hydraulic valve.

control the speed of an actuator by regulating the flow rate. The valve is controlled by
electric current passed through the DC motor. Here it is used to dispense the oil to the
card holder. A switch has to be pressed using DC motor arrangement to collect the liquid.
Their tasks are to shut off, release, dose, distribute or mix fluids. Figure 4.2 shows the cross
sectional view of Hydraulic valve.

Dept.of ECE, S.I.T.,Tumakuru 13


Chapter 5
System Software
The system software is the interface between hardware and user applications. A computer
program that is designed to run a computer’s hardware and application programs.

Figure 5.1: Flowchart of IOT based smart public distribution system.

14
IOT based Smart public distribution system 2016-17

Initially the user is asked to enter the ID and password given to them in the app. The
Raspberry pi compares the unique ID with the data base. If the ID matches, the user can
view their profile which will have details of their transactions. Then user is asked to scan the
finger. Once the user is authenticated, the commodity and quantity can be selected their itself
using buttons given. If the commodity and quantity are valid, the system dispenses the valid
commodity. However, if the authentication fails the system waits for valid authentication.
Figure 5.1 shows the flow chart of IOT based smart public distribution system.

5.1 Android Studio


Android Studio is the official integrated development environment (IDE) for Android
platform development.It was announced on May 16, 2013 at the Google I/O conference.
Android Studio is freely available under the Apache License 2.0. Google provides an IDE
called Android Studio to develop android applications. Android applications require specific
configuration files. The application logic is primarily written in the Java programming. The
android developing tool converts these files into an android application. The tooling allows
compiling, packaging, deploying and starting applications which are developed.
The Android Software Development Kit (Android SDK) and gradle tooling contains the
necessary tools for this. The android SDK contains the android debug bridge (ADB). ADB
is a tool that allows you to connect to a virtual or real android device. This allows managing
the device or debugging your application. Most of androids configuration files are based on
XML. The android tools provide special specialized editors for android specific files. These
editors typically allow switching between the XML representation of the file and structured
user interface.

5.2 Raspbian
Raspbian which is based on Linux Debian is used as an operating system for the proposed
project which has a strong documentation. Raspbian comes pre-installed with plenty of
software for education, programming and general use. It has Python, Scratch, Sonic Pi,
Java, mathematica and more.The raspbian with PIXEL image contained in the ZIP archieve
is over 4GB in size, which means that these archives use features which are not supported
by older unzip tools on some platforms.

5.3 Flowchart of minutiae based matching


Minutiae based fingerprint matching algorithm is explained in the Figure 5.2. Three
major steps are explained in the form of flowchart which also includes subprocesses that

Dept.of ECE, S.I.T.,Tumakuru 15


IOT based Smart public distribution system 2016-17

takes place to match the reference and input fingerprint.

Figure 5.2: Steps involved in fingerprint recognition.

Before purchasing user has to give their fingerprint in order to withdraw the commodities.
The stored templates are used as reference. When user tries to purchase the commodities
the input fingerprint is compared with stored database to identify the user. Later user can
buy the commodities if fingerprint is matched.

Dept.of ECE, S.I.T.,Tumakuru 16


Chapter 6
Results
This section illustrates the snapshots and results of the overall project.

6.1 Snapshots
The snapshots of the result are shown below. Finger print module is interfaced to the
Raspberry pi board through serial port. The user enters unique ID and password into the
android application which is then verified using stored database. It is followed by Finger
print identification to verify the identity of user.
After validating ID and password user is asked to scan the finger which acts as a level 2
authentication to stop any fraudulent activity in case if the ID and password are hacked.
Figure 6.1 shows the dispensing containers for three commodities rice, sugar and any fluid
which are connected by DC motors (for rice and sugar) and hydraulic valve arrangement
(for fluid)via H-bridge.

Figure 6.1: Snapshot showing the dispensing containers.

17
IOT based Smart public distribution system 2016-17

Figure 6.2 (a) displays user login page where they have to enter ID and password to see
their profile. Figure 6.2 (b) shows different options to the user. They can purchase, enroll
there fingerprint, delete unwanted fingerprint or view the profile. User can enroll his/her
fingerprint by pressing enroll button as shown in Figure 6.2 (c).

Figure 6.2: Snapshot showing an overview of android app.

If the user selects purchase on the android app, system will ask for fingerprint authenti-
cation, user is expected to provide fingerprint by placing a finger on fingerprint scanner as
shown in Figure 6.3.

Figure 6.3: Snapshot shows user enrolling fingerprint.

Dept.of ECE, S.I.T.,Tumakuru 18


IOT based Smart public distribution system 2016-17

If fingerprint matched with enrolled fingerprint of user. The system displays a message
as template is found otherwise no match found as shown in Figure 6.4.

Figure 6.4: Snapshot shows Fingerprint matching.

Now user can select different commodities like rice,sugar,oil as per his/her need, Figure 6.5
gives the snapshot of the android app, which shows the various commodities.

Figure 6.5: Snapshot showing types of commodities.

Figure 6.6 shows 1 Kg of rice being dispensed, if user needs another kilograms of rice then
they have to press the rice button once again.

Figure 6.6: Snapshot showing rice of 1 Kg being dispensed.

Dept.of ECE, S.I.T.,Tumakuru 19


IOT based Smart public distribution system 2016-17

Figure 6.7: Snapshot showing sugar of 1 Kg being dispensed.

Figure 6.7 shows 1 Kg of sugar being dispensed.


Figure 6.8 shows 1 liter of oil being dispensed through hydrollic valve which controls flow of
oil.

Figure 6.8: Snapshot showing fluid of 1 liter being dispensed.

Figure 6.9 shows the information about user transactions which is stored in the database.

Figure 6.9: Snapshot showing transaction details of user.

Dept.of ECE, S.I.T.,Tumakuru 20


IOT based Smart public distribution system 2016-17

6.2 MATLAB Results on fingerprint matching


The minutiae based matching algorithm consists of many steps. The each stage output
is simulated in MATLAB as we cannot show the simulations in Raspberry Pi. Initially
Histogram equalization is done to increase the contrast of the input fingerprint as shown in
Figure 6.10.

Figure 6.10: Figure showing histogram equalization of input fingerprint.

After histogram equalization, Fast Fourier Transform FFT is applied. output of FFT is
shown in Figure 6.11.

Figure 6.11: Figure showing FFT applied to equalized image.

The adaptive binarisation technique is used to convert FFT image into grey scale image as
shown in Figure 6.12.

Figure 6.12: Figure showing Adaptive Binarization.

Dept.of ECE, S.I.T.,Tumakuru 21


IOT based Smart public distribution system 2016-17

Block direction estimation method is used for estimate the region of interest as shown in
Figure 6.13.

Figure 6.13: Figure showing Block direction estimation.

The particular region of interest region ROI is selected as shown in Figure 6.14.

Figure 6.14: Figure showing selection of Region of Interest.

The ridges were thinned and removes H breaks and Spikes which were present due to insuf-
ficient light intensity of the fingerprint module as shown in Figure 6.15.

Figure 6.15: Figure showing ridge thinning and removal of H breaks.

The extraction of minutiae points are done by using ridge ending points and ridge bifur-
cation. Some of Minutiae points removed by false minutiae detection technique as shown in

Dept.of ECE, S.I.T.,Tumakuru 22


IOT based Smart public distribution system 2016-17

Figure 6.16. Matching of fingerprints were done using the Minutiae points. Similarly the
accuracy score will be given for the matched fingerprints. If the accuracy score is above
threshold value then user is authorized to access the system.

Figure 6.16: Figure showing extraction of minutiae points.

6.3 Quantity Analysis:


The quantity analysis of different commodities is tabulated as shown in Table 6.1. The
error in weight for rice is 0-20 grams and sugar is around 0-10 grams. In case of oil the
measurement error is around 0-50 ml.

Table 6.1: Analysis of quantity


Commodities Actual Quantity Measured Quantity Error in Previous batch error in [1]
Rice(Kg) 1 1 0 grams 15 grams
2 1.98 20 grams 30 grams
Sugar(Kg) 1 1 0 grams 20 grams
2 1.99 10 grams 25 grams
Oil(liter) 1 1 0 ml 50 ml
2 1.95 50 ml 100 ml

The desired quantity of ration which is dispensed by the system is measured by calibrating
the delay of opening and closing of the valve. The delay is calculated using trail and error
method. Compared to previous system this system gives better performance because the
accuracy in delay calculation is more.
Table 6.2 shows samples of same fingerprint with different alignment are compared with
each other and the percentage of similarities between them are tabulated based on minutiae
points. As the alignment of fingerprint changes, similarities between the reference and input

Dept.of ECE, S.I.T.,Tumakuru 23


IOT based Smart public distribution system 2016-17

Table 6.2: Similarity and number of minutiae points


Different Orientations Reference minutiae points Minutiae Points Similarity %
Authorized person 1 42 34 80.95
Authorized person 2 38 32 84.21
Authorized person 3 45 35 77.7
Authorized person 4 39 33 84.61
Authorized person 5 37 29 78.37
Unauthorized person 0 0 0

image decreases. The percentage of similarities is computed using Equation (6.1)

M inutiae points of input sample


percentage of similarity = ( ) ∗ 100 (6.1)
M inutiae points of ref rence sample

Table 6.3 shows the accuracy of algorithm as the database is increased from 100 to 1000
and time taken to do the matching between whole database and the input fingerprint. As
the database increases accuracy decreases and time taken to process the images increases.

Table 6.3: Accuracy analysis of database


No. of fingerprints Computation Time(sec) Accuracy %
100 2 89.2
250 3.5 85.5
500 4.2 79.2
750 4.8 72.3
1000 5.1 67.5

Dept.of ECE, S.I.T.,Tumakuru 24


Chapter 7
Conclusion and Future Work
IoT based Smart public distribution system is an automation system and it is a recompense
over the present fair price shops. Fingerprint authentication uses Minutiae extraction based
algorithm, which makes the system more secure and accurate. It eliminates fake ration card
holders and protects the interest of the common people ensuring the country’s food security.
By means of its performance one can reduce the corruption level. Selecting the commodity
and quantity through the android app will make the system more smart and robust. It will
help the country’s economy to reach new heights. The automated PDS is easy to implement
and requires much less hard work when compared to the other system. Using this system one
can avoid the malpractices because there is no manual operations and also all information
is stored in a database. So this system will be really helpful to the people.
Project can be further extended by making the payment to the purchased commodities
can be done online. Thus it will make system more automatic.Distance of communication
between server and client can be increased using internet.

25
Bibliography
[1] Suhas K, Suhas N, Sumukh B, Sunil S, A project report on Public distribution system
guided by Mrs. S Mala, Department of Electronics and Communication, SIT Tumakuru
2015-16.

[2] Sana A, Qader P, Dube R , Smart Card based e-Public Distribution System , Inter-
national Journal of Advanced Research in Computer and Communication Engineering
Vol. 5, Issue 5, May 2016.

[3] Bhalekar D, Kulkarni R, Lawande K, Patil V, Online Ration Card System by using
RFID and Biometrics , International Journal of Advanced Research Computer Science
and Software Engineering 5(10), pp. 849-851, October- 2015.

[4] Ashok Kumar D, Ummal Sariba B, A Comparative Study on Fingerprint Matching


Algorithms for EVM, Journal of Computer Sciences and Applications, Vol. 1, No. 4,
pp:55-60,2013.

[5] Sharath P, Prabhakar S, Jain A, On the individuality of fingerprints, IEEE Transactions


on Pattern Analysis and Machine Intelligence, VOL. 24, NO. 8, pp: 1010-1025, 2002.

[6] Xuejun T, Bir B, Fingerprint matching by genetic, algorithms, Pattern Recognition


Society, Published by Elsevier Ltd, 39 pp: 465-477, 2006.

[7] Deepika S, Rashmi S, Minutiae Based FingerprintMatching for Identification and Verifi-
cation, International Journal of Science and Research (IJSR), Vol. 17 Issue 6, November
2014.

[8] Rohit S , Utkarsh S , Vinay G A project report on Fingerprint Recognition, Department


of Computer Sciencewf7, Indian Institute of technology, Kanpur 2009-10

[9] Raspberry Pi
https://www.Raspberrypi.org

26
Appendix
Raspberry Pi
Quick Start Guide
The Raspberry Pi – Single Board Computer

Source: Raspberry Pi & Wiki


Chapter 1: RPi Hardware Basic Setup

Typical Hardware You Will Need


While the RPi can be used without any additional hardware (except perhaps a power supply
of some kind), it won't be much use as a general computer. As with any normal PC, it is
likely you will need some additional hardware.
The following are more or less essential:
• Raspberry Pi board
• Prepared Operating System SD Card
• USB keyboard
• Display (with HDMI, DVI, Composite or SCART input)
• Power Supply
• Cables
Highly suggested extras include:

• USB mouse
• Internet connectivity - a USB WiFi adaptor (Model A/B) or a LAN cable (Model B)
• Powered USB Hub
• Case

Connecting Together

You can use the diagram to connect everything together, or use the following instructions:

1. Plug the preloaded SD Card into the Pi.


2. Plug the USB keyboard and mouse into the Pi, perhaps via a USB Hub. Connect the
Hub to power, if necessary.
3. Plug the video cable into the screen (TV) and into the Pi.
4. Plug your extras into the Pi (USB WiFi, Ethernet cable, hard drive etc.). This is where
you may really need a USB Hub.
5. Ensure that your USB Hub (if any) and screen are working.
6. Plug the power source into the main socket.
7. With your screen on, plug the other end of the power source into the Pi.
8. The Pi should boot up and display messages on the screen.
It is always recommended to connect the MicroUSB Power to the unit last (while most
connections can be made live, it is best practice to connect items such as displays/h/w pin
connections with the power turned off).
The RPi may take a long time to boot when powered-on for the first time, so be patient!

Prepared Operating System SD Card


As the RPi has no internal storage or built-in operating system it requires an SD-Card that is
set up to boot the RPi.

• You can create your own preloaded card using any suitable SD card you have. Be sure
to backup any existing data on the card.
• Preloaded SD cards will be available from the RPi Shop.
This guide will assume you have a preloaded SD card.

Keyboard & Mouse


Most standard USB keyboards and mice will work with the RPi. Wireless keyboard/mice
should also function, and only require a single USB port for an RF dongle. In order to use a
Bluetooth keyboard or mouse you would need to use a Bluetooth dongle, which again uses a
single port.
Remember that the Model A has a single USB port and the Model B only has two (typically a
keyboard and mouse will use a USB port each).

Display
There are two main connection options for the RPi display, HDMI (high definition)
and Composite (low definition).

• HD TVs and most LCD Monitors can be connected using a full-size 'male' HDMI
cable, and with an inexpensive adaptor if DVI is used. HDMI versions 1.3 and 1.4 are
supported, and a version 1.4 cable is recommended. The RPi outputs audio and video
via HMDI, but does not support HDMI input.
• Older TVs can be connected using Composite (a yellow-to-yellow cable) or via
SCART (using a Composite to SCART adaptor). PAL and NTSC TVs are supported.
When using composite video, audio is available from a 3.5mm (1/8 inch) socket, and
can be sent to your TV, to headphones, or to an amplifier. To send audio your TV,
you will need a cable which adapts from 3.5mm to double (red and white) RCA
connectors.
Note: There is no VGA output available, so older VGA monitors will require an
expensive adaptor.
Using an HDMI to DVI-D (digital) adaptor plus a DVI to VGA adaptor will not work. HDMI
does not supply the DVI-A (analogue) needed to convert to VGA - converting an HDMI or
DVI-D source to VGA (or component) needs an active converter. (It can work out cheaper to
buy a new monitor.) The lack of VGA has been acknowledged as a priority issue.

Power Supply
The unit uses a Micro USB connection to power itself (only the power pins are connected - so
it will not transfer data over this connection). A standard modern phone charger with a micro-
USB connector will do, but needs to produce at least 700mA at 5 volts. Check your power
supply's ratings carefully. Suitable mains adaptors will be available from the RPi Shop and
are recommended if you are unsure what to use.
You can use a range of other power sources (assuming they are able to provide enough
current ~700mA):

• Computer USB Port or powered USB hub (will depend on power output)
• Special wall warts with USB ports
• Mobile Phone Backup Battery (will depend on power output) (in theory - needs
confirmation)
To use the above, you'll need a USB A 'male' to USB micro 'male' cable - these are often
shipped as data cables with MP3 players.

Cables
You will probably need a number of cables in order to connect your RPi up.

1. Micro-B USB Power Cable


2. HDMI-A or Composite cable, plus DVI adaptor or SCART adaptor if required, to
connect your RPi to the Display/Monitor/TV of your choice.
3. Audio cable, this is not needed if you use a HDMI TV/monitor.
4. Ethernet/LAN Cable

Additional Peripherals
You may decide you want to use various other devices with your RPi, such as Flash
Drives/Portable Hard Drives, Speakers etc.
Internet Connectivity
This may be an Ethernet/LAN cable (standard RJ45 connector) or a USB WiFi adaptor. The
RPi ethernet port is auto-sensing which means that it may be connected to a router or directly
to another computer (without the need for a crossover cable).

USB-Hub
In order to connect additional devices to the RPi, you may want to obtain a USB Hub, which
will allow multiple devices to be used.
It is recommended that a powered hub is used - this will provide any additional power to the
devices without affecting the RPi itself.
USB version 2.0 is recommended. USB version 1.1 is fine for keyboards and mice, but may
not be fast enough for other accessories.

Case
Since the RPi is supplied without a case, it will be important to ensure that you do not use it
in places where it will come into contact with conductive metal or liquids, unless suitably
protected.

Expansion & Low Level Peripherals


If you plan on making use of the low level interfaces available on the RPi, then ensure you
have suitable header pins for the GPIO (and if required JTAG) suitable for your needs.
Also if you have a particular low-level project in mind, then ensure you design in suitable
protection circuits to keep your RPi safe.

You might also like