Professional Documents
Culture Documents
Project Report Demo1
Project Report Demo1
Project report
on
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
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.
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.
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
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
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.
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.
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.
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.
• Multi-rate operation;
Application Software
Operating
System
H/
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.
Some of the most common embedded systems used in everyday life are,
(e.g., thermostats)
Department of mechanical engineering 6
AUTOMATIC RAINWATER SENSING ROOF
Embedded networks
Signal processing: Often use DSP chips for vision, audio, or otheranother signal
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
4. Mobile devices
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
In this type of an embedded system, a specific work has to be complete in a particular period.
Department of mechanical engineering 8
AUTOMATIC RAINWATER SENSING ROOF
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: -
Mobile devices such as Mobile phone, Personal digital assistants, smart phones etc. are special
category of embedded systems
Block Diagram
LCD
Power
supply
CPU
Roof
motor
CHAPTER 04
HARDWARE DESCRIPTION
Arduino
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
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
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).
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).
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.
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.
In case you use Arduino Nano, you will need an A to Mini-B cable instead as shown in the
following image.
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
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.
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.
Department of mechanical engineering 18
AUTOMATIC RAINWATER SENSING ROOF
Department of mechanical engineering 19
AUTOMATIC RAINWATER SENSING ROOF
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.
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.
Here, we have selected Arduino Uno board according to our tutorial, but you must select the
name matching the board that you are using.
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.
Department of mechanical engineering 22
AUTOMATIC RAINWATER SENSING ROOF
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.
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
Department of mechanical engineering 24
AUTOMATIC RAINWATER SENSING ROOF
Void setup ( ) {}
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:
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
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
Filter
Regulator
This is a simple DC regulated supply project using 7805 voltage regulator to obtain a
variable DC voltage range from 5V to 15V
1. Unregulated voltage in
2. Ground
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.
Semiconductor
Wavelength Colour VF @ 20mA
Material
GaP
550-570nm Green 3.5v
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.
Department of mechanical engineering 30
AUTOMATIC RAINWATER SENSING ROOF
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.
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
Microcontroller
P
O
R
T
P
I
N
S
Department of mechanical engineering 32
AUTOMATIC RAINWATER SENSING ROOF
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
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.
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.
Department of mechanical engineering 35
AUTOMATIC RAINWATER SENSING ROOF
Applications
The applications of rain sensor include the following.
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.
Department of mechanical engineering 37
AUTOMATIC RAINWATER SENSING ROOF
Principles of operation
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
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
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
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
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.
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 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
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
L H L H Forward Running
H L H L Backward Running
Department of mechanical engineering 46
AUTOMATIC RAINWATER SENSING ROOF
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.
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
Department of mechanical engineering 49
AUTOMATIC RAINWATER SENSING ROOF
ROOF COVER
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 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
delay(2000);
lcd.clear();
sen1 = analogRead(A0);
Serial.println(sen1);
delay(100);
lcd.clear();
lcd.print("autoamtic roof");
lcd.setCursor(0,1);
delay(2000);
lcd.clear();
lcd.print("rain is detected");
lcd.setCursor(0,1);
forward();
delay(20000);
Stop();
else
Department of mechanical engineering 53
AUTOMATIC RAINWATER SENSING ROOF
lcd.clear();
lcd.setCursor(0,1);
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.
[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