Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 67

A

Project report
on

Design and modeling of Aautomatic Rainwater Sensing Roof


Submitted
To

JAWAHARARLAL NEHRU TECHNOLOGICAL UNIVERSITY,ANANTAPUR


(In partial fulfiliment of the requirements for the award of the degree of)

BACHELOR OF TECHNOLOGY
IN
MECHANICAL ENGINEERING
Sudmitted
By
V.SHAMEER 19BG5A0310
M.CHANDRASEKHAR REDDY 19BG5A030O7
P.KALAVATHIP. KALAVATHI 18BG1A0319
A.RAJAA. RAJA KULLAYAPPA 19BG5A0301
R.LAKSHUMMAR. LAKSHUMMA 18BG1A0321

Under the esteemed guidance of


Mr. K. HEMADRI M.TechM. Tech, (Ph.D.)
Associateistant professor
DEPARTMENT OF MECHANICAL ENGINEERING

SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHONOLOGY


(Approved by AICTE, Affiliated to Jawaharlal Nehru Technological University, Anantapuramu)
KADAPA-516003
2018-2022
SRI VENKATESWARA INSTITUTE OF SCIENCE AND TECHONOLOGY
(Approved by AICTE, Affiliated to Jawaharlal Nehru Technological University, Anantapuramu)

DEPARTMENT OF MECHANICAL ENGINEERING

CERTIFICATE
This is crtify that the project report entitled “Design and modeling of Aautomatic
rainwaterwater sensing roof” submitted by
V.SHAMEER 19BG5A0310
M.CHANDRASEKHAR REDDY 19BG5A030O7
P.KALAVATHIP. KALAVATHI 18BG1A0319
A.RAJAA. RAJA KULLAYAPPA 19BG5A0301
R.LAKSHUMMAR. LAKSHUMMA
18BG1A0321

In partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in
the department of Mechanical Engineering, SsVIST, Kadapa.

PROJECT GUIDE HEAD OF THE DEPARTMENT

Mr. K. HEMADRI M.TechM. Tech, (Ph.D.) Mr. K. HEMADRI


M.TechM. Tech, (Ph.D.)
Associateistant Professor Associateistant
Professor SVIST, Kadapa.
SVIST, Kadapa.
Internal examiner External examiner
Date: Date:

ACKNOWLEDGEMENT
We express our sincere thanks to Sri ER. Rajoli Sai Saran Reddy Chairman, Sri
Venkateswara Institute oOf Science aAnd Technology,kadapa, for inspiring us all the way
for arranging all the facilities and resources nreeded to complete the course.

We thankfully acknowledge to Sri .Er. Rajoli .Veera Reddy, Founder Chairman, Sri
Venkateswara Institute oOf Science aAnd Technology,Kkadapa, for his valuable suggestions
and advices throughout the course.

We thankfully acknowledge to professor DrR. C. Raja Gopal Reddy Ph.D, ,Prinicipal,


Sri Venkateswara Institute oOf Science aAnd Technology,Kkadapa, for his valuable
suggestions and advices throughtout the course.

We thankfully acknowledge to to Dr .E. SUBBA RAO, HEAD OF THE


DEPARTMENT OF MECHANICAL, SRI VENKATESWARA INSTITUTE OF SCIENCE
AND TECHNOLOGY,kadapa,for his valuable suggestions and advices throughtout the course.

We thankfully acknowledge to Mr. K. HEMADRI M. Tech, (Ph.D.) Head of The Department


of Mechanical Engineering, Sri Venkateswara Institute of Science and
Technology,Kadapa,for his valuable suggestions and advices throughtout the course.

My sincere thanks to Mr. K. HEMADRI M. Tech, (Ph.D.) guide of this project, for his
valuable suggestions and advices throughtout the course.

We express our heart full thanks to our Pparents and family members, who gave moral
support in completion of the course.

We express our heartfull thanks and gratitude to all professors and Lab Technician Sri T.
MUNI SWAMY, and who have helped us by understanding, encouragement and support made
this effort worthwhile and possible.

V.SHAMEER 19BG5A0310
M.CHANDRASEKHAR REDDY 19BG5A030O7
P.KALAVATHIP. KALAVATHI 18BG1A0319
A.RAJAA. RAJA KULLAYAPPA 19BG5A0301
R.LAKSHUMMAR. LAKSHUMMA
18BG1A0321

DECLARATION

We hereby declare that this project report entitled “Design and modeling of
Aautomatic rainwaterwater sensing roof” is the work done by

V.SHAMEER 19BG5A0310
M.CHANDRASEKHAR REDDY 19BG5A030O7
P.KALAVATHIP. KALAVATHI 18BG1A0319
A.RAJAA. RAJA KULLAYAPPA 19BG5A0301
R.LAKSHUMMAR. LAKSHUMMA
18BG1A0321
Towards the partial fulfillment of the requirements for the award of the degree of bachelor
of technology in Mechanical Engineering and submitted to JAWAHARARLAL NEHRU
TECHNOLOGICAL UNIVERSITY,ANANTAPURAMU,is the result of the work carried out
under the guidence of Sri. K. HEMADRI M. Tech, (Ph.D.) Assiociatestant Professor of SVIST
Kadapa.

We further declare that this project report havehas not been previously submitted before
either in part or full for the award of any degree or any diploma by any organization or any
universities.
CONTENTS
CHAPTER.NO TITLE PAGE.NO
01 ABSTRACT 1
02 INTRODUCTION 2
03 EMBEDDED SYSTEMS 3-9
04 HARDWARE DESCRIPTION 10-14

05 SOFTWARE INSTALATION 15-22


06 STRUCTURE 23-24
07 POWER SUPPLY 25-27
08 LIGHT EMITTING DIODES 28-32
09 RAIN SENSOR 33-35
10 DC MOTOR 36-39
11 ‘ ‘H’ - BRIDGE 40-45
12 ADDITIONAL PARTS 46-48
13 SOURCE CODE 49-53
14 WORKING PRINCIPLE 54
15 CONCLUISION 55
16 REFERENCES 56
LIST OF FIGURES
FIG.NO. NAME OF THE FIGURES PAGE NO.
3.1 Embedded System Architecture 6
3.2 Embedded System 9
4.1 Arduino 11
5.1 USB cable (A plug to B plug) plug) 15
5.2 USB cable (A to Mini-B cable) cable)
15
5.3 Download Arduino IDE Software 16
5.4 Launch Arduino IDE 177
5.5 Open your first project 18
5.6 Existing project 19
5.7 Select your Arduino board 20
5.8 Select your serial port 21
5.9 Upload the program to your board 22
6.1 Structure 23
7.1 Components of a typical linear power supply 25
7.2 Transformer 25
7.3 Bridge rectifier 26
7.4 Full wave varying DC 26
7.5 Electrolytic Capacitor 26
7.6 Regulator 27
8.1 Light Emitting Diodes I-V Characteristics 29
8.2 Series Resistance 29
8.3 Microcontroller 30
8.4 Pin description 30
8.5 LCD interface with microcontroller 31
9.1 Rain-sensor-module 33
9.2 Rain Sensor 34
10.1 Principles of operation 37
11.1 Circuit 41
11.2 Relay Circuit 43
11.3 Transistors 43
12.1 Ball Bearing Set 46
12.2 Deep grove ball bearing 46
12.3 Lead Screw and Copper Nut 46
12.4 Clamps 47
12.5 Support Plates and Screw-Nut 47
12.6 Roof Cover 48
LIST OF TABLES
TABLE.NO. NAME OF THE TABLE PAGE NO.
8.1 Typical LED Characteristics 28
8.2 Pin description 31
11.1 Circuit Description 42
11.2 Half H-Bridge 45
11.3 Half H-Bridge to form a Full H-Bridge 45

Department of mechanical engineering 1
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 01
ABSTRACT

During monsoon, sellers with an open shop, neighbor’sneighbor’s drying clothes outside
and many similar situations cause inconveniences in our life. In case of street vegetable sellers,
they need to protect the vegetables, fruits and customers from rains in monsoon season.

To overcome such problems and help we live with the inconvenience raining system.
This auto rain-sensing roof smart system comes up with a solution. This smart rain sensing
system can detect the rain and opens up the roof. In this smart system, we have a raindrop
sensing system, which gives a reading proportional to the amount of rain pouring on it.

The rain sensor activated when there is a rainfall. Therefore, when the sensor is ‘ON’, it
will givesgive intimation to the controller it will indicate to the DC motor and it will
automatically open the roof. In this project, the roof is open automatically when both the sensor
is ‘ON’. Our main purpose of project is to develop a system to improve the protection
performance and to avoid losses due to atmosphere. It utilized mainly for the detection of heavy
rain from the outside atmosphere. This roofing protectprotects the crop from damaging that
indirectly increase yield of the crop.


Department of mechanical engineering 1
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 02
INTRODUCTION
Different approaches for building roof reconstruction have reported in the literature. In
the model driven approach, also known as the parametric approach, a predefined catalogue of
roof forms (e.g., flat, saddle, etc.) is prescribed and the model that best fits the data is chosen. An
advantage of this approach is that the final roof shape is always topologically correct. The
disadvantage, however, is that complex roof shapes cannot reconstructed if they are not in the
input catalogue.

In addition, the level of detail in the reconstructed building compromised as the input
models usually consist of rectangular footprints. In the data driven approach, also known as the
generic approach or polyhedral approach, the roof reconstructed from planar patches derived
from segmentation algorithms.

The challenge here is to identify neighboring planar segments and their relationship, for
example, coplanar patches, intersection lines or step edges between neighboring planes. The
main advantage of this approach is that polyhedral buildings of arbitrary shape may be a
reconstructed. The main drawback of data driven methods is their susceptibility to the
incompleteness and inaccuracy of the input data.

Therefore, some roof features such as small dormer windows and chimneys cannot be
represented if the resolution of the input data is low. Moreover, if a roof is assumed a
combination of a set of 2D planar faces, a building with a curved roof structure cannot be
reconstructed. Nonetheless, in the presence of high densityhigh-density LIDAR and image data,
curved surfaces can be a well approximated.

The structural approach, also known as the global strategy or Hybrid approach, exhibits
both model and data driven characteristics.


Department of mechanical engineering 2
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 03
EMBEDDED SYSTEM

Introduction for embedded

Everyach day, our lives become more dependent on 'embedded systems', digital
information technology that is an embedded in our environment. More than 98% of processors
applied today are in embedded systems, and are no longer visible to the customer as 'computers'
in the ordinary sense. An Embedded System is a special-purpose system in which the computer
is completely an encapsulated by or dedicated to the device or system it controls. Unlike a
general-purpose computer, such as a personal computer, an embedded system performs one or a
few pre-defined tasks, usually with very specific requirements.

Since the system is a dedicated to specific task, design engineers can optimize it,
reducing the size and cost of the product. Embedded systems are often mass-produced,
benefiting from economies of scale. The increasing use of PC hardware is one of the most
important developments in high-end embedded systems in recent years. Hardware costs of high-
end systems have dropped dramatically because of this trend, making feasible some projects,
which previously not done because of the high cost of non-PC-based embedded hardware.
However, software choices for the embedded PC platform are not nearly as attractive as the
hardware.

Typically, an embedded system is a housed on a single microprocessor board with the


programs stored in ROM. Virtually all appliances that have a digital interface -- watches,
microwaves, VCRs, cars -- utilize embedded systems. Some embedded systems include an
operating system, but many are so specialized that the entire logic can be an implemented as a
single program.

Physically, Embedded Systems range from portable devices such as digital watches and
MP3 players, to large stationary installations like traffic lights, factory controllers, or the systems
controlling nuclear power plants.


Department of mechanical engineering 3
AUTOMATIC RAINWATER SENSING ROOF

In terms of complexity, embedded systems can range from very simple with a single
microcontroller chip, to very complex with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.

Definition of an Embedded System

Embedded system defined as, for a particular/specific application implementing the


software code to interact directly with that particular hardware what we built. Software used for
providing features and flexibility, Hardware = {Processors, ASICs, Memory...} used for
Performance (& sometimes security)

There are many definitions of embedded system but these entire can combined into a
single concept. An embedded system is a special purpose computer system that is a used for
particular task.

Features of Embedded Systems

The versatility of the embedded computer system lends itself to utility in all kinds of
enterprises, from the simplification of deliverable products to a reduction in costs in their
development and manufacture. Complex systems with rich functionality employ special
operating systems that take into account major characteristics of embedded systems. Embedded
operating systems have minimized footprint and may follow real-time operating system
specifics.

The special computers system is usually less powerful than general-purpose systems,
although some expectations do exist where embedded systems are very powerful and
complicated. UsuallyUsually, a low power consumption CPU with a limited amount of memory
is a used in embedded systems. Many embedded systems use very small operating systems; most
of these provide very limited operating system capabilities.


Department of mechanical engineering 4
AUTOMATIC RAINWATER SENSING ROOF

Since the embedded system is a dedicated to specific task, design engineers can optimize
it, reducing the size and cost of the product, or increasing the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.

Some embedded systems have to operate in extreme environment conditions such as very
high temperature & humidity.

For high volume systems such as portable music players or mobile phones, minimizing
cost is usually the primary design consideration. Engineers typically select hardware that is just
“good enough” to implement the necessary functions.

For low volume or prototype-embedded systems, general-purpose computers may be


adapted by limiting the programs or by replacing the operating system with a real-time operating
system.

Characteristics of Embedded Systems

Embedded computing systems generally exhibit rich functionality-—complex


functionality is usually the reason for introducing CPUs into the design. However, they also
exhibit many non-functional requirements that make the task especially challenging:

• Real-time deadlines that will cause system failure if not met;

• Multi-rate operation;

• In many cases, low power consumption;

• Low manufacturing cost, which often means limited code size.

Workstation programmers often concentrate on functionality. They may consider the


performance characteristics of a few computational kernels of their software, but rarely analyze
the total application. They almost never consider power consumption and manufacturing cost.
The need to juggle all these requirements makes embedded system programming very
challenging and is the reason why embedded system designers need to understand computer
architecture.

Department of mechanical engineering 5
AUTOMATIC RAINWATER SENSING ROOF

Overview of an Embedded System Architecture

Every Embedded system consists of a custom-built hardware built around a central


processing unit. This hardware also contains memory chips onto which the software is loaded.

Application Software

Operating
System
H/

Fig 3.1 Embedded System Architecture

The operating system runs above the hardware and the application software runs above
the operating system. The same architecture is applicable to any computer including desktop
computer. However, these are significant differences. It is not compulsory to have an operating
system in every embedded system. For small applications such as remote controlremote-control
units, air conditioners, toys etc.

Applications of Embedded SystemsSystems; -

Some of the most common embedded systems used in everyday life are,

Small embedded controllers: 8-bit CPUs dominate, simple or no operating system

(e.g., thermostats)


Department of mechanical engineering 6
AUTOMATIC RAINWATER SENSING ROOF

Control systems: Often use DSP chip for control computations

Distributed embedded control: Mixture of large and small nodes on a real-time

Embedded networks

(e.g., cars, elevators, factory automation)

System on chip: ASIC design tailored to application area

(e.g., consumer electronics, set-top boxes)

Network equipment: Emphasis on data movement/packet flow

(e.g., network switches; telephone switches)

Critical systems: Safety and mission critical computing

(e.g., pacemakers, automatic trains)

Signal processing: Often use DSP chips for vision, audio, or otheranother signal

Processing (e.g., face recognition)

Robotics: Uses various types of embedded computing (especially

Vision and control) (e.g., autonomous vehicles)

Computer peripherals: Disk drives, keyboards, laser printers, etc.

Wireless systems: Wireless network-connected “sensor networks” and

“Motes” to gather and report information

Embedded PCs: Palmtop and small form factor PCs embedded into

Equipment

Command and control: Often huge military systems and “systems of systems”


Department of mechanical engineering 7
AUTOMATIC RAINWATER SENSING ROOF

Home Appliances, intercom, telephones, security systems, garage door openers, answering
machines, fax machines, home computers, TVs, cable TV tuner, VCR, camcorder, remote
controls, video games, cellular phones, musical instruments, sewing machines, lighting control,
paging, camera, pinball machines, toys, exercise equipment

Office Telephones, computers, security systems, fax machines, microwave, copier, laser printer,
color printer, paging

Auto Trip computer, engine control, air bag, ABS, instrumentation, security system,
transmission control, entertainment, climate control, cellular phone, keyless entry

TYPES OF EMBEDDED SYSTEMS


Based on functionality and performance-embedded systems categorized as 4 types

1. Stand-alone embedded systems

2. Real time embedded systems

3. Networked information appliances

4. Mobile devices

[1.] Stand-alone embedded systems:-systems: -

As the name implies, stand-alone systems work in stand-alone mode. They take iI/p, process
them and produce the desire o/p and iI/p can be an electrical signal from transducer or
temperature signal or commands from human being. The o/p can be electrical signal to drive
another system an led or LCD display

Ex: - digital camera, microwave oven, CD player, Air conditioner etc.

[2.] Real time embedded systems:-systems: -

In this type of an embedded system, a specific work has to be complete in a particular period.

Hard Real time systems: - embedded real time used in missiles


Department of mechanical engineering 8
AUTOMATIC RAINWATER SENSING ROOF

Soft Real time systems: - DVD players

[3.] Networked information appliances:-appliances: -

Embedded systems that is provided with networkn/w interfaces and accessed by networkn/w
such as local area network n/w or internet are called Network Information Appliances

ExAppliances a web camera connected to the internet. Camera can send pictures in real time to
any computers connected to the internet.

4. Mobile devices: -

Actually, it is a combination of both VLSI and Embedded System

Mobile devices such as Mobile phone, Personal digital assistants, smart phones etc. are special
category of embedded systems

Block Diagram

LCD

Power
supply

CPU

Rain sensor L298


driver

Department of mechanical engineering 9
AUTOMATIC RAINWATER SENSING ROOF

Roof
motor

Fig 3.2 Embedded System

CHAPTER 04
HARDWARE DESCRIPTION

Arduino

Arduino is a prototype platform (open-source) based on an easy-to-use hardware and


software. It consists of a circuit board, which can programedhave programed (referred to as a
microcontroller) and a ready-made software called Arduino IDE (Integrated Development
Environment), which is used to write and upload the computer code to the physical board.

The key features are −

 Arduino boards are able to read analog or digital input signals from different sensors and
turn it into an output such as activating a motor, turning LED on/off, connect to the
cloud and many other actions.
 You can control your board functions by sending a set of instructions to the
microcontroller on the board via Arduino IDE (referred to as uploading software).
 Unlike most previous programmable circuit boards, Arduino does not need an extra piece
of hardware (called a programmer) in order to load a new code onto the board. You can
simply use a USB cable.


Department of mechanical engineering 10
AUTOMATIC RAINWATER SENSING ROOF

 Additionally, the Arduino IDE uses a simplified version of C++, making it easier to learn
to program.
 Finally, Arduino provides a standard form factor that breaks the functions of the micro-
controller into a more accessible package.

Board Types

Various kinds of Arduino boards are available depending on different microcontrollers


used. However, all Arduino boards have one thing in common: they programed through the
Arduino IDE.

The differences based on the number of inputs and outputs (the number of sensors,
LEDs, and buttons you can use on a single board), speed, operating voltage, form factor etc.
Some boards designed to be an embedded and have no programming interface (hardware),
which you would need to buy separately. Some can run directly from a 3.7V battery, others need
at least 5V.

We will learn about the different components on the Arduino board. We will study the
Arduino UNO board because it is the most popular board in the Arduino board family. In
addition, it is the best board to get started with electronics and coding. Some boards look a bit
different from the one given below, but most Arduinos have majority of these components in
common.


Department of mechanical engineering 11
AUTOMATIC RAINWATER SENSING ROOF

Fig 4.1 Arduino

Power USB

Arduino board can poweredhave powered by using the USB cable from your computer.
All you need to do is connect the USB cable to the USB connection (1).

Power (Barrel Jack)

Arduino boards can powered directly from the AC mains power supply by connecting it
to the Barrel Jack (2).


Department of mechanical engineering 12
AUTOMATIC RAINWATER SENSING ROOF

Voltage Regulator

The function of the voltage regulator is to control the voltage given to the Arduino board
and stabilize the DC voltages used by the processor and other elements.

Crystal Oscillator

The crystal oscillator helps Arduino in dealing with time issues. How does Arduino
calculate time? The answer is, by using the crystal oscillator. The number printed on top
of the Arduino crystal is 16.000H9H. It tells us that the frequency is 16,000,000 Hertz or
16 MHz

Arduino Reset

You can reset your Arduino board, i.e., start your program from the beginning. You can
reset the UNO board in two ways. First, by using the reset button (17) on the board.
Second, you can connect an external reset button to the Arduino pin labelled RESET (5).

Pins (3.3, 5, GND, Vin)

 3.3V (6) − Supply 3.3 output volt

 5V (7) − Supply 5 output volt

 Most of the components used with Arduino board works fine with 3.3 volt and 5
voltvolts.

 GND (8)(8) (Ground) − There are several GND pins on the Arduino, any of
which can be used to ground your circuit.

 Vin (9) − This pin also can be used to power the Arduino board from an external
power source, like AC mains power supply.


Department of mechanical engineering 13
AUTOMATIC RAINWATER SENSING ROOF

Analog pins

The Arduino UNO board has six analog input pins A0 through A5. These pins can read
the signal from an analog sensor like the humidity sensor or temperature sensor and
convert it into a digital value that can read by the microprocessor.

Main microcontroller

Each Arduino board has its own microcontroller (11). You can assume it as the brain of
your board. The main IC (integrated circuit) on the Arduino is slightly different from
board to board. The microcontrollers are usually of the ATMEL Company. You must
know what IC your board has before loading up a new program from the Arduino IDE.
This information is available on the top of the IC. For more details about the IC
construction and functions, you can refer to the data sheet.

ICSP pin

Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino consisting of
MOSI, MISO, SCK, RESET, VCC, and GND. It is an often referred to as an SPI (Serial
Peripheral Interface), which could be considered as an "expansion" of the output.
Actually, you are slaving the output device to the master of the SPI bus.

Power LED indicator

This LED should light up when you plug your Arduino into a power source to indicate
that your board is a powered up correctly. If this light does not turn on, then there is
something wrong with the connection.

TX and RX LEDs

On your board, you will find two labels: TX (transmit) and RX (receive). They appear in
two places on the Arduino UNO board. First, at the digital pins 0 and 1, to indicate the


Department of mechanical engineering 14
AUTOMATIC RAINWATER SENSING ROOF

pins responsible for serial communication. Second, the TX and RX led (13). The TX led
flashes with different speed while sending the serial data. The speed of flashing depends
on the baud rate used by the board. RX flashes during the receiving process.

Digital I/O

The Arduino UNO board has 14 digital I/O pins (15) (of which 6 provide PWM (Pulse
Width Modulation) output. These pins can configuredhave configured to work as input
digital pins to read logic values (0 or 1) or as digital output pins to drive different
modules like LEDs, relays, etc. The pins labeled “~” can used to generate PWM.

AREF

AREF stands for Analog Reference. It is sometimes, used to set an external reference
voltage (between 0 and 5 Volts) as the upper limit for the analog input pins.

CHAPTER 05

SOFTWARE INSTALATION

After learning about the main parts of the Arduino UNO board, we are ready to learn
how to set up the Arduino IDE. Once we learn this, we will be ready to upload our program on
the Arduino board.


Department of mechanical engineering 15
AUTOMATIC RAINWATER SENSING ROOF

In this section, we will learn in easy steps, how to set up the Arduino IDE on our
computer and prepare the board to receive the program via USB cable.

Step 1 − First you must have your Arduino board (you can choose your favorite board) and a
USB cable. In case you use Arduino UNO, Arduino Duemilanove, Nano, Arduino Mega 2560,
or Diecimila, you will need a standard USB cable (A plug to B plug), the kind you would
connect to a USB printer as shown in the following image.

Fig 5.1 USB cable (A plug to B plug)

In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the
following image.

Fig 5.2 USB cable (A to Mini-B cable)

Step 2 − Download Arduino IDE Software.

You can get different versions of Arduino IDE from the Download page on the Arduino
Official website. You must select your software, which is compatible with your operating
system (Windows, IOS, or Linux). After your file download is complete, unzip the file.


Department of mechanical engineering 16
AUTOMATIC RAINWATER SENSING ROOF

Fig 5.3 Download Arduino IDE Software

Step 3 − Power up your board.

The Arduino Uno, Mega, DuemilanoveDemilune and Arduino Nano automatically draw
power from either, the USB connection to the computer or an external power supply. If you are
using an Arduino DiecimilaDecimal, you have to make sure that the board configured to draw
power from the USB connection. The power source selected with a jumper, a small piece of
plastic that fits onto two of the three pins between the USB and power jacks. Check that it is on
the two pins closest to the USB port.

Connect the Arduino board to your computer using the USB cable. The green power LED
(labeled PWR) should glow.

Step 4 − Launch Arduino IDE.



Department of mechanical engineering 17
AUTOMATIC RAINWATER SENSING ROOF

After your Arduino IDE software downloaded, you need to unzip the folder. Inside the
folder, you can find the application icon with an infinity label (application.exe). Double-click
the icon to start the IDE.

Fig 5.4 Launch Arduino IDE

Step 5 − Open your first project.

Once the software starts, you have two options −


Department of mechanical engineering 18
AUTOMATIC RAINWATER SENSING ROOF

 Create a new project.

 Open an existing project example.

To create a new project, select File → New.

Fig 5.5 Open your first project

To open an existing project example, select File → Example → Basics → Blink.


Department of mechanical engineering 19
AUTOMATIC RAINWATER SENSING ROOF

Fig 5.6 Existing project

Here, we are selecting just one of the examples with the name Blink. It turns the LED on
and off with some time delay. You can select any other example from the list.

sStep 6 − Select your Arduino board.


Department of mechanical engineering 20
AUTOMATIC RAINWATER SENSING ROOF

To avoid any error while uploading your program to the board, you must select the
correct Arduino board name, which matches with the board connected to your computer.

Go to Tools → Board and select your board.

Fig 5.7 Select your Arduino board

Here, we have selected Arduino Uno board according to our tutorial, but you must select the
name matching the board that you are using.

Step 7 − Select your serial port.



Department of mechanical engineering 21
AUTOMATIC RAINWATER SENSING ROOF

Select the serial device of the Arduino board. Go to Tools → Serial Port menu. This is
likely to be COM3 or higher (COM1 and COM2 are usually reserved for hardware serial ports).
To find out, you can disconnect your Arduino board and re-open the menu, the entry that
disappears should be of the Arduino board. Reconnect the board and select that serial port.

Fig 5.8 Select your serial port


Department of mechanical engineering 22
AUTOMATIC RAINWATER SENSING ROOF

Step 8 − Upload the program to your board.

Before explaining how we can upload our program to the board, we must demonstrate
the function of each symbol appearing in the Arduino IDE toolbar.

Fig 5.9 Upload the program to your board

A − Used to check if there is any compilation error.

B − Used to upload a program to the Arduino board.

C − Shortcut used to create a new sketch.

D − Used to directly open one of the example sketch.

E − Used to save your sketch.

F − Serial monitor used to receive serial data from the board and send the serial data to the
board.

Now, simply click the "Upload" button in the environment. Wait a few seconds; you will see the
RX and TX LEDs on the board, flashing. If the upload is successful, the message "Done
uploading" will appear in the status bar.

the Arduino program structure and we will learn more new terminologies used in the Arduino
world. The Arduino software is open-source. The source code for the Java environment is
released under the GPL and the C/C++ microcontroller libraries are under the LGPL.

Department of mechanical engineering 23
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 06

STRUCTURE

Structure

Arduino programs can be divided in three main parts: Structure, Values (variables and
constants), and Functions. In this tutorial, we will learn about the Arduino software program,
systematically, and how we can write the program without any syntax or compilation error.

Let us start with the Structure. Software structure consist of two main functions −

 Setup( ) function

 Loop( ) function

Fig 6.1 Structure


Department of mechanical engineering 24
AUTOMATIC RAINWATER SENSING ROOF

Void setup ( ) {}

 PURPOSE − The setup(setup () function is called when a sketch starts. Use it to


initialize the variables, pin modes, start using libraries, etc. The setup function will only
run once, after each power up or reset of the Arduino board.
 INPUT − -
 OUTPUT − -
 RETURN − -

Void Loop () {}

 PURPOSE − after creating a setup () function, which initializes and sets the initial
values, the loop () function does precisely what its name suggests, and loops
consecutively, allowing your program to change and respond. Use it actively control the
Arduino board.
 INPUT − -
 OUTPUT − -
 RETURN − -


Department of mechanical engineering 25
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 07
POWER SUPPLY
POWER SUPPLY MODULES:

 STEP DOWN TRANSFORMER


 BRIDGE RECTIFIER WITH FILTER
 VOLTAGE REGULATORS

Fig 7.1 Components of a typical linear power supply

Transformer

Transformers convert AC electricity from one voltage to another with little loss of power.
Transformers work only with AC and this is one of the reasons why mains electricity is AC.
Step-up transformers increase voltage, step-down transformers reduce voltage. A step down
power transformer used to step down the AC voltage from the line voltage Of 110 VAC or 220
VAC i.e., it converts higher voltage at the input side to a lower voltage at the output


Department of mechanical engineering 26
AUTOMATIC RAINWATER SENSING ROOF

Fig 7.2 Transformer

Rectifier

There are several ways of connecting diodes to make a rectifier to convert AC to DC. The
bridge rectifier is the most important and it produces full-wave varying DC

Fig 7.3 Bridge rectifier Fig 7.4 Full wave varying DC

Filter

Filtering is performed by a large value electrolytic capacitor connected across the DC


supply to act as a reservoir, supplying current to the output when the varying DC voltage from
the rectifier is falling. The diagram shows the unfiltered varying DC (dotted line) and the filtered
DC (solid line). The capacitor charges quickly near the peak of the varying DC, and then
discharges as it supplies current to the output.

Fig 7.5 Electrolytic Capacitor

Typically, 1000 μf capacitor is used in microcontroller of 8051.



Department of mechanical engineering 27
AUTOMATIC RAINWATER SENSING ROOF

Regulator

This is a simple DC regulated supply project using 7805 voltage regulator to obtain a
variable DC voltage range from 5V to 15V

Fig 7.6 Regulator

Pin out of the 7805 regulator IC.

1. Unregulated voltage in

2. Ground

3. Regulated voltage out

If you need other voltages than +5V, you can modify the circuit by replacing the 7805 chips
with another regulator with different output voltage from regulator 78xx chip family. The last
numbers in the chip code tells the output voltage. Remember that the input voltage must be at
least 3V greater than regulator output voltage to otherwise, the regulator does not work well.


Department of mechanical engineering 28
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 08
LIGHT EMITTING DIODES
Light Emitting Diodes

Light Emitting Diodes or LEDs, are among the most widely used of all the types of
diodes available. They are the most visible type of diode that emits a narrow bandwidth of either
visible colored light, invisible infra-red or laser type light when a forward current passed through
them. A "Light Emitting Diode" or LED as it is more commonly called, is basically just a
specialized type of PN-junction diode, made from a very thin layer of fairly heavily doped
semiconductor material. When the diode is Forward Biased, electrons from the semiconductors
conduction band combine with holes from the valence band, releasing sufficient energy to
produce photons of light.

Typical LED Characteristics

Semiconductor
Wavelength Colour VF @ 20mA
Material

++++GaAs 850-940nm Infra-Red 1.2v

GaAsP 630-660nm Red 1.8v

GaAsP 605-620nm Amber 2.0v

GaAsP:N 585-595nm Yellow 2.2v

GaP
550-570nm Green 3.5v

SiC 430-505nm Blue 3.6v

GaInN 450nm White 4.0v

Table 8.1 Typical LED Characteristics



Department of mechanical engineering 29
AUTOMATIC RAINWATER SENSING ROOF

From the table above we can see that the main P-type dopant used in the manufacture of
Light Emitting Diodes is Gallium (Ga, atomic number 31) and the main N-type dopant used is
Arsenic (As, atomic number 31) giving the resulting Gallium Arsenide (GaAs) crystal structure,
which has the characteristics of radiating significant amounts of infrared radiation from its
junction when a forward current is flowing through it. By also adding Phosphorus (P, atomic
number 15), as a third dopant the overall wavelength of the emitted radiation is reduced to give
visible red light to the human eye. Further refinements in the doping process of the PN-junction
have resulted in a range of colors available from red, orange and amber through to yellow, and
the recently developed blue LED, which is achieved by injecting nitrogen atoms into the crystal
structure during the doping process.

Light Emitting Diodes I-V Characteristics:

Fig 8.1 Light Emitting Diodes I-V Characteristics

LED Series Resistance:

The series resistor value RS


calculated by simply using Ohm´s Law, knowing the required forward current IF, the supply
voltage VS and the expected forward voltage drop of the LED, VF at this current level as shown
in below:


Department of mechanical engineering 30
AUTOMATIC RAINWATER SENSING ROOF

Fig 8.2 Series Resistance

LED Typical Applications:

The following figure shows how to interface the LED to microcontroller. As you can see,
the Anode is connected through a resistor to Vcc and the Cathode is connected to the
Microcontroller pin. Therefore, when the Port Pin is HIGH, the LED is OFF and when the Port
Pin is LOW, the LED is turned ON.

Fig 8.3 Microcontroller

Alphanumeric LCD

Liquid Crystal Display also called, as LCD is very helpful in providing user interface
as well as for debugging purpose. The most commonly used Character based LCDs are based on
Hitachi's HD44780 controller or other which are compatible with HD44580. The most
commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line LCDs which have
only 1 controller and support at most of 80 characters, whereas LCDs supporting more than 80
characters make use of 2 HD44780 controllers.

Pin Description


Department of mechanical engineering 31
AUTOMATIC RAINWATER SENSING ROOF

Fig 8.4 Pin description

1 VSS Power supply (GND)


2 VCC Power supply (+5V)
3 VEE Contrast adjusts
0 = Instruction input
4 RS
1 = Data input
0 = Write to LCD module
5 R/W
1 = Read from LCD module
6 EN Enable signal
7 D0 Data bus line 0 (LSB)
8 D1 Data bus line 1
9 D2 Data bus line 2
10 D3 Data bus line 3
11 D4 Data bus line 4
12 D5 Data bus line 5
13 D6 Data bus line 6
14 D7 Data bus line 7 (MSB)
15 LED+ Back Light VCC
16 LED- Back Light GND
Table 8.2 Pin description

LCD INTERFACE WITH MICROCONTROLLER

Microcontroller
P
O
R
T
P
I
N
S


Department of mechanical engineering 32
AUTOMATIC RAINWATER SENSING ROOF

Fig 8.5 LCD interface with microcontroller

INTERFACING LCD TO MICROCONTROLLER

The LCD is generally interfaced in 8-bit mode or 4-bit mode. in this project LCD is
connected in 4-bit mode the interface connections of LCD with microcontroller are as follows

RS of LCD connected to p0.0 of microcontroller

EN of LCD connected to p0.1 of microcontroller

D4 of LCD connected to p0.4 of microcontroller

D5 of LCD connected to p0.5 of microcontroller

D6 of LCD connected to p0.6 of microcontroller

D7 of LCD connected to p0.7 of microcontroller

In 8-bit mode, the complete ASCII code is sent at once along with the control signals.
However, in 4-bit mode, the data divided into two parts, i.e. MSB & LSB are called upper nibble
& lower nibble.

The control signals are RS,RS; R/W & E. RS is used to select the internal registers i.e.
data register & command register. R/W is used to set the mode of LCD to read mode or write
mode. E is used as chip select and is used to push the data internally to the corresponding
registers.

To transfer the data/command in 8-bit mode, the data is written to the 8-bit data bus after
selecting the required register and setting the mode to write mode. The E signal pin is then given
a high to low signal to transfer the data.

To transfer the data/command in 4-bit mode, the higher nibble is first written to the MSB
of the data port and the E is given a high to low signal. After a little delay or when the LCD is
not busy, the lower nibble is transferred in the same procedure.


Department of mechanical engineering 33
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 09

RAIN SENSOR

Rain sensor
Nowadays, conserving water as well as its proper usage is essential in everyone’s life.
Here is a sensor namely rain sensor which is used to detect the rain and generate an alarm.
Therefore, we can conserve water to use it later for different purposes. There are several methods
available for conserving water like harvesting, etc. Using this method, we can increase the level
of underground water. These sensors are mainly used in the field like automation, irrigation,
automobiles, communication etc. This article discusses a simple as well as reliable sensor
module, which can be available at low cost in the mark

A rain sensor is one kind of switching device, which is used to detect the rainfall. It
works like a switch and the working principle of this sensor is whenever there is rain, the switch
will be normally closed.

The rain sensor module/board is shown below. This board includes nickel-coated lines
and it works on the resistance principle. This sensor module permits to gauge moisture through
analog output pins & it gives a digital output while moisture threshold surpasses.

Fig 9.1 Rain-sensor-module

This module is similar to the LM393 IC because it includes the electronic module as well
as a PCB. Here PCB is used to collect the raindrops. When the rain falls on the board, then it
creates a parallel resistance path to calculate through the operational amplifier.

This sensor is a resistive dipole, and based on the moisture only it shows the resistance.
For example, it shows more resistance when it is dry and shows less resistance when it is wet.


Department of mechanical engineering 34
AUTOMATIC RAINWATER SENSING ROOF

Pin Configuration
The pin configuration of this sensor is shown below. This sensor includes four pins, which
include the following.

 Pin1 (VCC): It is a 5V DC pin


 Pin2 (GND): it is a GND (ground) pin
 Pin3 (DO): It is a low/ high output pin
 Pin4 (AO): It is an analog output pin
Specifications
The specifications of the rain sensor include the following.

Fig 9.2 Rain Sensor

 This sensor module uses good quality of double-sided material.


 Anti-conductivity & oxidation with long time use
 The area of this sensor includes 5cm x 4cm and can be built with a nickel plate on the
side
 The sensitivity can be adjusted by a potentiometer
 The required voltage is 5V
 The size of the small PCB is 3.2cm x 1.4cm
 For easy installation, it uses bolt holes
 It uses an LM393 comparator with wide voltage
 The output of the comparator is a clean waveform and driving capacity is above 15mA


Department of mechanical engineering 35
AUTOMATIC RAINWATER SENSING ROOF

Applications
The applications of rain sensor include the following.

 This sensor is used as a water preservation device and this is connected to


the irrigation system to shut down the system in the event of rainfall.
 This sensor is used to guard the internal parts of an automobile against the rainfall as
well as to support the regular windscreen wiper’s mode.
 This sensor is used in specialized satellite communications aerials for activating a rain
blower over the opening of the aerial feed, to get rid of water droplets from the mylar
wrap to keep pressurized as well as dry air within the waveguides.

L293D “H” BRIDGE

The motor driver package L293D is interfaced with 89C51 microcontroller through IN1 to IN4 of
H Bridge (L293D). Both the enable pins (EN1 and EN2) of motor driver L293D is combined together and
fed to controller to access the command signals. Depending up on the command signals issued by the
controller, the enable pins are activated to control all the four internal drivers of L293D respectively to
drive two geared DC motors. Hear H Bridge is required, because the microcontroller output is not
sufficient to drive the DC motors, so current drivers are required for motor rotation.

The L293D is a quad, high current, half-H driver designed to provide bidirectional drive currents
of up to 600mA at voltages from 4.5V to 36V. It makes it easier to drive the DC motors. The L293D
consists of four drivers. Pins IN1 through IN4 and OUT1 through OUT4 are input and output pins,
respectively, of driver 1 through driver 4. Drivers 1 and 2, and drivers 3 and 4 are enabled by enable pin 1
(EN1) and pin 9 (EN2), respectively. When enable input EN1, (Pin1) is high, drivers 1 and 2 are enabled
and the outputs corresponding to their inputs are active. Similarly, enable input EN2 (Pin9) enables drivers
3 and 4.


Department of mechanical engineering 36
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 10
DC MOTOR
DETAILS ABOUT DC MOTORS
Permanent magnet DC motor responds to both voltage and current. The steady state voltage across a
motor determines the motor’s running speed, and the current through its armature windings determines the
torque. Apply a voltage and the motor will start running in one direction; reverse the polarity and the
direction will be reversed. If you apply a load to the motor shaft, it will draw more current, if the power
supply does not able to provide enough current, the voltage will drop and the speed of the motor will be
reduced. However, if the power supply can maintain voltage while supplying the current, the motor will
run at the same speed. In general, you can control the speed by applying the appropriate voltage, while
current controls torque. In most cases, DC motors are powered up by using fixed DC power supply,
therefore; it is more efficient to use a chopping circuit.

Consider what happens when a voltage applied to a motor’s windings is rapidly turned ON and OFF in
such a way that the frequency of the pulses produced remains constant, but the width of the ON pulse is
varied. This is known as Pulse Width Modulation (PWM). Current only flows through the motor during
the ON portion of the PWM waveform. If the frequency of the PWM input is high enough, the mechanical
inertia of the motor cannot react to the ripple wave; instead, the motor behaves as if the current were the
DC average of the ripple wave. Therefore, by changing the width of pulse, we can control the motor
speed.

At the most basic level, electric motors exist to convert electrical energy into mechanical energy.
This is done by way of two interacting magnetic fields -- one stationary, and another attached to a part that
can move. A number of types of electric motors exist, but most BEAM bots use DC motors in some form
or another. DC motors have the potential for very high torque capabilities (although this is generally a
function of the physical size of the motor), are easy to miniaturize, and can be "throttled" via adjusting
their supply voltage. DC motors are also not only the simplest, but also the oldest electric motors.

OerstedForested, Gauss, and Faraday discovered the basic principles of electromagnetic


induction in the early 1800’s. By 1820, Hans Christian OerstedForested and Andre Marie Ampere had
discovered that an electric current produces a magnetic field. The next 15 years saw a flurry of


Department of mechanical engineering 37
AUTOMATIC RAINWATER SENSING ROOF

crossCross-Atlantic experimentation and innovation, leading finally to a simple DC rotary motor. A


number of men were involved in the work, so proper credit for the first DC motor is really a function of
just how broadly you choose to define the word "motor

Principles of operation

In any electric motor, operation is based on simple electromagnetism. A current carrying


conductor generates a magnetic field; when this is then placed in an external magnetic field, it will
experience a force proportional to the current in the conductor, and to the strength of the external magnetic
field. As you are well aware of from playing with magnets as a kid, opposite (North and South) polarities
attract, while as if polarities (North and North, South and South) repel. The internal configuration of a DC
motor is designed to harness the magnetic interaction between a current -carrying conductor and an
external magnetic field to generate rotational motion. Let us start by looking at a simple 2-pole DC
electric motor (here dark black represents a magnet or winding with a "North" polarization, while light
color represents a magnet or winding with a "South" polarization).

Every DC motor has six basic parts -- axle, rotor (a.k.a., armature), stator, commutator, field
magnet’smagnets, and brushes. In most common DC motors, the external magnetic field is produced by
high-strength permanent magnets. The stator is the stationary part of the motor -- this includes the motor
casing, as well as two or more permanent magnet pole pieces. The rotor (together with the axle and
attached commutator) rotates with respect to the stator. The rotor consists of windings (generally on a
core), the windings being electrically connected to the commutator. The above diagram shows a
common motor layout -- with the rotor inside the stator (field) magnets.


Department of mechanical engineering 38
AUTOMATIC RAINWATER SENSING ROOF

Fig 10.1 Principles of operation

The geometry of the brushes, commutator contacts, and rotor windings are such that when power
is applied, the polarities of the energized winding and the stator magnet(s) are misaligned, and the rotor
will rotate until it is almost aligned with the stator's field magnets. As the rotor reaches alignment, the
brushes move to the next commutator contacts, and energize the next winding. Given our example two-
pole motor, the rotation reverses the direction of current through the rotor winding, leading to a "flip" of
the rotor's magnetic field, driving it to continue rotating.

In real life, though, DC motors will always have more than two poles (three is a very common
number). In particular, this avoids "dead spots" in the commutator. You can imagine how with our
example two-pole motor, if the rotor is exactly at the middle of its rotation (perfectly aligned with the
field magnets), it will get "stuck" there. Meanwhile, with a two-pole motor, there is a moment where the
commutator shorts out the power supply (i.e., both brushes touch both commutator contacts
simultaneously). This would be bad for the power supply, waste energy, and damage motor components
as well. Yet another disadvantage of such a simple motor is that it would exhibit a high amount of torque
"ripple" (the amount of torque it could produce is cyclic with the position of the rotor).

D.C. Motors with field coils are classified as series. Shunt, compound and separately
excited according to how the field windings and armature windings are connected. With the
series wound motor, the armature and fields coils are in series. Such a motor exerts the highest
starting torque and has the greatest no-load speed. With light loads there is a danger that a series
wound motor might run at too high a speed. Reversing the polarity of the supply to the coils has
no effect on the direction of rotation of the motor, it will continue rotating in the same direction
since both the field and armature currents have been reversed.
With the shunt wound, motor the armature and field coils are in parallel. it provides the
lowest starting torque, a much lower no- load speed and has good speed regulation. Because of
this almost constant speed regardless of load, shunt wound motors are very widely used to
reverse the direction of rotation, either the armature or field supplied must be reversed. For this
reason, the separately excited windings are preferable for such a situation.


Department of mechanical engineering 39
AUTOMATIC RAINWATER SENSING ROOF

The compound motor has two field windings, one in series with the armature and one in
parallel. Compound wound motors aim to get the best features of the series and shunt wound
motors, namely a high starting torque and good speed regulation. The separately excited motor
has separate control of the armature and field currents and can be considered a special case of the
shunt wound motor. The torque-speed characteristics of the above motors and the speed of such
D.C. Motors can be changed by either changing the armature current or the field current.
Generally, the armature current is varied.
The choice of motor will depend on its application. For example, with a robot,
manipulator, and the robot wrist might use a series woundseries-wound motor because the speed
decreases as the load increases.
Aa shunt wound motor would be used where a constant speed was required, regardless of
the load. The speed of a permanent magnet motor depends on the current through the armature
coil. With a field coil motor, either varying the armature current or the field current can change
the speed; generally, it is the armature current that is varied. Thus, speed control can be obtained
by controlling the voltage applied to the armature. However, because fixed voltage supplies are
often used, an electronic circuit obtains a variable voltage.
With an alternating current supply, the thyristorthruster circuit can be used to control the
average voltage applied to the armature. However, we are often concerned with the control of
D.C. Motors by means of control signals emanating from microprocessors. In such cases, the
technique known as pulse width modulation (PWM) is generally used. This involves taking a
constant D.C. supply voltage and chopping it so that the average value is varied.


Department of mechanical engineering 40
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 11
‘H’ - BRIDGE
Introduction

Whenever a robotics hobbyist talktalks about making a robot, the first thing comes to his mind is
making the robot move on the ground. In addition, there are always two options in front of the designer
whether to use a or a stepper motor. When it comes to speed, weight, size, and cost... DC motors are
always preferred over stepper motors. There are many things, which we can do with DC motor when
interfaced with a micro controller. For example, we can control the speed of motor, we can control the
direction of rotation, and we can do encoding of the rotation made by DC motor i.e. keeping track of how
many turns the motors etc. make. Therefore, we can see DC motors are better than stepper motors.

In this part of tutorial, we will learn to interface a DC motor with a micro controller. Usually H-
bridge is preferred way of interfacing a DC motor. These days many IC manufacturers have H-bridge
motor drivers available in the market as if L293D is most used H-Bridge driver IC. H-bridge can also be
made with the help of transistors and MOSFET’s etc. rather of being cheap, they only increase the size of
the design board, which is sometimes not required so using a small 16 pin IC is preferred for this purpose.
L293D is having two ‘H’ Bridges inside, so that we can drive two DC motors simultaneously. Before
discussing about this device, first we must learn basic theory of ‘H’ Bridges. The following is the
description.

Basic Theory

Fig 11.1 Circuit


Department of mechanical engineering 41
AUTOMATIC RAINWATER SENSING ROOF

Let us start with the name, H-bridge. Sometimes called a "full bridge" the H-bridge is so named
because it has four switching elements at the "corners" of the H and the motor forms the cross bar. The
basic bridge is shown in the figure above. The key fact to note is that there are, in theory, four switching
elements within the bridge. These four elements are often called, high side left, high side right, low side
right, and low side left (when traversing in clockwise order).

The switches either are turned on in pairs, high left and lower right, or lower left and high right,
but never both switches on the same "side" of the bridge. If both switches on one side of a bridge are
turned on it creates a short circuit between the battery plus and battery minus terminals. If the bridge is
sufficiently powerful it will absorb that load and your batteries will simply drain quickly. Usually however
the switches in question melt.

To power the motor, turn on two switches that are diagonally opposed. The current flows and the
motor begin to turn in a "positive" direction. Switch off these two switches and switch on other two
switches diagonally in other direction then the motor starts rotating in opposite direction. Actually it is
quite simple, the tricky part comes in when we decide what to use for switches. Anything that can carry a
current will work, from four SPST switches, one DPDT switch, relays, transistors, to enhancement mode
power MOSFET’s.

One more topic in the basic theory section is quadrants. If each switch can be controlled
independently then we can do some interesting things with the bridge, some folks call such a bridge a
"four quadrant device" (4QD). If we built it out of a single DPDT relay, we can really only control
forward or reverse. We can build a small truth table that tells us for each of the switch's states, what the
bridge will do. As each switch has one of two states, and there are four switches, there are 16 possible
states. However, since any state that turns both switches on one side on is "bad", there are in fact only four
useful states (the four quadrants) where the transistors are turned on.


Department of mechanical engineering 42
AUTOMATIC RAINWATER SENSING ROOF

High Side Left High Side Right Low Side Left Low Side Right Quadrant Description

On Off Off On Forward Running

Off On On Off Backward Running

On On Off Off Braking

Off Off On On Braking

Table 11.1 Circuit Description

In the above table the last two rows describesdescribe condition about short circuit the motor that
causes the motors generator effect to work against it. The turning motor generates a voltage, which tries to
force the motor to turn the opposite direction. This causes the motor to rapidly stop spinning and is called
"braking" on many H-bridge designs. Of course, there is also the state where all the transistors are turned
off. In this case, the motor coasts freely if it was spinning and does nothing if it was doing nothing.

1. Using Relays:

A simple implementation of a H Bridge using four SPST relays is shown. Terminal A is High Side
Left, Terminal B is High Side Right, Terminal C is Low Side Left and Terminal D is Low Side Right. The
logic followed is according to the table above.

Warning: Never turn on A and C or B and D at the same time. This will lead to a short circuit of the
battery and will lead to failure of the relays due to the large current.


Department of mechanical engineering 43
AUTOMATIC RAINWATER SENSING ROOF

Fig 11.2 Relay Circuit

2. Using Transistors:
We can better control our motor by using transistors or Field Effect Transistors (FET’s). Most of
what we have discussed about the relays H-Bridge is true of these circuits. See the diagram showing how
they are connected. We should add diodes across the transistors to catch the back voltage that is generated
by the motor's coil when the power is switched on and off. This fly back voltage can be many times higher
than the supply voltage. Do not turn on A and C or B and D at the same time.

Fig 11.3 Transistors


Department of mechanical engineering 44
AUTOMATIC RAINWATER SENSING ROOF

Transistors, being a semiconductor device, will have some resistance, which causes them to get hot
when conducting much current. This is called not being able to sink or source very much power, i.e.: Not
able to provide much current from ground or from plus voltage.

MOSFET’s are much more efficient, they can provide much more current and not get as hot. They
usually have the fly back diodes built in so we do not need the diodes anymore. This helps guard against
fly back voltage frying our ICs. To use MOSFET’s in an H-Bridge, we need P-Channel MOSFET’s on top
because they can "source" power and N-Channel MOSFET’s on the bottom because they can "sink"
power. It is important that the four quadrants of the H-Bridge circuits be turned on and off properly. When
there is a path between the positive and groundside of the H-Bridge, other than through the motor, a
condition exists called "shoot through". This is a direct short of the power supply and can cause
semiconductors to become ballistic, in circuits with large currents flowing. There are H-bridge chips
available that are much easier, and safer, to use than designing our own H-Bridge circuit.

L293D Dual H-Bridge Motor Driver

L293D is a dual H-Bridge motor driver, so with one IC we can interface two DC motors, which
can be controlled in both clockwise and counter clockwise directions. Since the device is having four half
‘H’ Bridges, thereby if required four motors can be driven through this single device, moreover the task is
to run all four motors in one direction only. L293D has output current of 600mA and peak output current
of 1.2A per channel. Moreover, for protection of circuit from back EMF output diodes are included within
the IC. The output supply (VCC2) has a wide range from 4.5V to 36V, which has made L293D a best
choice .

In this IC there are two different power supplies (Vcc1 and Vcc2). Vcc1 is for logic input circuit
while Vcc2 is supply for the output circuit. This means that we should apply about 5V to Vcc1 and
whatever voltage required by the motor (up to 36V max for this IC) to Vcc2. Each Half H-Bridge has an
individual Ground. Therefore, we must ground the terminal corresponding to the Half H-Bridge,
depending up on the circuit design, if required all four terminals of bridges can be connected to the
ground.
Each Half H-Bridge has an Input (A) and output (Y). In addition, there are enable pins to turn on
the Half H-Bridges. Once a Half H-bridge is enabled, then the truth table is as follows:

Department of mechanical engineering 45
AUTOMATIC RAINWATER SENSING ROOF

INPUT OUTPUT
A Y

L L

H H

Table 11.2 Half H-Bridge

So we just give a High level when we want to turn the Half H-Bridge on and Low level when we
want to turn it off. When the Half H-Bridge is on, the voltage at the output is equal to Vcc2.If we want to
make a Full H-Bridge, we must connect the motor (or the load) between the outputs of two Half H-
Bridges and the inputs will be the two inputs of the Half H-Bridges.

Suppose we have connected Half H-Bridges 1 and 2 to form a Full H-Bridge. Now the truth table
is as follows:

OUTPU
INPUT INPUT OUTPUT
T Description
1A 2A 2Y
1Y

Braking (both terminals of motor are


L L L L
Gnd)

L H L H Forward Running

H L H L Backward Running

Braking (both terminals of motor at


H H H H
Vcc2)


Department of mechanical engineering 46
AUTOMATIC RAINWATER SENSING ROOF

Table 11.3 Half H-Bridge to form a Full H-Bridge

CHAPTER 12
ADDITIONAL PARTS
BALL BEARING SET

Fig 12.1 Ball Bearing Set Fig 12.2 Deep grove ball bearing
A ball bearing is a type of rolling-element bearing that serves three main functions while
it facilitates motion: it carries loads, reduces friction and positions moving machine parts.
Ball bearings use balls to separate two “races,” or bearing rings, to reduce surface contact and
friction across moving planes.

LEAD SCREW AND COPPER NUT

Fig 12.3 Lead Screw and Copper Nut


Department of mechanical engineering 47
AUTOMATIC RAINWATER SENSING ROOF

Lead screw is a power transmission linkage used in modern machines. It can generate very
high forces with a small moment, thus providing a large mechanical advantage. It can be thought of as
a wedge wrapped around a cylindrical rod.


Department of mechanical engineering 48
AUTOMATIC RAINWATER SENSING ROOF

CLAMPS

Fig 12.4 Clamps


Clamps are used to fix various members like support plates, base & other members.

SUPPORT PLATES & SCREW-NUT

Fig 12.5 Support Plates and Screw-Nut


Support Plates are used support on two sides of the roof one side it supports the motor &
lead screw and rest of support is end of the lead screw and bearing, Plates in vertical position.
A nut is a mechanical fastener with a threaded hole. It is attached to a bolt, screw or stud to
provide a clamping force and prevent axial movement. For example, a bolt is inserted through two parts,
with aligned holes, and a nut is then screwed onto the bolt


Department of mechanical engineering 49
AUTOMATIC RAINWATER SENSING ROOF

ROOF COVER

Fig 12.6 Roof Cover


A retractable roof structure is a type of structure in which a part of or the entire roof
structure can be moved or retracted within a short period so that the building can be used either
in an open state or in a closed state of the roof.


Department of mechanical engineering 50
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 13
SOURCE CODE
CODE

#include <LiquidCrystal.h>

#include<SoftwareSerial.h>

LiquidCrystal lcd(8,9,10,11,12,13);

#define m11 7

#define m12 6

int sensor1 = A0;

int sen1 = 0;

void forward()

digitalWrite(m11, HIGH);

digitalWrite(m12, LOW);

void backward()


Department of mechanical engineering 51
AUTOMATIC RAINWATER SENSING ROOF

digitalWrite(m11, LOW);

digitalWrite(m12, HIGH);

void Stop()

digitalWrite(m11, LOW);

digitalWrite(m12, LOW);

void setup()

lcd.begin(16,2);

Serial.begin(9600);

pinMode(m11, OUTPUT);

pinMode(m12, OUTPUT);

pinMode(sensor1, INPUT);

lcd.begin(16,2);

lcd.print("autoamtic roof");

lcd.setCursor(0,1);

Department of mechanical engineering 52
AUTOMATIC RAINWATER SENSING ROOF

lcd.print(" covering System ");

delay(2000);

lcd.clear();

sen1 = analogRead(A0);

Serial.println(sen1);

delay(100);

lcd.clear();

lcd.print("autoamtic roof");

lcd.setCursor(0,1);

lcd.print(" covering System ");

delay(2000);

if(sen1 < 800)

lcd.clear();

lcd.print("rain is detected");

lcd.setCursor(0,1);

lcd.print(" covering roof ");

Serial.println("rain is detected covering roof ");s

forward();

delay(20000);

Stop();

else

Department of mechanical engineering 53
AUTOMATIC RAINWATER SENSING ROOF

lcd.clear();

lcd.print("rain not detected");

lcd.setCursor(0,1);

lcd.print("uncovering roof ");

Serial.println("rain not detected uncovering roof ");

backward();

delay(20000);

Stop();

void loop()


Department of mechanical engineering 54
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 14

WORKING PRINCIPLE
Working principle

The working of the model is very simple. The supply is given through the power jack.
From the Arduino we take 5v supply and connect it to one of the terminalterminals of photo
resistor and other end is connected to a resistor of 10k, which acts as a voltage divider and then
final connected to ground. The output is given by output pin 13 of the Arduino, which is
connected to the led through a 220-ohm resistor. The other end of LED is perfectly grounded.

The LDR senses the amount of light in the atmosphere at that moment of time and
accordingly sends the data is to Arduino . The Arduino converts the data received into various
discrete levels .levels.

For example from 0 to 1023 discrete levels for a given data then 0 represents maximum
darkness and 1023 represents maximum brightest so light is received is converted into one of the
discrete value from 0 to 1023.Now depending upon the discrete value that we get (0 to 1023) we
adjust the output voltage accordingly from 0 to 5v.So, when complete darkness (night time) that
is discrete level 0 than the output is 5v as a result LED is brightest or when partially dark
(dawn/evening) that is discrete level of 512 then the output is 2.5 v as a result LED is half of the
maximum brightest or when completely bright that is discrete level 1023 then the output voltage
is 0v as a result LED switched off.

Thus, the LED not only just automatically switches on and off but also adjusts the
amount of light emitted according to the outside condition. The usage of such kind of application
in the headlights of cars, park lights, streetlights is very useful.


Department of mechanical engineering 55
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 15
CONCLUISION
CONCLUSION
In this projectaper our proposed scheme was automatic roofing system for open shop,
street vegetable sellers etc. which it provides an automatic roof for the different applications
when the rain detects the rain sensor send the information sensor is ‘ON’, it will give intimation
to the controller it will indicate to the DC motor and it will automatically open the roof. In this
project, the roof is open automatically.This Arduino based project will provide a competent
method for lighting systems and make the whole process of energy saving easier and efficient.
With a capability to change the amount of light emitted depending upon the outside condition is
no doubt an innovation with many future applications apart from the fact that it can also be used
in many present day tech such as headlights, streetlight, park lights, industrial lights and many
more. The usage of the smart lighting system will undoubtedly change the world that we see
today.


Department of mechanical engineering 56
AUTOMATIC RAINWATER SENSING ROOF

CHAPTER 16
REFERENCES
[1] . D. A. Devi and A. Kumar, Design and Implementation of CPLD based Solar Power
Saving System for Street Lights and Automatic Traffic Controller, International Journal of
Scientific and Research Publications, [2]. J. Mohlnikova, Electric Energy Savings and Light
Guides, Energy& Environment, 3 rdrd. IASME/WSEAS International Conference on,
Cambridge, UK, February 2008, pp.470-474.

[23]. A.A.Nippun KumaarKumar, Kiran.G, Sudarshan TSB,” Intelligent Lighting


System Using Wireless Sensor Networks”, International Journal of Ad hoc, Sensor & Ubiquitous
Computing (IJASUC) Vol.1, No.4, December 2010, pp 17-27

[34]. Y. K. Tan; T. P. Huynh; Z. Wang,” Smart Personal Sensor Network Control for
Energy Saving in DC Grid Powered LED Lighting System”, IEEE Trans. Smart Grid

[4] Google for downloading pictures and also for web searching for document support.

[5] Electronic media like Wikipedia, Quora, YouTube, yahoo. [5]. Mustafa Saad,
Abdalhalim Farij, Ahamed Salah and Abdalroof Abdaljalil “Automatic Street Light Control
System Using Microcontroller” Department of Control Engineering College of Electronic
Technology/ Baniwalid Baniwalid- Libya, Mathematical Methods and Optimization Techniques
in Engineering


Department of mechanical engineering 57

You might also like