Documente Academic
Documente Profesional
Documente Cultură
A Project Report submitted in partial fulfillment of the requirements for the award
of the degree of
Bachelor of Engineering In
Specialization
Submitted by
Shubham Kulsange (48)
Akshay Bhoyar (23)
Stuti Patil (17)
Shyamli Kamane (16)
Swati Gajbe (18)
DECLARATION
We hereby declare that the work presented in this project report entitled, “SMART
CLASSROOM AUTOMATION SYSTEM USING ARDUINO AND IOT” in the
subject Department of Electrical in the faculty of Science and Technology is the original
contribution carried out by us under the guidance of Prof. Pranay Ambade, Department of
Electrical Engineering, J D College of Engineering and Management, Nagpur. This work
has not been submitted to any other University or Institution for the award of any degree
course.
Place:
Date:
Shubham Kulsange (48)
Akshay Bhoyar (23)
Stuti Patil (17)
Shyamli Kamane (16)
Swati Gajbe (18)
Template 4
CERTIFICATE
Forwarded to:
CERTIFICATE OF APPROVAL
INDEX
CONTENTS AT GLANCE
Chapter 4 EXPERIMENTATION
4.1] Hardware
4.1.1] NodeMCU 14
4.1.2] EM18 Reader Module 15
4.1.3] RFID Tag 17
4.1.4] Arduino Nano 21
4.1.5] LCD 16*2 22
4.1.6] IR 24
4.1.7] DHT11 27
4.1.8] Relay 29
4.1.9] I2C LCD MODULE 31
4.1.10] Servo Motor 32
4.2] SOFTWARE
REFERENCES 54
ANNEXURES
Paper published
Plagiarism Report
Grammarly Report
Photo Gallery
Bibliography.
Template 7
ACKNOWLEDEMENT
We express our sincere gratitude, for giving us the opportunity to work on the project during our final
year of B.E.
We owe our sincerest gratitude towards Dr. S. R. Choudhari, Principal J D College of Engineering &
Management, Nagpur, for providing the platform and necessary facilities.
We also express our sincere gratitude towards Dr. S.V. Sonekar, Vice Principal and Dean Academics, J
D College of Engineering and Management, Nagpur, for continuous support and motivation.
The constant guidance and encouragement received from Dr S.R. Vaishnav, Head, Department of
Electrical Engineering J D College of Engineering & Management, Nagpur, has been of great help in
carrying out the project work and is acknowledged with reverential thanks.
We would like to thank Prof.Akshay Kakde, Project Coordinator, J D College of Engineering &
Management, and Nagpur for providing proper guidelines and continuous efforts taken towards the
completion of project.
We would like to express a deep sense of gratitude and thanks profusely to our Guide Assistant
Prof.Pranay Ambade, Department of Electrical Engineering, J D College of Engineering &
Management, Nagpur. Without his/her wise counsel and able guidance, it would have been impossible to
complete the project in this manner.
We would like to thank the members of the Departmental Research Committee for their valuable
suggestions and healthy criticism during our presentation of the work. We express gratitude to other
faculty members Electrical Engineering Department, J D College of Engineering & Management,
Nagpur, for their intellectual support throughout the course of this work.
i
Template 8
LIST OF FIGURES
ii
Template 9
LIST OF TABLES
iii
4
Template 11
ABSTRACT
Modern day class rooms are equipped with electronic devices that have supporting software to
improve and facilitate teaching methods. However, it is often seen that significant class time is
wasted on taking attendance, or the class may face interruption due to late entries of students and
disturbances such as the manual control of fan and light. Therefore, to overcome those problems a
feasible system is created in this thesis project that will have no physical intervention from
teachers, students or floor attendance. Thus, the system will facilitate the smooth running of the
scheduled classes at our class room, and minimize time loss.
In this project we are building a prototype of smart classroom in which an application
would be pivotal for carrying out various operations in classroom. This thesis instantly infers the
power consumption in the class rooms. The knowledge about the power wastage is used to
suggest the smart class room in which the operation of the electrical and electronic devices is
automated. In our method we first estimated what are all the devices a classroom consist (i.e.)
fan, light. Some existing method had already control this kind of devices using infrared remotes.
Hence by replacing the infrared remote with wireless sensor effective automation can be achieved
in the class room. The smart classroom system controls automatic ON/OFF of fan and light
system based on the presence and absence of the human inside the room through IR Sensor and
based on the temperatures of the room. The system is developed with the help of ARDUINO
board which can be used to control the electric fan based on the changes in temperature of its
surrounding using DHT11 Sensor. With the help of one sensor connected outside the door which
is basically open and close the door when someone goes to enter in the class room.
RFID card is used for attendance purpose, which is connected to the NodeMCU board.
When student punch the RFID card through the RFID reader module NodeMCU board sends the
data to the internet in the goggle firebase and with the help of webpage , teachers can easily get
the date wise analysis of the particular student.
iv
CHAPTER 1
INTRODUCTION
1
microcontroller kit and it will be sent on a static web page then it will be compared in the
SQLite database of dedicated web application for this system. If the unique identification
number is matched with any record in database the associated record of student will be
retrieved from database and the information will be stored in another database and that
student’s attendance will be marked and will be notified to the teacher via the web
application. In case of attempt to mark intentional fake attendance if any student marks
attendance of other students, the system also stores total count of number of students who
marked their attendance then the teacher can cross verify headcount of students by
entering value in application and can have detailed information of present students and
students who are absent but still having their attendance marked.
2
through an algorithm without any biases. This said system model is proposed for the
basic automations for a classroom that need to be automated. This system is also
expected to help automate classroom electronics such as tube light, fan etc. If changes
incorporated further this can also help in contributing to the institute automation and
make the entire information of the place available in a single web application with the
help of RFID tracking. This will also help in having a good automation impact in the near
future for city and home automations. This will also add as an initiative to digitalize the
world and make a smarter move towards the evolution of Internet of Things.
Considering the estimation of the possible device in the class room, three modules
were planned to be executed (1) RFID attendance, (2) light and fan control (3)
temperature sensing. Thus in case of light and fan control, occupancy sensor is used to
estimate the people present and with that, only the required devices are made ON & OFF
automatically. Counting to 315 million students, India has the most number of students in
the world. This counts that there is a strong need for the automation when it comes to
mark the attendance of these students. 69.133 % of the total youth are found college
going or taking some kind of education. The traditional system which is being followed
since ages is the pen and paper method. Later we observe a time wherein to avoid the
intentional fake attendance given by the student’s adoption of biometric system was
observed. Colleges have started to turn down to this in order to say goodbye to intentional
proxy attendances, apart from this when it comes down classroom automation we also
need to consider the electric equipments and their functioning. We have a strong need of
a system where it can mark attendance along with a regular thing (say ID card). Hence
these systems will be not only help in attendance but also make things like ID cards
compulsory for college premises. A classroom mostly consist of a fan and a tube light at
least. Many a times it is observed that it’s the human nature and we tend to forget to
switch off the lights when we leave the house. This leads to more of energy consumption
and wastage of energy. The same scenario can also happen with the classroom. Hence it
is considered as one of the most important issue that needs to be addressed. The same
system is not only dedicated to solve the problems of class room but the same can also be
used in home automation application. The said system can be used to keep a track on the
3
devices that are on in the classroom when we are not present. This will lead to
automation plus the energy consumption factor that will save energy. The system will
operate with the help of a relay module. The relay controls the circuit functions and acts
as an interface between input and output circuits. The system will also require a
communication network channel that helps to transmit messages between the application
at the user end and the hardware at the system end.
4
CHAPTER 2
LITERATURE SURVEY
5
existing method had already control this kind of devices using infrared remotes. Though
the infrared remotes are used, power wastage due to human negligence is possible. Hence
by replacing the infrared remote with wireless sensor effective automation can be
achieved in the class room. The smart classroom system controls automatic ON/OFF of
fan and light system based on the presence and absence of the human inside the room and
based on the temperatures of the room. The system is developed with the help of
ARDUINO NANO board which can be used to control the speed of an electric fan based
on the changes in temperature of its surrounding using Thermistor.
2) Mrs. Tanuja Sali, Shelar, Mr. Chetan Pardeshi,. Mr. Vikas Malshette,
“Classroom Automation System” International Journal of Innovations in Engineering
and Technology (IJIET), Volume, Mar 2014.
The application of Internet of Things in the modern world is the center of interest
of many researchers and standardization bodies since several years. Internet of things
mainly consists of two parts automations and analysis. Automation is an important topic
which is more and more covered by various actors in the intelligent transportation
systems, home automations field via many proposed solutions. Thus, in order to achieve
the dream of automation, a special attention has given to the treatment of home
automations and home management problem; especially when it comes to operating
things with the help of mobile applications. In this context systems based on wireless
operational technologies, are proposed to address this situation. Therefore, with
increasingly high-speed networks, it is increasingly important to have mechanisms that
keep throughput high. Our systems will certainly contribute to the concept of home
automation and classroom automation is some way. The paper will present the complete
adaptation of the new methodologies of the intelligent classroom automation systems. We
will also present a schema of the proposed model.
6
Electronic Engineering, December 2013.
Modern day class rooms are equipped with electronic devices that have supporting
software to improve and facilitate teaching methods. However, it is often seen that
significant class time is wasted on taking attendance, or the class may face interruption
due to late entries of students and disturbances such as the manual control of fan and
light. Therefore, to overcome those problems a feasible system is created in this thesis
project that will have no physical intervention from teachers, students or floor attendance.
Thus, the system will facilitate the smooth running of the scheduled classes at our
university, and minimize time loss.
8
7) Miss. Snehal Arun Khulape, Miss. Sakshi Rajendra Malage, Miss. Manasi Sudhir
Patil, Miss. Arfa Aslam Bargir, Mr. Sagar V. Chavan “Home Automation Android
Based GSM System” International Journal of Trend in Scientific Research and
Development (ijtsrd), ISSN: 2456-6470, Volume-2 | Issue-6, October 2018, pp.774-777.
The main aim of the project is to develop a system, which uses mobile technology that
keep control of the various units of the automobiles, which executes with respect to the
signal sent by mobile. In today’s time every system is automated in order to face new
challenges. Automated system has minimized manual operation, so that the flexibility,
reliabilities are found to be highly accurate. Hence every field prefers automated control
systems. Specifically in the field of electronics automated systems are proved to be best.
Probably the important factor to know about the GSM is that it is an international
standard. If you travel around the world, global system for mobile communication is only
type of cellular service available in present time. Rather than analog service global
system for mobile communication (GSM) was developed as a digital system using
TDMA technology. For using devices the unique concept has been about to implement to
operate them remotely by using global system for mobile communication , which enables
the user to remotely control ON/OFF condition of household appliances. Only a simple
SMS sending to the global system for mobile communication modem at nearer place, the
devices can be turned ON/OFF and the status of the devices can be sent to the prescribed
mobile number registered in the microcontroller. We can control the appliances using
mobile. We develop the android app on our mobile. That we can control the any
household devices..
8) Er. Bharti Sood, Er. Rahul Gupta “Smart Home Automation using Wi-Fi”
International Journal of Trend in Scientific Research and Development (ijtsrd), ISSN:
2456-6470, Volume-3 | Issue-2, February 2019, pp.396-399.
This paper aims to design an Advanced home automation system using normal web
server and Wi-Fi technology. The devices can be switched ON/OFF and sensors can be
read using a Personal Computer (PC) through Wi-Fi. This paper helps to develop a home
automation system that gives the user complete control over all remotely controllable
aspects of his or her home. The automation system will have the ability to be controlled
9
from a central host PC, the Internet, and also remotely accessed via a Pocket PC with a
Windows Mobile based application.
10
5.3 Objectives
The Intelligent Classroom management system has three main objectives that will be
explained in details in the further chapters. The first objective of the system is to
automatically take attendance from students using their RFID card. Student ID cards
contains coded data, and if the data is utilized and transmitted to a computer via EM18
reader module, the attendance can be recorded with greater efficiency. The second
objective is to automatically control the fan and lights. The idea is to plant several sensors
around the classroom and give a calculated feedback to the response these sensors
receive. An example would be having temperature sensors around the class room that
would detect the temperature and respond to any change by altering the fan ON/OFF. For
light control, there will be IR sensors that would detect student’s presence and cause the
lights to turn on if students are near that area. The third objective is to be overall cost
effective. While the idea to improve classroom is the priority of this thesis work,
importance is made to ensure that this system is affordable to all those who need it. The
setup cost may initially be a bit high, but in the long run it is expected that there will be a
reduction in both electricity and paper cost.
11
CHAPTER 3
RESEARCH METHODOLOGY
12
CHAPTER 4
EXPERIMENTATION
4.1] HARDWARE
4.1.1] NodeMCU
4.1.2] EM18 Reader Module
4.1.3] RFID Tag
4.1.4] Arduino Nano
4.1.5] LCD
4.1.6] IR
4.1.7] DHT11
4.1.8] Relay
4.1.9] I2C LCD MODULE
4.1.10] Servo Motor
4.2] SOFTWARE
4.2.1] Arduino Ide
13
4.1.1] NodeMCU
The ESP8266 is the name of a micro controller designed by Espressif Systems. The
ESP8266 itself is a self-contained WiFi networking solution offering as a bridge from
existing micro controller to WiFi and is also capable of running self-contained
applications. This module comes with a built in USB connector and a rich assortment of
pin-outs. With a micro USB cable, you can connect NodeMCU devkit to your laptop and
flash it without any trouble, just like Arduino Nano. It is also immediately breadboard
friendly.
Specification:
• Voltage: 3.3V.
• Wi-Fi Direct (P2P), soft-AP.
• Current consumption: 10uA~170mA.
• Flash memory attachable: 16MB max (512K normal).
• Integrated TCP/IP protocol stack.
• Processor: Tensilica L106 32-bit.
14
• Processor speed: 80~160MHz.
• RAM: 32K + 80K.
• GPIOs: 17 (multiplexed with other functions).
• Analog to Digital: 1 input with 1024 step resolution.
• +19.5dBm output power in 802.11b mode
• 802.11 support: b/g/n.
• Maximum concurrent TCP connections: 5.
Pin Definition:
15
The board has power indication LED (Labeled red in color) and to indicate the detection
of Card/Tag, it has a LED (Labeled green in color) and Buzzer. SEL selection jumper is
used to switch between two output formats:
Serial O/P from TTL/CMOS Pin (Microcontroller Compatible) and RS232 O/P from
DB9 Female Connector. (Note:- Data is available at both TTL/CMOS and DB9
simultaneously.)
Weigand26 O/P from ONLY DATA2 (It is DATA0 pin of EM-18) & DATA1 (It is
DATA1 pin of EM-18) Pins. (Note:- This is a different mode which uses different
protocol, so if selected data can’t be read using SERIAL Protocols, Like on UART or
HyperTerminal.)
16
Technical Specification:
Supply Voltage: 4.6 V to 5.4 V DC.
Current: 65mAmp.
Card/Tag Format: EM4001 or Compatible.
Frequency: 125 KHz.
Encoding: Manchester 64-bit, Modulus64.
Operating Temp. : 0* to 85* Celsius.
Data capacity
The amount of data storage on a tag can vary, ranging from 16 bits on the low end to as
much as several thousand bits on the high end. Of course, the greater the storage capacity,
the higher the price per tag.
Frequencies
Like all wireless communications, there is variety of frequencies or spectra through
which RFID tags can communicate with readers. Again, there are trade-offs among cost,
performance and application requirements. For instance, low-frequency tags are cheaper
than ultra high-frequency (UHF) tags, use less power and are better able to penetrate non-
metallic substances. They are ideal for scanning objects with high water content, such as
fruit, at close range. UHF frequencies typically offer better rang, and can transfer data
faster. But they use more power and are less likely to pass through some materials. UFIF
tags are typically best suited for use with or near wood, paper, cardboard or clothing
products. Compared to low-frequency tags, UHF tags might be better for scanning boxes
of goods as 2they pass through a bay door at a warehouse.
RF TRANSCEIVER
The RF transceiver is the source of the RF energy used to activate and power the passive
RFID tags. The RF transceiver may be enclosed in the same cabinet as the reader or it
may be a separate piece of equipment. When provided as a separate piece of equipment,
the transceiver is commonly referred to as an RF module. The RF transceiver controls
and modulates the radio frequencies that the antenna transmits and receives. The
transceiver filters and amplifies the backscatter signal from a passive RFID tags.
Typical Applications for RFID
Automatic Vehicle identification
Inventory Management
18
Work-in-Process
Container/ Yard Management
Document/ Jeweler tracking
Patient Monitoring
Working:
Many types of RFID exist, but at the highest level, we can divide RFID classes:
active and passive. Active tags require a power source they’re either connected to a
powered infrastructure or use energy stored in an integrated battery. In the latter case, a
19
tags lifetime is limited by the stored energy, balanced against the number-of read
operations the device must undergo. One example of an active tag is the transponder
attached to an aircraft that identifies its national origin. Another example is a LoJack
device attached to a car, which incorporates cellular technology and a GPS to locate the
car if stolen. However, batteries make the cost, size, and life-time of active tags
impractical for the retail trade. Passive RFID is of interest because the tags don't require
batteries or maintenance. The tags also have an indefinite operational life and are small
enough to fit into a practical adhesive label. A passive tag consists of three parts: an
antenna, a semiconductor chip attached to the antenna, and some form of encapsulation.
The tag reader is responsible for powering and communicating with a tag. The tag
antenna captures energy and transfers the tag's ID (the tag's chip coordinates this
process). The encapsulation maintains the tag’s integnity and protects the antenna and
chip from environmental conditions or reagents.
The encapsulation could be a small glass vial or a laminar plastic substrate with
adhesive side to enable easy attachment to goods. Two fundamentally different RFID
design approaches exist for transferring power from the reader to the tag: magnetic
induction and electromagnetic (EM) wave capture. These two designs take advantage of
the EM properties associated with an RF antenna—the near field and the far field. Both
can transfer enough power to a remote tag to sustain its operation—typically between
10W and 1mW, depending on the tag type, (For comparison, the nominal power an Intel
X Scale processor consumes is approximately 500 mw, and an Intel Pentium 4 consumes
up to 50W.) Through various modulation techniques, near-and far-fields based signals
can also transmit and receive data.
20
4.1.4] Arduino Nano
There are totally three ways by which you can power ano.
USB Jack: Connect the mini USB jack to a phone charger or computer through a cable
and it will draw power required for the board to function
Vin Pin: The Vin pin can be supplied with a unregulated 6-12V to power the board. The
on-board voltage regulator regulates it to +5V
+5V Pin: If you have a regulated +5V supply then you can directly provide this o the +5V
pin of the Arduino Nano.
Input/output:
There are totally 14 digital Pins and 8 Analog pins on your Nano board. The digital pins
can be used to interface sensors by using them as input pins or drive loads by using them
as output pins. A simple function like pinMode() and digitalWrite() can be used to
control their operation. The operating voltage is 0V and 5V for digital pins. The analog
21
pins can measure analog voltage from 0V to 5V using any of the 8 Analog pins using a
simple function liken analogRead()
These pins apart from serving their purpose can also be used for special purposes which
are discussed below:
Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial
data. They are connected with the corresponding ATmega328P USB to TTL serial chip.
External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a
low value, a rising or falling edge, or a change in value.
PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using
analogWrite() function.
SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI
communication.
In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is HIGH –
LED is on and when pin 13 is LOW, its off.
I2C A4 (SDA) and A5 (SCA): Used for IIC communication using Wire library.
AREF: Used to provide reference voltage for analog inputs with analogReference()
function.
22
Figure 4.1.5:- 16*2 LCD Pin out Diagram
4 Selects command register when low, and data register when RS (Register
high Select )
5 Low to write to the register; High to read from the register Read/write
23
6 Sends data to data pins when a high to low pulse is given; Enable
Extra voltage push is required to execute the instruction and
EN(enable) signal is used for this purpose. Usually, we make
it en=0 and when we want to execute the instruction we make
it high en=1 for some milli seconds. After this we again Make
it ground that is, en=0.
24
Pin Configuration
Range: Up to 20cm
Mounting hole
25
The IR sensor module consists mainly of the IR Transmitter and Receiver, Opamp,
Variable Resistor (Trimmer pot), output LED in brief.
IR LED Transmitter
IR LED emits light, in the range of Infrared frequency. IR light is invisible to us as
its wavelength (700nm – 1mm) is much higher than the visible light range. IR LEDs have
light emitting angle of approx. 20-60 degree and range of approx. few centimeters to
several feets, it depends upon the type of IR transmitter and the manufacturer. Some
transmitters have the range in kilometers. IR LED white or transparent in colour, so it can
give out amount of maximum light.
Photodiode Receiver
Photodiode acts as the IR receiver as its conducts when light falls on it. Photodiode
is a semiconductor which has a P-N junction, operated in Reverse Bias, means it start
conducting the current in reverse direction when Light falls on it, and the amount of
current flow is proportional to the amount of Light. This property makes it useful for IR
detection. Photodiode looks like a LED, with a black colour coating on its outer side;
Black colour absorbs the highest amount of light.
LM358 Opamp
LM358 is an Operational Amplifier (Op-Amp) is used as voltage comparator in the
IR sensor. the comparator will compare the threshold voltage set using the preset (pin2)
and the photodiode’s series resistor voltage (pin3).
Photodiode’s series resistor voltage drop > Threshold voltage = Opamp output is
High
Photodiode’s series resistor voltage drop < Threshold voltage = Opamp output is
Low
When Opamp's output is high the LED at the Opamp output terminal turns
ON (Indicating the detection of Object).
Variable Resistor
26
The variable resistor used here is a preset. It is used to calibrate the distance range
at which object should be detected.
DHT11 Temperature & Humidity Sensor features a temperature & humidity sensor
Complex with a calibrated digital signal output. By using the exclusive digital-
signal-acquisition technique and temperature & humidity sensing technology, it ensures
high reliability and excellent long-term stability. This sensor includes a resistive-type
humidity measurement component and an NTC temperature measurement component,
and connects to a highperformance 8-bit microcontroller, offering excellent quality, fast
response, anti-interference ability and cost-effectiveness.
Specifications:
27
Sampling Rate 1Hz (one reading every
second)
Operating Voltage 3 - 5V
DHT11 Specifications:
Each DHT11 element is strictly calibrated in the laboratory that is extremely accurate on
Humidity calibration. The calibration coefficients are stored as programmes in the OTP
memory, which are used by the sensor’s internal signal detecting process. The single-wire
serial interface makes system integration quick and easy. Its small size, low power
consumption and up-to-20 meter signal transmission making it the best choice for various
applications, including those most demanding ones. The component is 4-pin single row
pin package. It is convenient to connect and special packages can be provided according
to users’ request.
28
4.1.8] Relay
The relay module is an electrically operated switch that allows you to turn on or off a
circuit using voltage and/or current much higher than a microcontroller could handle.
There is no connection between the low voltage circuit operated by the microcontroller
and the high power circuit. The relay protects each circuit from each other. The each
channel in the module has three connections named NC, COM, and NO. Depending on
the input signal trigger mode, the jumper cap can be placed at high level effective mode
which ‘closes’ the normally open (NO) switch at high level input and at low level
effective mode which operates the same but at low level input. Specifications
Module can be directly and MCU I/O link, with the output signal indicator
29
Pin Configuration
30
(NO) or NC. If connected to NO the load remains
disconnected before trigger
31
Specifications:
Contrast Adjustable by
Features
Operating Voltage is +5V typically
Torque: 2.5kg/cm
Operating speed is 0.1s/60°
Gear Type: Plastic
Rotation : 0°-180°
Weight of motor : 9gm
Package includes gear horns and screws
5. Save
Saves your sketch.
6. Serial Monitor
Opens the serial monitor.
34
Figure 4.2.1: Arduino IDE window
In this module the student attendance is automated with the help of Radio
Frequency Identification (RFID) Technology. Each student will be provided with a RFID
card for identification purpose and the uniqueness of this system is that student’s college
identity card will be printed itself on RFID card thus making it compulsory for student to
bring his college identity card. A RFID card has its internal storage which holds a unique
identification number. These cards can be programmable or comes with a predefined
identifier. This RFID card/tag is a passive tag which will be activated when in contact
with a RFID receiver. The card contains at least two components: an integrated circuit for
storing the unique identification number and modulating and demodulating radio
frequency (RF) signals; an Antenna for signal sending and receiving purpose. The RFID
readers are fixed and they create an interrogation zone. It reads the RFID cards/tags when
they go in or out of the interrogation zone. The reader gets a unique identification number
from RFID card. RFID receiver is connected with a microcontroller Arduino Nano
NodeMCU ESP8266 module. The NodeMCU is an IoT platform. It is a firmware that
uses Lua scripting language. The unique identification number read by reader is collected
36
by the microcontroller kit and it will be sent on a static web page then it will be compared
in the SQLite database of dedicated Android application for this system. The SQLite
database is weakly typed, ACID compliant database. It does not uses client-server
architecture like most of the databases. It resides on local/client side or can be embedded
in web browsers. This also provides bindings with an android application. If the unique
identification number is matched with any record in database the associated record of
student will be retrieved from database and the information will be stored in another
database and that student’s attendance will be marked and will be notified to the teacher
via web applications. In case of attempt to mark intentional fake attendance if any student
marks attendance of other students, the system also stores total count of number of
students who marked their attendance then the teacher can cross verify headcount of
students by entering value in application and can have detailed information of present
students and students who are absent but still having their attendance marked.
37
4.3.4) Implementation of Class Room Automation System
Smart Classroom, can be defined as the classroom equipped with the technology
to aid teaching and learning .We often see that from entering the class to leaving it much
of the time teacher is occupied in many of secondary nature jobs such as taking the
attendance which (cases where class size is more than 60) eats up much of the time and
after that adjusting the lighting of the room etc. Thus teacher is left with a portion of
allotted time which in much of the cases is not sufficed. To eliminate this conundrum
smart classroom would be the best rectification.
With the help of smart classroom it would be easier for teacher to focus on primary job
(teaching) whereas the secondary job can be done in miniscule part of allocated time.
It makes it possible to control lighting, fan as well as allows the teacher to mark
attendance through RFID based system. Even it allows the teachers to access the
attendance of the students date wise.
This is a simplest smart automation system prototype which ranges from the controlling
of electrical devices in the room to the attendance marking through RFID System.
38
4.4.1) Code for Automation
#include <Servo.h>
#include "DHT.h"
#include <LiquidCrystal.h>
#define servoPin 8
#define DHTPIN A3 // what digital pin we're connected to
#define DHTTYPE DHT11 // DHT 11
#define IR1 A0
#define IR2 A1
#define bulb1 9
#define fan1 10
#define bulb2 11
#define fan2 12
#define doorsensor A2
DHT dht(DHTPIN, DHTTYPE);
Servo S1;
//LiquidCrystal lcd(RS, EN, D4, D5, D6, D7); // LCD pin
LiquidCrystal lcd(7, 6, 5, 4, 3, 2); // arduino pin
float tempC;
int servoCureentAngle = 45;
int openAngle = 120, closeAngle = 45;
void setup() {
Serial.begin(9600); // bits/sec
pinMode(IR1, INPUT);
pinMode(IR2, INPUT);
pinMode(doorsensor, INPUT);
pinMode(bulb1, OUTPUT); pinMode(fan1, OUTPUT);
pinMode(bulb2, OUTPUT); pinMode(fan2, OUTPUT);
digitalWrite(bulb1, HIGH);
digitalWrite(bulb2, HIGH);
digitalWrite(fan1, HIGH);
39
digitalWrite(fan2, HIGH); //off
dht.begin();
lcd.begin(16, 2); //char length , lines
lcd.clear();
lcd.setCursor(0, 0); // lcs.setCursor(position , Line) (pos= 0to 15, Line 0 to 1)
lcd.print("Temp Hum ");
lcd.setCursor(0, 1);
lcd.print(" ");
delay(1000);
S1.attach(servoPin);
S1.write(closeAngle);
}
void loop() {
int h = dht.readHumidity();
// Read temperature as Celsius (the default)
int t = dht.readTemperature();
Serial.println("Temp=" + String(t) + " Hum=" + String(h));
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(t);
lcd.print("^c ");
lcd.print(h);
lcd.print("% ");
if (digitalRead(IR1) == LOW)
{
Serial.println("BULB1 ON");
digitalWrite(bulb1, LOW); //ON
if (t > 27)
40
{
digitalWrite(fan1, LOW); //ON
Serial.println("FAN1 ON");
}
}
else
{
digitalWrite(bulb1, HIGH); //off
digitalWrite(fan1, HIGH);
}
if (digitalRead(IR2) == LOW)
{
Serial.println("BULB2 ON");
digitalWrite(bulb2, LOW); //ON
if (t > 27)
{
digitalWrite(fan2, LOW); //ON
Serial.println("FAN2 ON");
}
}
else
{
digitalWrite(bulb2, HIGH);
digitalWrite(fan2, HIGH);
}
if (digitalRead(doorsensor) == LOW)
{
delay(100);
if (digitalRead(doorsensor) == LOW)
{
Serial.println("OPENING DOOR");
41
ServoAngle(openAngle);
delay(5000);
Serial.println("CLOSING DOOR");
ServoAngle(closeAngle);
}
}
delay(300);
}
void ServoAngle(int angleofservo)
{
if (servoCureentAngle < angleofservo)
{
while (servoCureentAngle < angleofservo)
{
S1.write(servoCureentAngle);
servoCureentAngle = servoCureentAngle + 10;
delay(50);
}
}
else
{
while (servoCureentAngle > angleofservo)
{
S1.write(servoCureentAngle);
servoCureentAngle = servoCureentAngle - 10;
delay(50);
}
}
}
42
4.4.2) Code for Attendance
#include <ESP8266WiFi.h> //wifi header file
#include <FirebaseArduino.h>
#include <WiFiUdp.h>
#include <NTPClient.h>
#include <LiquidCrystal_I2C.h>
#define led D5
// Set these to run aaexample.
//pcollegeiot@gmail.com
//
#define FIREBASE_HOST "myclassroom-d4cf2.firebaseio.com"
#define FIREBASE_AUTH "H9ceMrsUjmHK3JvHcwYM4p3GwhbD7tWfw2NoAtln"
#define WIFI_SSID "ElectroEra"
#define WIFI_PASSWORD "mywifipassword"
int n = 0;
int light = 10;
String formattedDate;
String dayStamp;
String OlddayStamp = "";
String timeStamp;
int rollno = 50;
void loop() {
digitalWrite(led,LOW);
while(true)
{
rollno=getid();
if(rollno!=0)
break;
44
else
{
lcd.setCursor(0,1);
lcd.print("INVALID CARD ");
delay(5000);
lcd.setCursor(0,1);
lcd.print(" ");
}
}
timeClient.update();
formattedDate = timeClient.getFormattedDate();
Serial.println(formattedDate);
if (OlddayStamp != dayStamp)
{
OlddayStamp = dayStamp;
Firebase.setString(dayStamp, dayStamp); //Firebase.setString(dayStamp);
if (Firebase.failed()) {
Serial.print("New Date Creation Fails");
lcd.setCursor(0,1);
lcd.print("Not uploaded# ");
45
}
else
{
Serial.println("New db created with date" + dayStamp);
}
delay(1000);
}
//Firebase.setString(Path,"sarang shastrakar,123");
Firebase.pushInt(dayStamp, rollno);
if (Firebase.failed()) {
Serial.print("Roll number logging fails");
Serial.println(Firebase.error());
delay(1000);
lcd.setCursor(0,1);
lcd.print("Not uploaded# ");
//return;
}
else
{
Serial.println("ROll No. " + String(rollno)+" Updated");
lcd.setCursor(14,1);
lcd.print("OK");
delay(3000);
}
//delay(3000);
}
int getid()
{
int rNo=0;
46
//lcd.clear();
Serial.println("Puch ID Card");
lcd.clear();
//lcd.setCursor(0,0);
lcd.print(" Puch ID Card ");
String ID="";
for(int i=0;i<12;i++)
{
while(!Serial.available());
char ch=Serial.read();
ID+=ch;
Serial.print(ch);
//delay(1);
}
digitalWrite(led,LOW);
if(ID.compareTo(RFID1)==0)
rNo=50;
else if(ID.compareTo(RFID2)==0)
rNo=51;
else if(ID.compareTo(RFID3)==0)
rNo=52;
else if(ID.compareTo(RFID4)==0)
rNo=53;
else if(ID.compareTo(RFID5)==0)
rNo=54;
else
rNo=0;
Serial.println("Attendance : "+String(rNo));
lcd.setCursor(0,1);
lcd.print("Roll No : "+String(rNo));
47
return rNo;
}
void connectNet()
{
if ((WiFi.status() != WL_CONNECTED))
{
Serial.println("ERROR - NO INTERNET");
Serial.print("Connecting to ");
lcd.clear();
lcd.print("Connecting NET ");
Serial.println(WIFI_SSID);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD); // network connection
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
lcd.setCursor(0, 1); // pos,line
lcd.print("Connected");
Serial.println();
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
delay(3000);
}
}
48
CHAPET 5
RESULT AND DISCUSSION
5.1 Result
In the above fig Automatic Attendance system using RFID system is shown which
consist of NodeMCU board through which I2C LCD is connected which always show an
information message for punching the RFID Card as soon as the student punch the card
the valid card holder name display on the LCD screen also the attendance of the
particular card holder login on the webpage. As the card is not register in the database
then LCD shown the invalid card in the LCD Screen.
49
Figure 5.2: Implementation of Class Room Automation
In the above fig show the Implementation of Class Room Automation which
consist of Arduino Nano as a motherboard through which all the peripherals devices (IR
Sensors, Relay, Fans, Lights, Servo Motor) are connected for making class room
automation. In the first part when someone come in front of entry door IR detect the
motion then it sends the signal to the controller according to the predefined instruction in
the controller , controller open the door with the help of servo motor for curtain amount
of time after some time it automatically close the door.
In the second part when no one is present in the class all light and fan are in the
off position. When someone enter in the class IR detect the motion and turn on the light
of class also if the temperature of the class is going above the threshold value then
controller automatically turn on/off according to the temperature of the class. All this
process is control by the controller. The implemented proposed project is shown in the
above fig.
50
5.2 Discussion
This presents a model that has been proposed to meet the basic needs of
classroom automation. An important advantage of this system is that it gives the system
as a complete prototype to develop more such cost efficient systems that can be used in
classrooms and college automation. A study of the system shall be conducted in order to
verify the expected results in the classroom automation system as proposed.
51
CHAPET 6
SUMMARY AND CONCLUSION
6.1) Summary
This presents a model that has been proposed to meet the basic needs of classroom
automation. An important advantage of this system is that it gives the system as a
complete prototype to develop more such cost efficient systems that can be used in
classrooms and college automation. A study of the system shall be conducted in order to
verify the expected results in the classroom automation system as proposed. In addition to
this the future work can be focused on developing applications that can help in
automating an entire department or a college.
6.2) Conclusion
In this project, we instantly infer the power wastage in the class rooms. The
knowledge derived from our estimation can enable many variable applications for social
good such as effective utilization of the available power and we consider our project as a
contribution for developing smart city. Thus we address the problem by establishing a
smart class room. By observing the above details, we conclude that these techniques can
also be implemented at collage level, Institute level. Which we will go to design a new
project that is “SMART CLASSROOM AUTOMATION USING ARDUINO NANO
AND IOT”.
52
REFERENCES
5] Coutaz J., Crowley J., Dobson S., Garlan D. - « Context is key » -Commun. ACM,
Vol. 48, No. 3. (March 2005).
53
9] 9. Rey G., Coutaz J.- « Le Contexteur : Capture et distribution Dynamique
d'Informations Contextuelles » - Ubimob04 - Grenoble - France, ACM Publication,
2004. X10 standard », http://www.x10.com
12] Lee K.– « IEEE 1451: A Standard in Support of Smart Transducer Networking » -
IEEEInstrumentation and Measurement Technology conference Baltimore, MD USA,
May 1-4, 2000.
13] Launay P.- « Déploiement d'un bus à messages sur un réseau à grande échelle » -
Master thesis , Grenoble- France , 2000 June.
14] Yang H., Jansen E., Helal S., Mann W.- « An IDE for Programmable Pervasive
Spaces Based on a ContextDriven Programm » - PerCom, Italy, March 2006.
15] Wang X.H., Gu T., Zhang D.Q., Pung H.K. – « Ontology Based Context Modeling
and Reasoning using OWL ». Workshop on CoMoRea 2004, Orlando, Florida USA,
March 2004.
16] Euzenat J., Pierson J., Ramparany F.- « Gestion dynamique de contexte pour
l’informatique diffuse » - Tours – France - RFIA 2006.
54
ANNEXURES