Vous êtes sur la page 1sur 78

GREENHOUSE MONITORING SYSTEM

CHAPTER 1

INTRODUCTION

We live in a world where everything can be controlled and


DOEACC CENTRE 1

GREENHOUSE MONITORING SYSTEM


operated automatically, but there are still a few important sectors in our country where automation has not been adopted or not been put to a fully fledged use, perhaps because of several reasons one such reason is cost. One such field is that of agriculture. Agriculture has been one of the primary occupations of man since early civilizations and even today manual interventions in farming are inevitable. Greenhouses form an important part of the agriculture and horticulture sectors in our country as they can be used to grow plants under controlled climatic conditions for optimum produce. Automating a greenhouse envisages monitoring and controlling of the climatic parameters which directly or indirectly govern the plant growth and hence their produce. Automation is process control of industrial machinery and processes, thereby replacing human operators.

CURRENT SCENARIO
Greenhouses in India are being deployed in the high altitude regions where the sub-zero temperature up to - !" # ma$es any $ind of plantation almost impossible and in arid regions where conditions for plant growth are hostile. %he e&isting set-ups primarily are'

MANUAL SETUP:
%his set-up involves visual inspection of the plant growth, manual irrigation of plants, turning O( and O)) the temperature controllers, manual spraying of the fertilizers and pesticides. It is time consuming, vulnerable to human error and hence less accurate and unreliable.

PARTIALLY AUTOMATED SETUP'


%his set-up is a combination of manual supervision and partial automation and is similar to manual set-up in most respects but it reduces the labour involved in terms of irrigating the set-up.

FULLY AUTOMATED:
%his is a sophisticated set-up which is well e*uipped to react to most of the climatic changes occurring inside the greenhouse. It wor$s on a feedbac$ system which helps it to respond to the e&ternal stimuli efficiently. Although this set-up
DOEACC CENTRE 2

GREENHOUSE MONITORING SYSTEM


overcomes the problems caused due to human errors it is not completely automated and e&pensive.

PROPOSED MODEL FOR AUTOMATION OF GREENHOUSE


%he proposed system is an embedded system which will closely monitor and control the microclimatic parameters of a greenhouse on a regular basis round the cloc$ for cultivation of crops or specific plant species which could ma&imize their production over the whole crop growth season and to eliminate the difficulties involved in the system by reducing human intervention to the best possible e&tent. %he system comprises of sensors, microcontroller and li*uid crystal display. When any of the above mentioned climatic parameters cross a safety threshold which has to be maintained to protect the crops, the sensors sense the change and the microcontroller reads this from the data at its input ports after being converted internally to a digital form by the internal A+# of the microcontroller. %he microcontroller then performs the needed actions by employing relays until the strayed out parameter has been brought bac$ to its optimum level. ,ince a microcontroller is used as the heart of the system, it ma$es the setup low cost and effective never the less. As the system also employs a -#+ display for continuously alerting the user about the condition inside the greenhouse, the entire setup becomes user friendly. %hus, this system eliminates the drawbac$s of the e&isting setups mentioned in the previous section and is designed as an easy to maintain, fle&ible and low cost solution.

DOEACC CENTRE 3

GREENHOUSE MONITORING SYSTEM

CHAPTER 2

BLOCK DIAGRAM

DOEACC CENTRE 4

GREENHOUSE MONITORING SYSTEM


)ig. shows bloc$ diagram of our pro.ect /greenhouse monitoring and control system0. %his pro.ect consists of following bloc$s' ,ensors. a1 %emperature sensor. b1 -ight sensor. c1 2umidity sensor. d1 3oisture sensor. 3icrocontroller unit. ,ignal conditioning circuit. 45&6 -#+ display. +river circuit 78elays1 a1 %emperature relay. b1 2umidity relay. c1 -ight relay. d1 ,oil moisture relay 9eyboard :ower supply.

CHAPTER 3 BLOCK DIAGRAM DESCRIPTION

DOEACC CENTRE 5

GREENHOUSE MONITORING SYSTEM

Sensors
,ensor are basically use to convert physical *uantity in electrical form there are different sensor are available for various physical *uantity. In our pro.ect we control four parameters they are %emperature, light, humidity, moisture .)or this four parameters we use four different sensors.

a Te!"era#$re sensor%
We are going to use -3;< for measuring temperature as it gives output in analog form and re*uire critical signal conditioning. (ational semiconductor=s -3;< I# has been used for sensing the temperature. It is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature 7in "#1. %he temperature can be measured more accurately with it than using a thermistor. %he operating circuit is shown in figure. %he output voltage of -3;< is converted to temperature in "#.

%emp.7"#1 > 7 ?4!!1@4 "#

)igure' %emperature sensor circuit

& H$!'('#) sensor


We are going to use type (2- humidity sensor use in air conditioner system this sensor since surrounding relative humidity and convert it in mille volt.

DOEACC CENTRE 6

GREENHOUSE MONITORING SYSTEM

)igure' 2umidity sensor circuit

* L'+,# sensor%
3ost common way to convert light intensity in to electrical form is -+8 7-ight dependent resistor1. %his special resistor gives change in resistance with respect to change in light. %his -+8 can be used in combination with variable resistance to ma$e a voltage divider circuit.

( So'- !o's#$re sensor%


%o sense moisture in soil, carbon material rod can give change in continuity with respect to water. %his is further connected to logic gates so when moisture is full water pump is off.

A#!e+a. /M'*ro*on#ro--er

DOEACC CENTRE 7

GREENHOUSE MONITORING SYSTEM

)igure' :in out of AtmegaA We have chosen this microcontroller because of its following features 2igh-performance, -ow-power AB8CA-bit 3icrocontroller Advanced 8I,# Architecture :owerful Instructions D 3ost ,ingle-cloc$ #ycle E&ecution ;6 & A General :urpose Wor$ing 8egisters )ully ,tatic Operation Fp to 45 3I:, %hroughput at 45 32z On-chip 6-cycle 3ultiplier A9 Gytes of In-,ystem ,elf-programmable )lash program memory <46 Gytes EE:8O3 49 Gyte Internal ,8A3 Write@Erase #ycles' 4!,!!! )lash@4!!,!!! EE:8O3 +ata retention' 6! years at A<"#@4!! years at 6<"# Optional Goot #ode ,ection with Independent -oc$ Gits In-,ystem :rogramming by On-chip Goot :rogram %rue 8ead-While-Write Operation :rogramming -oc$ for ,oftware ,ecurity

H'+, En($ran*e Non01o-a#'-e Me!or) se+!en#s

Per'",era- Fea#$res
%wo A-bit %imer@#ounters with ,eparate :rescaler, one #ompare 3ode One 45-bit %imer@#ounter with ,eparate :rescaler, #ompare 3ode, and #apture
DOEACC CENTRE 8

GREENHOUSE MONITORING SYSTEM


3ode 8eal %ime #ounter with ,eparate Oscillator %hree :W3 #hannels A-channel A+# in %H): and H)(@3-) pac$age Eight #hannels 4!-bit Accuracy 5-channel A+# in :+I: pac$age ,i& #hannels 4!-bit Accuracy

S'+na- *on('#'on'n+ *'r*$'#


%his bloc$ includes signal conditioning circuits for all the sensors.

1232 L'4$'( Cr)s#a- D's"-a) Mo($-e

)igure' -#+ interface

%o show parameter such as temperature, light intensity, humidity, moisture. We use Alpha numeric display instead of I segment -#+ display because on I segment reading and writing alphanumeric such as J,H,W,3 is *uite difficult so we use alphanumeric display which has two column of 45 character each i.e. we can write up to ;6 characters.

Dr'1er *'r*$'#

DOEACC CENTRE 9

GREENHOUSE MONITORING SYSTEM

)igure' +river circuit 8elay is basically a switching device to turn on or turn off particular devices. In our pro.ect we use electromagnetic type induction relay operated at 46v dc the function of this relay is as follows'

a Te!"era#$re re-a)
%his relay turns on or off air conditioning system so that surrounding temp is maintained at that particular temperature.

& H$!'('#) re-a)


%his relay can turn on or off air condition system or fogger so that relative humidity is constant.

* L'+,# re-a)
%his relay can turn on or off surrounding electrical light bulb so that light intensity is constant in room.

( Mo's#$re re-a)
%his unit can turn on or off water pump according to sensing of relative moisture.

Ke)"a(
%here are switches to select the parameter and set the value of parameter.

DOEACC CENTRE 10

GREENHOUSE MONITORING SYSTEM

Po5er s$""-)

)igure' :ower supply )or all I#, we re*uire < v +.#., K46v dc,-46v dc supply which can be generated by step down transformer, full wave bridge rectifier, filter condenser and voltage regulator I#. %wo supply voltages are re*uired for the circuit. A +# or A# 46B mains adapter is connected to bridge rectifier 7+4- + 1 via #( connector. A%megaAis supplied with a regulated <B from a IA!< fi&ed voltage regulator. %he unregulated voltage of appro&imately 46B is re*uired for the relay driving circuit.

DOEACC CENTRE 11

GREENHOUSE MONITORING SYSTEM

CHAPTER6 CIRCUIT 7ORKING AND OPERATION

DOEACC CENTRE 12

GREENHOUSE MONITORING SYSTEM

Greenhouse monitoring system specially made for to control the greenhouse environment. %he circuit has two main functions, monitoring and control. It can measure humidity,temperature,light intensity and soil moisture. %here is a microcontroller A%3EGAA wich constantly monitors all the inputs of the sensors and simultaneously controlles the output. %emperature sensor -3;< gives analog output according to the variation and temperature. %he -+8 is interfaced with the microcontroller according to the levels of light intensity in numeric form. It shows bright, dim or mid. We are using :O% to vary the humidity input signal. %here are two copper probes to be immersed in a soil according to the continuity between the copper probes, it detects the soil moisture. Fsing $eypad we can set the values of the four parameters. According to the set values of the parameters , the output devices are O( and O)). %herefore the environment is controlled for temperature , humidity, soil moisture and light intensity.

DOEACC CENTRE 13

GREENHOUSE MONITORING SYSTEM

CHAPTER 8 SCHEMATIC DIAGRAM

DOEACC CENTRE 14

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 15

GREENHOUSE MONITORING SYSTEM

CHAPTER 2 CIRCUIT DESIGN

PO7ER SUPPLY DESIGN: 0


,ince we re*uire <B regulated supply we are using -3IA!< regulator.

DOEACC CENTRE 16

GREENHOUSE MONITORING SYSTEM

To *a-*$-a#e 1a-$e o9 9'-#er *a"a*'#or:0


)or calculating the filter capacitor we use the following formula # > <i @ Bpf 741 Where, # > value of filter capacitor i > load current f > fre*uency of A# supply Bp > bridge output ,ince we are using -3IA!< the dropout voltage for -3IA!< is 7min. value1 6B And allowing 4!L of ripple we get the value of Bp as D Bp > <K6K!.I > IK!.I Bp > I.IB %he supply is designed such that it provides a load current of 4A. I > 4A %he fre*uency of the A# supply is <!2z substituting these values in e*. no. 741 We get the value of # as # > !.!4; ) Gut this value of # is very large and in such cases we can use two capacitors And connect them in parallel. ,o we choose the two values as #4 > !.4) and #6 > 4!!! ) 2ence # > !.!!4 ) (ow the voltage rating of the capacitor should not be less than
DOEACC CENTRE 17

GREENHOUSE MONITORING SYSTEM


4. ? Brms 761 Where Brms is the secondary voltage of the transformer and it is 46B ,ubstituting the value in e*. 761 We get 45.AB thus we choose #6 as an electrolytic capacitor with voltage rating 45B.

Re*#'9'er Ra#'n+s:41 %he ma&imum average current 7I1 should not be less than ma&imum load #urrent 7I-1. Gut I- > 4A thus we select I > I- > 4A 61 :ea$ inverse voltage rating 7Brms1 should not be less than 6.A ? Brms plus A safety margin upto <!L higher to allow for line transients thus if we %a$e Brrm > 4!!!B we get after solving about <;;.5B.
6!

;1 -et 8s be the source resistance due to transformer winding and let its min. Balue be 8sm > !<M the ma&imum instantaneous surge current is given by 74. Brms D 4.<1 @ 8sm 7;1 4.< is subtracted because of voltage loss in the bridge. %hus I),3 is calculated to be ;!.5A by substituting the values in e*. no. 7;1 %hus for the rectifier we choose diodes I( !!I.

APPLICATIONS:0
41 %his circuit is eminently suitable as an electronic door loc$. 61 %his circuit can be used as the switching section of a burglar alarm. ;1 %his circuit can be used as an ignition bloc$ing device.

CHAPTER : PCB DESIGN


DOEACC CENTRE 18

GREENHOUSE MONITORING SYSTEM

:#G designing is very important part in whole pro.ect. A wrong :#G design may cause electromagnetic interference, noise, or disturbance. As this pro.ect is access control system related so there are strict border of accuracy so any e&ternal interference or faulty design or neglecting rule should not there. :#G designing can be done either manually or on computer. +esigning a :#G using software is recommended practice, because it saves designer time, it improves accuracy to great e&tent, it re*uires less efforts. )or designing we have used #A+,%A8 software, it is widely used :#G designing software. While using #A+,%A8 software designer should ta$e care of following things' 4. #omponent of similar type should be placed in group. 6. #omponent arrangement should be from left to right horizontally N top to bottom vertically. ;. Arrange components in systematic order, referring circuit. . #omponent for internal ad.ustments such as I8 sensor, switches etc. should be arranged near the board edge. <. %a$e care of stray capacitance. 5. 9eep the signal path as short as possible. I. ,upply trac$s 7vcc, gnd1 should have sufficient width. A. Analog and digital circuits on the same :#G should have independent ground networ$. O. %rac$s should not overlap over each other. 4!. %rac$ should have angle of <".

DOEACC CENTRE 19

GREENHOUSE MONITORING SYSTEM

-APOF% )O8 G8EE(2OF,E 3O(I%O8I(G ,P,%E3

DOEACC CENTRE 20

GREENHOUSE MONITORING SYSTEM

:#G +E,IG( )O8 G8EE(2OF,E 3O(I%O8I(G ,P,%E3

DOEACC CENTRE 21

GREENHOUSE MONITORING SYSTEM

,I-9,#8EE( +8AWI(G

DOEACC CENTRE 22

GREENHOUSE MONITORING SYSTEM

,O-+E8 3A,9 +8AWI(G

CHAPTER .
DOEACC CENTRE 23

GREENHOUSE MONITORING SYSTEM

PCB FABRICATION

:%1 Ne+a#'1e +enera#'on :%1%1 Re4$'re!en# 9or ne+a#'1e +enera#'on -ith film, reprographic camera, developer solution, fi&er ,olution, stop bath. :%1%2 Pro*ess o9 ne+a#'1e +enera#'on #lean the upper and lower bed of camera with the cotton cloth. %a$e two trays with 6<!ml water in each of them ta$e third tray and ta$e *uic$ fi&er solution in it. 9eep artwor$ on lower bed of camera on focuses of camera switch of lights chec$ dimensions on upper bed change distance between two beds to set scale. ,witch off flashes of camera cut lith film and put emulsion side facing towards lower side and apply vacuum . E&pose for 45 second. %a$e grams of each of developer A and G in first tray. %a$e 6-; drops of acetic acid in second tray and this will be stop bath. (ow ta$e 6<!ml fi&er. (ow turn off vacuum ta$e out film dip into developer and sha$e tray gently soon you will see result. %ime of developing depends on solution temperature and solution concentration.
DOEACC CENTRE 24

GREENHOUSE MONITORING SYSTEM


8ole of visual inspection is very important for this stage. 8inse film in water and put it in stop bath again rinse film and put it in fi&er for almost <4!min. %his will generate negative from artwor$. %his film is highly sensitive to light so it should be saved from light. +eveloping time should be correct as under developed film causes shorted trac$s and over developed film causes open trac$s. 8insing is necessary after each stapes used in negative generation. )inally generated negative is not sensitive to light it can be preserved for 4-6 years. :%2 GENERATION OF PCB :%2%1 CLEANING #leaning is very important stage as if any impurity remains on board there will be definitely faulty transfer. Generally cleaning is done with washing powder and scrubber and this process of cleaning is $nown as manual cleaning. After cleaning board is $ept into oven. :%2%2 COATING %o ma$e board sensitive to light it is coated with -:84!6! 7li*uid photo resist1. Biscosity of -:8 plays important role in coating to ma$e solution thin thinner can be added. :%2%3 E;POSING In this stage lith film is placed on coated board and e&posed to ultraviolet light for appro&imately min. :%2%6 DE<ELOPING Goard is developed in -:8 developer for 4';! min. after developingQ board is dipped in to dye. :%2%8 ETCHING Etching is chemical process of removing unwanted copper from a developed board. Etching time depends upon solution temperature and solution concentration. After etching -:8 coating and dye is removed by striping solution. :%2%2 CUTTING In this process board is cut to final size. :%2%: DRILLING Goard is drilled with high speed drilling machine for insertion of leads of components.
DOEACC CENTRE 25

GREENHOUSE MONITORING SYSTEM


:%2%. TINNING +rilled board is coated with li*uid flu&, soldering metal is heated to proper temperatureQ and board is dragged from soldering bath gently and cleaned with isopropyl alcohol. %inning process increases solder ability of board, protect copper from corrosion, increases mechanical strength, increases conductivity of board. :%2%= SOLDERING )irstly clean soldering pads insert component lead gently hold soldering iron and metal together, ta$e metal out than iron. 9eep angel of iron between ! -6! .

DOEACC CENTRE 26

GREENHOUSE MONITORING SYSTEM

CHAPTER = SPECIFICATIONS

SR%NO ?1 ?2 ?3 ?6 ?8 ?2 ?: ?. ?= 1? 11 12 13 16 18 12 1: 1. 1= 2?

COMPONENTS 8E,I,%O8 7 49 1 8E,I,%O8 7 4! 9 1 8E,I,%O8 7 5A! ohms1 #A:A#I%O8, 7 66!f, 6<v 1 F-(6!!; Gridge rectifier7 W! G 1 -E+ A% 3EGAA -3 IA!< G# < A 8E-AP 7 46B dc1 ,:+% I.# ,O#9E%74 pin1 I.# ,O#9E%745 pin1 9EP:A+7;&41 -#+745&6 dot matri&1 :#G 7glass epo&y1 #O((E#%O8745 :I(1 #O((E#%O87; :I(1 #O((E#%O876 :I(1 -3;<

RATINGS 7 49 1 7 4! 9 1 7 5A! ohms 1 7 66!f, 6<v 1 F-(6!!; 7W! G1 A%megaA -3IA!< G#< A 46B 4 :I( +I: 45 :I( +I: ;J4matri& 45&6 dot matri& 44!mm&A!mm ,ip ,ip ,ip -3;<

>UANTITY 6 4 4 4 4 4 4 6 6 4 4 4 4 4 5 6 4

DOEACC CENTRE 27

GREENHOUSE MONITORING SYSTEM


21 22 23 26 28 22 -+8 7<mm1 :8E,E% 74!91 :F,2 %O O( ,WI%#2E, A+A:%E8 746B1 A+A:%E8 3A%I(G :A8% :OWE8 O( ,WI%#2 -+8 4!9 46B 4 4 ; 4 4 4

CHAPTER 11 COSTING @ ESTIMATION

DOEACC CENTRE 28

GREENHOUSE MONITORING SYSTEM #osting and estimation is necessary to $now the capability of our product with the e&isting product in the mar$et. METHODOLOGY %here are three steps of costing and estimation those are' In'#'a- es#'!a#'on %his estimation is done before producing the product. It is guide to get rough idea of the product cost. Ha-9 "o#en#'a- "roAe*# !e#,o( %his estimation is done after completing some part of product to chec$ whether estimation is correct or wrong. %he errors produced will be eliminated during this estimation. It also $eeps trac$ with economical feasibility of the manufacturing process. Es#'!a#'on a9#er *o!"-e#'on o9 "ro($*# A prototype is made before actual mass production to get as idea feasibility of the product, hence some modification in circuit or enclosure is possible. ,o as to get the e&act costing and estimation is done after the prototype is made. In costing and estimation the cost compromises of the following elements' 4. +evelopment cost 6. +irect material cost ;. %echnology N production cost . Overheads %he product e&ecution at +OEA## is done at prototype level N not on prototype level N not on the production level, hence we can ta$e only material cost into account. )or estimation it is necessary to generate process routine, process routine is generated because it gives idea to producer about se*uence of operation, so that product can be produced according to process routines. %he process routine contains following information' 4. %he se*uence operations necessary to produce the product. 6. +epartment in which the operation ta$es place. ;. %he machine on which the operation to be completed.
DOEACC CENTRE 29

GREENHOUSE MONITORING SYSTEM . A brief description of operation to be completed. <. %he shop order corresponding to the operation.

SR%NO 1 2 3 6 8 2 : . = 1? 11 12 13 16 18 12 1: 1. 1= 2? 21

COMPONENTS 8E,I,%O8 7 49 1 8E,I,%O8 7 4! 9 1 8E,I,%O8 7 5A! ohms1 #A:A#I%O8, 7 66!f, 6<v 1 F-(6!!; Gridge rectifier7 W! G 1 -E+ A% 3EGAA -3 IA!< G# < A 8E-AP 7 46B dc1 ,:+% I.# ,O#9E%74 pin1 I.# ,O#9E%745 pin1 9EP:A+7;&41 -#+745&6 dot matri&1 :#G 7glass epo&y1 #O((E#%O8745 :I(1 #O((E#%O87; :I(1 #O((E#%O876 :I(1 -3;< -+8 7<mm1

>TY% 6 4 4 4 4 4 4 6 6 4 4 4 4 4 5 6 4 4

RATE 1B0 1B0 1B0 8B0 18B0 1?B0 2B0 18?B0 1?B0 8B0 2?B0 8B0 8B0 2?B0 12?B0 3?B0 2?B0 8B0 6B0 68B0 1?B0

TOTAL 6B0 2B0 1B0 8B0 18B0 1?B0 .B0 18?B0 1?B0 1?B0 .?B0 1?B0 8B0 2?B0 12?B0 3?B0 2?B0 3?B0 .B0 68B0 1?B0

DOEACC CENTRE 30

GREENHOUSE MONITORING SYSTEM


22 23 26 28 22 :8E,E% 74!91 :F,2 %O O( ,WI%#2E, A+A:%E8 746B1 A+A:%E8 3A%I(G :A8% :OWE8 O( ,WI%#2 4 ; 4 4 4 2B0 2B0 8B0 18B0 18?B0 18?B0 2B0 2B0 1?B0 1?B0 TOTAL C Rs% ::?B0

CHAPTER 12 APPLICATIONS AND AD<ANTAGES

DOEACC CENTRE 31

GREENHOUSE MONITORING SYSTEM

A""-'*a#'ons:
%he greenhouse monitoring system can control the greenhouse environment set at particular values. %his product is specially made artificial greenhouses which use air conditioning systems, incandescent bulbs, fogger and drip irrigation. :lants can be grown in controlled for a healthy life.

A(1an#a+es:
:lant grown in controlled environment will be healthy. It is easy to use It can be used for any plant as it can be set to any value of the parameter. -ow cost and user friendly. +ecrease labour cost. ,ave time as there will be no need to chec$ temperature, humidity, light intensity and soil moisture. It is easy for maintenance.

DOEACC CENTRE 32

GREENHOUSE MONITORING SYSTEM

CHAPTER 13 PROGRAMMING DESIGN

Rinclude Savr@io.hT @@Rinclude Sstdio.hT Rinclude Sstring.hT Rinclude SavrUeeprom.hT Rinclude SutilUdelay.hT Rinclude Vlcd.hV Rdefine fogger 4@@:+!

DOEACC CENTRE 33

GREENHOUSE MONITORING SYSTEM


Rdefine lamp Rdefine heater Rdefine pump Rdefine Out:ort 6@@:+4 @@:+6 A@@:+; :O8%+

Rdefine -ampMO))71 7Out:ort N> W74SS:+411 Rdefine -ampMO(71 7Out:ort X> 74SS:+411

Rdefine 2eaterMO))71 7Out:ort N> W74SS:+611 Rdefine 2eaterMO(71 7Out:ort X> 74SS:+611 Rdefine )oggerMO))71 7Out:ort N> W74SS:+!11 Rdefine )oggerMO(71 7Out:ort X> 74SS:+!11 Rdefine :umpMO))71 7Out:ort N> W74SS:+;11 Rdefine :umpMO(71 7Out:ort void ,how3ain3enu71Q void ,et%emp71Q void ,et8h71Q void ,etlight71Q void :umpMonMoff71Q void chec$Malrm71Q unsigned int $u,$$Q uintAMt temp,tempMset,rh,rhMset,pump,pumpMset,temp4,3emYIZQ uintAMt light,lightMset,mystrY ZQ void delayMms7unsigned int de1 [ unsigned int rr,rr4Q for 7rr>!QrrSdeQrrKK1 [ for7rr4>!Qrr4S !!Qrr4KK1 @@;O< [ asm7VnopV1Q X> 74SS:+;11

DOEACC CENTRE 34

GREENHOUSE MONITORING SYSTEM


\ \ \ int readMadc7char ch1 [ A+3FJ A+#,8A > > 7!b!4!!!!!! X ch1Q !&#IQ

while 7]7A+#,8A N 74SSA+I)111Q $u A+#,8A > X> A+#Q 4SS Q

@@$u > 7$p @ 6<<1 ^ 4!!!Q return $uQ \ void Wait71 [ uintAMt iQ for7i>!QiS6!QiKK1 MdelayMloopM67!1Q \ uintAMt :8EBM:I(#>!&))Q ^@ )unction to test the current status of $eys7! to 61 returns ! if (O% pressed 4 if :ressed ^@ uintAMt Get9ey,tatus7uintAMt $ey1 [ return 7]7:I(# N 74SS$ey111Q \ @^

DOEACC CENTRE 35

GREENHOUSE MONITORING SYSTEM


)unction to test the previous status of $eys7! to 61 returns ! if (O% pressed 4 if :ressed ^@ uintAMt Get:rev9ey,tatus7uintAMt $ey1 [ return 7]7:8EBM:I(# N 74SS$ey111Q \ @@-------------------------3ain ,tarts 2ere-----------------------------------------int main7void1 [ MdelayMloopM67!1Q MdelayMloopM67!1Q -#+Init7-,MG-I(9MO))1Q -#+#lear71Q -#+Write,tring7V Green2ouseAutoV1Q -#+Write,tringJP7!,4,V +OEA## #entreV1Q delayMms74!!!1Q delayMms74!!!1Q delayMms74!!!1Q -#+#lear71Q -#+Write,tring7V ,ana ,aher V1Q -#+Write,tringJP7!,4,V 76!!A@+@!I1 V1Q delayMms74!!!1Q -#+#lear71Q -#+Write,tring7V Oshin 9harat V1Q -#+Write,tringJP7!,4,V 76!!A@+@;41 V1Q delayMms74!!!1Q -#+#lear71Q

DOEACC CENTRE 36

GREENHOUSE MONITORING SYSTEM


-#+Write,tring7V Anil 9umar V1Q -#+Write,tringJP7!,4,V 76!!A@+@<I1 V1Q delayMms74!!!1Q @@eepromMreadMbloc$77void^1N,8A3string, 7const void^1N(onBolatile,tring, 4!1Q eepromMreadMbloc$77void^1N3em, 7const void^14, I1Q tempMset rhMset lightMset pumpMset ++8# > !&!!Q @@:O8%#X>774SS:#51X74SS:#<1X74SS:# 11Q ++8+ > !b!!!!4444Q :O8%#X>774SS:#<1X74SS:# 11Q while741 [ uintAMt iQ float $pQ -#+#lear71Q -#+Write,tring7V%' # ,'+ryV1Q L -'+imV1Q > 3emY!ZQ > 3emY4ZQ > 3emY6ZQ > 3emY;ZQ

-#+Write,tringJP7!,4,V82' $p > readMadc7!1Q $$ > $pQ $p > 77$p @ 61 ^ 4!1Q -#+WriteIntJP7;,!,$p,;,41Q if7$$ T tempMset1 2eaterMO))71Q else 2eaterMO(71Q $$ > readMadc741Q

@@ %emp reading @@ )loat value

@@2eater O))

@@2eater O( @@ 82 reading

DOEACC CENTRE 37

GREENHOUSE MONITORING SYSTEM


$p > $$Q $p > 7$p @ 4!6;1 ^ 4!!!Q -#+WriteIntJP7;,4,$p, ,41Q if7$$ T rhMset1 )oggerMO))71Q else )oggerMO(71Q $$ > readMadc761Q $p > $$Q $p > 77$p @ 4!6;1 ^ 4!!1Q $$ > $pQ @@-#+WriteIntJP7;,4,$$,;,!1Q if7$$ S 5!1[ -#+Write,tringJP746,4,VGriV1Q -ampMO))71Q \ else if775! S $$1 NN 7$$ S A!11[ -#+Write,tringJP746,4,V3idV1Q -ampMO))71Q \ @@-ight O)) @@-ight O)) @@ -ight reading @@)ogger O( @@)ogger O))

else if7$$ T O41[ -#+Write,tringJP746,4,V+imV1Q -ampMO(71Q \ if77:I(# N !&!A11[ -#+Write,tringJP746,!,V+ryV1Q :umpMO(71Q \ @@:ump O( @@-ight O(

DOEACC CENTRE 38

GREENHOUSE MONITORING SYSTEM


if7]7:I(# N !&!A11[ -#+Write,tringJP746,!,VWetV1Q :umpMO))71Q \ @@-#+Write,tringJP7!,4,V82' L -'+imV1Q @@8ead adc and update display @@Wait ,ome time and $eep testing $ey input for7i>!QiS6!QiKK1 [ if7Get9ey,tatus7<11 [ @@Go %o 3ain 3enu ,how3ain3enu71Q MdelayMloopM67!1Q MdelayMloopM67!1Q MdelayMloopM67!1Q \ MdelayMloopM67<!!!1Q \ \ \ @@--------------------------------------------------------------------------------------------------@@ void ,how3ain3enu71 [ @@%he 3ain 3enu char ^menuMitemsYZ>[ V,et %empV, V,et 8hV, V,et -ightV, V,et :umpV, @@:ump O))

DOEACC CENTRE 39

GREENHOUSE MONITORING SYSTEM


VHuitV \Q uintAMt menuMcount><Q uintAMt selected>!Q MdelayMloopM67!1Q MdelayMloopM67!1Q while741 [ -#+#lear71Q -#+Write,tring7V 3ain 3enu V1Q -#+Write,tringJP76,4,menuMitemsYselectedZ1Q -#+Write,tringJP7!,4,VSV1Q -#+Write,tringJP74<,4,VTV1Q if7Get9ey,tatus7<11 [ @@-eft 9ey7(o 41 is pressed @@#hec$ that it was not pressed previously if7]Get:rev9ey,tatus7<11 [ if7selected ]>!1 selected--Q \ \ if7Get9ey,tatus7 11 [ @@8ight 9ey7(o !1 is pressed @@#hec$ that it was not pressed previously if7]Get:rev9ey,tatus7 11 [

DOEACC CENTRE 40

GREENHOUSE MONITORING SYSTEM


if7selected ]>7menuMcount-411 selectedKKQ \ \ if7Get9ey,tatus7511 [ @@Enter 9ey :ressed @@#hec$ that it was not pressed previously if7]Get:rev9ey,tatus7511 [ @@#all Appropriate )unction switch 7selected1 [ case !' ,et%emp71Q brea$Q case 4' ,et8h71Q brea$Q

case 6' ,etlight71Q brea$Q case ;' :umpMonMoff71Q brea$Q case ' returnQ@@Huit \

DOEACC CENTRE 41

GREENHOUSE MONITORING SYSTEM


\ \ :8EBM:I(#>:I(#Q MdelayMloopM67<!!!1Q \ \ void ,et%emp71 [ uintAMt sel>!Q while741 [ -#+#lear71Q -#+Write,tring7V!! +O(E +#elV1Q @@ no float value

-#+WriteIntJP7!,!,tempMset,6,!1Q @@+raw :ointer -#+Write,tringJP7sel^;,4,V__V1Q @@Input Fp $ey if7Get9ey,tatus7<11 [ if7]Get:rev9ey,tatus7<11 [ if7sel>>!1 [ @@temperature set if7tempMset>>OO1 [ tempMset>4Q \ else

DOEACC CENTRE 42

GREENHOUSE MONITORING SYSTEM


[ tempMsetKKQ \ \ if7sel >> 41 [ @@O9 brea$Q \ \ \ @@Input +own if7Get9ey,tatus7 11 [ if7]Get:rev9ey,tatus7 11 [ if7sel>>!1 [ @@%emp set if7tempMset>>41 [ tempMset>OOQ \ else [ tempMset--Q \ \ if7sel >> 41

DOEACC CENTRE 43

GREENHOUSE MONITORING SYSTEM


[ @@O9 brea$Q \ \ \ if7Get9ey,tatus7511 [ if7]Get:rev9ey,tatus7511 [ @@#hange ,election if7sel>>41 sel>!Q else selKKQ \ \ :8EBM:I(#>:I(#Q MdelayMloopM67;!!!!1Q \ @@-------------------EE:8O3------------------------------3emY!Z 3emY4Z 3emY6Z > > > tempMsetQ rhMsetQ lightMsetQ

eepromMwriteMbloc$ 77const void^1N3em, 7void ^14, I1Q @@--------------------------------------------------------#+#lear71Q -#+Write,tring7V3essage ]V1Q -#+Write,tringJP7!,4,V(ew %emp ,etV1Q

DOEACC CENTRE 44

GREENHOUSE MONITORING SYSTEM


uintAMt iQ for7i>!QiS4!QiKK1 MdelayMloopM67!1Q \ @@--------------------------------------O( %I3E-----------------------------------------------------------void ,et8h71 [ uintAMt sel>!Q @@ read time from EE:8O3 while741 [ -#+#lear71Q -#+Write,tring7V!! +O(E 82V1Q @@ no float value

-#+WriteIntJP7!,!,rhMset,6,!1Q @@+raw :ointer -#+Write,tringJP7sel^;,4,V__V1Q @@Input Fp $ey if7Get9ey,tatus7<11 [ if7]Get:rev9ey,tatus7<11 [ if7sel>>!1 [ @@2our if7rhMset>>OO1 [ rhMset>4Q \ else

DOEACC CENTRE 45

GREENHOUSE MONITORING SYSTEM


[ rhMsetKKQ \ \ if7sel >> 41 [ @@O9 brea$Q \ \ \ @@Input +own if7Get9ey,tatus7 11 [ if7]Get:rev9ey,tatus7 11 [ if7sel>>!1 [ @@2our if7rhMset>>41 [ rhMset>OOQ \ else [ rhMset--Q \ \ if7sel >> 41

DOEACC CENTRE 46

GREENHOUSE MONITORING SYSTEM


[ @@O9 brea$Q \ \ \ if7Get9ey,tatus7511 [ if7]Get:rev9ey,tatus7511 [ @@#hange ,election if7sel>>41 sel>!Q else selKKQ \ \ :8EBM:I(#>:I(#Q MdelayMloopM67;!!!!1Q \ @@-------------------EE:8O3------------------------------3emY!Z 3emY4Z 3emY6Z > > > tempMsetQ rhMsetQ lightMsetQ

eepromMwriteMbloc$ 77const void^1N3em, 7void ^14, I1Q @@--------------------------------------------------------#+#lear71Q -#+Write,tring7V 3essage ]V1Q -#+Write,tringJP7!,4,V(ew 82 ,etV1Q

DOEACC CENTRE 47

GREENHOUSE MONITORING SYSTEM

uintAMt iQ for7i>!QiS4!QiKK1 MdelayMloopM67!1Q \ @@--------------------------------------- O)) %I3E--------------------------------------------void ,etlight71 [ uintAMt sel>!Q @@ read from EE:8O3 while741 [ -#+#lear71Q -#+Write,tring7V!! +O(E -ightV1Q -#+WriteIntJP7!,!,lightMset,6,!1Q @@+raw :ointer -#+Write,tringJP7sel^;,4,V__V1Q @@Input Fp $ey if7Get9ey,tatus7<11 [ if7]Get:rev9ey,tatus7<11 [ if7sel>>!1 [ @@light set if7lightMset>>OO1 [ lightMset>4Q \ @@no float value

DOEACC CENTRE 48

GREENHOUSE MONITORING SYSTEM


else [ lightMsetKKQ \ \ if7sel >> 41 [ @@O9 brea$Q \ \ \ @@Input +own if7Get9ey,tatus7 11 [ if7]Get:rev9ey,tatus7 11 [ if7sel>>!1 [ if(light_set==1) [ lightMset>OOQ \ else [ lightMset--Q \ \ if7sel >> 41

DOEACC CENTRE 49

GREENHOUSE MONITORING SYSTEM


[ brea$Q \ \ \

if7Get9ey,tatus7511 [ if7]Get:rev9ey,tatus7511 [ @@#hange ,election if7sel>>41 sel>!Q else selKKQ \ \ :8EBM:I(#>:I(#Q MdelayMloopM67;!!!!1Q \ @@(ow save time to EE:8O3-----------------------------------------------------------------3emY!Z 3emY4Z 3emY6Z > > > tempMsetQ rhMsetQ lightMsetQ

eepromMwriteMbloc$ 77const void^1N3em, 7void ^14, I1Q @@-----------------------------------------------------------------------------------------

-#+#lear71Q -#+Write,tring7V 3essage ]V1Q

DOEACC CENTRE 50

GREENHOUSE MONITORING SYSTEM


-#+Write,tringJP7!,4,V(ew -ight ,etV1Q uintAMt iQ for7i>!QiS4!QiKK1 MdelayMloopM67!1Q \ @@------------------------------------------------alram on and off-----------------void :umpMonMoff71 [ uintAMt sel>!Q @@ read from EE:8O3 while741 [ -#+#lear71Q -#+Write,tring7V--- +O(EV1Q -#+WriteIntJP7!,!,pumpMset,6,!1Q if7pumpMset1 [ -#+Write,tringJP7!,!,VA#%V1Q \ else [ -#+Write,tringJP7!,!,V+E#V1Q \ -#+Write,tringJP7sel^5,4,V__V1Q if7Get9ey,tatus7<11 [ if7]Get:rev9ey,tatus7<11 [ if7sel>>!1 @@ no float value

DOEACC CENTRE 51

GREENHOUSE MONITORING SYSTEM


[ if7pumpMset>>!1 [ pumpMset>4Q \ else [ pumpMset>!Q \ \ if7sel >> 41 [ brea$Q \ \ \ if7Get9ey,tatus7 11 [ if7]Get:rev9ey,tatus7 11 [ if7sel>>!1 [ if7pumpMset>>!1 [ pumpMset>4Q \ else [ pumpMset>!Q

DOEACC CENTRE 52

GREENHOUSE MONITORING SYSTEM


\ \ if7sel >> 41 [ brea$Q \ \ \

if7Get9ey,tatus7511 [ if7]Get:rev9ey,tatus7511 [ if7sel>>41 sel>!Q else selKKQ \ \ :8EBM:I(#>:I(#Q MdelayMloopM67;!!!!1Q \ @@-------------------EE:8O3------------------------------3emY!Z 3emY4Z 3emY6Z 3emY;Z > > > > tempMsetQ rhMsetQ lightMsetQ pumpMsetQ

eepromMwriteMbloc$ 77const void^1N3em, 7void ^14, I1Q @@--------------------------------------------------------

DOEACC CENTRE 53

GREENHOUSE MONITORING SYSTEM


-#+#lear71Q -#+Write,tring7V 3essage ]V1Q -#+Write,tringJP7!,4,V:ump ,etV1Q uintAMt iQ for7i>!QiS4!QiKK1 MdelayMloopM67!1Q
\

CHAPTER 16 DATASHEETS

DOEACC CENTRE 54

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 55

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 56

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 57

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 58

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 59

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 60

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 61

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 62

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 63

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 64

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 65

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 66

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 67

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 68

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 69

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 70

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 71

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 72

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 73

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 74

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 75

GREENHOUSE MONITORING SYSTEM

DOEACC CENTRE 76

GREENHOUSE MONITORING SYSTEM

BIBLOGRAPHY
BOOK
:ractical electronics handboo$ %he A!<4 microcontroller and Embedded systems :rinciple electronics :rinted circuit board design

AUTHOR
-an ,inclair N `ohn +unton 3uhammad Ali 3azidi, `anice Gillespie 3azidi, 8olin +.3c$inal A.:.3alvino W. #. Gosshart

NOMENCLATURE
I8' infrared IO' input@output
DOEACC CENTRE 77

GREENHOUSE MONITORING SYSTEM -#+' A digital display that uses li*uid crystal cells -E+' -ight Emitting +iode 8A3' 8andom Access 3emory ,8A3' ,tatic 8andom Access 3emory EE:8O3' Electrically Erasable :rogrammable 8ead Only 3emory

DOEACC CENTRE 78

Vous aimerez peut-être aussi