bila diaktifkan akan membuat LED yang tersambung pada pin PD.7-nya akan berkedip. Berikut ini merupakan listing programnya:
regfile = m8535.dat crystal = 4000000
Config Portd = Output Do
Set Portd.7 Waitms 250
Reset Portd.7 Waitms 250
Loop
Ketika program ini diaktifkan pada rangkaian mikrokontrolernya, maka LED yang terhubung pada pin PD.7 akan berkedip terus menerus. Dengan demikian, maka rangkaian
mikrokontroler tersebut dinyatakan dalam kondisi baik.
4.3 Pengujian Rangkaian LCD Karakter 2x16
Untuk menguji rangkaian LCD, maka dibuatlah rangkaian sebagai berikut ini:
Universitas Sumatera Utara
Gambar 4.3 Pengujian Rangkaian LCD Kemudian, pada mikrokontroler dimasukkan program sebagai berikut:
regfile = 8535def.dat
crystal = 12000000
Config Lcd = 16 2
Config Lcdpin = Pin , Rs = Portc.1 , E = Portc.0 , Db4 = Portc.4 , Db5 = Portc.5 , Db6 = Portc.6 , Db7 = Portc.7
Cursor Off
Cls
Do
Locate 1 , 1
Lcd Hello World
Loop
Ketika program dieksekusi oleh mikrokontroler, maka pada display LCD akan muncul tulisan “hello, world” pada layar LCD.
4.4 Program keseluruhan rangkaian
regfile = 8535def.dat crystal = 11059200
Dim Waktu1 As Byte Dim Waktu2 As Byte
Dim Waktu3 As Byte Dim Waktu_normal As Byte
Config Portb = Input Config Porta = Output
Universitas Sumatera Utara
Universitas Sumatera Utara
Universitas Sumatera Utara
Universitas Sumatera Utara
Universitas Sumatera Utara
BAB V
KESIMPULAN DAN SARAN
5.1 KESIMPULAN
Dari hasil evaluasi kerja dapat diambil beberapa kesimpulan dalam penelitian ini. Kesimpulan yang dapat diambil oleh penulis adalah :
1. Penggunaan sensor fotodioda sebagai sensor kepadatan kendaraan sangat mudah terganggu oleh cahaya
2. Sebagai pengatur sistem kinerja alat ini membutuhkan mikrokontroler, untuk mengatur kerja sensor yang bekerja pada traffic light.
3. Rangkaian Mikrokontroler sangat di butuhkan untuk mengatur sensivitas sensor kepadatan kendaraan.
5.2 SARAN
1. Dengan beberapa perbaikan komponen dan sistem kerja alat ini ,maka alat ini akan bekerja lebih baik
2. Agar sempurna maka setiap Traffic Light harus dikendalikan Microkontroler secara otomatis
Universitas Sumatera Utara
DAFTAR PUSTAKA
Andi, Nalwan Paulus.2004.Panduan Praktis menggunakan dan Antarmuka Modul LCD
M1632.Jakarta:PT.Elex Media Komputindo. Budiharto, Widodo.2005.Panduan Lengkap Belajar Mikrokontrorel Perancangan
Sistem dan Aplikasi Mikrokontrorel .Jakarta:PT.Elex Media Komputindo.
Budioko, Totok. 2005. Belajar dengan mudah dan cepat pemograman bahasa c dengan
sdcc small device c compiler pada mikrokontrorel ATMEGA 8535 AT89C51
Teori ,Simulasi dan aplikasi .Edisi Pertama.Yogyakarta:PENERBIT GAVA MEDIA
Wahyudin ,Didin .2007 .Belajar mudah Mikrokontrorel dengan bahasa Basic menggunakan bascom -8051.Yogyakarta :c.v.andi offset.
Universitas Sumatera Utara
LM139, LM239, LM339
Low-power quad voltage comparators
Features
■
Wide single supply voltage range or dual supplies for all devices: +2 to +36 V or ±1 V to
±18 V
■
Very low supply current 1.1 mA independent of supply voltage
■
Low input bias current: 25 nA typ
■
Low input offset current: ±5 nA typ
■
Low input offset voltage: ±1 mV typ
■
Input common-mode voltage range includes ground
■
Low output saturation voltage: 250 mV typ; I
SINK
= 4 mA
■
Differential input voltage range equal to the supply voltage
■
TTL, DTL, ECL, MOS, CMOS compatible outputs
Description
This family of devices consists of four independent precision-voltage comparators with
an offset voltage specification as low as 2 mV maximum for LM339A, LM239A and LM139A.
Each comparator has been designed specifically to operate from a single power supply over a wide
range of voltages. Operation from split power supplies is also possible.
These comparators also have a unique characteristic in that the input common mode
voltage range includes ground even though operated from a single power supply voltage.
N DIP14
Plastic package
D SO-14
Plastic micropackage
P TSSOP14
Thin shrink small outline package
Q QFN16 3x3
Plastic micropackage
July 2011 Doc ID 2159 Rev 3
119
www.st.com 19
Universitas Sumatera Utara
Pin and schematic diagram LM139, LM239, LM339
1 Pin and schematic diagram
Figure 1. Pin connections top view
Output2 1 Output1 2
V +
CC 3
14 Output3 13 Output4
12 11
10 9
8 V
CC -
Inverting input1 Non-inverting input1
Inverting input2 Non-inverting input2
4 5
6 7
Non-inverting input4 Inverting input4
Non-inverting input3 Inverting input3
Figure 2. Schematic diagram 14 LM139
V
CC
3.5 A
100 A
3.5 A
100 A
Non-inverting input
V
O
Inverting input
V
CC
219 Doc ID 2159 Rev 3
Universitas Sumatera Utara
LM139, LM239, LM339 Absolute maximum ratings and operating conditions
2 Absolute maximum ratings and operating conditions
Table 1. Symbol
V
CC
V
ID
V
IN
R
thja
R
thjc
T
stg
T
j
T
LEAD
ESD
Absolute maximum ratings Parameter
Supply voltage Differential input voltage
Input voltage Output short-circuit to ground
1
Thermal resistance junction to ambient
2
DIP14 SO-14
TSSOP14 QFN16 3x3
Thermal resistance junction to case
2
DIP14 SO-14
TSSOP14 QFN16 3x3
Storage temperature range Junction temperature
Lead temperature soldering 10 seconds Human body model HBM
3
Machine model MM
4
Charged device model CDM
5
Value ±18 or 36
±36 -0.3 to +36
Infinite Unit
V V
V
80 105
100 45
°CW
33 31
32 14
-65 to +150 +150
260 500
100 1500
°CW °C
°C °C
V
1. Short-circuits from the output to V
CC +
can cause excessive heating and eventual destruction. The maximum output current is approximately 20 mA independent of the magnitude of V
CC +
. 2. Short-circuits can cause excessive heating. These values are typical.
3. Human body model: a 100 pF capacitor is charged to the specified voltage, then discharged through a 1.5 k
Ω resistor between two pins of the device. This is done for all couples of connected pin combinations while the other pins are floating.
4. Machine model: a 200 pF capacitor is charged to the specified voltage, then discharged directly between two pins of the device with no external series resistor internal resistor 5
Ω. This is done for all couples of
connected pin combinations while the other pins are floating. 5. Charged device model: all pins and the package are charged together to the specified voltage and then
discharged directly to the ground through only one pin. This is done for all pins.
Doc ID 2159 Rev 3 319
Universitas Sumatera Utara
Absolute maximum ratings and operating conditions LM139, LM239, LM339
Table 2.
Symbol
V
CC
V
ICM
Operating conditions T
amb
Parameter
Supply voltage Common mode input voltage range
= 25° C
Value 2 to 32
±1 to ±16
0 to V
CC +
- 1.5
Unit V
V T
oper
Operating free-air temperature range - LM139, LM139A
- LM239, LM239A - LM339, LM339A
-55, +125 -40, +105
0, +70 °C
419 Doc ID 2159 Rev 3
Universitas Sumatera Utara
LM139, LM239, LM339 Electrical characteristics
3
Table 3.
Electrical characteristics
Electrical characteristics at V
CC
unless otherwise specified
+
= +5 V, V
CC -
= GND, T
amb
= +25° C LM139A - LM239A
LM339A Min.
Typ. 1
LM139 - LM239 LM339
Min Typ.
1 Symbol
Parameter Unit
Input offset voltage
1
T
min
T
amb
T
max
Input offset current T
min
T
amb
T
max
Input bias current I
+
or I T
min
T
amb
T
max
Large signal voltage gain V
CC
= 15 V, R
L
= 15 k Ω
- 2
V
IO
3 I
IO
25 I
IB
Max. 2
4 25
100 100
300
5 25
Max. 5
9 50
150 250
400
mV nA
nA A
VD
V
o
= 1 V to 11 V 50
200 50
200 VmV
Supply current all comparators V
CC
V
CC
= +5 V, no load = +30 V, no load
I
CC
1.1 1.3
2 2.5
1.1 1.3
2 2.5
mA Input common mode voltage range
3
V
CC
= 30 V T
min
T
amb
T
max
Differential input voltage
4
Low level output voltage V
ID
= -1 V, I
SINK
= T
min
T
amb
T
max
4 mA V
ICM
V
CC +
-1.5 V
CC
V
CC +
-2
+
V
ID
V
CC +
-1.5 V
CC
V
CC +
-2
+
V V
V
OL
250 400
700 250
400 700
mV High level output current
V
CC
T
min
= V
o
= 30 V, V
ID
= T
amb
T
max
I
OH
1 V 0.1
0.1 1
1 nA
A Output sink current
ID
= 1 V, V
o
= 1.5 V Response time
5 L
= 5.1 k Ω connected to V
CC
V R
+
I
SINK
6 16
6 16
mA t
re
1.3 1.3
s
Doc ID 2159 Rev 3 519
Universitas Sumatera Utara
Electrical characteristics LM139, LM239, LM339
Table 3. Electrical characteristics at V
CC +
= +5 V, V
CC -
= GND, T
amb
= +25° C unless otherwise specified continued
LM139A - LM239A Parameter
Min. LM339A
Typ. LM139 - LM239
LM339 Min Typ. Max.
Symbol Unit
Max.
Large signal response time R
L
= 5.1 k Ω connected to V
CC
trel
+
, e
l
= TTL, V
ref
= +1.4 V 300
300 ns
1. At output switch point, V
o
1.4 V, V
CC +
from 5 V to 30 V, and over the full common-mode range 0 V to V
CC +
-1.5 V. 2. The direction of the input current is out of the IC due to the PNP input stage. This current is essentially constant,
independent of the state of the output, so no loading charge exists on the reference of input lines. 3. The input common-mode voltage of either input signal voltage should not be allowed to go negative by more than 0.3 V.
The upper end of the common-mode voltage range is V
CC
damage.
+
-1.5 V, but either or both inputs can go to +30 V without 4. Positive excursions of input voltage may exceed the power supply level. As long as the other voltage remains within the
common-mode range, the comparator will provide a proper output state. The low input voltage state must not be less than -0.3 V or 0.3 V below the negative power supply, if used.
5. The response time specified is for a 100 mV input step with 5 mV overdrive. For larger overdrive signals, 300 ns can be obtained.
619 Doc ID 2159 Rev 3
Universitas Sumatera Utara
LM139, LM239, LM339 Electrical characteristics curves
4
Figure 3.
Electrical characteristics curves
Supply current vs. supply voltage Figure 4.
80 60
40 20
Input current vs. supply voltage
1 0.8
0.6
T
amb
= -55°C
9
T
amb
= 0°C
T
amb
= -55°C V
i
R
i
= 0V = 10
Ω
T
amb
= 0°C T
amb
T
amb
= +25°C
Tamb = +70°C
= +25°C 0.4
0.2
T amb
= +125°C
T
amb
= +125°C
R =
10 20
30 40
10 20
T
amb
30 = +70°C
40 SUPPLY VOLTAGE V
SUPPLY VOLTAGE V
Figure 5. Output saturation voltage vs.
output current Figure 6.
1
10
Response time for various input overdrives - negative transition
6 Input overdrive : 5mV
5V
5 4
5.1k Ω
20mV
e
I
3
e
o
2 1 100mV
-50 -100
T
amb
= +25°C 0 0.5
1 TIME
s 1.5
2 Out of saturation
10 T
amb
= +125°C
-1
10
-2
10 T
amb
T
amb
= +25°C = -55°C
10
-3
10
-2 -1
1 2
10 10
10 10
OUTPUT SINK CURRENT mA
Figure 7. Response time for various input
overdrives - positive transition
20mV T
amb
= +25°C 6
5 4
3 2
1 00
50 Input overdrive : 100mV
5mV
0.5 1
TIME s
1.5 2
Doc ID 2159 Rev 3 719
A n
NT RE
R U
C T
P U
N I
m A
UR RE
NT C
S UP
P L
Y
E G
A T
L V
O L
T A
GE V
O OL
T A
GE T
U P
T U
O V
INP UT
V V
m V
T UR
A T
IO N
SA
1 V
E m
V T
A GE
V OL
T A
G OL
V INP
UT OUT
P UT
Universitas Sumatera Utara
Typical applications LM139, LM239, LM339
5
Figure 8.
Typical applications
Basic comparator
V
CC
= 5 V 15 k
Ω
Figure 9. Driving CMOS
5 V
100 k Ω
+V
ref
+V
ref
14 LM139
1 4 LM139
V
O
-V
ref
-V
ref
Figure 10. Driving TTL
5 V
Figure 11. Low frequency op amp
5 V 15 k
Ω
10 k Ω
14 LM139
+V
ref
~
e
l
1 4 LM139
100 k Ω
A
V
= 100
e
o
0.5 F
-V
ref
1 k Ω
Figure 12. Low frequency op amp
5 V e
o
= 0 V for e
l
= 0 V
Figure 13. Transducer amplifier
5 V 15 k
Ω Magnetic pick-up
10 k Ω
3 k Ω
1 4 LM139
2N 2222
~
e
l
0.5 F
1 4 LM139
20 M Ω
e
o
100 k Ω
A
V
= 100 1 k
Ω e
o
10 k Ω
819 Doc ID 2159 Rev 3
Universitas Sumatera Utara
LM139, LM239, LM339 Typical applications
Figure 14. Time delay generator
V
C C
= +15V 10 k
Ω 15 kΩ 200 k
Ω 3 k
Ω 10 M
Ω 10 k
Ω
14 LM139
V
30
V
3
V
CC
t
o
t
3
3k Ω
10 k Ω
10 k Ω
V
CC
t
o
14 LM139
51 k Ω
V
C1
10 M Ω
t
A
14 LM139
V O2
V
ref.
V
2
V
CC
t
o
t
2
Input gating signal
V
CC
0.001 F
3 k Ω
10 M Ω
51 k Ω
10 k Ω
V
C1
V
3
V
2
V
1
t t t
1 1 4
LM139
V
O1
t t
3
t
4
V
1
51 k Ω
V
CC
t t
1
2
Figure 15. Low frequency op amp with offset adjust
5 V Offset adjust 100 k
Ω 5 V
R
2
1 M Ω
1 M Ω
R
S
R
1
Figure 16. Zero crossing detector single power supply
5 V
5.1 k Ω
100 k Ω
5.1 k Ω
100 k Ω
5.1 k Ω
15 k Ω
1 4 LM139
0.5 F
R1 100 k
Ω
e
l
e
l
~ 2N 2222
1 4 LM139
1N4148
1 k Ω
20 M Ω
e
o
10 k Ω
Figure 17. Two-decade high-frequency VCO
V
CC
100 k Ω
V
CC
100 k Ω
Frequency control voltage input
Vcontrol 500 pF
1 4 LM139
0.1 F
20 k Ω
3 k Ω
5.1 k Ω
0.01 F
3 k
Ω 1 4
LM139 Output 1
V
CC
2 Output 2
50 k Ω
20 k Ω
V
CC
2 1 4
LM139 V
CC
= + +250 mV
700 Hz 3 0 V
Vcontrol fo
+50 V 100 kHz
Doc ID 2159 Rev 3 919
Universitas Sumatera Utara
Typical applications LM139, LM239, LM339
Figure 18. Limit comparator
V
CC
Figure 19. Crystal-controlled oscillator
V
CC
= 15 V
12 V 2R
S
10 k Ω
1 4 LM139
200 k Ω
2 k Ω
V
ref
high
100 k Ω
Lamp R
S
V
CC
0.1 F
1 4 LM139
e
o
e
I
~
f = 100 kHz
2R
S
1 4 LM139
2N 2222
200 k Ω
V
ref
low
Figure 20. Zero crossing detector
15 V
Figure 21. Comparator with a negative reference
15 V
5.1 k Ω
5.1 k Ω
14 LM139
e
o
1 4 LM139
e
o
e
I
~ e
I
~ 5 V
15 V 15 V
1019 Doc ID 2159 Rev 3
Universitas Sumatera Utara
LM139, LM239, LM339 Package information
6 Package information
In order to meet environmental requirements, ST offers these devices in different grades of ECOPACK
®
packages, depending on their level of environmental compliance. ECOPACK
®
specifications, grade definitions and product status are available at: www.st.com. ECOPACK
®
is an ST trademark.
Doc ID 2159 Rev 3 1119
Universitas Sumatera Utara
Package information LM139, LM239, LM339
6.1 DIP14 package information