Professional Documents
Culture Documents
A
Major Project Report
Submitted
in fulfillment
Bachelor of Technology
Abhay Chouhan(15EIAEC001)
Mahendra Meena
(Roll No. 15EIAEC005)
Shubham Pandey
(Roll No.: 15EIAEC011)
Nandita Narayan
(Roll No.: 15EAEEC007)
Abhay Singh Chouhan
(Roll No.: 15EIAEC001)
Counter Signed by
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:…………
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.
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
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
□ One have open with bonnet than another will small area front of the dustbin.
□ Model one designed for domestic waste and model two designed
for hotel, Cafes and restaurants.
8
4.3 Hardware Required:
1. Raspberry Pi 3 Model B
Figure Raspberry Pi
9
Figure Raspberry Pi 3 Model B Pin Configuration
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
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
11
□ Where RASPBERRY PI 3 is Used?
1. Take the 16GB micro SD card and dedicate it specifically for PI OS.
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.
□ IoT applications
□ Media center
□ Robotics
□ Industrial/Home automation
□ Server/cloud server
□ Print server
□ Security monitoring
□ Web camera
□ Gaming
Figure U l t r a s o n i c Sensor
13
Product Features:
Ultrasonic principle:
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
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.
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
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.
Figure P o w e r Signal
Figure L E D
18
Features:
□ 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:
Pin Configuration
2 Vdd (+5 Volt) Powers the LCD with +5V (4.7V – 5.3V)
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
11 Data Pin 4
12 Data Pin 5
13 Data Pin 6
14 Data Pin 7
21
Features of 16×2 LCD module
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.
22
Control and display commands
23
Set CGRAM Set CGRAM Address
0 0 0 1 AC5 AC4 AC3 AC2 AC1 AC0 39 µs
Address in address counter.
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
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
4) Others
1 1 D7 D6 D5 D4 D3 D2 D1 D0
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.
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.
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.
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”.
26
Set CGRAM address to AC. This instruction makes CGRAM data available from MPU.
6) Function Set
0 0 0 0 1 DL N F X X
When 4 bit mode is activated, the data needs to be transferred in two parts, first higher
4bits, and then lower 4 bits.
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 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
D=’0’ means entire display is turned off. But Display data remains in DDRAM.
C=’0’ turns off the cursor. But I/D register retains the data
B=’0’ stops the cursor to blink and cursor looks steady if the Cursor is turned on.
0 0 0 0 0 0 0 1 I/D SH
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.
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.
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’).
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 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
4. Display Clear
30
LCD Initialization
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×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 }
0x0F CG8 / ? O _ o ← █
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.
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.
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
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 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
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:
Web frameworks
Multimedia
Databases
Networking Test
frameworks
Automation
Web scraping
Documentation
System administration
Scientific computing
Text processing
Image processing
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.
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
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
2. Manufacturing 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
42
Fig 01 Accessibility of Future RFID
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.
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.
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”.
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.
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.
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
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 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 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.
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.
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.
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
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:
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
57
REFERENCES
>https://cord-ex.com/news/2015/11/introduction-to-rfid-technology/
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 MFRC522
import signal
class MFRC522:
serNum = []
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)
spi.transfer(((addr<<1)&0x7E,val))
60
def Read_MFRC522(self, addr):
return val[1]
tmp = self.Read_MFRC522(reg)
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
61
break
self.ClearBitMask(self.BitFramingReg, 0x80)
if i != 0:
status = self.MI_OK
status = self.MI_NOTAGERR
if command == self.PCD_TRANSCEIVE:
n = self.Read_MFRC522(self.FIFOLevelReg)
if lastBits != 0:
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)
status = None
backBits = None
TagType = []
self.Write_MFRC522(self.BitFramingReg, 0x07)
TagType.append(reqMode);
(status,backData,backBits) = self.MFRC522_ToCard(self.PCD_TRANSCEIVE,
TagType)
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)
self.ClearBitMask(self.DivIrqReg, 0x04)
self.SetBitMask(self.FIFOLevelReg, 0x80);
i=0
pOutData.append(self.Read_MFRC522(self.CRCResultRegM))
return pOutData
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])
if not(status == self.MI_OK):
buf = []
66
buf.append(writeData[i])
i=i+1
crc = self.CalulateCRC(buf)
buf.append(crc[0])
i=0
# Check if authenticated
if status == self.MI_OK:
self.MFRC522_Read(i)
else:
i = i+1
def MFRC522_Init(self):
GPIO.output(self.NRSTPD, 1)
self.MFRC522_Reset();
.PICC_REQIDL)
67
if status == MIFAREReader.MI_OK:
(status,uid) = MIFAREReader.MFRC522_Anticoll()
if status == MIFAREReader.MI_OK:
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:
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:
69
70