View
215
Download
0
Category
Preview:
DESCRIPTION
garden automation project
Citation preview
7/17/2019 Garden Automation
1/54
Microcontroller based Public Garden Automation
Microcontroller based Public Garden Automation
Students name:
1
7/17/2019 Garden Automation
2/54
Microcontroller based Public Garden Automation
INTRODUCTION
2
7/17/2019 Garden Automation
3/54
Microcontroller based Public Garden Automation
INTRODUTION O! PRO"#T:
T$is %ro&ect aims to im%lement t$e total automation o' %ublic (arden) T$e %ro&ect *ill
$el% to a+oid t$e misuse o' electricit, and *ater in t$e %ublic (arden) Sometimes due to carelessness o'
t$e aut$orities and t$e *or-ers li($ts *ere le't on *$ic$ results in *asta(e o' electricit,) .ater *asta(e
is anot$er %roblem *$ic$ needs to be dealt *it$) .e are usin( $umidit, sensor *$ic$ *ill measure t$e
*ater content in t$e soil and *ater su%%l, time *ill be ad&usted accordin(l, *ater content in t$e soil)
T$is *ill a+oid unnecessar, *ater su%%l, durin( t$e rain, season)
T$e (ates o' t$e (arden are also o%ened and closed accordin( to %rede'ined timin(s) T$e (ate *ill be
o%ened b, motor *$ic$ is controlled b, t$e Microcontroller) /i($ts *ill be s*itc$ed on0o'' de%endin(
u%on t$e intensit, o' natural li($t and t$e li($ts remain 'unctional till t$e (arden remains o%en)
T$e Garden *ill be closed at around ) %)m) At around 3)4 %m a bu55er *ill indicate closure o' t$e
(arden and alert t$e +isitors) T$e (ate *ill be t$en closed at )%m and lam%s *ill be s*itc$ed o''
e6ce%t one or t*o) Microcontroller is used to control entire 'unctionalit,)
)
7
7/17/2019 Garden Automation
4/54
Microcontroller based Public Garden Automation
Block Diagram and Description:
Block Diagram:
8
7/17/2019 Garden Automation
5/54
Microcontroller based Public Garden Automation
Description:
19 UMIDIT; S#NSOR: T$is sensor is used to measure t$e $umidit, and it *ill (i+e t$e +olta(e
out%uts *$ic$ *ill be a%%lied to si(nal conditionin( circuit and t$en a%%lied to t$e microcontroller)
29 /IGT S#NSOR: T$is is second sensor *$ic$ is used to sense li($t) T$is can be /DR) Out%ut o'
sensor (i+en to si(nal conditionin( circuit *$ic$ *ill raise si(nal to reu55er
Rela,
Gate ontrol
Motor
7/17/2019 Garden Automation
6/54
Microcontroller based Public Garden Automation
89 R#/A;: .e need to control t$e +alues o' tem%erature) !or t$is %ur%ose *e need to dri+e a 'an and
$eater) .e are (oin( to use Rela, 'or t$is %ur%ose
49 MIRO?ONTRO//#R @3419: T$is is t$e most im%ortant se(ment o' t$e %ro&ect) T$e controller is
res%onsible 'or detection and %ollin( o' t$e %eri%$erals status) It is res%onsible 'or ma-in() It is
res%onsible 'or %rioriti5in( all t$e de+ices attac$ed to it)
.# $a+e used t$e P3=41RD2 microcontroller) T$e P3=41RD2 is a lo*?%o*er $i($?%er'ormance
MOS 8?bit microcontroller *it$ B8C b,tes o' in?s,stem %ro(rammable !las$ memor,) It $as (ot 72
I0O lines t*o data %ointers t*o 1B?bit timer0counters si6?+ector t*o?le+el interru%t arc$itecture a 'ull
du%le6 serial %ort on?c$i% oscillator and a cloc- circuitr,)
B9 RT: T$e DS17 serial real?time cloc- @RT9 is a lo*?%o*er 'ull binar,?coded decimal @>D9
cloc-0calendar %lus 4B b,tes o' N= SRAM) Address and data are trans'erred seriall, t$rou($ an IEbidirectional bus) T$e cloc-0calendar %ro+ides seconds minutes $ours da, date mont$ and ,ear
in'ormation) T$e end o' t$e mont$ date is automaticall, ad&usted 'or mont$s *it$ 'e*er t$an 71 da,s
includin( corrections 'or lea% ,ear) T$e cloc- o%erates in eit$er t$e 28?$our or 12?$our 'ormat *it$
AM0PM indicator) T$e DS17 $as a built?in %o*er?sense circuit t$at detects %o*er 'ailures and
automaticall, s*itc$es to t$e bac-u% su%%l,) Time-ee%in( o%eration continues *$ile t$e %art o%erates
'rom t$e bac-u% su%%l,)
B
7/17/2019 Garden Automation
7/54
Microcontroller based Public Garden Automation
Circuit diagram & Description
Circuit diagram:
Po*er Su%%l, Section:
7/17/2019 Garden Automation
8/54
Microcontroller based Public Garden Automation
Humidity Sensor Section:
3
7/17/2019 Garden Automation
9/54
Microcontroller based Public Garden Automation
Signal Conditioning Section LDR:
7/17/2019 Garden Automation
10/54
Microcontroller based Public Garden Automation
Microcontroller Circuit Section
M C _ M o t o r - V eM C _ M o t o r + V e
+ 5 V
0
O
S
C
_
1
C 9
0 . 1 U F
O
S
C
_
2
M C _ A L E
M
C
_
R
S
T
M C _ P S E N
+ 5 V
0
C 80 . 1 U F
U 8
A T 8 9 C 5 1 / D P
R S T9
! T A L 2
1 8 ! T A L 11 9
P S E N
2 9A L E / P R O "# 0
E A / V P P# 1
P 1 . 01
P 1 . 12
P 1 . 2#
P 1 . #$
P 1 . $5
P 1 . 5%
P 1 . %&
P 1 . &8
P 2 . 0 / A 82 1
P 2 . 1 / A 92 2
P 2 . 2 / A 1 02 #
P 2 . # / A 1 12 $
P 2 . $ / A 1 22 5
P 2 . 5 / A 1 #2 %
P 2 . % / A 1 $2 &
P 2 . & / A 1 52 8
P # . 0 / R ! D1 0
P # . 1 / T ! D1 1
P # . 2 / N T 01 2
P # . # / N T 11 #
P # . $ / T 01 $
P # . 5 / T 11 5
P # . % / ' R1 %
P # . & / R D1 &
P 0 . 0 / A D 0# 9
P 0 . 1 / A D 1# 8
P 0 . 2 / A D 2# &
P 0 . # / A D ## %
P 0 . $ / A D $# 5
P 0 . 5 / A D 5# $
P 0 . % / A D %# #
P 0 . & / A D 2
V C C$ 0
" N D2 0
M C _ S ( r ) *
M C _ ' t e r M o t o r
M C _ L ( , tM C _ ) ( ( t _ *
M C _ L r _ *
Buzzer & Light Driver Section:
1
7/17/2019 Garden Automation
11/54
Microcontroller based Public Garden Automation
Stepper Motor Driver :
11
7/17/2019 Garden Automation
12/54
Microcontroller based Public Garden Automation
ater Supply Motor Section
12
7/17/2019 Garden Automation
13/54
Microcontroller based Public Garden Automation
17
7/17/2019 Garden Automation
14/54
Microcontroller based Public Garden Automation
Relay Circuit:
RT Section:
18
7/17/2019 Garden Automation
15/54
Microcontroller based Public Garden Automation
.or-in( o' %ro&ect:
T$is %ro&ect basicall, deals *it$ controllin( +arious %arameters *$ic$ are res%onsible 'or t$e (ro*t$
o' %lants e6am%le .ater Tem%erature li($t moisture etc) .e can control t$ese %arameters as %er t$e
%lants reased .ater Su%%l, ontrol:
It is necessar, in order to maintain (ood moisture le+el in soil or to %re+ent e6cess
amount t o' *ater (oin( in to t$e soil) T$e *ater s%rin-ler motor can be automaticall, ON or O!! 'or set
time limit)
29 /DR >ased /i($t ontrol:
T$is is im%ortant %arameter come in %icture *$en sunli($t is absentF *e $a+e
used /DR Sensor @/i($t De%endant Resistance9 to detect t$e dar-ness in t$e surroundin() Its basic
14
7/17/2019 Garden Automation
16/54
Microcontroller based Public Garden Automation
%ro%ert, is +ariance in resistance as %er t$e amount o' li($t 'alls on it t$is can be used to detect t$e
dar-ness) So *e $a+e connected /DR out%ut to Micro controller it is %ro(rammed in t$e 'ollo*in( *a,?
1) I' t$e li($t intensit, is +er, /o* t$e out%ut +olta(e o' /DR *ill increase $ence t$e controller *ill
sense it as /o(ic 1 and TURN ON t$e e6ternal li($t source)
2)) I' t$e li($t intensit, is +er, i($ t$e out%ut +olta(e o' /DR *ill decrease $ence t$e controller *ill
sense it as /o(ic and TURN O!! t$e e6ternal li($t source
79 Gate motor ontrol:
89 >u55er control Timin( >ased:
ence *e can maintain t$e intensit, o' li($t in t$e surroundin( o' %lants or 'or monitorin(
%ur%ose)
1B
7/17/2019 Garden Automation
17/54
Microcontroller based Public Garden Automation
Speci!ication o! Components used:
Microcontroller "#$%'RD(:
!eatures
B8 C> 'las$ memor,
1 C> RAM
72 I0O lines
Pro(rammable counter arra,
In S,stem A%%lication
1
7/17/2019 Garden Automation
18/54
Microcontroller based Public Garden Automation
T$ree 1B?bit Timer0ounter Accumulator:
A is t$e accumulator re(ister) It is an 3 bit re(ister) It is most +ersatile and $olds sources o%erand
and recei+es t$e result o' arit$metic o%erations includin( addition subtraction inte(er multi%lication
di+ision and >oolean bit mani%ulations)
It is also used 'or data trans'er bet*een 341 and an, e6ternal memor,) Se+eral 'unctions li-e rotate
test etc) a%%l, s%eci'icall, on t$e accumulator)
Arit$metic and /o(ic Unit @A/U9:
T$e A/U can %er'orm arit$metic and lo(ic o%erations on ei($t bit data) It can %er'orm arit$metic
o%erations li-e addition subtraction multi%lication di+ision and lo(ical o%erations li-e AND OR # H
OR com%lement rotate etc)
Pro(ram Status .ord @PS.9 and !la(s:
Man, instructions a''ect t$e status o' 'la(s) In order to address t$ese 'la(s con+enientl,
t$e, are (rou%ed to 'rom t$e %ro(ram status *ord) PS. contain arr, 'la( @ ;9 Au6iliar, carr,
'la( @ A 9 User de'ined !la( @! 9 re(ister ban- selections 'la( @RSRS19 O+er'lo* 'la(@ O= 9
Parit, 'la( @%9 )!la(s are 1 bit re(isters %ro+ided to store t$e results o' some instructions) A !la( is a
'li% 'lo% t$at indicates some condition %roduced b, t$e e6ecution o' an instruction)
RST:
Reset in%ut) A $i($ on $is %in t*o mac$ine c,cles *$ile t$e oscillator is runnin( resets
t$e de+ice) T$is %in dri+es $i($ 'or 3 oscillator %eriods a'ter t$e .atc$do( times out) T$e DISRTO bit
in S!R AUR @address 3 #9 can be used to disable t$is 'eature) In t$e de'ault state o' bit DISRTO t$e
R#S#T IG out 'eature is enabled)
Pro(ram ounter @P9:
It is a 1B?bit re(ister) It is used to $old t$e address o' a b,te in t$e memor,) It -ee%s
t$e trac- o' t$e e6ecution o' t$e %ro(ram) T$e %ro(ram instruction b,tes are 'etc$ed 'rom locations
in memor, t$at are addressed b, t$e Pro(ram counter)
T$e Stac- and Stac- Pointer:13
7/17/2019 Garden Automation
19/54
Microcontroller based Public Garden Automation
T$e stac- is a reser+ed area o' t$e memor, in RAM *$ere tem%orar, in'ormation
ma, be stored) An 3 H bit stac- %ointer is used to $old t$e address o' t$e most recent stac- entr,)
T$is location *$ic$ $as t$e most recent entr, is called as t$e to% o' t$e stac-)
S%ecial !unction Re(isters:
A ma% o' t$e on?c$i% memor, area called t$e S%ecial !unction Re(ister @S!R9 s%ace
is s$o*n in Table 4?1) Note t$at not all o' t$e addresses are occu%ied and unoccu%ied addresses ma,
not be im%lemented on t$e c$i%) Read accesses to t$ese addresses *ill in (eneral return random data
and *rite accesses *ill $a+e an indeterminate e''ect) User so't*are s$ould not *rite 1s to t$ese
unlisted locations since t$e, ma, be used in 'uture %roducts to in+o-e ne* 'eatures) In t$at case t$e
reset or inacti+e +alues o' t$e ne* bits *ill al*a,s be )
Timer 2 Re(isters: ontrol and status bits are contained in re(isters T2ON @s$o*n in
Table 4? 29 and T2MOD @s$o*n in Table 1?29 'or Timer 2) T$e re(ister %air @RAP2 RAP2/9
are t$e a%ture0Reload re(isters 'or Timer 2 in 1B?bit ca%ture mode or 1B?bit auto?reload mode)
Interru%t Re(isters: T$e indi+idual interru%t enable bits are in t$e I# re(ister) T*o %riorities can be set
'or eac$ o' t$e si6 interru%t sources in t$e IP re(ister)
In%ut and out%ut %orts:
T$e I0O circuit o' microcontroller is totall, +ersatile) It connects t$e
microcontroller to e6ternal *orld) T$e microcontroller 3+41 $as 'our i0o %orts i)e) 28 lines out o' 72
%ort lines are 'or one o' t$e t*o entirel, di''erent 'unction so alt$ou($ microcontroller is 8 %in c$i%
it a%%ears to $a+e B8 %ins)
As t*o 'unctions are multi%le6ed in order to decide *$ic$ 'unction is su%%orted *e need
to see $o* t$e circuit is connected and *$at so't*are commands are used to %ro(ram t$e %in)
T$e microcontroller $as 'our %orts named as % %1 %2 %7) All t$ese %orts are bi?directional)
L)*H+ D,",-.-+ R,S)S+/R 0LDR1:
1
7/17/2019 Garden Automation
20/54
Microcontroller based Public Garden Automation
It is used to detect +ariation in li($t) It *ill c$an(e its resistance accordin( to t$e
c$an(e in li($t
T$e li($t?sensiti+e %art o' t$e /DR is a *a+, trac- o' cadmium sul%$ide) /i($t ener(, tri((ers t$e
release o' e6tra t$is material c$ar(e carriers in so t$at its resistance 'alls as t$e le+el o' illumination
increases) A li($t sensor uses an /DR as %art o' a +olta(e di+ider .e can s$o* t$e *a, t$e resistance
2
7/17/2019 Garden Automation
21/54
Microcontroller based Public Garden Automation
+aries *it$ li($t le+el as a (ra%$:
LM 2#: Lo3 "o3er Dual /perational .mpli!ier
Description
T$e /M743 consists o' t*o inde%endent $i($ (ain internall, 're
7/17/2019 Garden Automation
22/54
Microcontroller based Public Garden Automation
+olta(es) O%eration 'rom s%lit %o*er su%%lies is also %ossible and t$e lo* %o*er su%%l, current drain is
inde%endent o' t$e ma(nitude o' t$e %o*er su%%l, +olta(e)
A%%lication areas include transducer am%li'iers dc (ain bloc-s and all t$e con+entional o% am% circuits
*$ic$ no* can be more easil, im%lemented in sin(le %o*er su%%l, s,stems) !or e6am%le t$e /M743
can be directl, o%erated o'' o' t$e standard 4= %o*er su%%l, +olta(e *$ic$ is used in di(ital s,stems
and *ill easil, %ro+ide t$e reD9
cloc-0calendar %lus 4B b,tes o' N= SRAM) Address and data are trans'erred seriall, t$rou($ an IE
bidirectional bus) T$e cloc-0calendar %ro+ides seconds minutes $ours da, date mont$ and ,ear
in'ormation) T$e end o' t$e mont$ date is automaticall, ad&usted 'or mont$s *it$ 'e*er t$an 71 da,s
includin( corrections 'or lea% ,ear) T$e cloc- o%erates in eit$er t$e 28?$our or 12?$our 'ormat *it$
AM0PM indicator) T$e DS17 $as a built?in %o*er?sense circuit t$at detects %o*er 'ailures and
automaticall, s*itc$es to t$e bac-u% su%%l,) Time-ee%in( o%eration continues *$ile t$e %art o%erates
'rom t$e bac-u% su%%l,)
4eatures:
22
http://www.national.com/images/pf/LM358/00778723.pdf7/17/2019 Garden Automation
23/54
Microcontroller based Public Garden Automation
Real?Time loc- @RT9 ounts Seconds Minutes ours Date o' t$e Mont$ Mont$ Da, o'
t$e *ee- and ;ear *it$ /ea%?;ear om%ensation =alid U% to 21
4B?>,te >atter,?>ac-ed General?Pur%ose RAM *it$ Unlimited .rites
IE Serial Inter'ace
Pro(rammable Satter,?>ac-u% Mode *it$ Oscillator Runnin(
O%tional Industrial Tem%erature Ran(e: ?8K to 34K
A+ailable in 3?Pin Plastic DIP or SO
R,L.5S:
Rela,s are used t$rou($out t$e automobile) Rela,s *$ic$ come in assorted si5es ratin(s and
a%%lications are used as remote control s*itc$es) A t,%ical +e$icle can $a+e 2 rela,s or more)
27
7/17/2019 Garden Automation
24/54
Microcontroller based Public Garden Automation
R#/A; #N#RGIL#D @ON9
urrent 'lo*in( t$rou($ t$e control circuit coil @%ins 1 and 79 creates a small ma(netic 'ield *$ic$
causes t$e s*itc$ to close %ins 2 and 8) T$e s*itc$ *$ic$ is %art o' t$e load circuit is used to control
an electrical circuit t$at ma, connect to it) urrent no* 'lo*s t$rou($ %ins 2 and 8 s$o*n in R#D *$en
t$e rela, is ener(i5ed)
Pole and t$ro*
ircuit s,mbols o' rela,s) @ denotes t$e common terminal in SPDT and DPDT t,%es)9
Since rela,s are s*itc$est$e terminolo(, a%%lied to s*itc$es is also a%%lied to rela,s) A rela, *ill
s*itc$ one or morepoles eac$ o' *$ose contacts can be thrownb, ener(i5in( t$e coil in one o' t$ree
*a,s:
Normall,?o%en @NO9 contacts connect t$e circuit *$en t$e rela, is acti+atedF t$e circuit is
disconnected *$en t$e rela, is inacti+e) It is also called a !orm A contact or ma-e contact) NO
contacts can also be distin(uis$ed as earl,?ma-e or NO#M *$ic$ means t$at t$e contacts *ill
close be'ore t$e button or s*itc$ is 'ull, en(a(ed) Normall,?closed @N9 contacts disconnect t$e circuit *$en t$e rela, is acti+atedF t$e circuit is
connected *$en t$e rela, is inacti+e) It is also called a !orm > contact or brea- contact) ontacts
can also be distin(uis$ed as late?brea- or N/> *$ic$ means t$at t$e contacts *ill sta, closed
until t$e button or s*itc$ is 'ull, disen(a(ed)
28
http://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/Switchhttp://en.wikipedia.org/wiki/File:Relay_symbols.svghttp://en.wikipedia.org/wiki/Switch7/17/2019 Garden Automation
25/54
Microcontroller based Public Garden Automation
$an(e?o+er @O9 or double?t$ro* @DT9 contacts control t*o circuits: one normall,?o%en
contact and one normall,?closed contact *it$ a common terminal) It is also called a !orm contact
or trans'er contact @brea- be'ore ma-e9) I' t$is t,%e o' contact utili5es ma-e be'ore brea-
'unctionalit, t$en it is called a !orm D contact)
T$e 'ollo*in( desi(nations are commonl, encountered:
SPST H Sin(le Pole Sin(le T$ro*) T$ese $a+e t*o terminals *$ic$ can be connected or
disconnected) Includin( t*o 'or t$e coil suc$ a rela, $as 'our terminals in total) It is ambi(uous
*$et$er t$e %ole is normall, o%en or normall, closed) T$e terminolo(, SPNO and SPN is
sometimes used to resol+e t$e ambi(uit,)
SPDT H Sin(le Pole Double T$ro*) A common terminal connects to eit$er o' t*o ot$ers)
Includin( t*o 'or t$e coil suc$ a rela, $as 'i+e terminals in total)
DPST H Double Pole Sin(le T$ro*) T$ese $a+e t*o %airs o' terminals) #
t$at *ill be used)
T$e +olta(e di''erence bet*een eac$ trac- *ill determine t$e clearance bet*een eac$ conductor) I' t$e
clearance is not enou($ c$ances are t$at t$e electrical %otential bet*een eac$ trac- *ill cause s%ar-
24
http://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.html7/17/2019 Garden Automation
26/54
Microcontroller based Public Garden Automation
o+er and s$ort circuitt$e P>) T$is *ill cause 'unctional 'ailure to t$e %roduct and t$e sa'et,o' t$e
users t$at are usin( t$e %roduct *ill be com%romised) It is t$ere'ore critical 'or one to understand some
o' t$ese basics re %rocesses) I' $i($er current carr,in( ca%acit, is re:
)>OT ? bottom co%%er
)SM> ? Solder mas- bottom
2B
http://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.html7/17/2019 Garden Automation
27/54
Microcontroller based Public Garden Automation
)SST ? Sil- screen to%
)AS; ? Assembl, to% contains t$e board outline
)DS ? drill si5es
Trac-s Restricted Area
Trac-s s$ould not be located on t$e areas t$at can cause t$em to be %eeled o'' easil,) One o' t$e
restricted areas is $oles on t$e P> *$ic$ are used to mount scre*s or P> s%acers) T$ese $oles are
usuall, used to securet$e P> to a casin( or to secure it in a 'i6ed %lace)
T$e ed(es o' t$e P> s$ould not $a+e an, trac-s as t$ese areas are usuall, used to trans%ort t$e P>
'rom one %rocess to anot$er %rocess b, usin( a con+e,or belt) T$ese ed(es are %laces *$ere t$e
%ossibilit, o' scratc$es and crac-in( o' t$e P> $a%%ens) T$e recommended areas t$at s$ould not $a+e
an, trac- is as s$o*n in t$e dia(ram belo* assumin( a $ole diameter o' 8 mm *$ic$ is used to mount a
P> s%acer)
2
http://www.electronics-project-design.com/PCB-Design.htmlhttp://www.electronics-project-design.com/PCB-Design.html7/17/2019 Garden Automation
28/54
Microcontroller based Public Garden Automation
!/O. ART:
4lo3 Chart:
LDR Routine:
N
;
23
START
#ND
I! /DRQIN 1
S*itc$ ON /i($t Rela,
/i($t Rela, O!!
7/17/2019 Garden Automation
29/54
Microcontroller based Public Garden Automation
Humidity sensor routine
N
;
2
START
#ND
I! umidit, IN
i($
S*itc$ ON .ater
Su%%l, Motor Rela,
S*itc$ O!! .ater
Su%%l, Motor
7/17/2019 Garden Automation
30/54
Microcontroller based Public Garden Automation
GAT# OP#N ROUTIN#:
N
;
N
;
7
START
#ND
I! urrent time
Set GAT# ON time
S*itc$ ON Motor Anticloc-*ise
Motor remain o''
I! urrent time
Set GAT# O!!
time
S*itc$ ON Motor loc-*ise
Motor remain o''
7/17/2019 Garden Automation
31/54
Microcontroller based Public Garden Automation
>ULL#R ROUTIN#:
N
;
71
START
#ND
I! urrent time
Set ON >u55er
Time
Time time
>u55er remain o''
S*itc$ ON >u55er Rela,
7/17/2019 Garden Automation
32/54
Microcontroller based Public Garden Automation
Burning "rogram into Microcontroller:
L.5/6+:
72
7/17/2019 Garden Automation
33/54
Microcontroller based Public Garden Automation
77
7/17/2019 Garden Automation
34/54
Microcontroller based Public Garden Automation
78
7/17/2019 Garden Automation
35/54
Microcontroller based Public Garden Automation
74
7/17/2019 Garden Automation
36/54
Microcontroller based Public Garden Automation
>I// O! MAT#RIA/:
Sr) No) Descri%tion uantit, Price
1 P3=41RD2 1 13
2 Trans'ormer 13 = )4A 1 12
7 /M312 1 12
8 /M34 1 3
7B
7/17/2019 Garden Automation
37/54
Microcontroller based Public Garden Automation
4 Diode 1N8 8 3
B a%acitor 1 ' 1
Disc a%acitor 1 4
3 I >ase 8 Pin 1 13
Relimate >ase 1 8
1 Relimate onnector 1 33
11 Pull U% Resistance 1 C 8 3
12 P> 1
17 Reset S*itc$ 4 4
18 I >ase 3 Pin 7 1B
14 I >ase 1B Pin 2 12
1B 12 = Rela, 2 2
1 27 + rela, 1 74
13 /M 743 Dual O%?Am% 2 22
1 Resistance 2 12 /M 74 Tem% sensor 1 84
21 /DR 1 22
22 RT Ds17 1 7
27 transistor >c 48 4 13
28 transistor >c 44 4 13
24 eat Sin- 1 3
2B /D 14
2 !an 12 = 1 3
23 /#D 4 4
2 27 + *ater su%%l, Motor 1 84
TOTA/ AMOUNT
218
7
7/17/2019 Garden Automation
38/54
Microcontroller based Public Garden Automation
.pplications & .dvantages:
T$is electronic circuit can be used 'or t$e 'ollo*in( a%%lication
19 t$is s,stem can be used in t$e %ublic (arden 'or t$e com%lete automation o' t$e (arden)
29 T$is s,stem *ill utili5e t$e *ater su%%l, as %er t$e re, usin( access control tec$ni
7/17/2019 Garden Automation
39/54
Microcontroller based Public Garden Automation
>ibilo(ra%$,:
R#!#R#N# >OOCS:?
T$e 341 microcontroller :? Cennet$ A,ala
T$e 341 microcontroller and #mbedded s,stems :? Mu$ammad Ali Ma5idi
.#>?SIT#S:?
***)datas$eetarc$ie+e)com
***)ma6im?ic)com
7
http://www.datasheetarchieve.com/http://www.maxim-ic.com/http://www.datasheetarchieve.com/http://www.maxim-ic.com/7/17/2019 Garden Automation
40/54
Microcontroller based Public Garden Automation
***)alldatas$eet)com0
***)n6%)com0?P$ili%s
includeV%3+41r62)$W
de'ine .RQDS17 6D 00 DS17 .rite Address
de'ine RDQDS17 6D1 00 DS17 Read Address
de'ine =al Ste%7PinFSte%2PinFSte%1PinFSte%PinF
de'ine =al1 Ste%7PinFSte%2PinFSte%1PinFSte%Pin1F
de'ine =al2 Ste%7PinFSte%2PinFSte%1Pin1FSte%PinF
de'ine =al7 Ste%7PinFSte%2PinFSte%1Pin1FSte%Pin1F
de'ine =al8 Ste%7PinFSte%2Pin1FSte%1PinFSte%PinF
de'ine =al4 Ste%7PinFSte%2Pin1FSte%1PinFSte%Pin1F
de'ine =alB Ste%7PinFSte%2Pin1FSte%1Pin1FSte%PinF
de'ine =al Ste%7PinFSte%2Pin1FSte%1Pin1FSte%Pin1F
de'ine =al3 Ste%7Pin1FSte%2PinFSte%1PinFSte%PinF
de'ine =al Ste%7Pin1FSte%2PinFSte%1PinFSte%Pin1F
de'ine =alA Ste%7Pin1FSte%2PinFSte%1Pin1FSte%PinF
de'ine =al> Ste%7Pin1FSte%2PinFSte%1Pin1FSte%Pin1F
de'ine =al Ste%7Pin1FSte%2Pin1FSte%1PinFSte%PinF
de'ine =alD Ste%7Pin1FSte%2Pin1FSte%1PinFSte%Pin1F
de'ine =al# Ste%7Pin1FSte%2Pin1FSte%1Pin1FSte%PinF
de'ine =al! Ste%7Pin1FSte%2Pin1FSte%1Pin1FSte%Pin1F
8
http://www.alldatasheet.com/http://www.nxp.com/-Philipshttp://www.alldatasheet.com/http://www.nxp.com/-Philips7/17/2019 Garden Automation
41/54
Microcontroller based Public Garden Automation
int MotorStartour F
int MotorStartMinute 2F
int MotorStart!l( 1F
int Motor#ndour F
int Motor#ndMinute 7F
int Motor#nd!l( F
+oid Dela,@9F
+oid Ste%%erloc-@9F
+oid Ste%%erAntiloc-@9F
+oid Ste%MotDela,@9F
sbit Ste%Pin P2XF
sbit Ste%1Pin P2X1F
sbit Ste%2Pin P2X2F
sbit Ste%7Pin P2X7F
sbit .aterMotor P2XF
sbit /i($t P2XBF
sbit GateSirun P2X2F
sbit umidit,Status P1X8F
sbit /i($tStatus P1XBF
81
7/17/2019 Garden Automation
42/54
Microcontroller based Public Garden Automation
+oid Sense$ec-@9
Y
i'@umidit,Status 19
Y
.aterMotor F
Z else
Y
.aterMotor 1F
Z
i'@/i($tStatus 19
Y
/i($t 1F
Z else
Y
/i($t F
Z
Z
+oid GateO%en@9
Y
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
82
7/17/2019 Garden Automation
43/54
Microcontroller based Public Garden Automation
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Ste%%erloc-@9F
Z
+oid Gatelose@9
Y
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
87
7/17/2019 Garden Automation
44/54
Microcontroller based Public Garden Automation
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Ste%%erAntiloc-@9F
Z
+oid (etrtc@9F
+oid setrtc@9F
bit s$o*dateF
+oid lcdQcmd@9F
+oid dis%la,@9F
+oid startQi2c@9F
+oid sto%Qi2c@9F
+oid dataQinQi2c@9F
+oid dataQoutQi2c@9F
sbit /DRS P7XF 00 /D re(ister select %in
88
7/17/2019 Garden Automation
45/54
Microcontroller based Public Garden Automation
sbit /DR. P7X1F 00 /D read *rite
sbit /D#N P7X2F 00 /D enable %in
sbit /OC P1XF 00 loc- -e,
sbit #NTR P1X1F 00 enter -e,
sbit S!T P1X2F 00 s$i't -e,
sbit INR P1X7F 00 increment -e,
sbit S/ P7XBF
0
PIN D#/ARATION
0
0sbit /DRS P2X4F 00 /D re(ister select %in
sbit /D#N P2XBF 00 /D enable %in
sbit /OC P2XF 00 loc- -e,
sbit #NTR P2X1F 00 enter -e,
sbit S!T P2X2F 00 s$i't -e,
sbit INR P2X7F 00 increment -e,
+oid lcdQinit@9
Y
lcddat 673F lcdQcmd@9F 003 bit mode 101B dut, 463 'ont
lcddat 6F lcdQcmd@9F 00dis%la, on cursor o''
lcddat 61F lcdQcmd@9F 00clear dis%la,
Z
84
7/17/2019 Garden Automation
46/54
Microcontroller based Public Garden Automation
+oid lcdQcmd@9
Y 00send /D commond
P lcddatF
/DRS F
/D#N 1F
Qno%Q@9 F
/D#N F
'or@i F i V 1F i9 Y
Qno%Q@9F
Z
Z
+oid lcdQdata@9
Y
int &F 00send /D data
P lcddatF
/DRS 1F
/D#N 1F
Qno%Q@9 F
/D#N F
'or@& F & V 1F &9 Y
Qno%Q@9F
Z
Z
8B
7/17/2019 Garden Automation
47/54
Microcontroller based Public Garden Automation
+oid dis%num@9 00dis%la, number on ro*
Y
c$ar colF
'or @col F col V stcolF col9
Y
str1[col\ F
Z
+oid dis%la,@9 00dis%la, strin( or number on bot$ ro* o' /D
Y
c$ar iF
lcdQcmd@9F
'or@i F i V 1BF i9
Y
lcddat str1[i\F
lcdQdata@9F
Z
lcdQcmd@9F
'or@i F i V 1BF i9
Y
lcddat str2[i\F
lcdQdata@9F
Z
Z
8
7/17/2019 Garden Automation
48/54
Microcontroller based Public Garden Automation
0
MAIN
0
+oid main@9
Y
stcol F endcol 14 F
dis%str1@ /D 9F
dis%str2@ Initialised 9F
Dela,@9F
(etrtc@9F
i'@@date9]]@mont$9]]@da,99
Y da,1 F$our Fminute FsecondF date14Fmont$7F,ear11F Z
i'@$our9Yda,1 F$our Fminute FsecondF date14Fmont$7F,ear11FZ
setrtc@9F
dis%str1@ RT 9F
dis%str2@ Initialised 9F
Dela,@9F
83
7/17/2019 Garden Automation
49/54
Microcontroller based Public Garden Automation
*$ile@19
Y
Sense$ec-@9F
(etrtc@9F
i'@-e,/C9
Y
settime@9F
Z
Z
else s$o*dateF
i'@s$o*date9
Y
date'l( 1F
stcol F endcol 14F
dis%str1@ DD0MM0;; 9F 00(et start date DD0MM0;; 'rom user
stcol 8F endcol 11F
num @date1/9@mont$19,earF
'ormat 2 F
dis%num2@9F
Dela,@9F
dis%str1@ 9F
8
7/17/2019 Garden Automation
50/54
Microcontroller based Public Garden Automation
date'l( F
Z
else
Y
time'l( 1F
stcol 8F endcol 11F
num @$our19@minute19secondF
dis%num@9F
time'l( F
Z
i'@second'la(9
Y
second'la(F
(etrtc@9F
i'@@$our MotorStartour9]]@minute MotorStartMinute9]]@MotorStart!l( 199
Y
MotorStart!l( F
stcol F endcol 14F
dis%str1@ GARD#N OP#N 9F
GateSirun 1F
4
7/17/2019 Garden Automation
51/54
Microcontroller based Public Garden Automation
GateO%en@9F
GateSirun F
Motor#nd!l( 1F
Dela,@9F
Z
else i'@@$our Motor#ndour9]]@minute Motor#ndMinute9]]@Motor#nd!l( 199
Y
MotorStart!l( 1F
Motor#nd!l( F
stcol F endcol 14F
dis%str1@ GARD#N /OS# 9F
GateSirun 1F
Z
Gatelose@9F
GateSirun F
Z
Y
Z
41
7/17/2019 Garden Automation
52/54
Microcontroller based Public Garden Automation
Z
Z
+oid Ste%MotDela,@9
Y
unsi(ned c$ar i&-F
'or@iFiVBFi9
'or@&F&V44F&9
'or@-F-V44F-9F
Z
+oid Ste%%erloc-@9
Y
=al 00Ste%%erPort 6F
Ste%MotDela,@9F
=al8 00Ste%%erPort 68F
Ste%MotDela,@9F
=alB 00Ste%%erPort 6BF
Ste%MotDela,@9F
=al2 00Ste%%erPort 62F
Ste%MotDela,@9F
=al7 00Ste%%erPort 67F
Ste%MotDela,@9F
=al1 00Ste%%erPort 61F
Ste%MotDela,@9F
42
7/17/2019 Garden Automation
53/54
Microcontroller based Public Garden Automation
=al 00Ste%%erPort 6F
Ste%MotDela,@9F
=al3 00Ste%%erPort 63F
Ste%MotDela,@9F
Z
+oid Ste%%erAntiloc-@9
Y
=al3 00Ste%%erPort 63F
Ste%MotDela,@9F
=al 00Ste%%erPort 6F
Ste%MotDela,@9F
=al1 00Ste%%erPort 61F
Ste%MotDela,@9F
=al7 00Ste%%erPort 67F
Ste%MotDela,@9F
=al2 00Ste%%erPort 62F
Ste%MotDela,@9F
=alB 00Ste%%erPort 6BF
Ste%MotDela,@9F
=al8 00Ste%%erPort 68F
Ste%MotDela,@9F
=al 00Ste%%erPort 6F
Ste%MotDela,@9F
Z
47
7/17/2019 Garden Automation
54/54
Microcontroller based Public Garden Automation
Recommended