Professional Documents
Culture Documents
(EE4191)
BY
ASHOKE SUTRADHAR
2023-2024
DECLARATION BY THE CANDIDATES
ii) I/We have conformed to the norms and guidelines given in the Ethical
Code of Conduct of the Institute.
iii) Whenever I/we have used materials (data, theoretical analysis and
text) from other sources, I/we have given due credit to them by citing
them in the text of the report and giving their details in the
references.
iv) Whenever I/we have quoted written materials from other sources,
I/we have put them under quotation marks and given due credit to
the sources by citing them and giving details in the references.
Date:
Place:
CERTIFICATE
_________________________________
Prof. Ashoke Sutradhar
Professor
Department of Electrical
Engineering
IIEST, Shibpur
_______________________________
Table of Contents
Chapter 1: Introduction............................................................................................................1
Conclusion.............................................................................................................................. 19
References..............................................................................................................................20
Appendix................................................................................................................................ 21
Chapter 1: Introduction
A building automation system (BAS) is a system that controls the heating, ventilation, air
conditioning (HVAC), lighting, and other systems in a building. It can be used to improve
energy efficiency, comfort, and security.
An energy management system (EMS) is a system that monitors, controls, and optimizes the
energy use of a building or other facility. It can be used to improve energy efficiency, reduce
energy costs, and improve the comfort and safety of building occupants. EMS is a subset of
BAS
A BAS typically consists of a network of sensors, controllers, and actuators. The sensors
measure the conditions in the building, such as temperature, humidity, and occupancy. The
controllers use the sensor data to determine how to operate the HVAC, lighting, and other
systems. The actuators then carry out the instructions of the controllers.
BAS can be used to improve energy efficiency in a number of ways. For example, they can be
used to:
Automatically adjust the temperature and humidity in the building to match the
occupancy levels.
Turn off lights in unoccupied areas.
Schedule the operation of HVAC and lighting systems.
Monitor the performance of the building's systems and identify areas where energy
savings can be made.
BAS can also be used to improve comfort and security in a building. For example, they
can be used to:
1|Page
BAS are becoming increasingly common in buildings of all types. They offer a number of
benefits, including improved energy efficiency, comfort, and security.
There are many different types of sensors used in building automation systems (BAS).
The specific sensors used in a BAS will depend on the size and type of building, as well as the
specific needs of the building occupants.
If you are considering installing a BAS, there are a few things you should keep in mind:
The size and complexity of the building will affect the size and complexity of the BAS.
The type of building will also affect the BAS. For example, a hospital will have different
needs than a commercial office building.
It is important to work with a qualified BAS engineer to design and install a system that
meets the specific needs of your building.
2|Page
Chapter 2: Objective and Overview of the Project
Building automation systems (BAS) are integrated computer systems that monitor and
control the building's mechanical and electrical equipment. They are designed to improve
the efficiency, comfort, and safety of buildings.
Components of BAS:
Sensors: Sensors collect data about the building's environment, such as temperature,
humidity, and occupancy.
Actuators: Actuators control the building's equipment, such as heating and cooling systems,
lights, and doors.
Controllers: Controllers are the brains of the BAS. They receive data from the sensors, make
decisions about how to control the equipment, and send commands to the actuators.
Networks: Networks connect all of the BAS components together. They allow the
components to communicate with each other and share data.
Software: Software provides the user interface for the BAS. It allows users to monitor the
building's environment, control the equipment, and troubleshoot problems.
3|Page
In this project we aim to implement an Energy Efficient Building Automation System using
Arduino as the controller.
4|Page
Chapter 3: Implementation of Building Automation
System
3.1: Controller - Arduino
Arduino is an open-source electronics platform based on easy-to-use hardware and
software. Arduino boards are affordable, accessible, flexible and modular, making them well
suited for a wide range of projects, from simple sensor readings to complex robotics.
ATmega328P microcontroller. It has 14 digital input/output pins (of which 6 can be used as
PWM outputs), 6 analog inputs, a 16 MHz ceramic resonator, a USB connection, a power
jack, an ICSP header, and a reset button.
The Arduino Uno has six ADC channels, each capable of converting analog voltages between
0 and 5V into 10-bit digital values ranging from 0 to 1023.
In Arduino, PWM is implemented using analogWrite() function. This function takes two
arguments: the pin number and the desired PWM value. The PWM value ranges from 0 to
255, corresponding to a duty cycle of 0% to 100%.
Working Principle:
Chemical Reaction:
5|Page
The MQ-135 sensor contains a tin dioxide (SnO2) sensing layer, which undergoes a chemical
reaction with the gases it is designed to detect.
When certain gases come into contact with the SnO2 layer, they cause a change in the
conductivity of the sensor.
In the presence of specific gases, the surface of the SnO2 layer adsorbs or absorbs oxygen
(O2) molecules from the surrounding air.
This process reduces the conductivity of the SnO2 layer in the absence of the target gas.
Conductivity Change:
The conductivity of the SnO2 layer changes depending on the concentration of the target
gas in the environment.
When the sensor is exposed to the target gas, the conductivity increases due to the
chemical reaction between the gas and the SnO2 layer.
Resistance Measurement:
The resistance of the SnO2 layer is measured, and this resistance is inversely proportional to
the gas concentration.
Higher gas concentrations result in lower sensor resistance, and vice versa.
Output Signal:
The change in resistance is converted into an electrical signal that can be processed and
used to determine the concentration of the target gas.
This output signal can be calibrated to provide a quantitative measurement of the gas
concentration.
6|Page
Figure 1 MQ135 SENSOR MODULE
7|Page
3.2.2: GP2Y1010AU0F DUST SMOKE PARTICLE SENSOR
GP2Y1010AU0F is a dust sensor that works by using optical sensing system. An infrared
emitting diode (IRED) and a photo-transistor are diagonally arranged into this device. It
detects the reflected light of dust in air. Especially, it is effective to detect very fine particle
like the cigarette smoke. In addition, it can distinguish smoke from house dust by pulse
pattern of the output voltage obtained.
Working Principle:
The sensor contains an infrared LED and a phototransistor positioned in such a way that the
emitted infrared light from the LED passes through the air and is scattered by particles in the
air. The scattered light is then detected by the phototransistor.
Amplification Circuit:
Output Signal:
The amplified signal is then converted into a voltage signal, which is the output of the
sensor. The voltage level is directly related to the concentration of particles in the air—the
higher the concentration, the higher the output voltage.
Calibration:
The sensor may need calibration to correlate the output voltage with a specific particle
concentration. Calibration is typically done by exposing the sensor to a known concentration
of particles and adjusting the sensor output accordingly.
8|Page
Signal Processing:
In some applications, additional signal processing may be performed to filter out noise and
improve the accuracy of particle concentration measurements.
Output Interface:
The sensor often has an analog voltage output that can be connected to a microcontroller or
other measurement devices for further processing.
9|Page
3.2.3: DHT11 Temperature and Humidity Sensor
The DHT11 sensor measures humidity and temperature using a capacitive humidity sensor
and a thermistor, respectively. It communicates with a microcontroller using a single digital
data pin, sending a series of 40 bits of data consisting of humidity, temperature, and a
checksum. It is a low-cost, easy-to-use sensor with moderate accuracy, making it suitable for
various applications like home automation, weather monitoring, and environmental
monitoring.
The DHT11 sensor is a low-cost, digital temperature and humidity sensor .It is used to
measure the humidity and temperature of a room. Commonly used in various applications,
including home automation, weather monitoring, and environmental monitoring. It utilizes
two primary sensing elements: a capacitive humidity sensor and a thermistor.
Working Principle:
Humidity Measurement:
Temperature Measurement:
Data Communication:
The DHT11 sensor communicates with a microcontroller or data logger using a single digital
data pin. The sensor initiates the data transfer process by pulling the data pin low for a brief
period. Upon receiving the request, the microcontroller sends a high signal to acknowledge
10 | P a g e
the sensor. The sensor then responds by sending a series of 40 bits of data, consisting of an
integral humidity value, an integral temperature value, and a checksum byte for error
detection.
• Low cost
• Digital output
• Easy to use
• Wide operating range (0-50°C, 20-80% RH)
• Moderate accuracy (+/-2°C for temperature, +/-5% RH for humidity)
The DHT11 sensor can be easily interfaced with an Arduino microcontroller to measure
temperature and humidity. Here's a step-by-step guide:
11 | P a g e
Figure 5 DHT11 Sensor Module And Sensing element
12 | P a g e
3.2.4: BH1750FVI LIGHT INTENSITY SENSOR
The BH1750FVI is a digital light sensor commonly used in Arduino projects to measure
ambient light intensity. It utilizes a photodiode to convert incident light into an analog
signal, which is then processed by an integrated circuit to produce a digital output. The
sensor communicates with the Arduino using the I2C protocol, allowing for easy data
transfer and integration into various applications.
Working Principle:
2. Signal Processing: The analog current is converted into a digital signal by the ADC.
3. Lux Calculation: The IC processes the digital signal and converts it into a lux value, a
standardized unit of light intensity.
4. I2C Communication: The sensor communicates with the Arduino using the I2C
protocol, sending the lux value to the microcontroller for further processing.
13 | P a g e
Interfacing with Arduino:
1. Hardware Connections: Connect the sensor's VCC pin to Arduino's 5V pin, the GND
pin to Arduino's GND pin, and the SDA pin to Arduino's SDA pin (usually pin A4) and SCL pin
to Arduino's SCL pin (usually pin A5).
2. Library Installation: Install the BH1750 library from the Arduino IDE library manager
or download and install it manually.
3. Arduino Code: Write the Arduino code to initialize the sensor, read lux values, and
perform any desired actions based.
14 | P a g e
Chapter 4: Control Logic and Operation
15 | P a g e
Diagram 3 logic for DHT11 Diagram 4 logic for BHV1750
16 | P a g e
Conclusion
In conclusion, the successful identification of key hardware components such as controllers
and sensors, coupled with the development of a well-crafted codebase, marks a significant
milestone in the advancement of our building automation project. This comprehensive
groundwork lays the foundation for a seamless integration of automation technologies to
enhance building functionality.
The convergence of hardware and IoT reflects a holistic approach to modern building
management, where the amalgamation of cutting-edge technologies facilitates intelligent
decision-making and adaptive responses to environmental changes. Moving forward, the
project promises not only streamlined automation but also a glimpse into the future of
smart infrastructure, where interconnected devices collaborate harmoniously for the
betterment of occupants and the environment.
17 | P a g e
References
Fig-1: https://www.elprocus.com/mq135-air-quality-sensor/
Fig-2: https://projecthub.arduino.cc/m_karim02/arduino-and-mq-135-gas-sensor-with-
arduino-code-0385af
Fig-3: https://circuitdigest.com/microcontroller-projects/interfacing-dust-sensor-with-
arduino
Fig-4: https://circuitdigest.com/microcontroller-projects/interfacing-dust-sensor-with-
arduino
Fig-5: https://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-an-
arduino/
Fig-6: https://www.circuitbasics.com/how-to-set-up-the-dht11-humidity-sensor-on-an-
arduino/
Fig-7: https://circuitdigest.com/microcontroller-projects/how-to-use-bh1750-ambient-light-
sensor-with-arduino
Fig-8: https://miliohm.com/bh1750-light-sensor-tutorial-diy-lux-meter-with-arduino-
esp8266/
Other references;
Diagrams: https://www.lucidchart.com/pages/examples/flowchart-maker
https://forum.arduino.cc/
https://circuitglobe.com/
https://www.teachmemicro.com/mq-135-air-quality-sensor-tutorial/
18 | P a g e
Appendix
19 | P a g e
Serial.begin(9600);
}
void loop(){
digitalWrite(ledPower,LOW);
delayMicroseconds(280);
voMeasured = analogRead(measurePin);
calcVoltage = voMeasured*(5.0/1024);
dustDensity = 0.17*calcVoltage-0.1;
if ( dustDensity < 0)
{
dustDensity = 0.00;
}
#include "dht.h"
#define dht_apin A0 ;// Analog Pin sensor is connected to
dht DHT;
double tset;
int relay = 8; //relay connected to pin 8
void setup(){
Serial.begin(9600);
delay(500);//Delay to let system boot
Serial.println("DHT11 Humidity & temperature Sensor\n\n");
delay(1000);//Wait before accessing Sensor
}
void loop(){
double temp=DHT.temperature;
DHT.read11(dht_apin);
Serial.print("Current humidity = ");
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
20 | P a g e
}
else
{ digitalWrite(relay,LOW); //Turn off relay
Serial.println("TEMPERATURE Level Good");
}
delay (500);
}
BH1750 Arduino Code
#include <BH1750FVI.h>
BH1750FVI LightSensor;
void setup()
{
Serial.begin(9600);
LightSensor.begin();
pinMode(8,OUTPUT);
}
void loop()
{ int k=512;
int s;
float lux = LightSensor.GetLightIntensity();
Serial.print("Light intensity: ");
Serial.print(lux);
Serial.print(" lux");
While(lux!=k)
{ if(k<lux)
{ s++;
}
else
{ s=s-1;
}
}
Serial.println();
Overall code
#include <MQ135.h>
#include <LiquidCrystal.h>
#include <BH1750FVI.h>
#include "dht.h"
21 | P a g e
int measurePin = A5;
int ledPower = 7;
float thresholdDust = 0.34;
dht DHT;
double tset;
BH1750FVI LightSensor;
void setup() {
pinMode(relay, OUTPUT);
Serial.begin(9600);
LightSensor.begin();
}
void loop() {
readMQ135();
readDustSensor();
readDHT11();
readBH1750();
delay(500);
}
void readMQ135() {
int ppm = analogRead(aqsensor);
Serial.print("Air Quality: ");
Serial.println(ppm);
if (ppm > thresholdMQ135) {
Serial.println("AQ Level HIGH");
digitalWrite(relay, HIGH);
} else {
digitalWrite(relay, LOW);
Serial.println("AQ Level Good");
}
}
void readDustSensor() {
byte data[2];
Wire.beginTransmission(GP2Y1010AU_ADDRESS);
Wire.write(0x00);
Wire.endTransmission();
Wire.requestFrom(GP2Y1010AU_ADDRESS, 2, true);
while (Wire.available() < 2) {}
Wire.readBytes(data, 2);
int distance = data[0] << 8 | data[1];
Serial.print("Distance: ");
Serial.print(distance);
Serial.println(" cm");
22 | P a g e
digitalWrite(ledPower, LOW);
delayMicroseconds(280);
float voMeasured = analogRead(measurePin);
float calcVoltage = voMeasured * (5.0 / 1024);
float dustDensity = 0.17 * calcVoltage - 0.1;
if (dustDensity < 0) {
dustDensity = 0.00;
}
Serial.println("Dust Density:");
Serial.println(dustDensity);
if (dustDensity > thresholdDust) {
Serial.println("AQ Level HIGH");
digitalWrite(relay, HIGH);
} else {
digitalWrite(relay, LOW);
Serial.println("AQ Level Good");
}
}
void readDHT11() {
double temp = DHT.temperature;
DHT.read11(dht_apin);
Serial.print("Current humidity = ");
Serial.print(DHT.humidity);
Serial.print("% ");
Serial.print("temperature = ");
Serial.print(DHT.temperature);
Serial.println("C ");
void readBH1750() {
int k = 512;
float lux = LightSensor.GetLightIntensity();
Serial.print("Light intensity: ");
Serial.print(lux);
Serial.print(" lux");
while (lux != k) {
if (k < lux) {
// Do something if lux is higher than the threshold
} else {
// Do something if lux is lower than the threshold
}
23 | P a g e
}
Serial.println();
}
24 | P a g e