You are on page 1of 40

AN INDUSTRY ORIENTED MAJOR PROJECT REPORT

On

ARDUINO MANAGED MODULE FOR AUTOMATIC


VENTILATION OF VEHICLE INTERIORS
Submitted in partial fulfillment of the requirements
for the award of the degree of

BACHELOR OF TECHNOLOGY
In
Electronics & Communication Engineering
By

CH.SAI PRAVEEN KUMAR

(11891A0406)

CH. PRAVEEN

(11891A0407)

D.SAI VAMSEE MOHAN

(11891A0408)

Under the guidance of

Mr.N.Dinesh Kumar
M.Tech,(Ph.D.)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VIGNAN INSTITUTE OF TECHNOLOGY AND SCIENCE


(Affiliated to Jawaharlal Nehru Technological University)
Vignan Hills, Deshmukhi village, Pochampally Mandal, Nalgonda Dt.
Telangana 508284
08685226625
08685226600

2011-15

DECLARATION
We hereby declare that project entitled ARDUINO MANAGED MODULE FOR
AUTOMATIC VENTILATION OF VEHICLE INTERIORS is bonafide work duly completed
by me/us. It does not contain any part of the project or thesis submitted by any other candidate to
this or any other institute of the university.
All such materials that have been obtained from other sources have been duly acknowledged.

CH.SAIPRAVEEN KUMAR
(11891A0406 )

CH.PRAVEEN
(11891A0407)

D.SAI VAMSEE MOHAN


(11891A0408)

VIGNAN INSTITUTE OF TECHNOLOGY AND SCIENCE


DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGINEERING

CERTIFICATE
This is to certify that the thesis work titled ARDUINO MANAGED MODULE FOR
AUTOMATIC VENTILATION OF VEHICLE INTERIORS submitted by CH.SAI
PRAVEEN

KUMAR

(11891A0406),

CH.PRAVEEN

(11891A0407),

D.SAI VAMSE

MOHAN(11891A0408) in partial fulfillment of the requirements for the award of the degree of
Bachelor of Technology in Electronics & Communication Engineering to the Vignan Institute
Of Technology And Science, Deshmukhi is a record of bonafide work carried out by him/her under
my guidance and supervision.
The results embodied in this project report have not been submitted in any university for the award
of any degree and the results are achieved satisfactorily.

Guide: Mr. N.Dinesh Kumar


M.Tech,(Ph.D.)

(External Examinar)

ACKNOWLEDGEMENT
We would like to extend our deepest gratitude to our CEO Mr. Shravan Boyapati and principal
Dr.M.Venkata Ramana for his patronage and encouragement.
We also take this opportunity to express our heartfelt thanks to the our guide and Head of
Department Mr.N.Dinesh Kumar for his valuable insights and support.
This project has been a great learning experience for our team members for we found the work
very challenging and interesting ,and we experienced as much joy in seeing it to completion as we
had during the design stages.
It goes with out saying that the project would not have seen the light of the day without the constant
guidance

and

technical

knowhow

provided

by

our

guide/mentor

Mr.N.Dinesh

Kumar(M.Tech,(Ph.D).His willingness to motivate us contributed tremendously to our project.


Finally we would like to thank all the teaching and non teaching staff, friends and family for
obliging us with their help and guidance whenever sought.

ABSTARCT
In order to mitigate overheated interior of a vehicle parked in the hot summer sun and
thereby to make the entering into the vehicle more comfortable, arduino managed module for
automatic ventilation of vehicle interior is made. The module is implemented using a
microcontroller as a central logical unit and a series of sensors which provide sufficient data to
ensure functional, but also efficient, reliable and safe ventilation. The ventilation process is
performed by opening vehicle windows slightly, which enables air to circulate.Microcontroller
controls the position of the windows autonomously and independently of the drivers presence,
following predefined algorithm that uses sensors data obtained from the vehicles surroundings.
Besides temperature, the most important factors to ensure quality implementation of ventilation
are detected movements around the vehicle, the presence of precipitation and other.

TABLE OF CONTENTS

Topic

Page no.

Acknowledgement

ii

Abstract..

iii

Table of contents

iv

List of figures

vi

1. Introduction..

1.1 Overview

1.2 Required components.. .

2. Literature Survey.

3. Block Diagram.

3.1 Introduction on Arduino Uno ..

3.2 ARDUINO UNO.

3.3 Pin diagram of ATmega328....

3.4 Temperature sensor

3.5 Raindrops sensor...

10

3.6 IR sensor

12

3.7 H bridge......

14

3.8 DC motor

15

4. Flow chart..

16

5.Hardware and Soft ware implimentation..

18

5.1Interfacing temperature sensor to arduino..

18

5.2 Interfacing rain drops sensor to arduino.

18

5.3Interfacing IR sensor to arduino..

19

5.4 Interfacing dc motor to arduino.

20

5.5 Software implementation...

20

6. Results

22

7. Conclusion ...

25

7.1 Advantages.

25

7.2 Disadvantages...

25

7.3 Applications..

25

8. Biblography.

26

9. Appendix.

27

LIST OF FIGURES
Fig 3.1 Block Diagram.

Fig 3.2 Arduino Uno board.

Fig 3.3 Pin diagram of Atmega328.

Fig 3.4 Temperature sensor .

Fig 3.5 Rain drops sensor.

10

Fig 3.6 IR sensor

12

Fig 3.7 Working of IR sensor.

13

Fig 3.8 H bridge...

14

Fig 3.9 DC motor.

15

Fig 5.1 Interfacing Temperature sensor to arduino..

18

Fig 5.2 Interfacing Raindrops sensor to arduino

18

Fig 5.3 Interfacing IR sensor to arduino.

19

Fig 5.4 Interfacing DC motor to arduino

20

Fig 5.5 Arduino Integrated Development Environment(IDE)

21

Fig 6.1 Temperature reading on the serial monitor of the arduino...

22

Fig. 6.2 Rain drop sensor displaying raining or not

23

Fig. 6.3 All sensors and motor connected to arduino

24

1.INTRODUCTION
1.1 Overview:
This project aims to provide automatic ventillation for vehicle interiors by considering the outputs
of the all sensors. In this project we are using three sensors namely temperature sensor(LM35)
which displays the temperature in degree celsius, raindrop sensor which indicates whether it is
raining or not, IR sensor which indicates the detection of a person. The outputs of all these sensors
are linked to the motor and the motor rotates according to the conditions(specified) which indicates
the opening and closing of the window automatically without depending on people.

1.2 REQUIRED COMPONENTS

Arduino Uno

Temperature Sensor(LM35)

Rain drops Sensor

IR sensor

H Bridge(L293D)

DC motor(12V,100 rpm)

Jumper wires

2.LITERATURE SURVEY
To underline the work done in this project and to establish acquaintance with the subject, it is
necessary to study the history of the problem statement being investigated by summarizing aspects
of the work that has been done in this regard, both in the past as well as that which is being pursued
now.
[1] Microcontroller managed module for automatic ventilation of vehicle interior by Raic, B.
Polytech. of Zagreb, Zagreb, Croatia Radovan,A. This thesis presents a technique for automatic
ventillation of vehicle interiors according to output of the sensors. In order to get cooled in
overheated interior of a vehicle parked in the hot summer sun and thereby to make the entering
into the vehicle more comfortable, arduino managed module for automatic ventilation of vehicle
interior is made. The module is implemented using a microcontroller as a central logical unit and
a series of sensors which provide sufficient data to ensure functional, but also efficient, reliable
and safe ventilation. The ventilation process is performed by opening vehicle windows slightly,
which enables air to circulate
[2] An Embedded Based Protection of Vehicle Interior with Sensors Automation by Nageshwar
Reddy, Vijaya Krishna Institute of Technology & Sciences.This paper presents how to control
position of windows using microcontroller. Microcontroller controls the position of the windows
autonomously and independently of the drivers presence, following predefined algorithm that
uses sensors data obtained from the vehicles surroundings.

3.BLOCK DIAGRAM

Rain drops
sensor

H bridge

DC motor

ARDUINO
UNO

Temp
sensor

IR sensor

Fig. 3.1 Block diagram


3.1 INTRODUCTION ON ARDUINO UNO
About Arduino :
Arduino is an open source computer hardware and software company, project and user
community that designs and manufactures kits for building digital devices and interactive objects
that can sense and control the physical world.
The project is based on a family of microcontroller board designs manufactured primarily by
Smart Projects in Italy, and also by several other vendors, using various 8-bit Atmel,
AVR microcontrollers or 32-bit Atmel ARM processors. These systems provide sets of digital and
analog I/O pins that can be interfaced to various extension boards and other circuits. The boards
feature serial communications interfaces, including USB on some models, for loading programs
from personal computers. For programming the microcontrollers, the Arduino platform provides
an Integrated Development Environment (IDE) based on the Processing project, which includes
support for C and C++ programming languages.

3.2 ARDUINO UNO:


The Arduino Uno is a microcontroller board based on the ATmega328. 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. 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.

Fig 3.2 Arduino Uno board

Power:
The Arduino Uno can be powered via the USB connection or with an external power supply.
The power source is selected automatically External (non-USB) power can come either from an
AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm
center-positive plug into the board's power jack. Leads from a battery can be inserted in the Gnd
and Vin pin headers of the POWER connector.

The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V,
however, the 5V pin may supply less than five volts and the board may be unstable. If using more
than 12V, the voltage regulator may overheat and damage the board. The recommended range is
7 to 12 volts.

The power pins are as follows:

Vin : The input voltage to the Arduino board when it's 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
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 - 12V), the USB connector (5V), or
the Vin pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the
regulator, and can damage your board. We don't advise it.

3.3V: A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50
mA.

GND. Ground pins.

IOREF. This pin on the Arduino 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 for working
with the 5V or 3.3V.

Memory:
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM and
1 KB of EEPROM (which can be read and written with the EEPROM library).
Input and Output pins:

Each of the 14 digital pins on the Uno can be used as an input or output, using pinmode() ,digital
write(), and digital read()functions. They operate at 5 volts. Each pin can provide or receive a
maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX): Used to receive (RX) and transmit (TX) TTL serial data. These pins
are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.

External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a
rising or falling edge, or a change in value.

PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analog Write () function.

SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using
the SPI library.

LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the
LED is on, when the pin is LOW, it's off.

The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution
(i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible
to change the upper end of their range using the AREF pin and the analogReference() function.
Additionally, some pins have specialized functionality:

TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire Library.
There are a couple of other pins on the board:

AREF. Reference voltage for the analog inputs. Used with analogRefernce ()Reset. Bring this line
LOW to reset the microcontroller. Typically used to add a reset button to shields which block the
one on the board.

The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software
includes a Wire library to simplify use of the I2C bus; see the documentation for details. For SPI
communication, use the SPI library.

USB Overcurrent Protection


The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts
and overcurrent. Although most computers provide their own internal protection, the fuse provides
an extra layer of protection. If more than 500 mA is applied to the USB port, the fuse will
automatically break the connection until the short or overload is removed.
Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the
USB connector and power jack extending beyond the former dimension. Four screw holes allow
the board to be attached to a surface or case. Note that the distance between digital pins 7 and 8 is
160 mil (0.16"), not an even multiple of the 100 mil spacing of the other pins.

Microcontroller used in Arduino uno is ATmega328.


3.3 PIN DIAGRAM OF ATMEGA328:

Fig 3.3 Pin Diagram of ATmega328


Features of ATmega328:

8-Bit Microcontroller

is a low-power CMOS 8-bit microcontroller

Advanced RISC Architecture

32 x 8 General Purpose Working Registers

32K Bytes of In-System Self-Programmable Flash progam memory

1K Bytes EEPROM

2K Bytes Internal SRAM

Write/Erase Cycles: 10,000 Flash/100,000 EEPROM

Operating Voltage 1.8 - 5.5V for ATmega328

Clock speed -20MHz

On-chip Analog Comparator

Two 8-bit Timer/Counters

One 16-bit Timer/Counter

Temperature range : -40C

3.4 TEMPERATURE SENSOR: LM35:

Fig. 3.4 temperature sensor

The LM35-series devices are precision integrated-circuit temperature sensors, with an output
voltage linearly proportional to the Centigrade temperature. The LM35 device has an advantage
over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large
constant voltage from the output to obtain convenient Centigrade scaling. The LM35 device does
not require any external calibration or trimming to providetypical accuracies of C at room
temperature and C over a full 55C to 150C temperature range.
Lower cost is assured by trimming and calibration at the wafer level. The low output
impedance, linear output,and precise inherent calibration of the LM35 device makes interfacing
to readout or control circuitry especiallyeasy. The device is used with single power supplies, or
with plus and minus supplies. As the LM35 device draws only 60 A from the supply, it has very
low self-heating of less than 0.1C in still air. The LM35 device is rated to operate over a 55C
to 150C temperature range, while the LM35C device is rated for a 40C to 110C range (10
with improved accuracy). The temperature-sensing element is comprised of a delta-V BE
architecture.The temperature-sensing element is then buffered by an amplifier and provided to
the VOUT pin.
The LM35 device has a very wide 4-V to 5.5-V power supply voltage range, which makes it
ideal for manyApplications. In noisy environments, TI recommends adding a 0.1 F from V+ to
GND to bypass the powersupply voltage. Larger capacitances maybe required and are dependent
on the power-supply noise.
Features:

Calibrated Directly in Celsius (Centigrade)

Linear + 10-mV/C Scale Factor

0.5C Ensured Accuracy (at 25C)

Rated for Full 55C to 150C

Suitable for Remote Applications

Low-Cost Due to Wafer-Level Trimming scaling.

Operates from 4 V to 30 V

Less than 60-A Current Drain

Low Self-Heating, 0.08C in Still Air

Non-Linearity Only C Typical

Low-Impedance Output, 0.1 for 1-mA Load

The temperature sensor used here(LM35) gives an analog output so the output of
this LM35 is connected to analog pin of arduino uno.

3.5 RAIN DROPS SENSOR :


The Raindrop Detection Sensor module is an easy-to-use and low cost drop recognition sensor.
The sensor works through a series of exposed parallel traces on board which produces electrical
variations when drops or water volume changes. By using microcontrollers or ADC ICs (Arduino
and PIC) its fairly easy to convert the analog output from the sensor to digital values. This can be
directly read by an Arduino or a comparator circuit if you wish to use it as a rain detection alarm.
It can be used to monitor a variety of weather conditions.

Fig 3.5 Raindrops sensor

The rain sensor detects water that completes the circuits on its sensor boards' printed
leads. The sensor board acts as a variable resistor that will change from 100k ohms when
wet to 2M ohms when dry. In short, the wetter the board the more current that will be
conducted.

Pins:
A0.......... Analog output
D0......... Digital output
GND..... Ground
VCC...... Positive voltage (input: 5v for analog 3.3v for Digital.)
Features:
1. Comparator output signal is clean. And can source up to 15mA.
2. Adjustable Sensitivity for D0.
3. Working voltage 3.3V-5V.
4. The output format : digital switching outputs ( 0 and 1 ) and analog voltage output AO.
5. Fixed bolt holes for easy installation

3.6 IR SENSOR (INFRARED SENS0R):

Fig. 3.6 IR sensor


IR Generation
To generate a 36 KHz pulsating infrared is quite easy, more difficult is to receive and
identify this frequency. This is why some companies produce infrared receives, that contains the
filters, decoding circuits and the output shaper, that delivers a square wave, meaning the existence
or not of the 36kHz incoming pulsating infrared.
It means that those 3 dollars small units, have an output pin that goes high (+5V) when there
is a pulsating 36kHz infrared in front of it, and zero volts when there is not this radiation.

A square wave of approximately 27uS (microseconds) injected at the base of a transistor,


can drive an infrared LED to transmit this pulsating light wave.

Upon its presence, the

commercial receiver will switch its output to high level (+5V).If you can turn on and off this
frequency at the transmitter, your receiver's output will indicate when the transmitter is on or off.

Those IR demodulators have inverted logic at its output, when a burst of IR is sensed it drives its
output to low level, meaning logic level = 1. IR reflectance sensors contain a matched infrared
transmitter and infrared receiver pair. These devices work by measuring the amount of light that
is reflected into the receiver. Because the receiver also responds to ambient light, the device works
best when well shielded from abient light, and when the distance between the sensor and the
reflective surface is small(less than 5mm).
IR reflectance sensors are often used to detect white and black surfaces. White surfaces
generally reflect well, while black surfaces reflect poorly. One of such applications is the line
follower of a robot.

Fig 3.7 Working of IR sensor

The resistance of the sensor decreases when IR light falls on it. A good sensor will have near zero
resistance in presence of light and a very large resistance in absence of light. We have used this
property of the sensor to form a potential divider.

3.7 H-bridge:(L293D)

Fig. 3.8 H bridge


An H bridge is an electronic circuit that enables a voltage to be applied across a load in
either direction. These circuits are often used in robotics and other applications to allow DC motors
to run forwards and backwards. It works on the concept of H-bridge. H-bridge is a circuit which
allows the voltage to be flown in either direction. As you know voltage need to change its direction
for being able to rotate the motor in clockwise or anticlockwise direction, Hence H-bridge IC are
ideal for driving a DC motor.
In a single l293d chip there two h-Bridge circuit inside the IC which can rotate two dc
motor independently. Due its size it is very much used in robotic application for controlling DC
motors. Given below is the pin diagram of a L293D motor controller.There are two Enable pins
on l293d. Pin 1 and pin 9, for being able to drive the motor, the pin 1 and 9 need to be high.

For driving the motor with left H-bridge you need to enable pin 1 to high. And for right H-Bridge
you need to make the pin 9 to high. If anyone of the either pin1 or pin9 goes low then the motor in
the corresponding section will suspend working. Its like a switch.

3.8 DC Motor:
A DC motor is any of a class of electrical machines that converts direct current electrical
power into mechanical power. The most common types rely on the forces produced by magnetic
fields. Nearly all types of DC motors have some internal mechanism, either electromechanical or
electronic, to periodically change the direction of current flow in part of the motor. Most types
produce rotary motion; a linear motor directly produces force and motion in a straight line.DC
motors were the first type widely used, since they could be powered from existing direct-current
lighting power distribution systems. A DC motor's speed can be controlled over a wide range,
using either a variable supply voltage or by changing the strength of current in its field windings.
Small DC motors are used in tools, toys, and appliances.

Fig 3.9 DC MOTOR

4.FLOWCHART

START

Interfacin temperature
sensor,Raindrop sensor,IR
sensor andDC motor to
arduino

Initialize
C=0,d=0

If(a)

d++

Y
c++

If(a&&c==1)
If(b&&d==1)

Motor rotates clock


wise direction

Motor rotates anticlock


wise direction

STOP

Where
a=((temp<34&&range==2&&readsen==HIGH)||(temp<34&&(range==0||range==1)&&r
eadsen==LOW)||(temp<34&&(range==0||range==1)&&readsen==HIGH)||(temp>34&&(
range==0||range==1)&&readsen==LOW)||(temp>34&&(range==0||range==1)&&readse
n==HIGH))

b=(temp>34&&range==2&&readsen==LOW)||(temp>34&&range==2&&readsen==HIG
H)||(temp<34&&range==2&&readsen==LOW)

5.HARD WARE AND SOFT WARE IMPLIMENTATION:

5.1 Interfacing temparature sensor with arduino:

Fig. 5.1 Interfacing temparature sensor with arduino


The temperature sensor has 3 pins. +Vs,output,ground.The +Vs and ground of the
temperature sensor are connected to the +5v and ground pin of the arduino respectively.
The output pin of the temperature sensor is connected to the analog pin (A0) of the
arduino.The temperature reading can be seen on serial monitor of arduino IDE.

5.2 Interfacin rain drop sensor to arduino:

Fig. 5.2 Interfacin rain drop sensor to arduino

The rain drop sensor has a sensor module through which it detects the whether it is
raining or not . This state of raining or not raining is communicated to arduino with help
of an interfacing module .The interfacing module has four pins +Vcc,ground ,analog pin
and digital pin. +Vcc and ground of this module are connected to 5v and ground pin of
arduino . The analog pin of module is connected to analog pin (A1) of the arduino.

5.3 Interfacing IR sensor to arduino :

Fig 5.3 Interfacing IR sensor to arduino


The IR sensor has three pins are +Vcc, ground and output. The +Vcc and ground of the
IR sensor are connected to the +5v and ground pin of the arduino respectively.The output
pin of the IR sensor is connected to the Digital pin (D6) of the arduino.

5.4 Interfacing DC motor with arduino:

Fig. 5.4 Interfacing DC motor with arduino


The DC motor is connected to the pin 3 and pin 6 of H-bridge (L293D) which are output1
and output 2. The pin 1 and pin 16 of H-bridge connected to the +5v of the arduino. The
pin2 and pin7 of the H-bridge are connected to the digital pin 2 and pin 4 of the arduino.
The pin 8 is connected to the 9v power supply.

5.5 SOFTWARE IMPLEMENTATION


The programming of the arduino microcontrollers is done using the software Integrated
Development Environment (IDE)The Atmega328 chip on the Arduino Uno comes preburned with
a bootloader that allows uploading of new code to it without use of external hardware programmer.
It communicates using the original STK500 protocol.
The Arduino integrated development environment (IDE) is a cross-platform application written in
Java, and derives from the IDE for the Processing programming language and the Wiring projects.
It is designed to introduce programming to artists and other newcomers unfamiliar with software
development. It includes a code editor with features such as syntax highlighting, brace matching,
and automatic indentation, and is also capable of compiling and uploading programs to the board
with a single click. A program or code written for Arduino is called a sketch.
The programming method used in IDE is embedded c. Every arduino program has a void setup()
function that executes at least once and voidloop() that repeats the code.

Fig 5.5 Arduino Integarated Development Environment(IDE) Software

6.RESULTS
After the complete system design is completed, the hardware and software is tested for any
connection errors. Once it is clear that the connections are all fine the project working is tested.
OBSERVATIONS AND RESULTS
The temperature sensor , rain drop sensor, IR sensor and motor are interfaced with the
arduino uno. The temperature sensor displays the temperature , the rain drop sensor displays
whether it is raining or not on the serial monitor of arduino IDE. the on board led connected to the
pin13 of the arduino becomes high, when it detects a person.
This figure displays temperature reading on the serial monitor of the arduino uno.

Fig. 6.1 temperature reading on the serial monitor of the arduino

This figuare displays whether it is raining or not when rain drop sensor is interfaced to
arduino uno.

Fig. 6.2 Rain drop sensor displaying raining or not

This figuare shows the project when all sensors and motor are interfaced.

Fig. 6.3 All sensors and motor connected to arduino

7.CONCLUSION
7.1 Advantages:

Highly sensitive

Fit and Forget system

Low cost and reliable circuit

Complete elimination of manpower

7.2 Disadvantages:

Circuit once designed cant be changed every time.

Failure of any of the sensors makes improper closing and opening of windows and some
times it may not work.

Cant be used in vehicles with air conditioners.

7.3 Applications:

In vehicles

Public Transportation

military Applications

8.BIBLIOGRAPHY
REFERENCE BOOKS
[1] Programming in C++ : E.BALAGURU SWAMY
[2] Massimo Banzi, Getting Started with Arduino, Publisher: O'Reilly Media, 2009

WEBSITES:
[1] http://www.instructables.com/id/Arduino-Temperature-Sensor-Interfacing-LM35-THE-EA/
[2] http://playground.arduino.cc/Main/LM35HigherResolution
[3] http://www.instructables.com/id/Arduino-Modules-Rain-Sensor/
[4] http://www.gettutorialized.com/uncategorized/rain-drop-sensor-arduino-interface-coding/
[5] http://playground.arduino.cc/Main/PanasonicIrSensor
[6] http://www.instructables.com/id/ -IR-Proximity- sensor/ step5/Interfacing-to-arduino/
[7] http://www.erfssn.org/tutorials/arduino/interfacing-dc-motor/
[8] http://www.instructables.com/id/Arduino-Modules-L298N-Dual-H-Bridge-Motor-Controll/

9.APPENDIX
float temp;
int irsensor1 = 6;
int led1 = 13;
const int sensorMin = 0;

// sensor minimum

const int sensorMax = 1024; // sensor maximum


#define ENA 5 //enable A on pin 5 (needs to be a pwm pin)
#define IN1 2 //IN1 on pin 2 conrtols one side of bridge A
#define IN2 4 //IN2 on pin 4 controls other side of A
int c=0;
int d=0;
void setup()
{
Serial.begin(9600);
pinMode(irsensor1 , INPUT);
pinMode(led1, OUTPUT);
pinMode(ENA, OUTPUT);
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
}
void loop()
{int temp = analogRead(A1);

temp = temp * 0.48828125;


Serial.print("TEMPRATURE = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
delay(10000);
int sensorReading = analogRead(A0); // read the sensor on analog A0:
// map the sensor range (four options):
// ex: 'long int map(long int, long int, long int, long int, long int)'
int range = map(sensorReading, sensorMin, sensorMax, 0, 3);
// range value:
switch (range) {
case 0:

// Sensor getting wet

Serial.println("Heavy Rain");
delay(10000);
break;
case 1:

// Sensor getting wet

Serial.println("Rain Warning");
delay(10000);
break;
case 2:

// Sensor dry - To shut this up delete the " Serial.println("Not Raining"); " below.

Serial.println("Not Raining");
delay(10000);

break;
}
int readsen = digitalRead( irsensor1 );
if( readsen == LOW)
{
digitalWrite(led1, HIGH);
}
else if(readsen==HIGH)
{
digitalWrite(led1, LOW);
}
delay(100);
if((temp>34&&range==2&&readsen==LOW)||(temp>34&&range==2&&readsen==HIGH)||(te
mp<34&&range==2&&readsen==LOW))
{
d++;
}
else
{
c++;
}

if(((temp<34&&range==2&&readsen==HIGH)||(temp<34&&(range==0||range==1)&&readsen=
=LOW)||(temp<34&&(range==0||range==1)&&readsen==HIGH)||(temp>34&&(range==0||rang
e==1)&&readsen==LOW)||(temp>34&&(range==0||range==1)&&readsen==HIGH))&&c==1)
{
motorA(1,50); //back

delay(5000); //let motor A run for 5 seconds

motorA(0,0); //brake motor A with 100% braking power


d=0;
}
if(((temp>34&&range==2&&readsen==LOW)||(temp>34&&range==2&&readsen==HIGH)||(te
mp<34&&range==2&&readsen==LOW))&&d==1)
{
motorA(2,50); //back
delay(5000); //let motor A run for 5 seconds
motorA(0,0); //brake motor A with 100% braking power
c=0;
}
}
void motorA(int mode, int percent)
{
//change the percentage range of 0 -> 100 into the PWM

//range of 0 -> 255 using the map function


int duty = map(percent, 0, 100, 0, 255);
switch(mode)
{
case 0: //disable/coast
digitalWrite(ENA, LOW); //set enable low to disable A
break;
case 1: //turn clockwise
//setting IN1 high connects motor lead 1 to +voltage
digitalWrite(IN1, HIGH);
//setting IN2 low connects motor lead 2 to ground
digitalWrite(IN2, LOW);
//use pwm to control motor speed through enable pin
analogWrite(ENA, duty);
break;
case 2: //turn counter-clockwise
//setting IN1 low connects motor lead 1 to ground
digitalWrite(IN1, LOW);
//setting IN2 high connects motor lead 2 to +voltage
digitalWrite(IN2, HIGH);
//use pwm to control motor speed through enable pin
analogWrite(ENA, duty);

break;
case 3: //brake motor
//setting IN1 low connects motor lead 1 to ground
digitalWrite(IN1, LOW);
//setting IN2 high connects motor lead 2 to ground
digitalWrite(IN2, LOW);
//use pwm to control motor braking power
//through enable pin
analogWrite(ENA, duty);
break;
}
}