You are on page 1of 47

AUTOMATIC ADJUSTABLE CURTAIN CONTROL

SYSTEM
Submitted in partial fulfilment
of the requirements for the award of the degree of

BACHELOR OF
TECHNOLOGY
In
Department of Electronics and Communication Engineering
By
G.SAI LOKESH 18C91A0435

G.UJWALA DEEPTHI 18C91A0438

S.TUSHAR REDDY 18C91A0490

Under the Esteemed guidance of

MRS .Y. B. T. SUNDARI


Assistant Professor

HOLYMARY INSTITUTE OF TECHNOLOGY AND SCIENCE


(Approved by AICTE, Permanently Affiliated to JNTUH, Accredited By NAAC “A”)
BOGARAM (V), KEESARA (M), MEDCHAL - 501
301 2018-2022
HOLY MARY INSTITUTE OF TECHNOLOGY
& SCIENCE
(College of Engineering)
Approved by AICTE, New Delhi and Affiliated to JNTU, Hyderabad, Telangana
Accredited by NAAC

Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the mini project titled “ AUTOMATIC ADJUSTABLE

CURTAIN CONTROL SYSTEM ” is being submitted by following students in IV B.

Tech-I semester in ELECTRONICS AND COMMUNICATION ENGINEERING is a

record of Bonafide work done under my guidance & supervision.

The results embodied in the dissertation have not been submitted to any other

University or Institute to the best of my knowledge for the award of any degree

G.SAI LOKESH 18C91A0435

G.UJWALA DEEPTHI 18C91A0438

S.TUSHAR REDDY 18C91A0490

Under the guidance of

Internal Guide Project Co-ordinator (s)

MRS.Y.B.T.SUNDARI DR.P.SUMITHA BHASHINI


MR.Y.DAVID SOLOMON RAJU

Address: Bogaram (V), Keesara (M), Medchal (D), Telangana, INDIA. PIN 501 301
Website: www.hits.ac.in
HOLY MARY INSTITUTE OF TECHNOLOGY
& SCIENCE
(College of Engineering)
Approved by AICTE, New Delhi and Affiliated to JNTU, Hyderabad, Telangana
Accredited by NAAC

Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that the mini project titled “ AUTOMATIC ADJUSTABLE CURTAIN
CONTOL SYSTEM ” is being submitted by following students in Electronics and
Communication Engineering is a record of Bonafide work done under my guidance
&supervision.

The results embodied in the dissertation have not been submitted to any other University
or Institute to the best of my knowledge for the award of any degree

G. SAI LOKESH 18C91A0435


G. UJWALA DEEPTHI 18C91A0438
S.TUSHAR REDDY 18C91A0490

Under my supervision

Head of the Department

Address: Bogaram (V), Keesara (M), Medchal (D), Telangana, INDIA. PIN 501 301
Website: www.hits.ac.in
ACKNOWLEDGEMENT

The satisfaction and euphoria that accompany the successful completion of any task
would be incomplete without the mention of the people who made it possible, who’s constant
guidance and encouragement crowns all effort with success.

We take this opportunity to express my profound gratitude and deep regards to our
Guide MRS.Y.B.T.SUNDARI, Assistant Professor, Dept. of Electronics and
Communication Engineering, Holy Mary Institute of Technology & Science for her
exemplary guidance, monitoring and constant encouragement throughout the work.
We would present my deep sense of gratitude to the Industry Oriented Mini Project
Coordinators Dr.P.SUMITHA BHASHINI, Professor & Mr.Y.DAVID SOLOMON
RAJU, Associate Professor, Dept. of Electronics & Communication Engineering, Holy Mary
Institute of Technology & Science for their valuable suggestions and support for the
completion of this work.

Our special thanks to Dr .P. RAJA PRAKASHA RAO, Head of the Department,
Dept. of Electronics & Communication Engineering, Holy Mary Institute of Technology
(College of Engineering) who has given an immense support throughout the course.

We also thank to Dr. P. BHASKARA REDDY, the honourable Director of our


college Holy Mary Institute of Technology & Science for providing me the opportunity to
carry out this work.

At the outset, we express my deep sense of gratitude to the beloved Mr. A


SIDDHARTHA REDDY, Chairman, Dr. A. VARA PRASAD REDDY, Founder
Chairman & Dr. A. VIJAYA SARADA REDDY, Founder Secretary of Holy Mary
group of Institutions, for giving the opportunity to complete my course of work

We are obliged to Teaching and non-teaching staff members, of Holy Mary


Institute of Technology & Science for the valuable information provided by them in their
respective fields. I am grateful for their cooperation during the period of my assignment.

Last but not the least I thank ALMIGHTY along with My Parents, and Friends for
their constant encouragement without which this assignment would not be possible.

G.SAI LOKESH

G.UJWALA DEEPTHI

S.TUSHAR REDDY
DECLARATION

This is to certify that the work reported in the present Industrial Oriented mini
project titled “AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM”
is a record of work done by me in the department of Electronics and Communication
Engineering, Holy Mary Institute of Technology & Science

No part of the thesis is copied from books/journals/internet and whenever the


portion is taken, the same has been duly referred in the text; the reported are based on
the project work done entirely by me not copied from any othersource.

G. SAI LOKESH

G. UJWALA DEEPTHI

S.TUSHAR REDDY
ABSTRACT

With the development of smart home industry, smart curtain is going to come into the
life of people. An intelligent control system of curtain was developed in the paper based on
Arduino. Throughout detecting and analyzing the factors that include the sunlight
illumination, time, temperature, humidity and outdoor environmental conditions, the
microcontroller automatically controlss the opening and closing of curtains. By experiments,
it is proved that the intelligent control system of curtain has the high practicability and good
manipulative.
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

TABLE OF CONTENTS

TITLE PAGE NO
ACKNOWLEDGEMENT
ABSTRACT
LIST OF ACRONYMS
LIST OF FIGURES

CHAPTER-1
1. INTRODUCTION 1-2
1.1 Introduction 1
1.2 Project overview 2

CHAPTER-2
2. EMBEDDED SYSTEM 3-6
2.1 What is embedded system? 3
2.2 Types of embedded systems 4
2.3 Advantages of embedded systems 6

CHAPTER-3
3. HARDWARE DESCRIPTION 7-13
3.1 Arduino UNO 7
3.2 LDR Sensor 8
3.3 MQ135 Sensor 9
3.4 DHT11 Sensor 10
3.5 RTC Module 11
3.6 Stepper Motor 12
3.7 Jumper Wires 13

2HITS (COE )- ECE


2017-2021
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-4
4. WORKING OF HARDWARE COMPONENTS 14-19
4.1 Working of Arduino UNO 14
4.2 Working of LDR Sensor 15
4.3 Working of MQ135 Sensor 16
4.4 Working of DHT11 Sensor 17
4.5 Working of RTC Module 17
4.6 Working of Stepper Motor 19

CHAPTER-5
5. SPECIFICATION OF HARDWARE COMPONENTS 20-22
5.1 Specifications of Arduino UNO 20
5.2 Specifications of LDR Sensor 20
5.3 Specifications of MQ135 Sensor 21
5.4 Specifications of DHT11 Sensor 21
5.5 Specifications of RTC Module 21
5.6 Specifications of Stepper Motor 22

CHAPTER-6
6. SOFTWARE IMPLEMENTATION 23-27
6.1 What software means? 23
6.2 What is software IDE? 24
6.3 Arduino IDE 25
6.4 Installation & Libraries 26

CHAPTER-7
7. SOFTWARE DESCRIPTION 28-31
7.1 Software program 28
7.2 Compilation 31

2HITS (COE )- ECE


2017-2021
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-8
8. DESIGN AND IMPLEMENTATION 32
8.1 Block Diaram 32
8.2 Project Implementation 32

CHAPTER-9

9.RESULTS 33

CHAPTER-10

10. ADVANTAGES 34

CHAPTER-11
11.1 FUTURE SCOPE 35
11.2 CONCLUSION 35

CHAPTER-12
12. REFERENCES 36

BIO -DATA

2HITS (COE )- ECE


2017-2021
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

LIST OF ACRONYMS & ABBREVIATIONS


  
LDR   – Light Dependent Resistor
IDE     – Integrated Development Environment
PCB    – Printed Circuit Board
CPU    – Central Processing Unit
RTC    – Real Tiime Clock
DHT    – Digital Humidity and Temperature
RAM  – Random -Access Memory
LAN   – Local Area Network
USB   – Universal Serial Bus
GUI   – Graphical User Interface
GNU – GNU’s Not Unix
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

LIST OF FIGURES
Figure No. Name Page No.

Figure 3.1 Arduino Uno 7


Figure 3.2 LDR Sensor 8
Figure 3.3 MQ135 Sensor 9
Figure 3.4 DHT 11 Sensor 10
Figure 3.5 RTC Module 11
Figure 3.6 Stepper Motor 12
Figure 3.7 Jumper Wires 13
Figure 4.1 Working of LDR 16
Figure 4.2 Working of MQ135 16
Figure 4.3 Working of RTC 17
Figure 4.4 Working of Stepper Motor 19
Figure 6.1 Software Implementation 24
Figure 6.2 IDE Software 25
Figure 6.3 Open Source IDE Software 26
Figure 8.1 Block Diagram 32
Figure 8.2 Project Implementation 32
Figure 9.1 Result 1 33
Figure 9.2 Result 2 33

5
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-1
1.1 INTRODUCTION

Smart Home was one of the hottest topics in the modern society. The development of the internet
of things and embedded technology provide the basis for rising of the smart home. Human life
cannot be separated from the interaction with other humans and the environment. The
environment can not necessarily tell what it feels to humans directly. Therefore a tool is needed.
One of the tools that can be used to interact is automation.With the transformation of the
consumption concept and development of the industry, the smart home market is rapidly gaining
momentum . More and more companies and organizations are devoted to the research and
development of the smart home. Taking a panoramic view of intelligent home solutions, we must
complete the intellectualization of typical products to achieve the whole solution of the intelligent
home. Curtains have an irreplaceable role in our daily life, taking intellectualization of curtains as a
breakthrough of the whole intelligent is a good choice. This paper introduced the design of an
intelligent control system of curtain and the reasonable solution for existing problems in the
control system of curtain. These problems are mainly reflected in the single function, the rigid
control method limited to the infrared remote control, and the meager controllability. In this
paper, an intelligent control system of curtain was designed. Based on the controller of Arduino,
the practicality of the curtains was increased by adding features such as the infrared remote
control, timing control. Aiming to improve the autonomous of curtain control system, the
detection module of the sunlight illumination,temperature,humidity and control algorithm based
on fuzzy control theory was developed.

1
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

1.2 PROJECT OVERVIEW

Human life cannot be separated from the interaction with other humans and the environment. An
interacting human with the environment residence, room, campus, highway, and others. The
environment can not necessarily tell what it feels to humans directly. Therefore a tool is needed.
One of the tools that can be used to interact is automation. Arduino is made with the aim to
facilitate the experiment of various equipment based on a microcontroller. So with the function of
this technology we designed the automation tool. Humans who have been doing the job simply
put in a window curtain that almost every day is done. The function of the curtain is to reduce the
intensity of light into the house, and in the afternoon we close the curtain again or when the
condition of cloudy or rain fall, it requires energy that cannot be underestimated how humans do
work efficiently, effectively, comfortably and safely while doing a job. So we designed a project
named Automatic Adjustable Curtain Monitoring System which is automated based on LDR,
MQ135, DHT11 sensors and Real Time Clock module to detect temperature conditions (humidity,
sunrise, sunsets, etc) and detection of gases to open and close the curtains. The Arduino takes the
inputs from LDR, MQ135, RTC and DHT11 with different conditions and then correspondingly
controls the stepper motor through the motor driver. The stepper motor is attached to the belt of
the curtain for opening and closing during the rotation of motor.

2
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-2
2.EMBEDDED SYSTEM

2.1 What is Embedded System?


An embedded system is a computer system-a combination of a computer
processor, computer memory, and input/output peripheral devices-that has a dedicated
function within a larger mechanical or electrical system. It is embedded as part of a complete
device often including electrical or electronic hardware and mechanical parts. Because an
embedded system typically controls physical operations of the machine that it is embedded
within, it often has real-time computing constraints. Embedded systems control many devices
in common use today.]In 2009 it was estimated that ninety-eight percent of all
microprocessors manufactured were used in embedded systems.

Modern embedded systems are often based on microcontroller (i.e., microprocessors


with integrated memory and peripheral interfaces), but ordinary microprocessors (using
external chips for memory and peripheral interface circuits) are also common, especially in
more complex systems. In either case, the processor(s) used may be types ranging from
general purpose to those specialized in a certain class of computations, or even custom
designed for the application at hand. A common standard class of dedicated processors is
the digital signal processing (DSP).

Since the embedded system is dedicated to specific tasks, design engineers can


optimize it to reduce the size and cost of the product and increase the reliability and
performance. Some embedded systems are mass-produced, benefiting from economies of
scale.

Embedded systems range from portable devices such as digital watches and MP3


players, to large stationary installations like traffic light controllers, programmable logic
controllers, and large complex systems like hybrid vehicles, medical imaging systems,
and avionics. Complexity varies from low, with a single microcontroller chip, to very high
with multiple units, peripherals and networks mounted inside a large equipment rack.

3
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

2.2 Types of Embedded Systems

There are four types of embedded systems:

1.Stand-Alone Embedded System

2.Real-Time Embedded System

3.Network Embedded System

4.Mobile Embedded System

1. Stand-Alone Embedded Systems

This type of embedded systems, as the name suggests, does not require a host system
like a computer or a processor as it works by itself and displays data on the connected device
or make necessary changes on the device. Input data is taken from the ports as analog or
digital signals and processing are done in the port itself. The result after proper calculation
and conversion is displayed through a connected device. This result may either control or
drive or display the device depending on the data. These systems offer flexibility and
efficiency even though they work alone. Various examples are washing machines, mobile
phones, or any systems that work alone without the help of a computer.

2. Real-Time Embedded Systems


When an output is required at a particular time, real-time embedded systems can be
used. when a task has to be completed on time or when there is a deadline for a project, this
system comes as a savior on time. An external environment is controlled with the help of
computer systems and connected through sensors or any other output/input interfaces. We
can schedule the output either through a static or dynamic manner. There are two types under
this category. They are soft and hard real-time embedded systems.

 Soft Embedded Systems: These systems consider processes as the main task and
manage the task completely. Deadlines are not considered as a priority and even if the
deadlines are missed, missing the processes should not happen in this system. In a
computer system, the sound system is an example of a soft system. But it should be
noted that deadlines should not be missed always as it results in degradation of the
system.

4
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

 Hard Embedded Systems: These systems consider timelines as the deadline and it


should not be missed in any case. Also, even if there are any delays, they should also
be time-bound in the system. There is no permanent memory and hence the processes
should be done properly for the first time itself. The best example of a hard embedded
system is an aircraft control system. The timeline should not be missed as well as the
processes.

3. Network Embedded Systems

When a program is running inside another device, a network is formed. This is called
network embedded systems where the running program is controlled by a microprocessor or a
controller. A network is related in this system and they can be either LAN or WAN. It is not
necessary that the connection should be wired or wireless. Due to the flexibility and
connection, this category can be considered as the fastest growing in the embedded systems.
Also, there is a web server where the connection is based upon the web browser. All the
network is controlled and accessed with the help of a web browser. Security systems in any
office or tech park is an example of network embedded systems where all the connections are
made through a common network and it is controlled under one umbrella.

4. Mobile Embedded Systems


All the devices that are portable and working with an embedded system is a
mobileembedded system. Though there is a limitation of memory and functionality, its
portability and handy systems are useful for all the people. The best example that we can
connect easily is mobile phones, laptops, and calculators.

Based on the performance of microcontroller:

 Small Scale Embedded Systems: 8 bit or 16-bit microcontrollers are used to design
these and work with the help of batter in the system. Several programming tools are
used to develop small scale embedded systems. The hardware is very small and the
processor is slow. The memory is also less. The codes for developing these
embedded systems can be written with the help of any IDE.
 Medium Scale Embedded Systems: 16 bit or 32-bit microcontrollers are used to

5
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

develop medium systems. Also, these can be developed with DSPs or RISCs.
Hardware and software functionalities are complex and several coding languages can
be used as programming tools. As small-scale systems, an IDE is required for medium
scale systems also. We can use medium-scale systems in high-end applications with
large memory and processing data.
 Sophisticated Embedded Systems: The most complex embedded system with all the
difficult complexities of hardware and software that makes the system useful for all is
called sophisticated embedded systems. These systems require registers of huge
memory, scalable processors, and IPs so that the system can work well in any
environment.  They are used in systems with graphical screens, touchpads, and
cutting-edge options where software and hardware are equally needed for the
performance.

2.3 Advantages of Embedded System

The advantages of Embedded Systems are:

 They are convenient for mass production. This results in low price per piece.
 These systems are highly stable and reliable.
 Embedded systems are made for specific tasks.
 The embedded systems are very small in size, hence can be carried and loaded
anywhere.
 These systems are fast. They also use less power.
 The embedded systems optimize the use or resources available.
 They improve the product quality.

6
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-3
3.HARDWARE DESCRIPTION
3.1 Arduino UNO

Arduino Uno is a microcontroller board based on the ATmega328P (Datasheet). It has


14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analogy inputs, a 16
MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP
header and a reset button. It contains everything needed to support the microcontroller;
simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or
battery to get started. You can tinker with your Uno without worrying too much about doing
something wrong, worst case scenario you can replace the chip for a few dollars and start
over again.
 "Uno" means one in Italian and was chosen to mark the release of Arduino Software (IDE)
1.0. The Uno board and version 1.0 of Arduino Software (IDE) were the reference versions of
Arduino, now evolved to newer releases. The Uno board is the first in a series of USB
Arduino boards, and the reference model for the Arduino platform; for an extensive list of
current, past or outdated boards see the Arduino index of boards.

Figure 3.1 Arduino UNO

7
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

3.2 LDR SENSOR

LDR sensor module is a low-cost digital sensor as well as analog sensor module,

which is capable to measure and detect light intensity. This sensor also is known as the Photo

Resistor Sensor. This sensor has an onboard LDR (Light Dependent Resistor), that helps it to

detect light. This sensor module comes with 4 terminals. Where the “DO” pin is a digital

output pin and the “AO” pin is an analog output pin. The output of the module goes high in

the absence of light and it becomes low in the presence of light. The sensitivity of the sensor

can be adjusted using the onboard potentiometer .

Figure 3.2 LDR Sensor

8
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

3.3 MQ135 SENSOR

The MQ-135 Gas Sensor can detect gases like Ammonia (NH3), sulfur (S), Benzene (C6H6),

CO2, and other harmful gases and smoke. Similar to other MQ series gas sensor, this sensor

also has a digital and analog output pin. When the level of these gases go beyond a threshold

limit in the air the digital pin goes high. This threshold value can be set by using the on-board

potentiometer. The analog output pin, outputs an analog voltage which can be used to

approximate the level of these gases in the atmosphere.The MQ135 air quality sensor module

operates at 5V and consumes around 150mA. It requires some pre-heating before it could

actually give accurate results.

Figure 3.3 MQ135 Sensor

9
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

3.4 DHT 11

DHT11 Digital Temperature & Humidity Sensor is a temperature-humidity compound

sensor with calibrated digital signal output. The sensor includes a resistive humidity-

sensing component and a NTC temperature-sensing component. Each DHT11 sensor is

calibrated in an extremely accurate humidity-calibration chamber.

The calibration coefficients are stored in the OTP memory in the form of programs, and

these calibration coefficients are called during the internal signal detection process of the

sensor, so that there is no need to recalibrate them.

The single-wire serial interface provides easy and fast system integration. Its smart size,

low power-consumption and signal transmission distance up to 20 meters makes it an ideal

option in various applications.

Figure 3.4 DHT11

10
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

3.5 RTC MODULE

RTC Module, for Arduino, contains a DS3231 real-time clock IC with a backup

battery. It's one of the easiest to use RTCs out there, with Arduino and other libraries or

simply use I2C commands to set and retreive the time and date. Includes a lithium coin

cell battery which should be good for four years at least and is very easy to use.

Along with the DS3231 real time clock, the module also has an Atmel 24C32 EEPROM

chip which is handy for storing data without worrying about power loss. There is also space

on the board to solder your own DS18B20 temperature sensor.

Figure 3.5 RTC Module

11
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

3.6 STEPPER MOTOR

Stepper motor, also known as step motor or stepping motor, is a brushless DC electric

motor that divides a full rotation into a number of equal steps. The motor's position can be

commanded to move and hold at one of these steps without any position sensor for feedback

(an open-loop controller), as long as the motor is correctly sized to the application in respect

to torque and speed. Unlike a brushless DC motor, which rotates continuously when a fixed

DC voltage is applied to it, a step motor rotates in discrete step angles.

The Stepper Motors therefore are manufactured with steps per revolution of 12, 24, 72, 144,

180, and 200, resulting in stepping angles of 30, 15, 5, 2.5, 2, and 1.8 degrees per step. The

stepper motor can be controlled with or without feedback.

Figure 3.6 Stepper Motor

12
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

3.7 JUMPER WIRES

A  Jumper wire (also known as jumper, jump wire, jumper cable or cable) is

an electrical wire, or group of them in a cable, with a connector or pin at each end (or

sometimes without them – simply "tinned"), which is normally used to interconnect the

components of a breadboard or other prototype or test circuit, internally or with other

equipment or components, without soldering. Male ends have a pin protruding and can plug

into things, while female ends do not and are used to plug things into. Male-to-male jumper

wires are the most common and what you likely will use most often. When connecting two

ports on a breadboard, a male-to-male wire is what you'll need.

Figure 3.7 Jumper Wires

13
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-4

WORKING OF HARDWARE COMPONENTS

4.1 Working of Arduino UNO

The Arduino Uno is an open-source Micro controller based on the microchip


ATmega328p microcontroller and developed by Arduino.cc. The board is equipped with sets
of digital and analogy input/output (I/O) pins that may be interfaced to various
expansionboard (shields) and other circuits. The board has 14 digital I/O pins (six capable
of PWM output), 6 analogy I/O pins, and is programmable with the Arduino IDE (Integrated
Development Environment), via a type B USB cable It can be powered by the USB cable or
byan external 9-volts battery, though it accepts voltages between 7 and 20 volts. It is similar
to the Arduino and Leonardo. The hardware reference design is distributed under a creative
commons Attribution Share-Alike 2.5 license and is available on the Arduino website. Layout
and production files for some versions of the hardware are also available.
The word "uno" means "one" in Italian and was chosen to mark the initial release of Arduino
Software. The Uno board `is the first in a series of USB-based Arduino boards; it and
version 1.0 of the Arduino IDE were the reference versions of Arduino, which have now
evolved to newer releases. The ATmega328 on the board comes pre-programmed with
a bootloader that allows uploading new code to it without the use of an external hardware
programmer.
While the Uno communicates using the original STK500 protocol, it differs from all
preceding boards in that it does not use the FTDI USB-to-serial driver chip. Instead, it uses
the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter.

General Pin Functions

LED: There is a built-in LED driven by digital pin 13. When the pin is high value, the LED
is on, when the pin is low, it is off.
VIN: The input voltage to the Arduino/Genuine board when it is using an external power
source (as opposed to 5 volts from the USB connection or other regulated power source). You
can supply voltage through this pin, or, if supplying voltage via the power jack, access it

14
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

through this pin.


5V: This pin outputs a regulated 5V from the regulator on the board. The board can be
supplied with power either from the DC power jack (7 - 20V), the USB connector (5V), or
the VIN pin of the board (7-20V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage the board.
3.3 V: A 3.3-volt supply generated by the on-board regulator. Maximum current draw is
50mA.
GND: Ground pins.
I/OREF: This pin on the Arduino/Genuine board provides the voltage reference with which
the microcontroller operates. A properly configured shield can read the IOREF pin voltage
and select the appropriate power source, or enable voltage translators on the outputs to work
with the 5V or 3.3V.
RESET: Typically used to add a reset button to shields that block the one on the board.

4.2 Working of LDR

First of all, we need to connect the LDR sensor module to a 5v power supply. Then
set the threshold voltage at the Non-Inverting input of the IC according to the present light
intensity by rotating the preset knob for setting the sensor sensitivity.

When light intensity increase on the surface of the LDR then the resistance of the LDR
decreases. Then the maximum amount of voltage will be allocated across the resistor(R3). So,
a Low amount of voltage from the LDR is given to the Inverting input of the IC. Then the
Comparator IC compares this voltage with the threshold voltage. In this condition, this input
voltage is less than the threshold voltage, so the sensor output goes LOW (0).

In contrast, When light intensity decrease (low/dark) on the surface of the LDR then the
resistance of the LDR increases. Then the maximum amount of voltage will be allocated
across the LDR (R2). So, a High amount of voltage from the LDR is given to the Inverting
input of the IC. Then the Comparator IC compares this voltage with the threshold voltage. In
this condition, this input voltage is greater than the threshold voltage, so the sensor output
goes HIGH (1).

15
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

Figure 4.1: Working of LDR

4.3 Working of MQ135 Sensor

The MQ-135 alcohol sensor consists of a tin dioxide (SnO2), a perspective layer
inside aluminum oxide microtubes (measuring electrodes), and a heating element inside a
tubular casing. The end face of the sensor is enclosed by a stainless steel net and the backside
holds the connection terminals. Ethyl alcohol present in the breath is oxidized into acetic acid
passing through the heating element. With the ethyl alcohol cascade on the tin dioxide
sensing layer, the resistance decreases. By using the external load resistance the resistance
variation is converted into a suitable voltage variation. The circuit diagram and the
connection arrangement of an MQ 135 alcohol are shown below.

Figure 4.2: Working of MQ135

16
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

4.4 Working of DHT 11 Sensor

DHT11 sensor consists of a capacitive humidity sensing element and a thermistor


for sensing temperature.  The humidity sensing capacitor  has two electrodes with a
moisture holding substrate as a dielectric between them. Change in the capacitance value
occurs with the change in humidity levels. The IC measure, process this changed resistance
values and change them into digital form.

For measuring temperature this sensor uses a Negative Temperature coefficient thermistor,
which causes a decrease in its resistance value with increase in temperature. To get larger
resistance value even for the smallest change in temperature, this sensor is usually made up
of semiconductor ceramics or polymers.

The temperature range of DHT11 is from 0 to 50 degree Celsius with a 2-degree accuracy.
Humidity range of this sensor is from 20 to 80% with 5% accuracy. The sampling rate of
this sensor is 1Hz .i.e. it gives one reading for every second.  DHT11 is small in size with
operating voltage from 3 to 5 volts. The maximum current used while measuring is 2.5mA.

4.5 Working of RTC Module


In the simple circuit the two inputs X1 and X2 are connected to a 32.768 kHz

crystal oscillator as the source for the chip. VBAT is connected to positive culture of a 3V

battery chip. Vcc power to the I2C interface is 5V and can be given using microcontrollers.

If the power supply Vcc is not granted read and writes are inhibited.

The START condition and STOP condition when the DS1307 I2C communication with the

microcontroller is shown in the figure below.

Figure 4.3: Working of RTC

17
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

The device is configured mentioned in the figure below. The DS1307 has the 2-wire bus

connected to two I/O port pins of the DS5000: SCL – P1.0, SDA – P1.1. The VDD voltage is

5V, RP = 5KΩ and the DS5000 is by means of a 12-MHz crystal. The other secondary

device could be any other device that recognizes the 2-wire protocol, such as the DS1621

Digital Thermometer and Thermostat. The interface with the D5000 was skilled using the

DS5000T Kit hardware and software. These development kits allow the PC to be used as a

dumb terminal using the DS5000’s serial ports to substitute a few words with the keyboard

and monitor.

Accordingly, the following bus conditions have been defined:

Start data transfer: A change in the state of the data line from high to low, while the clock

line is high, defines a START condition.

Stop data transfer: A change in the state of the data line from low to high, while the clock

line is high, defines the STOP condition.

Data valid: The state of the data line represents valid data when, after a START condition,

the data line is stable for the duration of the high period of the clock signal. The data on the

line must be changed during the low period of the clock signal. There is one clock pulse per

bit of data.

Each data transfer is initiated with a START condition and terminated with a STOP

condition. The number of data bytes transferred between the START and the STOP

conditions is not limited, and is determined by the master device. The information is

transferred byte-wise and each receiver acknowledges with a ninth bit.

18
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

4.6 Working of Stepper Motor


The construction of a stepper motor is fairly related to a DC motor. It includes a
permanent magnet like Rotor which is in the middle & it will turn once force acts on it.
This rotor is enclosed through a no. of the stator which is wound through a magnetic coil all
over it. The stator is arranged near to rotor so that magnetic fields within the stators can
control the movement of the rotor.

The stepper motor can be controlled by energizing every stator one by one. So the stator
will magnetize & works like an electromagnetic pole which uses repulsive energy on the
rotor to move forward. The stator’s alternative magnetizing as well as demagnetizing will
shift the rotor gradually &allows it to turn through great control.

The stepper motor working principle is Electro-Magnetism. It includes a rotor which is


made with a permanent magnet whereas a stator is with electromagnets. Once the supply is
provided to the winding of the stator then the magnetic field will be developed within the
stator. Now rotor in the motor will start to move with the rotating magnetic field of the
stator. So this is the fundamental working principle of this motor.

Figure 4.4: Working of Stepper Motor

19
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-5

SPECIFICATIONS OF HARDWARE COMPONENTS

5.1 Specifications of Arduino UNO

It is an ATmega328P based Microcontroller


The Operating Voltage of the Arduino is 5V
The recommended input voltage ranges from 7V to 12V
The i/p voltage (limit) is 6V to 20V
Digital input and output pins-14
Digital input & output pins (PWM)-6
Analog i/p pins are 6
DC Current for each I/O Pin is 20 mA
DC Current used for 3.3V Pin is 50 mA
Flash Memory -32 KB, and 0.5 KB memory is used by the boot loader
SRAM is 2 KB
EEPROM is 1 KB
The speed of the CLK is 16 MHz
In Built LED
Length and width of the Arduino are 68.6 mm X 53.4 mm
The weight of the Arduino board is 25 g

5.2 Specifications LDR Sensor

Operating Voltage: 3.3V to 5V DC.

Operating Current: 15ma.

Output Digital - 0V to 5V, Adjustable trigger level from preset.

Output Analog - 0V to 5V based on light falling on the LDR.

LEDs indicating output and power.

PCB Size: 3.2cm x 1.4cm.

LM393 based design.

20
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

5.3 Specifications of MQ135 Sensor

High Sensitivity
High sensitivity to Ammonia, Sulfide and Benzene
Stable and Long Life
Detection Range : 10 - 300 ppm NH3, 10 - 1000 ppm Benzene, 10 - 300Alcohol
Heater Voltage : 5.0V
Dimensions: 18mm Diameter, 17mm High excluding pins, Pins - 6mm High
Long life and Low cost

5.4 Specifications of DHT 11

Temperature
Resolution :1°C
Accuracy :±2℃
Measuring range : 0°C ~50°C
Humidity
Resolution :1%RH
Accuracy : ±5%RH(0~50°C)
Measuring range : 20%RH ~ 90%RH(25°C)
Operating voltage : 3.3V ~ 5.5V

5.5 Specifications of RTC Module

Working voltage:5V

Two wire I2C interface

Hour : Minutes : SecondsAM/PM

Day Month, Date -Year

Leap yearcompensation

Accurate calendar up to year2100

Consumes Less than 500nA inBattery-Backup

Batteryincluded

21
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

1Hz output pin

56 Bytes of Non-volatile memory available touser

4KB of serial electrically erasable and programmable read only memory(EEPROM)

Embed DS18B20 temperature sensor interface with the pull-up resistor

5.5 Specifications of Stepper Motor

Shaft diameter: 5 mm “D”

Steps per revolution: 200.

Current rating: 1.2 A per coil.

Voltage rating: 4 V.

Resistance: 3.3 Ω per coil.

Holding torque: 3.2 kg-cm (44 oz-in)

22
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-6

SOFTWARE IMPLEMENTATION

6.1 What does Software mean?

Software is a collection of instructions and data that tell the computer how to work.


This is in contrast to physical hardware, from which the system is built and actually performs
the work. In computer science and software engineering, computer software is
all information processed by computer systems, including programs and data. Computer
software includes computer programs, libraries and related non-executable data, such
as online documentation or digital media. Computer hardware and software require each
other and neither can be realistically used on its own.
At the lowest programming level  executable code consists of machine
language instructions supported by an individual processor-typically a central processing
unit (CPU) or a graphics processing unit (GPU). A machine language consists of groups
of binary values signifying processor instructions that change the state of the computer from
its preceding state. For example, an instruction may change the value stored in a particular
storage location in the computer-an effect that is not directly observable to the user. An
instruction may also invoke one of many input or output operations, for example displaying
some text on a computer screen; causing state changes which should be visible to the user.
The processor executes the instructions in the order they are provided, unless it is instructed
to "jump" to a different instruction, or is interrupted by the operating system. As of 2015,
most personal computers, smartphone devices and servers have processors with multiple
execution units or multiple processors performing computation together, and computing has
become a much more concurrent activity than in the past.
The majority of software is written in high-level programming languages. They are
easier and more efficient for programmers because they are closer to natural languages than
machine languages. High-level languages are translated into machine language using
a compiler or an interpreter or a combination of the two. Software may also be written in a
low-level assembly language, which has strong correspondence to the computer's machine
language instructions and is translated into machine language using an assembler.

23
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

Figure 6.1: Software Implementation

6.2 What is Software IDE?

An integrated development environment (IDE) is a software application that provides


comprehensive facilities to computer programmers for software development. An IDE
normally consists of at least a source code editor, build automation tools and a debugger.
Some IDEs, such as NetBeans and Eclipse, contain the necessary compiler, interpreter, or
both; others, such as Sharp Develop and Lazarus, do not.
The boundary between an IDE and other parts of the broader software development
environment is not well-defined; sometimes a version control system or various tools to
simplify the construction of a graphical user interface (GUI) are integrated. Many modern
IDEs also have a class browser, an object browser, and a class hierarchy diagram for use
in object-oriented software development.

24
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

Figure 6.2 IDE Software


6.3 Arduino IDE

The Arduino Integrated Development Environment (IDE) is a cross-platform application


(for Windows, macOS, Linux) that is written in functions from C and C++. It is used to write
and upload programs to Arduino compatible boards, but also, with the help of third-party
cores, other vendor development boards
The source code for the IDE is released under the GNU General Public License, version
2. The Arduino IDE supports the languages C and C++ using special rules of code
structuring. The Arduino IDE supplies a software library from the Wiring project, which
provides many common input and output procedures. User-written code only requires two
basic functions, for starting the sketch and the main program loop, that are compiled and
linked with a program stub main( ) into an executable cyclic executive program with
the GNU toolchain, also included with the IDE distribution. The Arduino IDE employs the
program argued to convert the executable code into a text file in hexadecimal encoding that
is loaded into the Arduino board by a loader program in the board's firmware. By default,
argued is used as the uploading tool to flash the user code onto official Arduino boards
With the rising popularity of Arduino as a software platform, other vendors started to
implement custom open-source compilers and tools (cores) that can build and upload

25
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

sketches to other micro controllers that are not supported by Arduino's official line of


microcontrollers.

Figure 6.3 Open-Source Arduino IDE Software

6.4 Installation & Libraries

Libraries are files written in C or C++ (.c, .cpp) which provide your sketches with extra
functionality (e.g. the ability to control an LED matrix, or read an encoder, etc.). They were
introduced in Arduino 0004.
To use an existing library in a sketch simply go to the Sketch menu, choose "Import Library",
and pick from the libraries available. This will insert an #include statement at the top of the
sketch for each header (.h) file in the library's folder. These statements make the public
functions and constants defined by the library available to your sketch. They also signal the
Arduino environment to link that library's code with your sketch when it is compiled or
uploaded.
To install own library, create a folder inside ARDUINO/hardware/libraries with the name of

26
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

your library. The folder should contain a C or C++ file with your code and a header file with
your function and variable declarations. It will then appear in the Sketch | Import
Library menu in the Arduino IDE.
Because libraries are uploaded to the board with your sketch, they increase the amount of
space used by the ATmega328 on the board. If a sketch no longer needs a library, simply
delete its #include statements from the top of your code. This will stop the Arduino IDE from
linking the library with your sketch and decrease the amount of space used on the Arduino
board.
To get started writing libraries, download this Test library. It should provide a basic template
for creating a new library. After you've made changes to your library, in order to get it to
recompile, you will have to delete the file generated in the library's directory.

27
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-7

SOFTWARE DESCRIPTION

7.1 Software Program

#include <Stepper.h>
#include "DHT.h"
#include <MQ135.h>
#define DHTPIN 13
#define DHTTYPE DHT11
#define A 2
#define B 3
#define C 4
#define D 5
#define NUMBER_OF_STEPS_PER_REV 512
const int ldrPin = A1;
DHT dht(DHTPIN, DHTTYPE);

void setup() {

Serial.begin(9600);
dht.begin();
pinMode(ldrPin, INPUT);
pinMode(A,OUTPUT);
pinMode(B,OUTPUT);
pinMode(C,OUTPUT);
pinMode(D,OUTPUT);
}

void write(int a,int b,int c,int d){


digitalWrite(A,a);
digitalWrite(B,b);
digitalWrite(C,c);

28
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

digitalWrite(D,d);
}

void onestep(){
write(1,0,0,0);
delay(1);
write(1,1,0,0);
delay(1);
write(0,1,0,0);
delay(1);
write(0,1,1,0);
delay(1);
write(0,0,1,0);
delay(1);
write(0,0,1,1);
delay(1);
write(0,0,0,1);
delay(1);
write(1,0,0,1);
delay(1);
}

void loop() {

//Code for detecting Light Intensity

int ldrStatus = analogRead(A1);


Serial.print("Light Intensity : ");
Serial.print(ldrStatus);

//Code for detecting Temperature and Humidity

int h = dht.readHumidity();
int t = dht.readTemperature();

29
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

Serial.print(F("Humidity: "));
Serial.print(h);
Serial.print(F("% Temperature: "));
Serial.print(t);
Serial.print(F("°C "));

//Code for detecting Air Quality

MQ135 gasSensor = MQ135(A2);


int air_quality =gasSensor.getPPM();

Serial.print("Air Quality = ");


Serial.print(air_quality, DEC);
Serial.println(" PPM");

//Curtain Control Loop

if(t>35 || h < 56 || ldrStatus>=200 || air_quality >=1000)


{
Serial.print("Opening Curtains");
int i;
i=0;
while(i<NUMBER_OF_STEPS_PER_REV){
onestep();
i++;

}
delay(5000);
}
}

30
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

7.2 Dumping the Code into Arduino UNO

Connect your Arduino using the USB cable.


The square end of the USB cable connects to your Arduino and the flat end connects to a
USB port on your computer.
Choose Tools →Board →Arduino Uno to find your board in the Arduino menu.
You can also find all boards through this menu, such as the Arduino MEGA 2560 and
Arduino Leonardo.
Choose the correct serial port for your board.
You find a list of all the available serial ports by choosing Tools →Serial Port→ com X or
/dev/tty.usbmodem marks a sequentially or randomly assigned number. In Windows, if you
have just connected your Arduino, the COM port will normally be the highest number, such
as com 3 or com 15.
Many devices can be listed on the COM port list, and if you plug in multiple Arduinos, each
one will be assigned a new number. On Mac OS X, the /dev/tty. usbmodem number will be
randomly assigned and can vary in length, such as /dev/tty. usbmodem1421 or /dev/tty.
usbmodem262471. Unless you have another Arduino connected, it should be the only one
visible.
Click the Upload button.
This is the button that points to the right in the Arduino environment. You can also use the
keyboard shortcut Ctrl+U for Windows or Cmd+U for Mac OS X.

31
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-8
DESIGN AND IMPLEMENTATION
8.1 BLOCK DIAGRAM

Figure8.1: Block Diagram

8.2 PROJECT IMPLEMENTATION

Figure 8.2: Project Implementation

32
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-9

RESULTS

1. Opening Curtains during high humid comditions

Figure 9.1: Result 1

2.Opening of curtains during Low Light and Room surrounded by LPG Gas

Figure 9.2: Result 2

33
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-10

ADVANTAGES

Effectively save energy

Certain temperature rise can be easily detected with the help of a temperature sensor. Also,
this sort of smart technology will close the curtains or blinds which will effectively save the
energy costs associated with the excess electricity usage.

The automation feature present in it helps you to schedule the opening and closing time of
your automated curtains. This can easily sync it with the other smart home technology such
as the thermostat.

Safety

Opting for smart technology provides you safety. You also have the option to associate your
smart curtains specifically with the safety systems or else the smoke sensors.

Also, this aids in the automatic opening of the blinds or curtains whenever the smoke sensor
detects any dangerous gases. As a result, smoke can easily leave home.

Convenience

The smart curtains effectively solve a lot of problems in your house. You can get more
convenience whenever you opt for smart curtains

At precise times of the day, you can open or close it with the help of temperature sensors
specifically in the house. This aids in automatic opening whenever the house temperature
goes above or down.

Provides security

You can get security from burglary whenever you consider the installation of the automated
curtains in your house.

Efficient lightening

You specifically have the option to program the curtains so that it open at specific times
which can be either sunset or sunrise using light detecting Sensors. This allows the entry of
natural light to enter the house. Also, the lights can be programmed to switch off as well as
the curtains can open specifically at the pre-planned timings.

34
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-11

11.1 FUTURE ENHANCEMENT

This project Automatic adjustable curtain control system can be added to cloud computing
network in future as it is more networthy and more accurate and also it can be integrated
with home automation appliance ecosystem.

11.2 CONCLUSION

It’s theoretically possible to conserve energy using a control system to regulate the state of a
roller curtain based on feedback from temperature- and lux sensors. This has also been shown
to be practically realizable in the form of a small scale prototype. By detecting and analyzing
the factors that include the sunlight illumination, time, temperature, humidity and outdoor
environmental conditions, the designed control system of curtains has the characteristics of
high intelligence, compact, multi-functionalization, which are expected to have been widely
used in high-grade office buildings, convention centers, hotels and other places.

35
‘AUTOMATIC ADJUSTABLE CURTAIN CONTROL SYSTEM’

CHAPTER-12

REFERENCES

[1] M. Gregory: Intelligent living, Commun. ACM., 2014, Vol. 57 (12): 15-16
[2] H. Garcia, P. Tucker: World trends & forecasts: consumerism, information society, smart
homes, Medicine, Futurist, 2013: 6-9
[3] Cook DJ, Pullman: Computer science. How smart is your home? , Science, 2012, Vol.
335 (6076): 1579-1581
[4] C.L. Wu, L.C. Fu: Design and realization of a framework for human-system interaction in
smart homes, IEEE T. Syst. Man. Cy. A., 2012, Vol 42(1): 15-31
[5] G. Demiris, M.J. Rantz, M.A. Aud: Older adults' attitudes towards and perceptions of
‘smart home’ technologies: a pilot study, Inform. Health Soc, Care., 2004, Vol. 29(2): 87-94
[6] C.L. Hsu: Constructing intelligent living-space controlling system with blue-tooth and
speech-recognition microprocessor, Expert Syst. Appl., 2009, Vol. 36(5): 9308-9318.
[7] E.K. Hansen, G.G.H. Olesen, M. Mullins: Home smart home: a danish energy-positive
home designed with daylight, IEEE T. Consum. Electr., 2013, Vol. 101(11):2439-2449.
[8] S.V. Hoecke, R. Verborgh, D.V. Deursen, R.V. Walle: SAMuS: service-oriented
architecture for multisensor surveillance in smart homes, The scientific world J., 2014, Vol.
2014:9;
[9] R. Orpwood, C. Gibbs, T. Adlam, R. Faulkner, D. Meegahawatte: The design of smart
homes for people with dementia—user-interface aspects, Universal Access Inf., 2005, Vol.
4(2): 156-164.
[10] K. Young: Heather: residential sizzle, SDM, 2014, Vol. 44 (8): 72-78
[11] N. Balta-Ozkan, R. Davidson, M, Bicket, L. Whitmarsh: The development of smart
homes market in the UK, Energy, 2013, Vol. 60: 361-372

36

You might also like