Está en la página 1de 32

LI CM N

Kha thc tp tt nghip i n hi kt, v thc hin tt kha thc tp


ny, em c cc thy c, cng ty thc tp v cc bn b h tr gip rt nhiu.
u tin, em xin c gi li cm n chn thnh n thy gio hng dn thc
tp Ths Trn Trng Thng, gip em sut thi gian qua. Thy gii thiu, to
iu kin cho em thc tp ti Cng ty TNHH Cng ngh ng dng Bch Khoa (Bach
Khoa Applications Technology Co., Ltd.). V trong sut qu trnh thc tp, thy
hng dn, gi m, cung cp ti liu tng ca em tng bc tr thnh thc t.
Em cng xin c gi li cm n su sc n Cng ty TNHH Cng ngh ng
dng Bch Khoa (Bach Khoa Applications Technology Co., Ltd.) to iu kin tt
nht cho em thc tp.
Cng xin c gi li cm n nng nhit n cc thnh vin trong lp D4
DTVT, trng i Hc in Lc h tr, gip ti hon thnh tt cng vic
c giao ph.
V mt li cm n chn thnh ti tt c qu thy c trong khoa in T Vin
Thng, trng i Hc in Lc truyn cho em kin thc t nhng ngy u sinh
vin, c c nn tng nh hin nay.
H Ni, ngy 12/10/2013
Sinh vin
Nguyn Quc Hng

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

NHN XT
(Ca c quan thc tp)

GVHD:
Ths.Trn trng Thng
SVTH: Nguyn Quc Hng

NHN XT
(Ca ging vin hng dn)

GVHD:
Ths.Trn trng Thng
SVTH: Nguyn Quc Hng

NHN XT
(Ca ging vin phn bin)

GVHD:
Ths.Trn trng Thng
SVTH: Nguyn Quc Hng

MC LC

DANH MC CC T VIT TT .................................................................................. i


DANH MC CC HNH NH ......................................................................................ii
LI M U ..................................................................................................................ii
PHN I: GII THIU V CNG TY THC TP ....................................................... 2
1.1 Gii thiu chung .................................................................................................... 2
1.2 C cu t chc....................................................................................................... 3
1.2.1 C cu nhn s: ............................................................................................... 3
1.2.2 Phng tin thit b ........................................................................................ 4
1.3 Cc lnh vc hot ng kinh doanh ...................................................................... 4
1.4 Nhng thnh tu, sn phm ca cngty t c trong nhng nm hot ng 5
1.5 Gii thng ........................................................................................................... 6
PHN II: Ni dung ti ............................................................................................... 8
2.1 S khi h thng ............................................................................................... 8
2.2 S nguyn l chc nng cc khi ..................................................................... 9
2.2.1 Khi ngun ...................................................................................................... 9
2.2.2 Khi iu khin bng tay .............................................................................. 10
2.2.3 Khi role ....................................................................................................... 10
2.2.4 Khi X L trung tm v Hin Th............................................................... 11
2.2.5 Khi cm bin ............................................................................................... 12
2.2.6 Khi giao tip vi laptop qua chun UART ................................................. 12
2.3 Linh kin s dng................................................................................................. 13
GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

2.3.1 IC AT89S52 .................................................................................................. 13


2.3.2 Mn hnh LCD .............................................................................................. 18
2.3.4 Cm bin DTH 11 ......................................................................................... 20
2.3.5 Giao tip UART ............................................................................................ 21
2.3.6 Role 5V ......................................................................................................... 21
2.3.8 Hnh nh mch sau khi hon thin ................................................................ 23

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

DANH MC CC T VIT TT

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

ii
DANH MC CC HNH NH
Hnh 1.2: C cu t chc ca Cng ty TNHH Cng ngh ng dng Bch Khoa.......3
Hnh1.4.1: Cc thnh tu, sn phm ca cng ty............................................................. 5
Hnh 1.4.2: Thit b tit kim in cho h thng n tup .............................................. 6
Hnh 1.5.1: Gii sng to Nhn Ti t Vit 2008 .......................................................... 6
Hnh 1.5.2: Gii Nht cuc thi tngxanh 2010 ..................................................... 7
Hnh 1.5.3: Gii thng Hi thi sng to tr ton quc ln th 11 .............................. 7
Hnh 0.2.1: S khi h thng ...................................................................................... 8
Hnh 2.2.1: Khi ngun .................................................................................................... 9
Hnh 2.2.2: Khi iu khin bng tay ............................................................................ 10
Hnh 2.2.3: Khi Role ................................................................................................... 10
Hnh 2.2.4.1: S khi hin th .................................................................................. 11
Hnh 2.2.4.2: S khi x l trung tm ...................................................................... 11
Hnh 2.2.5: S khi cm bin nhit , m ......................................................... 12
Hnh 2.2.6: Khi giao tip vi my tnh ....................................................................... 12
Hnh 2.3.1: IC AT89S52 ............................................................................................... 13
Hnh 2.3.1.1: Khi reset ................................................................................................. 17
Hnh 2.3.1.2: B to dao ng bn trong 89S52 ........................................................... 18
Hnh 2.3.2:Mn hnh LCD ............................................................................................. 18
Hnh 2.3.5.1: Thit b cm bin DTH 11. ...................................................................... 20
Hnh 2.3.5.2: S kt ni vi vi x l ........................................................................ 21
Hnh 2.3.6: Thit b Role 5V ......................................................................................... 21
Hnh 2.3.7: S mch in............................................................................................. 22
Hnh 2.3.8: Sn phm hon thin ................................................................................... 23

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

iii
DANH MC CC BNG BIU
Bng 1: Chc nng cc chn ca 89S52 ....................................................................... 15
Bng 2 : Chc nng cc bit cng P3 ............................................................................. 16
Bng 3: M t chn ca LCD 16x2............................................................................... 19

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

1
LI M U
Hin nay, khi trnh khoa hc pht trin, i sng ngi dn nng cao th cc
sn phm in t phc v cho cuc sng tr nn ph bin nh : PC, laptop, qut
in, mobilevv.. Cc sn phm in t c th lin kt c vi nhau qua nhng
chun giao tip ring bit, qua , gip ngi dng ti u ha h thng, tit kim c
thi gian, tn dng thm c nhng tin ch ca sn phm in t.
V vy, nn em quyt nh la chn ti: Mch cm bin nhit m
ginh cho qut in, giao tip vi PC ( cng COM ) hay laptop ( cng USB) thng
qua chun giao tip UART. y l mt ti c tnh m cao, to tin pht trin
ln vi cc chun giao tip khc cao cp hn, tin li hn.
Bo co ca em gm 3 phn chnh:
-

Phn 1: Gii thiu v cng ty thc tp.

Phn 2: Ni dung ti

Phn 3: Kt lun

V thi gian thc tp ngn ngi, kin thc vn cn hn ch, nn trong bo co s


khng trch khi nhng thiu xt, nn em hi vng s nhn c phn hi tch cc
em ngy cng c hon thin hn.

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

2
PHN I: GII THIU V CNG TY THC TP
1.1 Gii thiu chung
Cng ty TNHH Cng ngh ng dng Bch Khoa (Bach Khoa Applications
Technology Co., Ltd.) l mt doanh nghip t nhn c thnh lp t nm 2009 vi
tn ng k ban u l Cng ty TNHH u t, Thng Mi v Pht trin khoa hc k
thut Vit Nam.
Tn Cng ty: Cng ty TNHH Cng ngh ng dng BchKhoa (BKAT Co.,
Ltd.)
Logo:
a ch :28 Trn Nhn Tng, Bi Th Xun, Hai B Trng, H ni
Lin

:Tel:

04-3944

8938

Website:

bkat.com.vn

Email:

contact@bkat.com.vn
Cng ty k tha v tip tc pht trin cc dng sn phm m cc thnh vin
chnh ca cng ty nghin cu pht trin t nhng nm 2003 di danh ngha nhm
in t Y sinh Vit Nam (VBEG).
Trong qu trnh nghin cu v pht trin n nay, cng ty c hn 22 dng
sn phm khc nhau c em ng dng trong thc t trong nhiu lnh vc khc
nhau, p ng cc yu cu i hi cp thit ca x hi.Cng ty gm c: 01 phng
nghin cu v pht trin, 02 xng sn xut, 01 khu o to k thut cho sinh vin
chuyn ngnh in- in t- Vin thng- T ng ha.
Hin nay, Cng ty tr thnh i tc quan trng ca Cng ty Vin thng in
lc 1,trc thuc Tp on in lc Vit Nam.

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

3
1.2 C cu t chc

Hnh 1.2: C cu t chc ca Cng ty TNHH Cng ngh ng dng Bch Khoa.
1.2.1 C cu nhn s:
- 01 gim c ph trch chung ton b cc hot ng ca cng ty, chu
trch nhim trc php lut.
- Khi hnh chnh tng hp/ k ton: 03 nhnvin
- Phng nghin cu v pht trin: 05 nhn vin chnh thc bao gm 01
Tin s, 01 thc s, 03 k s chnh.
- Phng kinh doanh: 23 nhn vin trong 01 trng phng kinh doanh,
01ph trng phng kinh doanh v 20 nhn vin kinh doanh.
- Xng sn xut 1: chc nng sn xut, lp rp v hon thin cc h
thng thit b bao gm 11 nhn vin trong 01 trng b phn sn xut chu
trch nhim chung, 01 nhn vin kim tra cht lng sn phm.
- Xng sn xut 2: Ch mu v thc hin cc thit k theo mu ca
phng nghin cu pht trin gm c 03 nhnvin.

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

4
1.2.2 Phng tin thit b
- Tng din tch s dng cho tr s: 120m2
- My tnh bn: 20 chic
- My chiu: 01 chic
- My in laser: 01 chic
- My in mu: 01 chic
- My nh k thut s: 04 chic
- My quay video: 01 chic
- Osciloscope: 03 chic
- ng h o cc loi: 30 chic
- Thit b o cng bc x t trng: 01 chic
- My pht sng: 02 chic
- My m tn: 01 chic
- My phn tch ph: 01 chic
- My phn tch s: 01 chic
- Cc dng c h tr hn, lp rp mch in t: 40 chic
- Cc phn mm lp trnh nhng, cc cng c h tr np chng trnh vo
chp,.
- Cc thit b khoan, lp rp, my ct, my mi v cc sn phm t ng khc
cng c trang b y , m bo cc yu cu trin khai thc t.
1.3 Cc lnh vc hot ng kinh doanh
Lnh vc kinh doanh chnh ca cng ty:
- Nghin cu v pht trin cc sn phm theo yu cu nghin cu ca cc
doanh nghip.
- Nghin cu v pht trin cc dng sn phm mi s dng cng ngh cao ng
dng trong cuc sng nhm p ng cc yu cu x hi.
GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

5
- Cung cp cc sn phm bng qung co in t LED do cng ty nghin cu
pht trin ra th trng.
- Cung cp cc trang thit b phc v o to cho chuyn ngnh in- in tT ng ha cho cctrng.
- Cung cp cc thit b my lc do cng ty nghin cu pht trin v sn xut.
- T vn, cung cp cc gii php k thut cho cc doanh nghip sn xut, thit
k v ch to cc dy chuyn t ng cho cc doanh nghip.
- Cung cp linh kin in t.
- Sn xut, cung cp cc sn phm tit kim nng lng v nng lng sch.
- T vn cc gii php tit kim nng lng cho cc doanh nghip sn xut.
1.4 Nhng thnh tu, sn phm ca cngty t c trong nhng nm hot
ng

Hnh 1.4.1: Cc thnh tu, sn phm ca cng ty.


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

Hnh 1.4.2: Thit b tit kim in cho h thng n tup


1.5 Gii thng
Sau nhiu nm nghin cu v pht trin, cc thnh vin trong cng ty t
c mt lot cc gii thng khc nhau v cc sn phm nghin cu m trong y
ni bt nht l:
Gii thng cho cm sn phm ngnh in t Y sinh ti Techmart2003.
Gii nht cuc thi MCU tonquc 2007- do NXP t chc cho sn phm mch
iu khin bng LED
Gii sng to Nhn Ti t Vit 2008 cho sn phm Cng ng khoa hc trc
tuyn

Hnh 1.5.1: Gii sng to Nhn Ti t Vit 2008


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

7
Gii Nht cuc thi tng xanh 2010- do B gio dc v o to kt hp
vi Tng cc mi trng, Vn phng tit kim nng lng B Cng thng, Cng ty
Toyota Vit Nam t chc cho sn phm Thit b tit kim in cho h thng n hunh
quang TKD-NXX.

Hnh 1.5.2: Gii Nht cuc thi tngxanh 2010

Gii thng Hi thi sng to tr ton quc ln th11- Gii thng

VIFOTEC ln th11. c trao gii vo 6/5/2012 cho h thng tit kim in thng
minh BKAT.

Hnh 1.5.3: Gii thng Hi thi sng to tr ton quc ln th 11


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

8
PHN II: MC CM BIN NHIT - M
2.1 S khi h thng

Hnh 0.1.1: S khi h thng


Nguyn l hot ng :
-

C 2 ch iu khin chnh : trc tip qua bm nt, v gin tip qua laptop.

Khi bm nt hay kch chut trn laptop, s c xung truyn lnh ti IC AT89S52
x l, sau IC ny s truyn lnh ti cc role role thc hin lnh.

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

9
2.2 S nguyn l chc nng cc khi
2.2.1 Khi ngun

Hnh 2.2.1: Khi ngun


Nhim v ca khi ngun: Chnh lu in AC thnh DC n p 5V lm
ngun nui cho c h thng iu khin.
in p ra sau mch cu chnh lu v lc ngun c dng nhp nh khng n
nh,ta s dng IC n p 7805 n nh in p gi tr 5V.
T in C1, C3 lc in p trc khi vo 7805, t in C2 lc in p ra
sau khi
qua 7805. Dng vo khng n nh nn cn t c gi tr ln C1=1000F, dng
qua 7805
n nh nhng trnh vic mt ngun t ngt nn cn t gi tr ln
C1=1000 F
V IC 7805 ch c th cp dng ra t gi tr 1A nn phi khuch i dng ra.
y dng transistor TIP42 khuch i dng in ra.
Gi tr in tr R quyt nh dng i qua 7805. Dng Ib ca transistor khng
ng
k nn dng qua 7805 xp x dng qua R. Hiu in th hai u in tr R
chnh l
hiu in th Ueb gia 2 chn transistor, UEB= 0,7V.
S dng transistor dn dng v 7805 n nh in p ra v vy khng cn
GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

10
dng ln i qua 7805. Chn dng qua 7805 khong 0,3A, ta xc nh in tr R
R= Ueb /I7805 =0,7/0,3=2,33.
2.2.2 Khi iu khin bng tay

Hnh 2.2.2: Khi iu khin bng tay


C tc dng iu khin trc tip role bng tay. To v pht m ng vi tng nt
c nhn.
- Chn m ngi dng C1=C2=C3=1.
- Mch pht c 5 nt iu khin.
2.2.3 Khi role

Hnh 2.2.3: Khi Role


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

11
Khi ny c chc nng iu khin cc ch nhanh chm ca qut, quay ca qut.
Thit lp :
-

Role s 1 th qut chy tc s 1

Role s 2 th qut chy tc s 2

Role s 3 th qut chy tc s 3

Role s 4 th qut quay

2.2.4 Khi X L trung tm v Hin Th


Phn hin th l 1 mn hnh LCD 16x2. C tc dng hin th ton b thng tin
m IC truyn ln.

Hnh 2.2.4.1: S khi hin th

Hnh 2.2.4.2: S khi x l trung tm


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

12
Khi x l trung tm s dng IC AT89S52 n tip nhn cc thit lp tn hiu
u vo xut ra tn hiu tng ng trong code lp trnh. Nhim v chnh bao gm:
-

Nhn thng tin t cm bin DTH11 v nhit , m sau truyn lnh ln


mn hnh LCD hin th.

Nhn bit t khi iu khin bng tay iu khin role tng ng.

Nhn lnh t laptop thng qua giao tip UART, truyn thng tin v nhit
m, trng thi bt tt ca cc role ri hin th ra mn hnh laptop cc thng s
.

Nhn lnh t laptop iu khin role.

2.2.5 Khi cm bin

Hnh 2.2.5: S khi cm bin nhit , m


S dng mt con cm bin DTH 11. C nhim v cm bin nhit m xung
quanh ri sau truyn v AT89S52 khi c lnh.
2.2.6 Khi giao tip vi laptop qua chun UART

Hnh 2.2.6: Khi giao tip vi my tnh


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

13
y l khi trung gian gia AT89S52 vi laptop. S dng chun giao tip
UART (Universal Asynchronous serial Reveiver and Transmitter ). N tip nhn lnh
t laptop sau truyn ln IC IC x l, sau ty theo yu cu t laptop m IC s
gi cc thng s nhit m, trng thi role hoc l s iu khin role bt tt.
2.3 Linh kin s dng
2.3.1 IC AT89S52

Hnh 2.3.1: IC AT89S52


y l mt vi iu khin 8bit vi 8k bite trong h thng lp trnh flash. Cc
thng s c bn:
-

Tng thch vi sn phm MCS-51

8k bite trong b nh ca h thng lp trnh flash ( ISP) bn : 1000 chu


k Ghi / Xa.

nh mc hot ng: 4V 5,5V

Hot ng khi hon ton tnh in: 0 Hz to 33 MHz

Kha b nh chng trnh c 3 mc.

B nh RAM bn trong l 256x8bit

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

14
-

32 ng dn I/O

3 B m / B nh thi 16 bit

8 ngun ngt.

Knh ni tip UART song cng

Ch gim in p v ngh ngi in p thp.

Phc hi ngt ch gim in p

B m cnh bo

Con tr d liu kp

C tt in p.

Cc AT89S52 l mt vi iu khin CMOS 8-bit nng lng thp, hiu sut cao
vi 8K byte trong b nh h thng lp trnh Flash. Thit b ny c sn xut bng
cng ngh b nh khng bin i mt cao ca Atmel, tng thch vi s chn v
thit lp lnh 80C51 theo tiu chun cng nghip. Flash trn chip cho php b nh
chng trnh c ti lp trnh trong h thng hoc bi mt b lp trnh b nh khng
bin i thng thng.Bng cch kt hp mt CPU 8-bit a nng vi trong h thng
lp trnh Flash trn mt chip nguyn khi, Atmel AT89S52 l mt vi iu khin mnh
m m cung cp mt gii php rt linh hot v hiu qu chi ph cho nhiu ng dng
iu khin nhng.
Ngoi ra, AT89S52 c thit k vi logic tnh cho hot ng tn s xung
khng v h tr hai phn mm la chn ch tit kim nng lng. Ch nhn ri
cho dng CPU trong khi cho php b nh RAM, b m/ b nh thi, cng ni tip v
h thng ngt tip tc hot ng. Ch gim in p th gi li ni dung b nh
RAM nhng ng bang b to dao ng, v hiu ha tt c cc chc nng khc ca
chip cho n ln ngt tip theo hoc l thit lp li h thng.
Chc nng c bn ca cc chn.
VCC:Cung cp in p.
GND: Ni t.
GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

15
Cng 0: t chn 32 n chn 39 (P0.0 _P0.7) l cng I/O 2 m 2 chiu 8 bit. Cng
0 c 2 chc nng: trong cc thit k c nh khng dng b nh m rng n c chc
nng nh cc ng IO, i vi thit k ln c b nh m rng n c kt hp gia
bus a ch v bus d liu.
Cng 0 cng c byte m trong khi lp trnh flash v kt qu u ra cc byte m
trong khi xc minh chng trnh. Tr pullups bn ngoi c yu cu trong qu trnh
xc minh chng trnh
Cng 1 :t chn 1 n chn 9 (P1.0 _ P1.7) l cng I/O 8 bit 2 hng vi tr
pullups bn trong, Cng 1 dng cho giao tip vi thit b bn ngoi nu cn.
Cng 1 cng nhn cc byet a ch mc thp trong khi xc minh chng trnh.
Bng 1: Chc nng cc chn ca 89S52
Chn cng

Cc chc nng thay th

P1.0

T2 ( u vo m ngoi cho B m/ b nh thi 2) , dng


ng h.

P1.1

T2EX ( B m/ b nh thi 2 chp/ ti li kch hot v iu


khin hng )

P1.5

MOSI ( c dng cho lp trnh trong h thng )

P1.6

MISO ( c dng cho lp trnh trong h thng )

P1.7

SCK ( c dng cho lp trnh trong h thng )

Cng 2:t chn 21 n chn 28 (P2.0 _P2.7) v l cng I/O 8 bit 2 hng vi tr
pullups bn trong. Cng 2 c tc dng kp dng nh cc ng xut/nhp hoc l
byte cao ca bus a ch i vi cc thit b dng b nh m rng.
Cng 2 cng nhn cc bit a ch mc cao v 1 s tn hiu iu khin trong khi
xc minh chng trnh.
GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

16
Cng 3:t chn 10 n chn 17 (P3.0 _ P3.7) v l cng I/O 8 bit 2 hng vi
tr pullups bn trong. Cng 3 c tc dng kp. Cc chn ca cng ny c nhiu chc
nng, c cng dng chuyn i c lin h n cc c tnh c bit ca 89S52 nh
bng sau:
Bng 2 : Chc nng cc bit cng P3
Bit

Tn

Chc nng chuyn i

P3.0

RX

Cng vo d liu ni tip.

P3.1
P3.2
P3.3

D
TXD
INT

Cng xut d liu ni tip.


Cng vo ngt cng th 0.
Cng vo ngt cng th 1.

0
Cng vo TIMER/ COUNTER th

P3.4
INT
P3.5

P3.6

T0

P3.7

0.
Cng vo ca TIMER/ COUNTER

T1

th 1.
Tn hiu ghi d liu ln b nh

WR

ngoi.

RD

Tn hiu c b nh d liu ngoi.

Cng 3 cng nhn 1 vi tn hiu iu khin cho lp trnh Flash v xc minh.


PSEN (Program store enable):
PSEN l tn hiu ng ra c tc dng cho php c b nh chng trnh
m rng v thng c ni n chn OE ca Eprom cho php c cc byte
GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

17
m lnh.
PSEN mc thp trong thi gian 89S52 ly lnh. Cc m lnh ca chng
trnh c c t Eprom qua bus d liu, c cht vo thanh ghi lnh bn trong
89S52 gii m lnh. Khi 89S52 thi hnh chng trnh trong ROM ni, PSEN mc
cao.
ALE (Address Latch Enable):
Khi 89S52 truy xut b nh bn ngoi, Port 0 c chc nng l bus a ch v d
liu do phi tch cc ng d liu v a ch. Tn hiu ra ALE chn th 30 dng
lm tn hiu iu khin gii a hp cc ng a ch v d liu khi kt ni chng
vi IC cht.
Tn hiu chn ALE l mt xung trong khong thi gian port 0 ng vai tr l
a ch thp nn cht a ch hon ton t ng.
EA (External Access):Tn hiu vo EA (chn 31) thng c mc ln mc 1
hoc mc 0. Nu mc 1, 89S52 thi hnh chng trnh t ROM ni. Nu mc 0,
89S52 thi hnh chng trnh t b nh m rng. Chn EA c ly lm chn cp
ngun 21V khi lp trnh cho Eprom trong 89S52.
RST (Reset):Khi ng vo tn hiu ny a
ln mc cao t nht 2 chu k my, cc thanh ghi
bn trong c np nhng gi tr thch hp khi
ng h thng. Khi cp in mch phi t ng
reset.
Cc gi tr t v in tr c chn l: .

Hnh 2.3.1.1: Khi reset

R1=10, R2=220, C=10 F


Cc ng vo b dao ng X1, X2:

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

18
B to dao ng c tch hp bn trong 89S52. Khi s dng 89S52, ngi ta ch
cn ni thm thch anh v cc t. Tn s thch anh ty thuc vo mc ch ca ngi
s dng, gi tr t thng c chn l 33p.

Hnh 2.3.1.2: B to dao ng bn trong 89S52


2.3.2 Mn hnh LCD

Hnh 2.3.2:Mn hnh LCD


LCD vit tt ca t Liquid Crytal Dislay mn hnh tinh th lng. C u im
l hin th c tt c cc k t trong bng m ASCCI, tuy nhin gi thnh cao v
khong cch nhn gn. LCD16x2 l loi LCD ph bin trn th trng, 16x2 tng ng
l 16 ct 2 hng.
Tnh nng ca LCD 16x2:
-

5 x 8 chm vi con tr

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

19
-

Tch hp b iu khin (KS 0066 hoc tng ng)

Ngun cp +5V ( cng c sn cho loi 3V)

1/16 chu k

B/L c chy bi chn 1, 2, 15,16 hoc A.K (LED)

Ty chn N.V cho ngun cp 3V.

Bng 3: M t chn ca LCD 16x2


STT Chn

K hiu

Chc nng

Vss

GND

Vdd

+3V ti 5V

Vo

iu chnh tng phn

RS

Tn hiu la chn thanh ghi H/L

R/W

Tn hiu c/Ghi H/L

Kch hot tn hiu H L

DB0

ng bus d liu H/L

DB1

ng bus d liu H/L

DB2

ng bus d liu H/L

10

DB3

ng bus d liu H/L

11

DB4

ng bus d liu H/L

12

DB5

ng bus d liu H/L

13

DB6

ng bus d liu H/L

14

DB7

ng bus d liu H/L

15

A/Vee

4.2V cho LED/u ra in p m

16

Ngun cp cho B/L (OV)

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

20
2.3.4 Cm bin DTH 11

Hnh 2.3.5.1: Thit b cm bin DTH 11.


DHT11 l cm bin nhit v m. N ra i sau v c s dng thay th
cho dng SHT1x nhng ni khng cn chnh xc cao v nhit v m. Mi
phn t DHT11 c hiu chnh ng nh trong phng th nghim nn cc k chnh
xc v hiu chun m. Cc h s hiu chnh c lu tr nh cc chng trnh
trong b nh OTP, c s dng bi tn hiu ni b ca qu trnh pht hin cm ng.
Giao din ni tip 1 dy lm cho vic tch hp h thng nhanh chng v d dng. Kch
thc nh, tiu th in nng thp v truyn tn hiu ln n 20 mt lm cho DTH 11
l s la chn tt nht cho cc ng dng khc nhau.
Thng s :
-

Phm vi o c: m trong khong RH 20-90%, nhit trong khong 050

Sai s m: 5RH

Sai s nhit : 2

phn gii : 1

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

21

Hnh 2.3.5.2: S kt ni vi vi x l
2.3.5 Giao tip UART
UART : Universal Asynchronous Serial Reveiver and Transmitter - b truyn
nhn ni tip khng ng b.
N thng kt hp vi cc chun giao tip (communication standards) nh RS232 truyn nhn d liu ni tip gia chip vi iu khin vi 1 thit b khc, chng
hn nh my tnh cc nhn PC.
Trn my tnh, cng dng giao tip RS-232 l cng DB9 (male), hay cn
c gi l cng COM. Tuy nhin hin ti ch cn PC l vn c cng COM, trong khi
th Laptop gn nh loi b hon ton cng COM m thay th bng USB. Nn khi
mun kt ni vi laptop th ngi dng phi s dng thm cc chip chuyn i UART
=> USB. VD: PL2303, CP2101/2102, PT232.
2.3.6 Role 5V

Hnh 2.3.6: Thit b Role 5V


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

22
Cc tnh nng chnh:
o Kh nng chuyn mch c sn bi 10A k c trn bng gn k thut
c mt P.C cao
o Nhn dng c UL, CUL, TUV
o Lm vic nhit cao
o Chi ph sn xut r.
2.3.7 S mch in

Hnh 2.3.7: S mch in


GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng

23
2.3.8 Hnh nh mch sau khi hon thin

Hnh 2.3.8: Sn phm hon thin

GVHD: Ths.Trn trng Thng

SVTH: Nguyn Quc Hng