You are on page 1of 80

“RFID BASED CAR PARKING SYSTEM”

A
Major Project Report

Submitted

in fulfillment

for the award of the degree of

Bachelor of Technology

In Department of Electronics & Communication Engineering

Supervisior: Submitted By:


Mr. Suraj Sharma Mahendra Meena (15EIAEC005)

HOD, (ECE Dept.) Shubham Pandey(15EIAEC011)

IET, Alwar Nandita Narayan (15EAEEC007)

Abhay Chouhan(15EIAEC001)

Department of Electronics & Communication Engineering

Institute of Engineering & Technology, Alwar

Rajasthan Technical University, Kota (Rajasthan)


CANDIDATE’S DECLARATION
We hereby declare that the work, which is being presented in the Project, entitled “ RFID
Based Car Parking System” in fulfillment for the award of Degree of Bachelor of
Technology in the Department of Electronics & Communication Engineering with
Specialization in Electronics & Communication Engineering, and submitted to the
Department of Electronics & Communication Engineering, Institute of Engineering &
Technology, Alwar, Rajasthan Technical University, Kota is a record of our own
investigations carried under the Guidance of Mr. Suraj Sharma, Head of Department,
Department of Computer Science & Engineering, Institute of Engineering & Technology,
Alwar. We have not submitted the matter presented in this project anywhere for the award of
any other Degree.

Mahendra Meena
(Roll No. 15EIAEC005)
Shubham Pandey
(Roll No.: 15EIAEC011)
Nandita Narayan
(Roll No.: 15EAEEC007)
Abhay Singh Chouhan
(Roll No.: 15EIAEC001)

Counter Signed by

Mr. Suraj Sharma


Assist Head of Department
Department of Electronic & Communication Engineering
Institute of Engineering & Technology, Alwar (Rajasthan)

i
ACKNOWLEGEMENT
We would like to thank Chairman Dr.V. K. Agarwal, Executive Director Dr. Manju
Agarwal, Principal Dr. Anil Kumar Sharma, Project In-charge Mr. Suraj Sharma Head
Department of Electronics & Communication Engineering for providing all the facilities and
working environment in the institute. We also like to thank the entire institute faculty
members who have helped us directly or indirectly to complete this work.
It is with deep sense of gratitude and reverence that We express our sincere thanks to
highly respectable supervisor Mr. Suraj Sharma , Head of Department, Department of
Electronics & Communication Engineering, Institute of Engineering & Technology, Alwar.
He has played a pivotal role for giving our guidance, encouragement, help and useful
suggestion throughout. His untiring and painstaking efforts, methodological approach and
individual help made it possible to complete this work in time. We consider ourselves very
fortunate for having been associated with the supervisor like him. His affection, guidance and
scientific approach served a veritable incentive for completion of this work.

Mahendra Meena(15EIAEC005)
Shubham Pandey(15EIAEC011)
Nandita Narayan (15EAEEC007)
Abhay Singh Chouhan(15EIAEC001)
B.Tech. (Electronics & Communication Engineering)

ii
CERTIFICATE
This is to certify that the Major Projrct Report entitled “RFID BASED CAR PARKING
SYSTEM ” submitted by Mahendra Meena, Shubham Pandey, Nandita Narayan and
Abhay Singh Chouhan under my supervision is student’s own work has not been submitted
elsewhere for the award of any degree, To the best of my knowledge and Belief.

DATE: SIGNATURE:…………

Name of Guide: Mr. Suraj Sharma

HOD ( ECE Dept.)


Table of Contents
Candidate’s Declaration ----------------------------------------------------------------------------------- ii
ACKNOWLEGEMENT ---------------------------------------------------------------------------------- iii
CERTIFICATE-------------------------------------------------------------------------------------------- iv
Table of Contents-------------------------------------------------------------------------------------------v-vi
List of Figures -----------------------------------------------------------------------------------------------vii
List of Tables ----------------------------------------------------------------------------------------------- viii
List of Abbreviations ------------------------------------------------------------------------------------ ix
CHAPTER 1:INTRODUCTION ---------------------------------------------------------------------- 1-2
1.1 Introduction ----------------------------------------------------------------------------------------------- 1
1.2 Issues and Challenges ----------------------------------------------------------------------------------- 2
1.3 Applications ------------------------------------------------------------------------------------------- 2
CHAPTER2:PROBLEM STATEMENT ------------------------------------------------------------- 3-4
1.1 Introduction ----------------------------------------------------------------------------------------------- 3
CHAPTER3:PROJECT DESCRIPTION ------------------------------------------------------------ 5-7
3.1 Introduction ----------------------------------------------------------------------------------------------- 5
3.2 Product Features -------------------------------------------------------------------------------------- 6
3.3 DataFlow Diagram ----------------------------------------------------------------------------------- 7
CHAPTER4:RESULT & ANALYSIS -------------------------------------------------------------- 8-40
4.1 Introduction------------------------------------------------------------------------------------------------ 8
4.2 Modules ------------------------------------------------------------------------------------------------ 8
4.3 Hardware Required ---------------------------------------------------------------------------------- 9
4.4 Software Requirement-------------------------------------------------------------------------------- 37
CHAPTER5:COST ESTIMATION ---------------------------------------------------------------- 41-43
5.1 Introduction---------------------------------------------------------------------------------------------- 41
5.2 Cost estimate types---------------------------------------------------------------------------------- 41
CHAPTER 6: Raspberry Pi Camera Module -------------------------------------------------- 44-48
6.1 Introduction --------------------------------------------------------------------------------------------44
6.2 Camera Details ------------------------------------------------------------------------------------------44
CHAPTER 7: SMPT----------------------------------------------------------------------------------------49
7.1 Introduction ------------------------------------------------------------------------------------------------ 49

v
7.2 History --------------------------------------------------------------------------------------------------------- 49
7.3 Mail Processing Model ------------------------------------------------------------------------------------- 51
7.4 Ports------------------------------------------------------------------------------------------------------------ 55
CONCLUSION --------------------------------------------------------------------------------------------- 57
REFERENCES---------------------------------------------------------------------------------------------- 58
Appendix---------------------------------------------------------------------------------------------- 59-69
1. Source Code --------------------------------------------------------------------------------------------- 59

vi
List of Figures
S.No. Figure Name Page No.
Figure 2.1 Introduction to RFID System 5
Figure 3.1 RFID Architecture 7
Figure 3.2 RFID In public area 8
Figure 3.3 Analysis 9
Figure 3.4 Connectivity 11
Figure 3-5 Flow chart 11
Figure 3.6 Use case diagram 14
Figure 3.7 Sequence diagram 15
Figure 3.8 Class diagram 16
Figure 3.9 Model 1 Architecture 18
Figure 4.1 Model 2 architecture 18
Figure 4.2 Real view of model 2 19
Figure 4.3 System Architecture 20
Figure 4.4 Raspberry Pi 20
Figure 4.5 Raspberry Pi Pin 21
Figure 4.6 Ultrasonic Sensor 24
Figure 4.7 Waveform of ultrasonic 25
Figure 4.8 Time waveform 26
Figure 4.9 Servo Motor 28
Figure 4.10 Power
Figure 4.11 LED 31
Figure 4.12 Display 28
Figure 4.13 Rfid reader (RC522) 30
Figure 4.14 Original view of our project 31
Figure 4.15 Real time analysis 31
Figure 4.16 Real time location 32
Figure 4.17 Rfid car parking view 33
ewew vii
List of Tables
Table No. Table name Page No.
Table1 Software Requirement 21
Table2 CostEstimationchart 22
Table3 RaspberryPi3TechnicalSpecifications 26
Table4 Board Connectors 29
Table5 Electric Parameter 35
Table6 DeviceSelectionGuide 40

viii
List of Abbreviations
System Rfid Rc522
Board Wooden board
PIR Passive Infra-Red
IoT Internet of Things
GUI Graphical User Interface
Qty Quantity
Approx. Approximate
Wi-Fi Wireless Fidelity
LED Light Emitted Diode
IDLE Integrated Development Environment
SSID Service Set Identifier
MySql Saves Data into table
RAD Rapid Application Development
Rpi Raspberry Pi
SoC System on Chip
HTTP Hyper Text Transfer Protocol
GND Ground
GPIO General Purpose Input Output
SPI Serial Peripheral Interface
PWM Pulse Width Modulation
SSD Solid State Drive
SD card Secure Digital Card
DDR2 Double Data Rate 2
GHz Giga Hertz
LAN Local Area Network
ix
CHAPTER: 1
1.1 Introduction
Radio-frequency identification (RFID) is an automatic identification method
wherein the data stored on RFID tags or transponders is remotely retrieved. The
RFID tag is a device that can be attached to or incorporated into a product,
animal or person for identification and tracking using radio waves. Some tags
can be read from several meters away, beyond the line of sight of the reader.

RFID technology is used in vehicle parking system of malls and buildings.the


system normally consists of a vehicle counter,sensor,displayboard,controller,rfid
tags and rfid reader.

RFID technology is used in vehicle parking systems of malls and buildings


The system normally consists of a vehicle counter, sensors, display board, gate
controller, RFID tags and RFID reader.Basically, an RFID system consists of
an antenna or coil, a transceiver (with decoder) and a transponder (RF tag)
electronically programmed with unique information. There are many different
types of RFID systems in the market. These are categorised on the basis of their
frequency ranges. Some of the most commonly used RFID kits are low-
frequency (30-500kHz), mid-frequency (900kHz-1500MHz) and high-frequency
(2.4-2.5GHz)
Issues and Challenges

Technical problems with RFID

 Problems with RFID Standards

 RFID systems can be easily disrupted

 RFID Reader Collision

 RFID Tag Collision

 RFID tags are difficult to remove

 RFID tags can be read without your knowledge.

1
1.2 Applications
 Product Tracking – RFID tags are increasingly used as a cost-effective way to
track inventory and as a substitute for barcodes. For instance, bookstores such as
Barnes & Noble use RFID to identify books to be removed from shelves and
returned to publishing houses.
 Toll Road Payments – Highway toll payment systems, such as E-Z Pass in the
eastern states, uses RFID technology to electronically collect tolls from passing
cars. Instead of stopping at the toll booth, cars pass directly through in the E-Z
Pass lane and the toll is automatically deducted from a pre-paid card.
 Passports – A number of countries, including Japan, the United States, Norway,
and Spain incorporate RFID tags into passports to store information (such as a
photograph) about the passport holder and to track visitors entering and exiting the
country.
 Identification – RFID chips can be implanted into animals and people to track their
movements, provide access to secure locations, or help find lost pets.
 Libraries – Libraries use RFID tags in books and other materials to track circulation and
inventory, store product information (such as titles and authors), and to provide security
from theft. Because RFID tags can be scanned without physically touching the item,
checking books in and out, plus doing laborious tasks such as shelf inventory, can be
accomplished quickly and efficiently using RFID technology.
 Shipping – Large shipments of materials, such as retail goods, often utilize RFID
tags to identify location, contents, and movement of goods. Wal-mart is one of the
largest consumers of this technology to assist in tracking shipments of
merchandise.
 Other uses – RFID tags are employed in numerous other ways, including
implantation in Saguaro cacti to discourage black-market traders, placement in car
tires to transmit road condition information to the onboard computer, and
placement around cities (such as Tokyo) to transmit tourist information to visitor
cell phones.

2
CHAPTER: 2
2.1 Introduction
Car parking management in organizations and malls often consists of many tasks like issuing
tokens, noting the check-in and check-out time, calculating fare and finally collecting the
amount.
 As the number of vehicles are increasing, the problems faced by manual parking
management system are also increasing. Such problems can be eliminated to
some extent by implementing an intelligent parking system where the entry and
exit of cars is monitored and payment is made easy with sensor technology.
 This project deals with an interesting manner of security access based car parking
system using AT89C51 microcontroller and RFID Technology.
 . The principle of operation of the project lies in functioning of RFID, RTC and
EEPROM.
 RFID Card is specific to the user and the card details are pre-programmed in the
microcontroller. When the RFID card is swiped against the RFID Reader.
 The reader then transmits the card’s information to the microcontroller via serial
communication protocol.
 if the card is existing in the database, the microcontroller will check for the
current time in the RTC module and stores the in time details of the particular
card in the EEPROM.
 The communication between the microcontroller and RTC module is using I2C
protocol. The communication between the microcontroller and the EEPROM is
also using I2C protocol.
 If the card is swiped again, the in time details from the EEPROM and out time
details from the RTC are taken and the fare is calculated as per the tariffs.
Radio-frequency identification (RFID) uses electromagnetic fields to automatically identify
and track tags attached to objects. The tags contain electronically-stored information. Passive
tags collect energy from a nearby RFID reader's interrogating radio waves. Active tags have a
local power source (such as a battery) and may operate hundreds of meters from the RFID
reader. Unlike a barcode, the tag need not be within the line of sight of the reader, so it may
be embedded in the tracked object.

3
RFID tags are used in many industries, for example, an RFID tag attached to an automobile
during production can be used to track its progress through the assembly line; RFID-tagged
pharmaceuticals can be tracked through warehouses; and implanting RFID microchips in
livestock and pets allows for positive identification
animal.

4
CHAPTER: 3
PROJECT DESCRIPTION

3.1 Introduction

Radio-frequency identification (RFID) is an automatic identification method wherein


the data stored on RFID tags or transponders is remotely retrieved. The RFID tag is a
device that can be attached to or incorporated into a product, animal . Internal
diagram of a typical RFID antenna Automatic vehicle parking system .Internal
structure of typical RFID tag or person for identification and tracking using radio
waves. Some tags can be read from several metres away, beyond the line of sight of
the reader. RFID technology is used in vehicle parking systems of malls and
buildings .The system normally consists of a vehicle counter, sensors, display board,
gate controller,

Figure 3.1RFID car parking system

The project is a car authorizing system where the system can only allow a car entry
when a valid RFID card id swiped by the car owner. The system also had paid
parking facility where the amount of parking gets deducted automatically whenever
the card is swiped and the available number of car parking are displayed on a seven .

5
3.2 Product Features
 Data capacity. The capacity of data storage on a tag can vary from 16 bits to
several thousand bits. Of course, the greater the storage capacity, the higher
the price of the tag.
 Form factor. The tag and antenna structure can come in a variety of physical
form factors and can either be self-contained or embedded as part of a
traditional label structure (termed as ‘smart label,’ it has the tag inside what
looks like a regular bar code label).
 Passive and active. Passive tags have no battery and broadcast their data only
when energised by a reader. It means these must be actively polled to send
information. Active tags broadcast data using their battery power. This means
their read range is greater than passive tags—around.

6
3.3 Data Flow Diagram

Fig 3.3

The workflow design depicts the flow of data and information through the system.
It caters for the logical developer design options and defines actions of given
decisions and information process flows. Fig illustrates the design achieved from
the requirements of this research.

7
CHAPTER: 4

4.1 Introduction

As per the system architecture project successfully done. And working well
as per designed, All the methods and models are describing in models.

4.2 Modules

4.2.1 Module 1 – Design & Planning

The system design and architecture based on the requirements specifications


identified from the analysis of the data collected. It defines the stakeholders
of the system, the system components, the system data models and system
process models. The chapter also reviews the database design and provides an
illustration of the interface wireframes of the system.
The system consists of three main components; a cloud based server setup,
NodeMCU Microcontroller used to interface the sensor system and the Azure
cloud. Dustbins in an area are embedded with low power and low cost smart
ultrasonic and gas sensors that are connected to the cloud, which acts as a
urth and its fill-level
central hub for all bins. The bins transmit their gas content
status to the central cloud platform. The cloud platform f er pushes the data to
the client app a GUI (Web or mobile) in which the current gas content and their
state (filled or not) is displayed. Database maintained at the central server can
be used to generate the monthly or yearly reports regarding amount of waste
collected in a week, month or year. This data can be used for management
purposes. See fig for the architectural diagram. Our smart dustbin has two
model. One is bonnetmodel and another one is hole model.
□ Working is same of the both dustbin.

□ One have open with bonnet than another will small area front of the dustbin.

□ Both dustbin have same sensors, motors, LEDs

□ Model one designed for domestic waste and model two designed
for hotel, Cafes and restaurants.

8
4.3 Hardware Required:

Figure System Architecture

1. Raspberry Pi 3 Model B

Figure Raspberry Pi

9
Figure Raspberry Pi 3 Model B Pin Configuration

Table 1: Raspberry Pi 3 Technical Specifications

Microprocessor Broadcom BCM2837 64bit Quad Core Processor


Processor 3.3V
Operation
Raw Voltage input 5V, 2A power source
Maximum current 16mA
through each I/O pin
Maximum total 54mA
Current
Flash Memory 16Gbytes SSD memory card
(Operating System)
Internal RAM 1Gbytes DDR2

10
Clock Frequency 1.2GHz
GPU Dual Core Video Core IV® Multimedia Co-
Processor. Provides Open GLES 2.0,
hardware- accelerated Open VG, and 1080p30
H.264 high- profile decode.
Capable of 1Gpixel/s, 1.5Gtexel/s or
24GFLOPs with texture filtering and DMA
Ethernet 10/100 Ethernet
Wireless Connectivity BCM43143 (802.11 b/g/n Wireless LAN
and Bluetooth 4.1)
Operating Temperature -40ºC to +85ºC

Table 2: Board Connectors

Name Description
Ethernet Base T Ethernet Socket
USB 2.0 (Four sockets)
Audio Output 3.5mm Jack and HDMI
Video output HDMI
Camera 15-pin MIPI Camera Serial Interface (CSI-2)
Connector
Display Display Serial Interface (DSI) 15 way flat flex cable connector
Connector with two data lanes and a clock lane.
Memory Push/Pull Micro SDIO
Card

□ Similar Boards

RASPBERRY PI – 2, RASPBERRY PI – 1, RASPBERRY PI – ZERO,


RASPBERRY PI – 2 B+
□ Other Development Boards

INTEL GALILEO, INTEL EDISON, ESP32, ARDUINO DUE

11
□ Where RASPBERRY PI 3 is Used?

RASPBERRY PI platform is most used after ADRUINO. Although overall


applications of PI are less it is most preferred when developing advanced
applications. Also the RASPBERRY PI is an open source platform where one can
get a lot of related information so you can customize the system depending on the
need.
□ How to Use RASPBERRY PI 3?

As mentioned earlier PI is simply a COMPUTER ON A SINGLE BOARD so


it cannot be used like ARDUINO development boards. For the PI to start working
we need to first install OPERATING SYSTEM. This feature is similar to our PC.
The PI has dedicated OS for it; any other OS will not work.
We will discuss the programming of PI in step by step below.

1. Take the 16GB micro SD card and dedicate it specifically for PI OS.

2. Choose and Download OS software.


[https://www.raspberrypi.org/downloads/] (‘NOOBS’ recommended for
beginners )
3. Format the SD card and install OS on to the SD memory card using convenient
methods.

4. Take the SD card after OS installation and insert it in PI board.

5. Connect monitor, keyboard and mouse

6. Power the board with micro USB connector

7. Once the power is tuned ON the PI will run on the OS installed in the
memory card and will start from boot.
8. Once all drivers are checked the PI will ask for authorization, this is set by
default and can be changed.
9. After authorization you will reach desktop where all application program
development starts.
On the PI you can download application programs required for your use and can
directly install as you do for your PC. After that you can work on developing
required program and get the PI run the developed programs.

12
□ Applications

□ Hobby projects.

□ Low cost PC/tablet/laptop

□ IoT applications

□ Media center
□ Robotics

□ Industrial/Home automation

□ Server/cloud server

□ Print server

□ Security monitoring

□ Web camera

□ Gaming

□ Wireless access point

□ Environmental sensing/monitoring (e.g. WEATHER STATION)


2. Ultrasonic Sensor

Figure U l t r a s o n i c Sensor

13
Product Features:

Ultrasonic ranging module HC - SR04 provides 2cm - 400cm non-contact


measurement function, the ranging accuracy can reach to 3mm. The modules
includes ultrasonic transmitters, receiver and control circuit. The basic principle
of work:
□ Using IO trigger for at least 10us high level signal,

□ The Module automatically sends eight 40 kHz and detect whether


there is a pulse signal back.
□ IF the signal back, through high level , time of high output IO
duration is the time from sending ultrasonic to returning.
Test distance = (high level time×velocity of sound (340M/S) / 2,

Wire connecting direct as following:


□ 5V Supply

□ Trigger Pulse Input

□ Echo Pulse Output

Ultrasonic principle:

Ultrasonic sensors emit short, high-frequency sound pulses at regular


intervals. These propagate in the air at the velocity of sound. If they strike an
object, then they are reflected back as echo signals to the sensor, which itself
computes the distance to the target based on the time-span between emitting the
signal and receiving the echo.

Figure : Principle of ultrasonic sensor

14
As the distance to an object is determined by measuring the time of flight
and not by the intensity of the sound, ultrasonic sensors are excellent at
suppressing background interference. Virtually all materials which reflect
sound can be detected, regardless of their colour. Even transparent materials
or thin foils represent no problem for an ultrasonic sensor. Microsonic
ultrasonic sensors are suitable for target distances from 20 mm to 10 m and as
they measure the time of flight they can ascertain a measurement with pinpoint
accuracy. Some of our sensors can even resolve the signal to an accuracy of
1.25 mm. Ultrasonic sensors can see through dust-laden air and ink mists.
Even thin deposits on the sensor membrane do not impair its function.
Sensors with a blind zone of only 20 mm and an extremely thin beam spread
are making entirely new applications possible today: Fill level measurement in
wells of microtiter plates

15
and test tubes, as well as the detection of small bottles in the packaging
industry, can be implemented with ease. Even thin wires are reliably detected.
Electric Parameter

Table 3 Electric Parameter

1. Timing diagram

The Timing diagram is shown below. You only need to supply a short 10uS pulse
to the trigger input to start the ranging, and then the module will send out an 8
cycle burst of ultrasound at 40 kHz and raise its echo. The Echo is a distance
object that is pulse width and the range in proportion. You can calculate the range
through the time interval between sending trigger signal and receiving echo signal.
Formula: uS / 58 = centimeters or uS / 148 =inch; or: the range = high level time *
velocity (340M/S) / 2; we suggest to use over 60ms measurement cycle, in order to
prevent trigger signal to the echo signal.

Figure Time Waveform

16
o The module is not suggested to connect directly to electric, if connected
electric, the GND terminal should be connected the module first, otherwise,
it will affect the normal work of the module.
o When tested objects, the range of area is not less than 0.5 square meters and
the plane requests as smooth as possible, otherwise ,it will affect the results
of measuring.

1. Servo Motor

Figure Servo Motor

□ MG90S servo, Metal gear with one bearing

Tiny and lightweight with high output power, this tiny servo i Helicopter,
Quadcopter or Robot. durability. Servo can rotate approximately 180 degrees (90
in each direction), and works just like the standard kinds but smaller. You can
use any servo code, hardware or library to control these servos. Good for
beginners who want to make stuff move without building a motor controller
with feedback & gear box, especially si (arms) and hardware.
□ Specifications

□ Weight: 13.4 g

17
□ Dimension: 22.5 x 12 x 35.5 mm approx.

□ Stall torque: 1.8 kgf·cm (4.8V ),2.2kgf.cm(6 V)

□ Operating speed: 0.1 s/60 degree(4.8 V),0.08 s/60 degree (6 V)

□ Operating voltage: 4.8 V – 6.0 V

Figure P o w e r Signal

 LED (Light Emitted Diode)

Figure L E D

18
Features:

□ Popular T-1 3/4 colorless 5mm package. ․

□ High luminous power. ․

□ Typical chromaticity coordinates x=0.30, y=0.29 according to CIE1931. ․

□ Bulk, available taped on reel. ․

□ ESD-withstand voltage: up to 4KV ․

□ The product itself will remain within RoHS compliant version.


□ Descriptions

□ The series is designed for application required high luminous intensity.

□ The phosphor filled in the reflector converts the blue emission of InGaN
chip to ideal white.
□ Applications

□ Outdoor Displays

□ Optical Indicators

□ Backlighting

□ Marker Lights
Table 4 Device Selection Guide

19
Notes:

1. All dimensions are in millimeters, and tolerance is 0.25mm except


being specified.
2. Lead spacing is measured where the lead emerges from the package.
3. Protruded resin under flange is 1.5mm Max. LED.

Fig. 5.Display (16x2)

Pin Configuration

Pin No: Pin Name: Description

1 Vss (Ground) Ground pin connected to system ground

2 Vdd (+5 Volt) Powers the LCD with +5V (4.7V – 5.3V)

3 VE (Contrast V) Decides the contrast level of display. Grounded to get maximum


contrast.

4 Register Select Connected to Microcontroller to shit between command/data register

20
5 Read/Write Used to read or write data. Normally grounded to write data to LCD

6 Enable Connected to Microcontroller Pin and toggled between 1 and 0 for data
acknowledgement

7 Data Pin 0

8 Data Pin 1
Data pins 0 to 7 forms a 8-bit data line. They can be connected to

9 Data Pin 2 Microcontroller to send 8-bit data.


These LCD’s can also operate on 4-bit mode in such case Data pin 4,5,6
10 Data Pin 3 and 7 will be left free.

11 Data Pin 4

12 Data Pin 5

13 Data Pin 6

14 Data Pin 7

15 LED Positive Backlight LED pin positive terminal

16 LED Negative Backlight LED pin negative terminal

21
Features of 16×2 LCD module

 Operating Voltage is 4.7V to 5.3V


 Current consumption is 1mA without backlight
 Alphanumeric LCD display module, meaning can display alphabets and numbers
 Consists of two rows and each row can print 16 characters.
 Each character is build by a 5×8 pixel box
 Can work on both 8-bit and 4-bit mode
 It can also display any custom generated characters
 Available in Green and Blue Backlight
Brief Description on LCD modules

LCD modules are vey commonly used in most embedded projects, the reason being its
cheap price, availability and programmer friendly. Most of us would have come across
these displays in our day to day life, either at PCO’s or calculators. The appearance and the
pinouts have already been visualized above now let us get a bit technical. 16×2 LCD is
named so because; it has 16 Columns and 2 Rows. There are a lot of combinations
available like, 8×1, 8×2, 10×2, 16×1, etc. but the most used one is the 16×2 LCD. So, it
will have (16×2=32) 32 characters in total and each character will be made of 5×8 Pixel
Dots. A Single character with all its Pixels is shown in the below picture.

Block Diagram of LCD Display

22
Control and display commands

Instruction Instruction Code Instruction Code Execution


Description time
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

Read Data Read data from 1.53-


1 1 D7 D6 D5 D4 D3 D2 D1 D0
From RAM internal RAM 1.64ms

Write data into


Write data 1.53-
1 0 D7 D6 D5 D4 D3 D2 D1 D0 internal RAM
to RAM 1.64ms
(DDRAM/CGRAM)

Busy flag (BF: 1→


LCD Busy) and
Busy flag &
0 1 BF AC6 AC5 AC4 AC3 AC2 AC1 AC0 contents of address 39 µs
Address
counter in bits AC6-
AC0.

Set DDRAM Set DDRAM address


0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0 39 µs
Address in address counter.

23
Set CGRAM Set CGRAM Address
0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0 39 µs
Address in address counter.

Set interface data


length (DL: 4bit/8bit),
Numbers of display line
Function Set 0 0 0 0 1 DL N F X X (N: 1-line/2-line) 39 µs
display font type (F:0→
5×8 dots, F:1→ 5×11
dots)

Set cursor moving and


display shift control bit,
Cursor or
0 0 0 0 0 1 S/C R/L X X and the direction 39 µs
Display Shift
without changing
DDRAM data

Set
Display &
Display(D),Cursor(C)
Cursor 0 0 0 0 0 0 1 D C B 39 µs
and cursor blink(b)
On/Off
on/off control

Assign cursor moving


Entry Mode
0 0 0 0 0 0 0 1 I/D SH direction and enable 0µs
Set
shift entire display.

Set DDRAM Address to


“00H” from AC and
Return
0 0 0 0 0 0 0 0 1 X return cursor to its 43µs
Home
original position if
shifted.

Write “20H” to
Clear DDRAM and set
0 0 0 0 0 0 0 0 0 1 43µs
Display DDRAM Address to
“00H” from AC

24
AC -Address Counter

Outline

Now the instruction can be divided mainly in four kinds

1) Function set instructions

2) Address set instructions

3) Data transfer instructions with internal RAM

4) Others

Details of the Instructions

1) Read Data from RAM

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

1 1 D7 D6 D5 D4 D3 D2 D1 D0

Read 8bit binary data from DDRAM/CGRAM

The selection of RAM is set by the previous address set instruction. If the address set
instruction of RAM is not performed before this instruction, the data that is read first is
invalid, because the direction of AC is not determined. If the RAM data is read several
times without RAM address set instruction before read operation, the correct RAM data
from the second, but the first data would be incorrect, as there is no time to transfer RAM
data. In case of DDRAM read operation, cursor shift instruction plays the same role as
DDRAM address set instruction; it also transfers RAM data to the output data registers.

After read operation, the data address counter is automatically increased or decreased by 1
according to the entry mode. After CGRAM read operation, display shift may not be
executed properly.

*In case of RAM write operation, AC is increased or decreased by 1 like that of the read
operation. In this time AC indicates the next address position, but the previous data can
only by the read instruction.

2) Write data to ram

25
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

1 0 D7 D6 D5 D4 D3 D2 D1 D0

Write binary 8bit data to DDRAM/CGRAM. The selection of CGRAM or DRAM is set by
the previous address set instruction; DDRAM address set, CGRAM address set. RAM set
instruction can also determine the AC direction to RAM.

After write operation, the address is automatically increased or decreased by 1 according


to the entry mode.

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 1 BF AC6 AC5 AC4 AC3 AC2 AC1 AC0

3) Read Busy Flag and Address

By making this read out operation, it can be determined if the LCD is performing some
internal operation or not. If Busy Flag (BF) is high, some internal operation is going inside
the LCD at that particular moment. To perform further operation the data source (e.g.
micro controller) must wait for the BF to go low. Here, the address counter value can also
be read.

4) Set DDRAM Address

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 1 AC6 AC5 AC4 AC3 AC2 AC1 AC0

Set DDRAM address to AC, this instruction makes DDRAM data available from MPU. In
1-line display mode, DDRAM address rangers from “00H” to “4FH”. In 2-line display
mode, DDRAM address in the first line ranges from “00H” to “27H”, and DDRAM
address in the 2nd line is from “40H” to “67H”.

5) Set CGRAM address

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0

26
Set CGRAM address to AC. This instruction makes CGRAM data available from MPU.

6) Function Set

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 0 1 DL N F X X

DL: Interface data length control bit

DL=’1’ means 8bit mode of data transfer.

DL=’0’ means 4bit mode of data transfer

When 4 bit mode is activated, the data needs to be transferred in two parts, first higher
4bits, and then lower 4 bits.

N: display line number control bit

N=’1’ will allows to characters to display in 2-lines

N=’0’ will allows to characters to display in the first line only

F: display font control bit

F=’0’ will use 5×8 dots format display mode

F=’1’ will use 5×11 dots format display mode

7) Cursor or display Shift

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 0 0 1 S/C R/L X X

Without writing or reading the display data, shifting right/left cursor position or display.

This instruction is made to correct or search or display data. During 2-line display mode,
cursor moves to the 2nd line after the 40th digit of the 1st line.

When displayed data is shifted repeatedly, each line shifts individually.

When display shift is performed, the contents of the address counter are not changed.

27
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 0 0 0 1 D C B

8) Display On/Off Control

This instruction controls Display, Cursor and cursor blink.

D: Display On/Off control bit

D=’1’ means entire display is turned on

D=’0’ means entire display is turned off. But Display data remains in DDRAM.

C: cursor On/Off control bit

C=’1’ turns on the cursor

C=’0’ turns off the cursor. But I/D register retains the data

B: Cursor blink On/Off control bit

B=’1’ makes cursor blink periodically.

B=’0’ stops the cursor to blink and cursor looks steady if the Cursor is turned on.

9) Entry Mode Set

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 0 0 0 0 1 I/D SH

This instruction sets the moving direction of cursor and display.

When I/D= ’1’ cursor moves to the right and DDRAM address is increased by 1.

When I/D= ’0’ cursor moves to the left and DDRAM address is decreased by 1.

CGRAM operates in the same way in this setting.

10) Return Home

28
RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 0 0 0 0 0 1 X

This instruction sets the address counter to ‘00H’, and returns the cursor to the first column
of first line. And if display is shifted previously, this instruction shifts this too. The
DDRAM contents don’t change in this instruction.

11) Clear display

RS R/W DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0

0 0 0 0 0 0 0 0 0 1

Clear all the display data by writing “20H” (ASCII code of ‘space’ character) to all
DDRAM address, AND set value DDRAM address counter (AC) to “00H”. It returns the
cursor to the first column of first line and sets the entry mode to increment mode (I/D=’1’).

8-bit and 4-bit interfacing of LCD

Now the question is how to display data in the LCD or give command to it. There is two
modes of data transfer are supported by LCD displays. One is 4bit mode, another is 8 bit
mode. To transfer data In 8 bit mode, first put your data in the 8bit bus, then put command
in the command bus and then pulse the enable signal.

To send data in 4bit mode; first put upper 4bit in the 4 bit data bus connected to 4MSB
pins of LCD display, then put control signals in the control bus, then pulse the E pin once.
Next put the lower 4 bit in the data bus and pulse the E pin again. Here is a flowchart
simply describing it.

29
LCD Display Interfacing – Flowchart:-

LCD Interfacing - Flowchart

LCD Initialization

We are pretty familiar how to send data. But before displaying characters on the LCD
display, it must be configured first. To configure an LCD display, four command words
must be sent to LCD in either 4 bit mode, or in 8 bit mode. The commands are:

1. Function set

2. Display On/Off control

3. Entry mode set

4. Display Clear

Here is a flow chart of the initialization sequence of LCD display.

30
LCD Initialization

Displaying Custom Characters

All these character display modules got the feature to create 8 user defined characters
(ASCII Codes 0…7) in addition to the ROM fixed codes.

1.) The command “CG RAM Address Set” defines the ASCII code (Bit 3, 4, 5) and the dot
line (Bit 0, 1, 2) of the new character. Example demonstrates creating ASCII code “00H”.

2.) Doing 8 times the write command “Data Write” defines line by line the new character.
8th byte stands for the cursor line.

3.) The new defined character can be used as a “normal” ASCII code (0…7); use with
“DD RAM Address Set” and “Data Write”.

31
Now let us look up the character set that can be displayed using the LCD Displayed

0×00 0×10 0×20 0×30 0×40 0×50 0×60 0×70 0×80 to 0xd0 0xE0 0xF0

0×00 CG1 0 @ P ` p Α

0×01 CG2 ! 1 A Q a q Ä

0×02 CG3 “ 2 B R b r Β θ

0×03 CG4 # 3 C S c s Ε

0×04 CG5 $ 4 D T d t Μ Ω

0×05 CG6 % 5 E U e u CUSTOM Σ ϋ


REGIONAL
0×06 CG7 & 6 F V f v CHARACHTERS Ρ Σ

0×07 CG8 7 G W g w G π

0×08 CG1 ( 8 H X h x √

0×09 CG2 ) 9 I Y i y ¯¹ y

0x0A CG3 * : J Z j z J

0x0B CG4 + ; K [ k {

32
0x0C CG5 , < L ¥ l |

0x0D CG6 - = M ] m }

0x0E CG7 . > N ^ n →

0x0F CG8 / ? O _ o ← █

CG→ CGRAM User Defined Character

Custom Regional characters vary from manufacturer to manufacturer. The Greek letters
may or may not appear. It too depends upon the design.

The LiquidCrystal library allows you to control LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you can usually tell them
by the 16-pin interface.

This example sketch prints "Hello World!" to the LCD and shows the time in seconds
since the Arduino was reset.

output of the sketch on a 2x16 LCD

The LCDs have a parallel interface, meaning that the microcontroller has to manipulate
several interface pins at once to control the display. The interface consists of the following
pins:

A register select (RS) pin that controls where in the LCD's memory you're writing data to.
You can select either the data register, which holds what goes on the screen, or an
instruction register, which is where the LCD's controller looks for instructions on what to
do next.

A Read/Write (R/W) pin that selects reading mode or writing mode

33
An Enable pin that enables writing to the registers

8 data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing
to a register when you write, or the values you're reading when you read.

There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED
Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display
contrast, and turn on and off the LED backlight, respectively.

The process of controlling the display involves putting the data that form the image of
what you want to display into the data registers, then putting instructions in the instruction
register. The LiquidCrystal Library simplifies this for you so you don't need to know the
low-level instructions.

The Hitachi-compatible LCDs can be controlled in two modes: 4-bit or 8-bit. The 4-bit
mode requires seven I/O pins from the Arduino, while the 8-bit mode requires 11 pins. For
displaying text on the screen, you can do most everything in 4-bit mode, so example shows
how to control a 2x16 LCD in 4-bit mode.

MF RC522 is a highly integrated read and write card chip applied to the 13.56MHz
contactless communication. Launched by the NXP Company, it is a low-voltage, low-cost,
and small-sized non-contact card chip, a best choice for intelligent instrument and portable
handheld devices.

The MF RC522 uses advanced modulation and demodulation concept which fully
presented in all types of 13.56MHz passive contactless communication methods and
protocols. In addition, it supports rapid CRYPTO1 encryption algorithm to verify
MIFARE products. MFRC522 also supports MIFARE series of high-speed non-contact
communication, with a two-way data transmission rate of up to 424kbit/s. As a new
member of the 13.56MHz highly integrated reader card series, MF RC522 is much similar
to the existing MF RC500 and MF RC530 when there are also great differences. It
communicates with the host machine via the serial manner which needs less wiring. You
can choose between SPI, I2C and serial UART mode (similar to RS232), which helps
reduce the connection, save PCB board space (smaller size), and reduce cost.

34
Fig RFID reader

Original model

Figure 4.13 Original view of our project(snapshot)

4.3 Model 3 – Software architecture


 RFID is an electronics device which has two parts - one is RFID Reader and other
35
is RFID tag or Card. When we put RFID tag near to the RFID reader, it reads tag
data serially. RFID tag has 12 digit character code in a coil. This RFID is working
at baud rate of 9600 bps. RFID uses electromagnet to transfer data from Reader to
Tag or Tag to Reader.
 Here Raspberry Pi 3 is controlling the whole the process of this project (User can
use any Raspberry Pi Board). RFID Reader reads the RFID card ID, this data is
received by Raspberry Pi through UART, then RPi validates the card and shows
the results on LCD screen.

Fig. RFID SYTEM With Raspberry pi

36
Software Requirement

o Python
Python is a general-purpose language, which means it can be used to build
just about anything, which will be made easy with the right
tools/libraries.Professionally, Python is great for backend web
development, data analysis, artificial intelligence, and scientific
computing. Many developers have also used Python to build productivity
tools, games, and desktop apps, so there are plenty of resources to help you
learn how to do those as well.

Python is an interpreted high-level programming language for general-


purpose programming. Created by Guido van Rossum and first released in
1991, Python has a design philosophy that emphasizes code readability,
notably using significant whitespace. It provides constructs that enable clear
programming on both small and large scales. In July 2018, Van Rossum
stepped down as the leader in the language community.

Python features a dynamic type system and automatic memory management.


It supports multiple programming paradigms, including object-oriented,
imperative, functional and procedural, and has a large and comprehensive
standard library.

Python interpreters are available for many operating systems. CPython, the
reference implementation of Python, is open source software[30] and has a
community-based development model, as do nearly all of Python's other
implementations. Python and CPython are managed by the non-profit Python
Software Foundation.

Libraries

Python's large standard library, commonly cited as one of its greatest


strengths,provides tools suited to many tasks. For Internet-facing applications,
many standard formats and protocols such as MIME and HTTP are supported.
It includes modules for creating graphical user interfaces, connecting to
relational databases, generating pseudorandom numbers, arithmetic with

37
arbitrary precision decimals, manipulating regular expressions,

Some parts of the standard library are covered by specifications (for example,
the Web Server Gateway Interface (WSGI) implementation wsgiref follows
PEP 333but most modules are not. They are specified by their code, internal
documentation, and test suites (if supplied). However, because most of the
standard library is cross-platform Python code, only a few modules need
altering or rewriting for variant implementations.

As of March 2018, the Python Package Index (PyPI), the official repository
for third-party Python software, contains over 130,000 packages with a wide
range of functionality, including:

Graphical user interfaces

Web frameworks

Multimedia

Databases

Networking Test

frameworks

Automation

Web scraping

Documentation

System administration

Scientific computing

Text processing

Image processing

Python For Beginners

Welcome! Are you completely new to programming? If not then we presume


you will be looking for information about why and how to get started with
Python. Fortunately an experienced programmer in any programming
38
language (whatever it may be) can pick up Python very quickly. It's also easy
for beginners to use and learn, so jump in!

Installing

Installing Python is generally easy, and nowadays many Linux and UNIX
distributions include a recent Python. Even some Windows computers
(notably those from HP) now come with Python already installed. If you do
need to install Python and aren't confident about the task you can find a few
notes on the BeginnersGuide/Download wiki page, but installation is
unremarkable on most platforms.

Learning

Before getting started, you may want to find out which IDEs and text editors
are tailored to make Python editing easy, browse the list of introductory
books, or look at code samples that you might find helpful.

There is a list of tutorials suitable for experienced programmers on the


BeginnersGuide/Tutorials page. There is also a list of resources in other
languages which might be useful if English is not your first language.

The online documentation is your first port of call for definitive information.
There is a fairly brief tutorial that gives you basic information about the
language and gets you started. You can follow this by looking at the library
reference for a full description of Python's many libraries and the language
reference for a complete (though somewhat dry) explanation of Python's
syntax. If you are looking for common Python recipes and patterns, you can
browse the ActiveState Python Cookbook
Thingspeak

It is an open source Internet of Things (IoT) application and API to store


and retrieve data from things using the HTTP protocol over the Internet
or via a Local Area Network. ThingSpeak enables the creation of
sensor logging applications, location tracking applications, and a social
network of things with status updates.

39
Table 5 Software Requirement

Software Description
Raspbian (Stretch) Operating System for Raspberry Pi
Internet Browser Any internet browser. Google Chrome is Preferred
Python IDLE Python IDLE Version 3.4 or higher
ThingSpeak API An IoT platform uses channels, REST web API to
collect and store sensor data in the cloud sent from

40
CHAPTER: 5
Cost Estimation
A cost estimate is the approximation of the cost of a program, project, or
operation. The cost estimate is the product of the cost estimating process.
The cost estimate has a single total value and may have identifiable
component values. A problem with a cost overrun can be avoided with a
credible, reliable, and accurate cost estimate. A cost estimator is the
professional who prepares cost estimates. There are different types of cost
estimators, whose title may be preceded by a modifier, such as building
estimator, or electrical estimator, or chief estimator.
5.1 Cost estimate types

Various projects and operations have distinct types of cost estimating,


which vary in their composition and preparation methods. Some of
the major areas include:
1. Construction cost

i. Detailed construction estimate

ii. Abstract construction estimate

2. Manufacturing cost

3. Software development cost

4. Aerospace mission cost

5. Resource exploration cost

6. Facility operation cost

7. Facility maintenance and repair cost

8. Facility rehabilitation and renewal cost

9. Facility retirement cost

41
Table 6 Cost Estimation chart
S.No. Hardware Quantity Rate Amount
1. Raspberry Pi 1 3000 3500
2. Relay 1 250 250
3. Display 1 250 250

4. Servo Motor 1 400 400


5. Jumper 300 300

6. Rfid Sensor 1 300 300


7. LED 5 2 10
Total Amount 5010
Approx. Amount 6000

5.3 Future Scope:


Radio Frequency IDentification is ranked among the top 10 of dominant
future technologies. RFID technology is being used now for access control
cards, tagging of returnable items, production and assembly tasks and will
penetrate other market segments soon due to lower costs and more
functionalities. Integration of sensor functions in RFID-tags will also give a
lot of potential for future applications in healthcare, food packaging, security
& safety etc.

42
Fig 01 Accessibility of Future RFID

Figure 02 Rfid on the vehicle

43
Raspberry Pi Camera Module

Introduction

The Raspberry Pi camera module can be used to take high-definition video, as well as
stills photographs. It’s easy to use for beginners, but has plenty to offer advanced users if
you’re looking to expand your knowledge. There are lots of examples online of people
using it for time-lapse, slow-motion and other video cleverness. You can also use the
libraries we bundle with the camera to create effects. If you’re interested in the nitty-gritty,
you’ll want to know that the module has a five megapixel fixed-focus camera that supports
1080p30, 720p60 and VGA90 video modes, as well as stills capture. It attaches via a 15cm
ribbon cable to the CSI port on the Raspberry Pi. It can be accessed through the MMAL
and V4L APIs, and there are numerous third-party libraries built for it, including the
Picamera Python library. The camera module is very popular in home security
applications, and in wildlife camera traps.

Features
 5MP sensor
 Wider image, capable of 2592x1944 stills, 1080p30 video
 1080p video supported
 CSI
 Size: 25 x 20 x 9 mm

Camera Details
The camera consists of a small (25mm by 20mm by 9mm) circuit board, which connects to
the Raspberry Pi's Camera Serial Interface (CSI) bus connector via a flexible ribbon cable.
The camera's image sensor has a native resolution of five megapixels and has a fixed focus
lens. The software for the camera supports full resolution still images up to 2592x1944
and video resolutions of 1080p30, 720p60 and 640x480p60/90. The camera module is
shown below:

44
Installation involves connecting the ribbon cable to the CSI connector on the Raspberry Pi
board. This can be a little tricky, but if you watch the videos that demonstrate how it is
done, you shouldn't have any trouble.
When you purchase the camera, you will receive a small camera board and cable. You'll
want to devise some method of supporting the camera in order to use it. Some camera
stands and Raspberry Pi cases are now available. You can also rig up something simple
yourself if you wish. I attached mine to a case using a small piece of plastic and double-
sided tape, as shown below:

Once the hardware is set up, you can move on to configuring the software.

Connect to the camera

 The flex cable inserts into the connector situated between the Ethernet and HDMI
ports, with the silver connectors facing the HDMI port. The flex cable connector
should be opened by pulling the tabs on the top of the connector upwards then
towards the Ethernet port. The flex cable should be inserted firmly into the
45
connector, with care taken not to bend the flex at too acute an angle. The top part
of the connector should then be pushed towards the HDMI connector and down,
while the flex cable is held in place.
 Update the SD card

In order to use the camera you must be using a recent operating system that knows that the
camera exists. The easiest way to do this is to grab the latest Raspbian image from the
RaspberryPi.org site and create a fresh SD card.

 Enable camera in raspi-config settings

Reboot. If you are using a fresh image the raspi-config utility should load. If it doesn’t
then you can run it manually using : sudo raspi-config Sekect the “Camera” option and
press “Enter”.

Select “Enable” and press “Enter”.

46
Select “Yes” and press “Enter”. Your Pi will reboot.

47
Updating your operating and enabling the camera using raspi-config did two things. It told
your Pi that there is a camera attached and it added two command line utilities. raspistill
raspivid These allow you to capture still photos and HD video respectively.

You are now ready to start having fun!

48
Simple Mail Transfer Protocol
The Simple Mail Transfer Protocol (SMTP) is a communication protocol for electronic
mail transmission. As an Internet standard, SMTP was first defined in 1982 by RFC 821,
and updated in 2008 by RFC 5321 to Extended SMTP additions, which is the protocol
variety in widespread use today. Mail servers and other message transfer agents use SMTP
to send and receive mail messages. Proprietary systems such as Microsoft
Exchange and IBM Notes and webmail systems such as Outlook.com, Gmail and Yahoo!
Mailmay use non-standard protocols internally, but all use SMTP when sending to or
receiving email from outside their own systems. SMTP servers commonly use
the Transmission Control Protocol on port number 25.

User-level email clients typically use SMTP only for sending messages to a mail server for
relaying, typically submit outgoing email to the mail server on port 587 or 465 as per RFC
8314. For retrieving messages, IMAP and POP3 are standard, but proprietary servers also
often implement proprietary protocols, e.g., Exchange ActiveSync.

History
Various forms of one-to-one electronic messaging were used in the 1960s. Users
communicated using systems developed for specific mainframe computers. As more
computers were interconnected, especially in the U.S. Government's ARPANET,
standards were developed to permit exchange of messages between different operating
systems. SMTP grew out of these standards developed during the 1970s.

SMTP traces its roots to two implementations described in 1971: the Mail Box Protocol,
whose implementation has been disputed,[1] but is discussed in RFC 196 and other RFCs,
and the SNDMSG program, which, according to RFC 2235, Ray
Tomlinson of BBN invented for TENEX computers to send mail messages across the
ARPANET. Fewer than 50 hosts were connected to the ARPANET at this time.

Further implementations include FTP Mail and Mail Protocol, both from
1973.Development work continued throughout the 1970s, until the ARPANET
transitioned into the modern Internet around 1980. Jon Postel then proposed a Mail
Transfer Protocol in 1980 that began to remove the mail's reliance on FTP. SMTP was
published as RFC 788 in November 1981, also by Postel.

The SMTP standard was developed around the same time as Usenet, a one-to-many
communication network with some similarities.
49
SMTP became widely used in the early 1980s. At the time, it was a complement to Unix to
Unix Copy Program (UUCP) mail, which was better suited for handling email transfers
between machines that were intermittently connected. SMTP, on the other hand, works
best when both the sending and receiving machines are connected to the network all the
time. Both use a store and forward mechanism and are examples of push technology.
Though Usenet's newsgroups are still propagated with UUCP between servers,UUCP as a
mail transport has virtually disappeared along with the "bang paths" it used as message
routing headers.

Sendmail, released with 4.1cBSD, right after RFC 788, was one of the first mail transfer
agents to implement SMTP. Over time, as BSD Unix became the most popular operating
system on the Internet, Sendmail became the most common MTA (mail transfer
agent). Some other popular SMTP server programs include Postfix, qmail, Novell
GroupWise, Exim, Novell NetMail, Microsoft Exchange Server and Oracle
Communications Messaging Server.

Message submission (RFC 2476) and SMTP-AUTH (RFC 2554) were introduced in 1998
and 1999, both describing new trends in email delivery. Originally, SMTP servers were
typically internal to an organization, receiving mail for the organization from the outside,
and relaying messages from the organization to the outside. But as time went on, SMTP
servers (mail transfer agents), in practice, were expanding their roles to become message
submission agents for Mail user agents, some of which were now relaying mail from the
outside of an organization. (e.g. a company executive wishes to send email while on a trip
using the corporate SMTP server.) This issue, a consequence of the rapid expansion and
popularity of the World Wide Web, meant that SMTP had to include specific rules and
methods for relaying mail and authenticating users to prevent abuses such as relaying of
unsolicited email (spam). Work on message submission (RFC 2476) was originally started
because popular mail servers would often rewrite mail in an attempt to fix problems in it,
for example, adding a domain name to an unqualified address. This behavior is helpful
when the message being fixed is an initial submission, but dangerous and harmful when
the message originated elsewhere and is being relayed. Cleanly separating mail into
submission and relay was seen as a way to permit and encourage rewriting submissions
while prohibiting rewriting relay. As spam became more prevalent, it was also seen as a
way to provide authorization for mail being sent out from an organization, as well as

50
traceability. This separation of relay and submission quickly became a foundation for
modern email security practices.

Mail processing model

Email is submitted by a mail client (mail user agent, MUA) to a mail server (mail
submission agent, MSA) using SMTP on TCPport 587. Most mailbox providers still allow
submission on traditional port 25. The MSA delivers the mail to its mail transfer agent
(mail transfer agent, MTA). Often, these two agents are instances of the same software
launched with different options on the same machine. Local processing can be done either
on a single machine, or split among multiple machines; mail agent processes on one
machine can share files, but if processing is on multiple machines, they transfer messages
between each other using SMTP, where each machine is configured to use the next
machine as a smart host. Each process is an MTA (an SMTP server) in its own right.

The boundary MTA uses the Domain name system (DNS) to look up the mail exchanger
record (MX record) for the recipient's domain (the part of the email address on the right
of @). The MX record contains the name of the target host. Based on the target host and
other factors, the MTA selects an exchange server: see the article MX record. The MTA
connects to the exchange server as an SMTP client.

Message transfer can occur in a single connection between two MTAs, or in a series of
hops through intermediary systems. A receiving SMTP server may be the ultimate
destination, an intermediate "relay" (that is, it stores and forwards the message) or a
"gateway" (that is, it may forward the message using some protocol other than SMTP).
Each hop is a formal handoff of responsibility for the message, whereby the receiving
server must either deliver the message or properly report the failure to do so.

51
Once the final hop accepts the incoming message, it hands it to a mail delivery
agent (MDA) for local delivery. An MDA saves messages in the relevant mailbox format.
As with sending, this reception can be done using one or multiple computers, but in the
diagram above the MDA is depicted as one box near the mail exchanger box. An MDA
may deliver messages directly to storage, or forward them over a network using SMTP or
other protocol such as Local Mail Transfer Protocol (LMTP), a derivative of SMTP
designed for this purpose.

Once delivered to the local mail server, the mail is stored for batch retrieval by
authenticated mail clients (MUAs). Mail is retrieved by end-user applications, called email
clients, using Internet Message Access Protocol (IMAP), a protocol that both facilitates
access to mail and manages stored mail, or the Post Office Protocol (POP) which typically
uses the traditional mbox mail file format or a proprietary system such as Microsoft
Exchange/Outlook or Lotus Notes/Domino. Webmail clients may use either method, but
the retrieval protocol is often not a formal standard.

Protocol overview

SMTP is a connection-oriented, text-based protocol in which a mail sender communicates


with a mail receiver by issuing command strings and supplying necessary data over a
reliable ordered data stream channel, typically a Transmission Control Protocol (TCP)
connection. An SMTP session consists of commands originated by an SMTP client (the
initiating agent, sender, or transmitter) and corresponding responses from the
SMTP server (the listening agent, or receiver) so that the session is opened, and session
parameters are exchanged. A session may include zero or more SMTP transactions.
An SMTP transaction consists of three command/reply sequences:

1. MAIL command, to establish the return address, also called return-path, reverse-
path, bounce address, mfrom, or envelope sender.
2. RCPT command, to establish a recipient of the message. This command can be
issued multiple times, one for each recipient. These addresses are also part of the
envelope.
3. DATA to signal the beginning of the message text; the content of the message, as
opposed to its envelope. It consists of a message header and a message
body separated by an empty line. DATA is actually a group of commands, and the
server replies twice: once to the DATA command itself, to acknowledge that it is
52
ready to receive the text, and the second time after the end-of-data sequence, to
either accept or reject the entire message.

Besides the intermediate reply for DATA, each server's reply can be either positive (2xx
reply codes) or negative. Negative replies can be permanent (5xx codes) or transient (4xx
codes). A reject is a permanent failure and the client should send a bounce message to the
server it received it from. A drop is a positive response followed by message discard rather
than delivery.

The initiating host, the SMTP client, can be either an end-user's email client, functionally
identified as a mail user agent (MUA), or a relay server's mail transfer agent (MTA), that
is an SMTP server acting as an SMTP client, in the relevant session, in order to relay mail.
Fully capable SMTP servers maintain queues of messages for retrying message
transmissions that resulted in transient failures.

A MUA knows the outgoing mail SMTP server from its configuration. A relay server
typically determines which server to connect to by looking up the MX (Mail
eXchange) DNSresource record for each recipient's domain name. If no MX record is
found, a conformant relaying server (not all are) instead looks up the A record. Relay
servers can also be configured to use a smart host. A relay server initiates
a TCP connection to the server on the "well-known port" for SMTP: port 25, or for
connecting to an MSA, port 587. The main difference between an MTA and an MSA is
that connecting to an MSA requires SMTP Authentication.

SMTP vs mail retrieval[edit]

SMTP is a delivery protocol only. In normal use, mail is "pushed" to a destination mail
server (or next-hop mail server) as it arrives. Mail is routed based on the destination
server, not the individual user(s) to which it is addressed. Other protocols, such as the Post
Office Protocol (POP) and the Internet Message Access Protocol (IMAP) are specifically
designed for use by individual users retrieving messages and managing mail boxes. To
permit an intermittently-connected mail server to pull messages from a remote server on
demand, SMTP has a feature to initiate mail queue processing on a remote server
(see Remote Message Queue Starting below). POP and IMAP are unsuitable protocols for
relaying mail by intermittently-connected machines; they are designed to operate after

53
final delivery, when information critical to the correct operation of mail relay (the "mail
envelope") has been removed.

Remote Message Queue Starting

Remote Message Queue Starting is a feature of SMTP that permits a remote host to start
processing of the mail queue on a server so it may receive messages destined to it by
sending the TURN command. This feature however was deemed insecure and was
extended in RFC 1985 with the ETRN command which operates more securely using
an authentication method based on Domain Name System information.

Outgoing mail SMTP server

An email client needs to know the IP address of its initial SMTP server and this has to be
given as part of its configuration (usually given as a DNS name). This server will deliver
outgoing messages on behalf of the user.

Outgoing mail server access restrictions

Server administrators need to impose some control on which clients can use the server.
This enables them to deal with abuse, for example spam. Two solutions have been in
common use:

 In the past, many systems imposed usage restrictions by the location of the client, only
permitting usage by clients whose IP address is one that the server administrators
control. Usage from any other client IP address is disallowed.
 Modern SMTP servers typically offer an alternative system that
requires authentication of clients by credentials before allowing access.

Restricting access by location

Under this system, an ISP's SMTP server will not allow access by users who are outside
the ISP's network. More precisely, the server may only allow access to users with an IP
address provided by the ISP, which is equivalent to requiring that they are connected to the
Internet using that same ISP. A mobile user may often be on a network other than that of
their normal ISP, and will then find that sending email fails because the configured SMTP
server choice is no longer accessible.

This system has several variations. For example, an organisation's SMTP server may only
provide service to users on the same network, enforcing this by firewalling to block access

54
by users on the wider Internet. Or the server may perform range checks on the client's IP
address. These methods were typically used by corporations and institutions such as
universities which provided an SMTP server for outbound mail only for use internally
within the organisation. However, most of these bodies now use client authentication
methods, as described below.

Where a user is mobile, and may use different ISPs to connect to the internet, this kind of
usage restriction is onerous, and altering the configured outbound email SMTP server
address is impractical. It is highly desirable to be able to use email client configuration
information that does not need to change.

Client authentication

Modern SMTP servers typically require authentication of clients by credentials before


allowing access, rather than restricting access by location as described earlier. This more
flexible system is friendly to mobile users and allows them to have a fixed choice of
configured outbound SMTP server. SMTP Authentication, often abbreviated SMTP
AUTH, is an extension of the SMTP in order to log in using an authentication mechanism.

Open relay

A server that is accessible on the wider Internet and does not enforce these kinds of access
restrictions is known as an open relay. This is now generally considered a bad practice
worthy of blacklisting.

Ports

Communication between mail servers generally uses the standard TCP port 25 designated
for SMTP.

Mail clients however generally don't use this, instead using specific "submission" ports.
Mail services generally accept email submission from clients on one of:

 587 (Submission), as formalized in RFC 6409 (previously RFC 2476)


 465 This port was deprecated after RFC 2487, until the issue of RFC 8314.

Port 2525 and others may be used by some individual providers, but have never been
officially supported.

55
Most Internet service providers now block all outgoing port 25 traffic from their customers
as an anti-spam measure.[18] For the same reason, businesses will typically configure their
firewall to only allow outgoing port 25 traffic from their designated mail servers.

56
CONCLUSION

The study is aimed at formulating a prototype for the adoption of waste bin
monitoring systems. This is because such a solution may go a long way in
enhancing accountability, proactive responsiveness and better management of
waste, thus ensuring a safer, cleaner environment for everyone. This study was
carried out in 2017. The target of this study is the domestic household and
corporate user. The prototype developed from this study will empower the
domestic and corporate user to be able to monitor the bin status over a period of
time, being able to send notifications when bins require to be attended and
reports on average waste reporting.
□ The novel cloud based system for waste collection in smart cities

□ Providing services for different of stakeholders involved in this are

□ On board surveillance and reporting systems

□ Integration with modern IoT systems

□ Development of Applications for city administrations, municipal staff

□ Recycling factories and other stakeholders is planned to be done in future


Rfid system

57
REFERENCES

>https://cord-ex.com/news/2015/11/introduction-to-rfid-technology/

Rfid reader rc522

https://www.rhydolabz.com/wireless-rfid-reader-tag-c-130_98/rc522-
rfid-reader-writer-1356mhz-with-cards-kit-p-2156.html

Module

<https://www.youtube.com/watch?v=THcgh8EP_xM>

Raspberry Pi 3 Model B

https://commons.wikimedia.org/wiki/File:Raspberry_Pi_3_B%2B_(3
9906369 025).png
Display 16*2

https://electronicsforu.com/resources/learn-electronics/16x2-lcd-
pinout-diagram
Raspberr Pi Datasheet

https://components101.com/microcontrollers/raspberry-pi-3-pinout-
features- datasheet

Dispaly

https://www.amazon.in/Generic-JCE-16X2-Lcd-
Display/dp/B00OVY28M4

Ultrasonic Datasheet

https://components101.com/ultrasonic-sensor-working-pinout-
datasheet

LED Datasheet

https://www.electronics-
notes.com/articles/electronic_components/diode/light- emitting-
diode-led-datasheet-specifications-parameters-characteristics.php

Servo Motor

58
https://components101.com/servo-motor-basics-pinout-datasheet

59
Appendix

1. Source Code

import RPi.GPIO as GPIO

import MFRC522

import signal

class MFRC522:

serNum = []

def init (self, dev='/dev/spidev0.0', spd=1000000):

spi.openSPI(device=dev,speed=spd)

GPIO.setmode(GPIO.BOARD)

GPIO.setup(self.NRSTPD, GPIO.OUT)

GPIO.output(self.NRSTPD, 1)

self.MFRC522_Init()

def MFRC522_Reset(self):

self.Write_MFRC522(self.CommandReg, self.PCD_RESETPHASE)

def Write_MFRC522(self, addr, val):

spi.transfer(((addr<<1)&0x7E,val))

60
def Read_MFRC522(self, addr):

val = spi.transfer((((addr<<1)&0x7E) | 0x80,0))

return val[1]

def SetBitMask(self, reg, mask):

tmp = self.Read_MFRC522(reg)

self.Write_MFRC522(reg, tmp | mask)

def ClearBitMask(self, reg, mask):

tmp = self.Read_MFRC522(reg);

self.Write_MFRC522(self.CommandReg, command)

if command == self.PCD_TRANSCEIVE:

self.SetBitMask(self.BitFramingReg, 0x80)

i = 2000

while True:

n = self.Read_MFRC522(self.CommIrqReg)

i=i-1

if ~((i!=0) and ~(n&0x01) and ~(n&waitIRq)):

61
break

self.ClearBitMask(self.BitFramingReg, 0x80)

if i != 0:

if (self.Read_MFRC522(self.ErrorReg) & 0x1B)==0x00:

status = self.MI_OK

if n & irqEn & 0x01:

status = self.MI_NOTAGERR

if command == self.PCD_TRANSCEIVE:

n = self.Read_MFRC522(self.FIFOLevelReg)

lastBits = self.Read_MFRC522(self.ControlReg) & 0x07

if lastBits != 0:

backLen = (n-1)*8 + lastBits

else:

backLen = n*8

if n == 0:

n=1

if n > self.MAX_LEN:

n = self.MAX_LEN

62
i=0

while i<n:

backData.append(self.Read_MFRC522(self.FIFODataReg))

i = i + 1;

else:

status = self.MI_ERR

return (status,backData,backLen)

def MFRC522_Request(self, reqMode):

status = None

backBits = None

TagType = []

self.Write_MFRC522(self.BitFramingReg, 0x07)

TagType.append(reqMode);

(status,backData,backBits) = self.MFRC522_ToCard(self.PCD_TRANSCEIVE,
TagType)

if ((status != self.MI_OK) | (backBits != 0x10)):

63
status = self.MI_ERR

return (status,backBits)

def MFRC522_Anticoll(self):

backData = [] serNumCheck

=0

serNum = []

self.Write_MFRC522(self.BitFramingReg, 0x00)

serNum.append(self.PICC_ANTICOLL)

serNum.append(0x20)

(status,backData,backBits) =
self.MFRC522_ToCard(self.PCD_TRANSCEIVE,serNum)

if(status == self.MI_OK):

i=0

if len(backData)==5:

while i<4:

64
serNumCheck = serNumCheck ^ backData[i]

i=i+1

if serNumCheck != backData[i]:

status = self.MI_ERR

else:

status = self.MI_ERR

return (status,backData)

def CalulateCRC(self, pIndata):

self.ClearBitMask(self.DivIrqReg, 0x04)

self.SetBitMask(self.FIFOLevelReg, 0x80);

i=0

pOutData.append(self.Read_MFRC522(self.CRCResultRegM))

return pOutData

def MFRC522_SelectTag(self, serNum):

backData = []

buf = []

buf.append(self.PICC_SElECTTAG)

buf.append(0x70)

i=0

65
while i<5:

buf.append(serNum[i])

i=i+1

pOut = self.CalulateCRC(buf)

buf.append(pOut[0])

buf.append(pOut[1])

(status, backData, backLen) = self.MFRC522_ToCard(self.PCD_TRANSCEIVE,


buf)

if (status == self.MI_OK) and (backLen == 0x18):

print "Size: " + str(backData[0])

# Now we start the authentication itself

(status, backData, backLen) = self.MFRC522_ToCard(self.PCD_AUTHENT,buff)

# Check if an error occurred

if not(status == self.MI_OK):

print "AUTH ERROR!!"

if not (self.Read_MFRC522(self.Status2Reg) & 0x08) != 0:

print "AUTH ERROR(status2reg & 0x08) != 0"

buf = []

while i < 16:

66
buf.append(writeData[i])

i=i+1

crc = self.CalulateCRC(buf)

buf.append(crc[0])

def MFRC522_DumpClassic1K(self, key, uid):

i=0

while i < 64:

status = self.MFRC522_Auth(self.PICC_AUTHENT1A, i, key, uid)

# Check if authenticated

if status == self.MI_OK:

self.MFRC522_Read(i)

else:

print "Authentication error"

i = i+1

def MFRC522_Init(self):

GPIO.output(self.NRSTPD, 1)

self.MFRC522_Reset();

.PICC_REQIDL)

67
if status == MIFAREReader.MI_OK:

print "Card detected"

(status,uid) = MIFAREReader.MFRC522_Anticoll()

if status == MIFAREReader.MI_OK:

print "Card read UID: %s,%s,%s,%s" % (uid[0], uid[1], uid[2], uid[3])

key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]

MIFAREReader.MFRC522_SelectTag(uid)

status = MIFAREReader.MFRC522_Auth(MIFAREReader.PICC_AUTHENT1A,
8, key, uid)

print "\n"

if status == MIFAREReader.MI_OK:

print "Now we fill it with 0x00:"

MIFAREReader.MFRC522_Write(8, data)

print "\n"

68
print "It is now empty:"

MIFAREReader.MFRC522_Read(8)

print "\n"

MIFAREReader.MFRC522_StopCrypto1()

continue_reading = False

else:

print "Authentication error"

69
70

You might also like