Smart Classroom Monitoring System
Smart Classroom Monitoring System
A Thesis Submitted in
Partial Fulfilment of the Requirements for the Degree of
Bachelor of Technology
by
Raj Kumar 1884120041
Shreyansh Sharma 1884120059
Ashish Kumar Bind 1884120015
Akash Singh 1884120006
Himanshu Srivastava 1884120025
pg. 1
DECLARATION
We declare that the presented thesis represents largely our own ideas and work in our own
words. Where others ideas or words have been included, we have adequately cited and
listed in the reference materials. We have adhered to all principles of academic honesty
and integrity. No falsified or fabricated data have been presented in the thesis. We
understand that any violation of the above will cause for disciplinary action by the
Institute, including revoking the conferred degree, if conferred, and can also evoke penal
action from the sources which have not been properly cited or from whom proper
permission has not been taken.
Date: 27/05/2022
pg. 2
CERTIFICATE
It is certified that the work contained in the thesis entitled ‘Smart Classroom Monitoring
System’ submitted by Raj Kumar, 1884120041; Shreyansh Sharma, 1884120059; Ashish
Kumar Bind, 1884120015; Akash Singh, 1884120006; Himanshu Srivastava,
1884120025 for the award of B.Tech is absolutely based on their work carried out under
my supervision and that this work has not been submitted elsewhere for any degree.
pg. 3
ABSTRACT
This project is about how to monitor and control lighting system using IOT. This project’s
aim is to make a device by which we can maintain and record the number of
visitors/students in the particular classroom in real time. This project is made to prevent
unwanted electric power waste in schools, colleges, offices and houses. For this project
we will use nodeMCU and two IR (Infrared sensor) as main devices also monitor and
control the data using Blynk Application as it is much cheaper and easier to manage and
control. And also Blynk application is easy to use and the data is much easier to
understand.
Except that, it also acted as a car power switching system. While the IR sensor
is caused, the sign will transmit wirelessly to take in addition movement.
This whole method is operated totally robotically through its sensors. We are able
to display the overall range of incoming, outgoing, and modern site visitors on line from
any part of the sector the use of Blynk Dashboard. To be counted wide variety the
incoming and outgoing site visitors, it’s a long way makes use of Infrared or IR Sensor.
The visitors records uploads routinely to Blynk cloud the usage of the NodeMCU
ESP8266 Wi-Fi Module. While no human beings are gift in the room, the
electrical appliances turns OFF robotically. Whilst the moderate sensor is added about,
the sensor will ship statistics to the Blynk.
The principle function of this venture is to find whether the lecture room is to be
had for now not by way of the use of the IR sensor to hit upon any presence of light.
We've finished few researches from the internet and additionally consult the lectures to
determine the tools and gadget wished for this undertaking. The NodeMCU module is the
primary software in this undertaking because it controls all of the fundamental operations.
pg. 4
ACKNOWLEDGEMENT
First of all, we praise omnipresent God, the creator of this universe, for giving the
opportunity to pursue B.Tech in our life. It gives us an immense pleasure to acknowledge
the several individuals who were influential in completing our B.Tech project.
We would like to express our sincere thanks to our respected project supervisor
Dr. Rajkumar Patel, HOD of Electrical Engineering Department, Rajkiya Engineering
College Sonbhadra for his motivation and valuable advices during various phases of this
project. We are highly grateful to him for his day-to-day instructions, valuable
suggestions and formulation of research problem that we received during this project.
We would like to thank project review committee members, Dr. Raj Kumar
Patel, Mr. Umesh Kumar Gupta, Dr. Vijay Pratap Singh, Mr. Ram Ishwar Vais
and Dr. T. Chiranjeevi for their valuable inputs to improve our work and support during
this project.
We owe a special thanks to our family members who supported us and helped us
throughout our life and during this study. We dedicate this work to you all.
Raj Kumar
Shreyansh Sharma
Ashish Kumar Bind
Akash Singh
Himanshu Srivastava
Date: 27/05/20229
pg. 5
CONTENTS
Declaration ii
Certificate iii
Abstract iv
Acknowledgement v
Contents vi
List of Figures ix
1. Introduction 10-12
1.1. Objective 10
1.2. Problem Statement 10
1.3. Thesis Organization 11
References 12
References 16
3. Methodology 17-21
3.1 Introduction 17
3.2 Analysis Study & Research Paradigm Justification 17
3.3 Project Design and Development 18
18
3.3.1 Project Development Methodology
3.3.2 Data Flow Diagram 19
pg. 6
3.4 Software and Hardware Requirements 20
3.6 Conclusions 21
21
References
4. Implementation, Testing & Result 23-52
24
4.1.1 Features
25
4.1.2 What do I need to Blynk?
26
4.1.3 Supported Software
27
4.1.4 Create a Blynk Project
29
4.1.5 Add Widgets to the Project
30
4.1.6 Upload the Firmware
32
4.2 Hardware
4.2.1 IR Sensor as Visitor Counter 32
4.4 Colcusion 51
References 51
pg. 7
5. Future Scopes, Advantages & disadvantages 53-55
5.3 Functions of Proposed System 53
5.4 Future Scopes 53
5.5 Advantages 54
5.6 Disadvantages 54
5.7 Conclusion 54
References
54
pg. 8
LIST OF FIGURES
pg. 9
CHAPTER
1
Introduction
This project is referred to as “Smart Classroom Monitoring System” the use
of internet of things (IOT). The main motive of this project is to develop a class
automation gadget that offers the person whole control over all remotely
controllable/monitoring devices of the study room the use of IOT. The principle reason
for this challenge is to examine the use of study room every day through the presence
of light within the classroom each time the lecture room is being used. However, this
project will also relate to power ON and off the light automatically. The presence of
person can be detected the usage of IR sensor along with NodeMCU module.
1.1 Objective
o Design a bi-directional visitor counter managed by way of the microcontroller
(NodeMCU) so as to display its statistical output on an liquid crystal
display and therefore mild up the room.
o To analyse data about the usage of the classroom daily and can be monitored
remotely from anywhere.
Technology of visitor counting had dated lower back to the 1990s. However,
there are some shortcomings present in the existing system. Visitor counting is simply
a measurement of the visitor traffic entering and exiting places of work, department
stores, sports venues, and auditorium. Counting the visitors enables to maximise the
efficiency and effectiveness of personnel, floor area and income ability of a business
enterprise.
This thesis consists of five chapters. The rest of the thesis is organized as follows:
In Chapter 2, literature survey on Smart Classroom Monitoring System and scope of
present research work is discussed.
pg. 11
References
Text Book
[1] Piero Zappi, Elisabetta Farella, and Luca Benini. (September, 2010). Fellow,
Tracking Motion Direction and Distance with Pyroelectric IR Sensors, 10(9).
[2] Mr. Rahul Mishra, Dr. Shelej Khera, Mr. Manoj Kumar, Mr. Vikrant Verma. (June-
December, 2017). Sensor Based Lighting Control System for Energy Efficient
Building Environment Using Real-Time Occupancy Measurements, 9(2), 54-56.
[3] V. V. Murali Krishna* and T. Anuradha. (May, 2016). An Energy Efficient Power
Usage Controlling and Monitoring using Wireless Sensor Network, 9(17), DOI:
10.17485/ijst/2016/v9i17/93007.
[4] Daniel Palma, Juan Enrique Agudo *, Héctor Sánchez and Miguel Macías Macías.
(2014). An Internet of Things Example: Classrooms Access Control over Near Field
Communication, 14.
[5] Rajeev Piyare1 and Seong Ro Lee. (September, 2013). Towards Internet of
Things(IOT) Integration of Wireless Sensor Network to Cloud Service Data Collection
and Sharing. International Journal of Computer Networks & Communications (IJCNC)
5(5).
Research Paper
[6] https://law.stanford.edu/wp-content/uploads/2016/06/Electricity-Consumption-
and-Economic-Growth.pdf
pg. 12
CHAPTER
2
Survey of Smart Classroom
Monitoring System
pg. 13
When the term the internet of things regarded it became achieved underneath the
basis that if there were devices with the ability to understand the
entirety approximately such gadgets or things. From all of the statistics formerly
accrued we would be capable of track and manage the whole thing and to realize when
things want to change low strength consumption this means that huge network of
sensors may be created, with the potential to attain information, process it and act for
this reason. Right here it is how the concept of the internet of things arises. Under this
term, computers and technologies are around users without noticing their presence,
being capable of cooperate and adapt their behaviours to the surroundings and enabling
customers to interact with technology without interfering with their ordinary life. on
this sense, the idea of laptop as hardware device is diluted to integrate connected
devices around and in cooperation with users’ each day lifestyles while the term the
internet of things regarded it become done under the premise that if there had been
devices with the capacity to recognise everything about such objects or things. From
all the statistics formerly gathered we would be capable of tune and manipulate the
whole thing and to realize when things need to change.
pg. 14
This research discusses home safety device the usage of facial pattern
recognition to get into the house. This gadget makes use of a Beagle Bone and cameras.
The system used email to make communication with customers. Another study
proposed a prototype of smart home intelligent lights manage architecture on board
sensors using a mobile computing gadget. This research discusses a prototype of a
smart home through using ambient light Sensor on smartphones. Therefore, we
determined to make a smart home prototype the use of the NodeMCU. The principle
functions of our prototype made are automation, manage, tracking, and security. The
automation will create an automation e.g. lights that is based totally on human
presence. The manipulate function is able to show on and off digital devices remotely.
pg. 15
o Count visitor which enters and leave the room and display total occupant inside the
room
o Room Light Controlling as per student in the room
o Implement two IR proximity sensors
o Identify the counter process (count up or countdown)
o Work in a double entrance and single exit room.
References
Text Book
[1] Piero Zappi, Elisabetta Farella, and Luca Benini, Fellow, Tracking Motion
Direction and Distance with Pyroelectric IR Sensors, VOL. 10, NO. 9, SEPTEMBER
2010
[2] Mr. Rahul Mishra, Dr. Shelej Khera, Mr. Manoj Kumar, Mr. Vikrant Verma, Sensor
Based Lighting Control System for Energy Efficient Building Environment Using
Real-Time Occupancy Measurements, Volume--9 •• Number--2 June --Dec 2017 pp..
54—56
[4] Daniel Palma, Juan Enrique Agudo *, Héctor Sánchez and Miguel Macías Macías,
An Internet of Things Example: Classrooms Access Control over Near Field
Communication, 2014, 14
[5] Rajeev Piyare1 and Seong Ro Lee, Towards Internet of Things(IoT) Integration of
Wireless Sensor Network to Cloud Service Data Collection and Sharing, International
Journal of Computer Networks & Communications (IJCNC) Vol.5, No.5, September
2013
pg. 16
CHAPTER
3
Methodology
3.1 Introduction
To have buildings which are able to adapt to the user needs and at the same time to
operate efficiently. It is essential to understand the hobby the people are performing.
Presence sensors, which can be broadly deployed in modern buildings, try to alter
lighting to the presence of people in indoor spaces. Even though,
a wonderful deal extra in terms of comfort and electricity efficiency may
be achieved if extra detailed data at the hobby of the customers is detected sensors
are broadly used as a presence trigger. But the analogue output of IR sensors relies
upon on numerous different elements, along with the space of the body from the IR
sensor, the direction and speed of movement, the body shape and size.
2. Data collection and accumulating in this level, all the associated data was
collected through a few method of records collection strategies, which can be
analysing articles, reports and journals. After reviewed of records gathered, the
approach that is suitable for this project is internet of things (IOT). Therefore, this
technique could be implemented in this project.
pg. 17
3. Framework design stage for this stage, framework is layout as well as prototyping
of the system. A framework will describe about the collection of classes or tools that
will be used to help in developing the system.
4. Evaluation stage for the duration of this stage, all unit and sub modules can be
tested before system integration process. That is important as it's far had to ensure
that the machine for the project will function as expected and meet the project
requirement.
pg. 18
3.3.2 Data Flow Diagram
Next, we can look into structure, behaviour, and information of the device through
conceptual model. Through project designing and modelling, we can understand
greater about the situation or the problem that may occur for the duration of task
testing and be prepared for it and it additionally help us to make fast choice wisely.
pg. 19
3.4 Software and Hardware Requirements
The requirement of hardware and software program are the most important for this
project as it will result in the successful of this task. Without software application
and hardware requirement, this challenge cannot be completed.
3.5 Framework
Usually, Framework is an actual or conceptual structure supposed to serve as a
support or manual for the building of something that expands the shape into
something beneficial. In laptop machine, a framework is often a layered structure
indicating what type of programs can or have to be constructed and the way they
could interrelate. A few laptop machine frameworks also consist of actual
programs, specify programming interfaces, or offer programming tools for the use
of the frameworks. A framework may be normally comprehensive than a protocol
and more prescriptive than a structure.
pg. 20
Fig. 3.4 Prototype Model of Visitors Counter
When IR sensor detects any Object presence, it will send the signal to the
nodeMCU. NodeMCU act as a bridge between Blynk and sensor. Then nodeMCU
will send the data receive to Blynk app to be analyse.
3.6 Conclusion
In conclusion, this chapter describe about the methodology for this project. Besides
that, the requirement of the software and hardware that needed for this project also
has been listed in this chapter.
References
Text Book
[1] Piero Zappi, Elisabetta Farella, and Luca Benini, Fellow, Tracking Motion
Direction and Distance with Pyroelectric IR Sensors, VOL. 10, NO. 9,
SEPTEMBER 2010
pg. 21
[2] Mr. Rahul Mishra, Dr. Shelej Khera, Mr. Manoj Kumar, Mr. Vikrant Verma,
Sensor Based Lighting Control System for Energy Efficient Building Environment
Using Real-Time Occupancy Measurements, Volume--9 •• Number--2 June --Dec
2017 pp.. 54—56
[4] Daniel Palma, Juan Enrique Agudo *, Héctor Sánchez and Miguel Macías
Macías, An Internet of Things Example: Classrooms Access Control over Near
Field Communication, 2014, 14
[5] Rajeev Piyare1 and Seong Ro Lee, Towards Internet of Things(IoT) Integration
of Wireless Sensor Network to Cloud Service Data Collection and Sharing,
International Journal of Computer Networks & Communications (IJCNC) Vol.5,
No.5, September 2013
Research Paper
[6] https://myfik.unisza.edu.my/www/fyp/fyp17sem2/report/041534.pdf
Figure
[7] https://images.app.goo.gl/jW1QwDMGzJwhE2Eh8 [Fig. 3.4(a)]
pg. 22
CHAPTER
4
Implementation, Testing & Result
Blynk App: Permits to you create first rate interfaces for your initiative with
numerous widgets we offer.
Blynk Libraries: For all of the popular hardware systems, permit verbal
exchange with the server and procedure all of the incoming and out
coming commands.
Now believe each time you press a Button in the Blynk app, the message travels to
space the Blynk Cloud, in which it magically reveals its way on your hardware.
pg. 23
It works the same inside the contrary path and everything happens in a Blynk of a
watch.
4.1.1 Features
Similar API & UI for all supported hardware & devices connection to the cloud using:
o WiFi
o Bluetooth and BLE
o Ethernet
o USB (Serial)
o GSM
o Set of easy-to-use Widgets
o Direct pin manipulation with no code writing
o Easy to integrate and add new functionality using virtual pins
o History data monitoring via Super Chart widget
o Device-to-Device communication using Bridge Widget
o Sending emails, tweets, push notifications, etc.
o New features are constantly added
pg. 24
4.1.2 What do I need to Blynk?
At this point you might be thinking: “Ok, I want it. What do I need to get started?” –
Just a couple of things, really:
Hardware
Blynk works over the internet. This means that the hardware you select should be
able to connect to the internet. Some of the forums, like Arduino Uno will want an
Ethernet or Wi-Fi defend to communicate, others are already internet-enabled: just
like the ESP8266, Raspberry Pi with WiFi dongle, Particle Photon or SparkFun
Blynk Board. But even in case you don’t have a protect, you can connect it over
USB for your pc or computer (it’s a chunk greater complicated for beginners,
however we got you blanketed). What’s cool, is that the list of hardware that works
with Blynk is massive and will keep on growing.
A Smartphone
The Blynk app is a well-designed interface builder. It works on both IOS and
Android, so no holy wars here, ok?
pg. 25
4.1.3 Supported Software
Blynk application can be found from the following links:
Android Blynk App
IOS Blynk App
After downloading the app, create an account and log in. (If feasible than log in
together with your real mail identity for higher connectivity later.) You’ll also need
to install the Blynk Arduino Library, which allows generate the firmware going for
walks for your ESP8266. Down load the contemporary launch from
https://github.com/blynkkk/blynk-library/releases, and observe on the side of
the instructions there to put inside the unique libraries.
pg. 26
4.1.4 Create a Blynk Project
After create new account, install Blynk Library in sketch. After that,
opened caricature software program application and choose document then
choosed options. Next duplicate a link to download the Blynk’s Library
into caricature. We get the link from internet.
Next, I’m able to configure Blynk with a view to begin my project. First I
click on the new venture button.
Click the “Create New Project” in the app to create a new Blynk app. Give it any
name.
pg. 27
Fig. 4.5 Board Select
Then I need to pick out hardware to be able to be used on this task. As stated in
advance, for this project, we will used NodeMCU as principal hardware. Then for
the connection type, we will used Wi-Fi.
.
pg. 28
4.1.5 Add Widgets to the Project
o Then you will be presented with a smooth new challenge.
o To open the widget container, click on in the undertaking window to open.
o We are selecting a button to control Led connected with NodeMCU.
o Click on Button.
o Give name to Button say led.
o Below OUTPUT tab- click on pin and pick out the pin to which led is
connected to NodeMCU, proper here its miles digital pin 2, as an end
result pick virtual and under pin D2.and click on preserve.
o Under MODE tab- Select whether you want this button as “push button” or
“Switch”.
pg. 29
Fig 4.8 Button Setting
pg. 30
Fig 4.9 ESP8266_Standalone menu
pg. 31
4.2 Hardware
o The emitter is virtually an IR LED (moderate Emitting Diode) and the detector
is virtually an IR photodiode. Photodiode is touchy to IR mild of the identical
wavelength that's emitted by way of the IR LED. Whilst IR mild falls on the
photodiode, the resistances and the output voltages will alternate in share
to the significance of the IR light obtained.
o There are five basic factors used in a regular infrared detection system: an
infrared source, a transmission medium, optical issue, infrared detectors or
receivers and sign processing. Infrared lasers and Infrared LED’s of particular
wavelength used as infrared assets.
o The three principal forms of media used for infrared transmission are
vacuum, surroundings and optical fibers. Optical components are used to
awareness the infrared radiation or to restriction the spectral reaction.
Types of IR Sensor
There are two types of IR sensors are available and they are:
Active Infrared Sensor
Passive Infrared Sensor
pg. 32
Active Infrared Sensor
Active infrared sensors consist of elements: infrared source and infrared detector.
Infrared assets include the LED or infrared laser diode. Infrared detectors consist of
photodiodes or phototransistors. The energy emitted with the aid of the infrared
supply is pondered by an object and falls at the infrared detector.
IR Transmitter or IR LED
Infrared Transmitter is a light emitting diode (LED) which emits infrared radiations
referred to as IR LED’s. Despite the fact that an IR LED looks as if an everyday
LED, the radiation emitted by its far invisible to the human eye.
IR Receiver or Photodiode
Infrared receivers or infrared sensors discover the radiation from an IR transmitter.
IR receivers come inside the shape of photodiodes and phototransistors. Infrared
Photodiodes are unique from normal image diodes as they discover best infrared
radiation. below picture shows the image of an IR receiver or a photodiode,
exclusive styles of IR receivers exist based totally on the wavelength, voltage,
package, etc. when utilized in an infrared transmitter – receiver combination, the
wavelength of the receiver should fit with that of the transmitter.
pg. 33
Fig 4.11 IR Sensor
The ESP8266 has the potential to technique and save competencies allowing it to be
integrated with sensors and other tool-precise devices thru its GPIOs with a few
earlier enhancements and fewer loading for the duration of operation.
pg. 34
Its high level of chip integration lets in for minimal outside rotation, and the
complete answer, which includes the front module, is designed to accommodate a
small PCB region. ESP8266 NodeMCU improvement board - a actual plug-and-play
answer for less highly-priced projects using Wi-Fi. The module comes up Wi-Fi rest
with the NodeMCU wireless so they may be geared up to head - simply deploy your
USB driver.
The ESP-12 Lua NodeMCU WIFI improvement Board integrated built-in board
consists of a entire ESP8266 Wi-Fi module with all broken GPIO, a complete USB-
serial integrated, and power built-in a built-inunmarried packet of the breadboard.
The board is pre-loaded with NodeMCU - Lua-based wi-firmware for ESP8266 that
allows easy control with pure script building language - Lua - so that you're equipped
to go integrated just a few built-in. ESP-12 Lua NodeMCU.
WIFI Dev. Board integrated built-in with ESP8266 is a very smooth-to-use
microcontroller + in a single platform to build projects with Wi-Fi and IOT-
integrated built-in of factors. The board is primarily based at the ESP8266 Wi-Fi
Module chip with the ESP-12 SMD footprint grated.
pg. 35
The Wi-Fi improve board has already integrated on its board all of the ESP8266
(ESP-12E) code for organizing and uploading the code. It has WIFI USB serial chip
add codes, a 3.3V voltage regulator, and a good judgment degree converter circuit
so that you can speedy down load codes and built-in integrated your circuits.
If if you are built-in with Ardubuilt-ino, built-in the use of NodeMCU is the
subsequent step if you are built-in for a compatible alternative, with Wi-Fi.
NodeMCU is primarily based on ESP8266-12E Wi-Fi built-in-On-Chip. Loaded
with open source, Lua-based wi-firmware. Gettbuilt-ing started out with
NodeMCU could be very easy. Perfect for IOT programs, and other Wi-Fi
connectivity programs. This chip has plenty built-in not unusual with Ardubuilt-ino
- each of these microcontroller-armed prototyping forums may be configured the
usage the Ardubuilt-ino IDE. ESP8266 is greater currently released than Ardubuilt-
ino and has more potent mean built-in. It has a 32-bit RISC processor clocked at
80MHz, built-in addition to a RAM deliver and helps up to 16 MB of external flash
garage. The tool is built integrated useful for IOT packages, because of its small
footprint and Wi-Fi support. ESP8266 Integrates 802.11b / g / n HT40 Wi-Fi
transceiver, so it can most effective hook up with a Wi-Fi community and built-
interact with the integrated. It can also built-installation its very own network, built-
in other gadgets to connect directly to it. There may be a board controller that
guarantees very easy strength at the MCU itself, built integrated a push-button reset
and USB connection to make it simpler to connect to your pc.
Energy requirements:
Operating voltage: 2.5 to 3.3 v.
Onboard power control 3.3v 600mA
It currently operates 800mA
pg. 36
4.2.2.2 I / O Pins:
The ESP6266 NodeMCU board comes with 17 GPIO, these anchors assign all kinds
of structural functions like:
10 bit ADC channel
PWM output
UART display
SPI, I2C, I2S display: to connect all kinds of sensors and devices.
I2S: sound installation for your project.
Due to the pin multiplexing feature of ESP8266 (multiple parameters multiplied
by one GPIO pin). Which means that one GPIO pin can work as a PWM / UART
/ SPI.
pg. 37
Wi-Fi frequency ranges from 2.4G to 2.5G. It uses the Wi-Fi protocol IEEE
802.11 b / g / n. The power of Esp6266 Wi-Fi is guaranteed by the Wi-Fi
Alliance.
1) Power Pins:
There are four power pins namely- a VIN pin and three 3.3V pins.
There are VIN pin can be used to directly supply ESP8266 and its components if
you have a controlled 5V voltage source.
pg. 38
The 3.3V pins are the output of the voltage board controller
These pins can be used to supply power to external parts.
2) GND- Ground:
It is the ground pin of the ESP8266 NodeMCU development board.
3) I2C Pins:
These are used to integrate all styles of I2C sensors and parameters within the
task. Both I2C master and I2C Slave are supported. The performance of the I2C
optical connector can be systematically detected, and the clock frequency is one
hundred kHz at maximum velocity. It must be mentioned that the frequency of
the I2C clock have to be greater than the frequency of the slowest clock of the
slave device.
4) GPIO Pins:
The ESP8266 NodeMCU has 17 GPIO anchors that can be assigned to various
functions such as I2C, I2S, UART, PWM, IR Remote Control, LED Light, and
Button respectively. Each GPIO digitally-enabled can be adjusted to internal drag
or drop or set to high intensity. When set as input, it can also be set to Edge-trigger
or level-trigger to produce CPU interference.
5) ADC channel:
NodeMCU is embedded 10-bit with SAR ADC accuracy. These functions can be
finished the usage of the ADC viz. VDD3P3 pin electricity deliver and TOUT pin
energy enter. but, they can't be used simultaneously.
6) UART: The ESP8266 NodeMCU has 2 UART domains, namely UART0 and UART1,
which offer different connections (RS232 and RS485), and can speak as much as
four.5 Mbps. UART0 pins (TXD0, RXD0, RST0 & CTS0) may be used for verbal
exchange helps fluid manipulate. But, the UART1 (TXD1 pin) consists of a
statistics switch signal only, so it's far used to print the log.
7) SPI Pins:
ESP8266 incorporates two SPIs (SPI and HSPI) into slave and master modes.
These SPIs also support the following SPI features:
4-time modes for SPI format transfer
Up to 80 MHz with split clocks of 80 MHz
Up to 64-Byte FIFO
pg. 39
8) SDIO Pins:
ESP8266 carries the secure virtual input / Output Interface (SDIO) that is used
to connect directly to SD cards.
4-bit 25 MHz SDIO v1.1 and 4-bit 50 MHz SDIO v2.0 are supported.
9) PWM Pins:
The board has four Pulse Width Modulation (PWM) channels.
PWM output can be programmed and used to pressure virtual engines and
LEDs.
The frequency range of PWM levels from a thousand μs to ten thousand μs,
eg among 100 Hz and 1 kHz.
11) EN Pin(Enable):
The ESP8266 chip is enabled when the EN pin is pulled inner. When pulled LOW
the chip works at low power.
pg. 40
Fig 4.14 Preferences
Click OK, then navigate to the Board manager through going to equipment >
forums > boards manager. There must be a couple new entries further to the usual
entry and choose install. Arduino forums. Filter out your search by means of Click
on ESP8266.
pg. 42
Now, plug your ESP8266 NodeMCU into your laptop through micro-B USB cable.
Once the board is plugged in, it need to be assigned a unique COM port.
On windows machines, this may be something like COM#, and on Mac/Linux
computers it's going to come within the shape of /dev/tty.usbserial-XXXXXX. Select
this serial port underneath the Arduino IDE > tools > Port menu. Also select the
upload velocity: 115200.
Warning:
More attention needs to receive to deciding on board, choosing COM port and
deciding on add velocity. You may get espcomm_upload_mem error while uploading
new sketches, if didn't do so. Once the code is uploaded, LED will start blinking. You
may need to tap the RST button to get your ESP8266 to begin running the sketch.
pg. 43
Fig 4.18 Connection of ESP8266 with Cable
Pin wiring:
Because the OLED display makes use of I2C communication protocol, wiring is quite
simple. You simply want to connect to the Arduino Uno I2C pins as proven within
the desk under.
pg. 44
Fig 4.20 0.96” OLED Pin Description
pg. 45
After installing the SSD1306 library from Adafruit, type “GFX” in the search
box and install the library.
pg. 46
After upload coding and change settings, run the program this will helps to
start OLED display.
The subsequent diagram shows its pinout diagram. It’s far known as a
single channel due to the fact only one relay is used and it operates on 5V.
pg. 47
Fig 4.25 Pinout Diagram of Relay
1) Signal Pin:
It’s far used to govern the relay. This pin can be active low or lively excessive. In case
of active low, the relay will activate whilst we observe an energetic low signal to the
sign pin. On the opposite, inside the case of a lively excessive, the relay will set off
whilst we follow an active high signal to the sign pin. However generally, those
modules work on a lively excessive signal. This sign will energize the relay coil to
make contact with the common terminal with the commonly open terminal.
2) Vcc Pin:
As its name suggests, it is a 5V relay. That means it calls for 5V DC to perform. Hence,
connect the 5v DC power supply to this pin.
3) Ground Pin:
Connect it with the floor terminal of 5V energy supply. Furthermore, in case you are
driving a relay module with a microcontroller, also connect this pin with the ground
terminal of the microcontroller.
pg. 48
4) Common Pin:
This terminal is connected with the load that we want to switch with the relay module.
5) NC Pin:
As the name of the typically close terminal indicates, its miles generally connected
with the COM pin and forms a closed circuit. However this normally closed
connection breaks even as the relay is activated via way of applying
an energetic excessive or active low signal to the signal pin of the relay module from
a microcontroller.
6) NO Pin:
This pin is normally open except we apply an activation signal to the signal pin of the
5V single channel relay module. In this case, the COM pin breaks its connection with
the NC pin and makes a connection with the NO pin.
5V single-Channel Relay Module additives the following discern depicts all the
components of a 5V single channel relay module.
1) 5V Relay:
At the heart of the module is a 5V relay covered in blue colour plastic. Maximum
operating current and voltage for each AC and DC load also are noted on the top
of the relay cover. SRD-05VDC-SL-C is a part variety and
it suggests the running voltage. Its miles referred to as a 5V relay module. Due to
the fact the relay operates at 5V DC.
pg. 49
In different words, a 5V energetic excessive or low signal turns on the relay by
energizing its coil. As noted in advance, internally a 5V relay consists of a NC, NO,
COM terminals and a coil.
2) Output Terminal:
On the left hand of this figure is an output terminal that is used to attach a DC/AC
load and DC/AC input electricity source. We can discuss the wiring diagram to attach
a LOAD and electricity source with this terminal in later sections of this educational.
Each terminal of the output connector is attached and not using a, NC and COM pins
of 5V relay. Every factor of the module has screws which make it clean to attach
cables and wires with the relay module. This 5V relay module supports 10A most
output current and maximum contact voltage of 250V AC and 30V DC. If you are the
usage of a immoderate AC voltage and high modern-day load with this module,
you have to use thick main cables.
3) Status LED:
Status LED is SMD LED that is connected via modern limiting resistor and its miles
available on top right nook of the module. It suggests the status of the relay.
In other phrases, the repute LED activates when the relay is energetic and the coil is
energized thru a sign input pin. The DC contemporary passes through a relay coil.
4) Power LED:
Power LED is likewise a SMD type and it shows the status of electricity source related
with the 5V unmarried channel relay module. Do now not connect greater than 5V
source to Vcc and GND pins of the module. In any other case, higher voltage may
harm the repute and power LEDs.
5) Freewheeling Diode:
A freewheeling diode is connected throughout the coil to avoid the effect of back
EMF. It’s also referred to as a fly back diode. The coil used within the relay is an
inductive type. While the modern passes through an inductive load, it produces a back
EMF voltage. This back EMF might also harm the circuit. Consequently, a
freewheeling diode is used to avoid this effect.
6) Input Connector:
On the right hand side of the relay module is an input connector. It is used to offer
input signal and 5V power supply. Furthermore, it also presents strength to the status
LED, energy LED and relay coil.
pg. 50
7) Switching Transistor:
We generally offer an enter signal to a relay from the overall-reason input-output pins
of microcontrollers inclusive of Arduino, TM4C123, ESP32, etc. but the most cutting-
edge sourcing capability of GPIO pins is commonly much less than 20mA. As an end
result, a switching transistor is used in this relay module to extend modern-day to the
level of the minimum modern requirement of the relay coil. Via using a switching
transistor, we can control the relay from the GPIO pin of a microcontroller.
Note: Some relay modules additionally include an opt isolator as a switching device to
offer optical isolation among low and high voltage circuits. But in case you are using
a standalone relay without a module and also you want to apply multiple relays on your
initiatives. You can use a relay driver IC to drive more than one arrays from GPIO pins
of a microcontroller
4.3 Result
After finish the installation of Blynk application and modelling the prototype we can
begin the mission. Then join the prototype to the computer. After that, add the coding
into the NodeMCU. You can observe the result.
4.4 Conclusion
In this chapter, the implementation, testing and the result of the project had been
explained. The implementation and testing have been carried out in prototype model.
References
Figure
[1] https://docs.blynk.cc/#hardware-set-ups-nodemcu
Fig. (4.1), (4.2), (4.3), (4.4), (4.5), (4.6), (4.7).
[2] https://roboindia.com/tutorials/blynk-introduction-nodemcu/
[3] https://components101.com/development-boards/nodemcu-esp8266-
Fig. (4.19)
[4] https://lastminuteengineers.com/esp8266-nodemcu-arduino-tutorial/
Fig. (4.13), (4.14), (4.15), (4.16), (4.17), (4.18).
[5] https://randomnerdtutorials.com/guide-for-oled-display-with-arduino/
pg. 51
Fig. (4.20), (4.21), (4.22), (4.23).
[6] https://microcontrollerslab.com/5v-single-channel-relay-module-pinout-
working-interfacing-applications-datasheet/
Fig. (4.24), (4.25), (4.26).
Research Paper
[7] https://www.elprocus.com/infrared-ir-sensor-circuit-and-working/
[8] https://www.sphinxsai.com/2018/ch_vol11_no4/2/(101-
106)V11N04CT.pdf
[9] http://arduino.esp8266.com/stable/package_esp8266com_index.json
pg. 52
CHAPTER
5
Future Scopes, Advantages &
Disadvantages
This chapter will in brief explained about the functions, purposed and suggestions that
can be executed to improve the machine.
pg. 53
Use in automated open/close door system.
For automatic room appliances control.
5.3 Advantages
Adds safety through appliance and lighting control.
No need of human intervention.
Can work 24x7 without any problem.
Save time
Save money and increase convenience.
5.4 Disadvantages
The system needs a continuous power supply to be practical or else we might
not be able to control the appliances.
Hence, best way to design the system efficiently would be to implement both the
automated control and manual control through switches at a time.
If there are multiple doors for the same room the project becomes quite complex.
IR sensor cannot detect if lots of people are entering at one time.
5.5 Conclusion
This project has introduced advance generation for class management machine and
safety through IOT to make human life greater smooth and luxuries. The purpose of
this project become to provide an overview of IOT as a technology and showcase its
talents. The undertaking efficiently managed to optimize light automation activity by
imparting the consumer with greater control over its utilization ranges. The results
showed that the IOT technology may be used to deliver improvements to a family
appliance also school room with minimum quantity of hardware. In in addition exams
the accuracy of the results should be advanced with the aid of running all stages
simultaneously.
References:
Text Book
[1]. Piero Zappi, Elisabetta Farella, and Luca Benini. (September, 2010). Fellow,
Tracking Motion Direction and Distance with Pyroelectric IR Sensors, 10(9).
[2]. V. V. Murali Krishna* and T. Anuradha. (May, 2016). An Energy Efficient Power
Usage Controlling and Monitoring using Wireless Sensor Network, 9(17), DOI:
10.17485/ijst/2016/v9i17/93007.
pg. 54
[3]. Daniel Palma, Juan Enrique Agudo *, Héctor Sánchez and Miguel Macías
Macías. (2014). An Internet of Things Example: Classrooms Access Control over
Near Field Communication, 14.
Research Paper
[4] https://www.dnatechindia.com/Bidirectional-VisitorCounter.html
[5]https://www.ijser.org/researchpaper/Congestion-Control-Bidirectional-Digital-
visitor-counter.pdf
[6]https://www.researchgate.net/publication/309429978_ARM_Based_Bidirectional
_Visitor_Counter_and_Automatic_Room_Light_Controller_Using_PIR_Sensors
[7]https://techatronic.com/blynk-home-automation/
pg. 55
Appendix
#define BLYNK_TEMPLATE_ID "*********"
#define BLYNK_DEVICE_NAME "Smart Classroom Monitoring System"
#define BLYNK_AUTH_TOKEN "***********************"
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Blynk.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#define SSD1306_128_64
int inStatus;
int outStatus;
int countin = 0;
int countout = 0;
int in;
int out;
int now;
pg. 56
WidgetLED light(V0);
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
delay(1000); // wait a second
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //initialize with the I2C addr
0x3C (128x64)
delay(2000);
pinMode(inSensor, INPUT);
pinMode(outSensor, INPUT);
pinMode(relay1, OUTPUT);
digitalWrite(relay1, HIGH);
pinMode(relay2, OUTPUT);
digitalWrite(relay2, HIGH);
pg. 57
digitalWrite(relay1,LOW); // Set digital pin 3 LOW
}
}
void loop()
{
Blynk.run(); // Initiates Blynk
inStatus = digitalRead(inSensor);
outStatus = digitalRead(outSensor);
if (inStatus == 0)
{
in = countin++;
}
if (outStatus == 0)
{
out = countout++;
}
now = in - out;
if (now <= 0)
{
digitalWrite(relay1, HIGH);
digitalWrite(relay2, HIGH);
light.off();
display.clearDisplay();
display.setTextSize(2);
pg. 58
display.setTextColor(WHITE);
display.setCursor(0, 15);
display.print("No Visitor");
display.setCursor(5, 40);
display.print("Light Off");
display.display();
Serial.println("No Visitors! Light Off");
delay(500);
}
else if(now <= 5)
{
digitalWrite(relay1, LOW);
digitalWrite(relay2, HIGH);
light.on();
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(15, 0);
display.print("Current Visitor");
display.setTextSize(2);
display.setCursor(50, 15);
display.print(now);
display.setTextSize(1);
display.setCursor(0, 40);
display.print("IN: ");
display.print(in);
display.setTextSize(1);
display.setCursor(70, 40);
display.print("OUT: ");
display.print(out);
display.display();
Serial.print("Current Visitor: ");
Serial.println(now);
Serial.print("IN: ");
Serial.println(in);
Serial.print("OUT: ");
Serial.println(out);
delay(500);
pg. 59
}
else
{
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
light.on();
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(15, 0);
display.print("Current Visitor");
display.setTextSize(2);
display.setCursor(50, 15);
display.print(now);
display.setTextSize(1);
display.setCursor(0, 40);
display.print("IN: ");
display.print(in);
display.setTextSize(1);
display.setCursor(70, 40);
display.print("OUT: ");
display.print(out);
display.display();
Serial.print("Current Visitor: ");
Serial.println(now);
Serial.print("IN: ");
Serial.println(in);
Serial.print("OUT: ");
Serial.println(out);
delay(500);
}
Blynk.virtualWrite(V1, in); // Visitors In
Blynk.virtualWrite(V2, out); // Visitors Out
Blynk.virtualWrite(V3, now); // Current Visitors
delay(1000);
}
pg. 60