Realisasi Kendaraan Yang Mengikuti Suatu Lintasan Tertentu Dengan Pengendali Logika Fuzzy.

Abstrak
Pada saat ini teknologi robot berkembang dengan sangat cepat.
Robot-robot tersebut banyak digunakan dalam berbagai bidang seperti:
bidang penelitian, industri, kedokteran, eksplorasi ruang angkasa dan lainlain. Salah satu jenis robot yang banyak digunakan dalam bidang industri
yaitu robot yang dapat mengikuti lintasan garis tertentu (line follower
robot). Pada umumnya robot tipe ini berbentuk kendaraan.
Realisasi

hardware

dari

line

follower

robot

menggunakan

penjejakan sensor inframerah untuk mendeteksi garis lintasan berwarna

hitam pada bidang alas berwarna putih. Sensor yang digunakan berupa
sensor optocoupler sebanyak enam buah. Pengaturan kecepatan dari
motor

dc

dilakukan

dengan

metoda

PWM

oleh

mikrokontroler.

Mikrokontroler ATMega16 ini juga sebagai pengatur kerja antara satu
komponen dengan yang lain. Metoda pengendalian yang digunakan

adalah logika fuzzy, namun proses perhitungan logika fuzzy dilakukan di
luar mikrokontroler, dengan menggunakan software petrafuz. Hasil input
dan output logika fuzzy tersebut kemudian disimpan ke dalam
mikrokontroler. Lintasan yang diuji coba berupa garis lintasan lurus, belok
melengkung dan persimpangan.
Hasil percobaan yang dilakukan menunjukkan bahwa kendaraan
dapat mengikuti bentuk garis lintasan yang harus diikuti. Jadi dapat
disimpulkan, realisasi kendaraan secara hardware berhasil dibuat.
Sedangkan untuk pengendali dengan logika fuzzy, hasil yang dicapai
masih belum sempurna. Hal ini karena penulis mengalami kesulitan dalam
membuat program pengendali logika fuzzy. Sehingga pengendali logika
fuzzy yang dipakai belum dapat dilakukan oleh mikrokontroler sendiri.

i

Universitas Kristen Maranatha

Abstract
In the past few years, the development of robotic technology is
growing very rapidly. Those robots are use in many different fields, such

as: experimental, medical, industrial, space exploration and etc. One type
of robot that commonly use in industrial fields is a line follower robot.
This final project goal is to make a realization of a line follower robot
using fuzzy logic controller. This robot is using six infrared sensors
(optocoupler sensor) to detect a black line in a white background. The dc
motor speed is controlled by microcontroller’s PWM output. This
microcontroller also works as a control center for other components. The
controller of this line follower robot is using a fuzzy logic control. However
the computation of fuzzy logic Is done by using Petrafuz software. Then
the input and output value from Petrafuz software will be store in
microcontroller. The shapes of tracks that will be test are a straight line, a
slope curve with 900 angle and a cross section.
The experiment showed that the line follower robot is capable in
following the shapes of

tracks. From the result, we can say that the

realization of a line follower robot is succeed. However for the fuzzy logic
controller is not perfect. This because the computation process of fuzzy
logic is not done by microcontroller itself.


ii

Universitas Kristen Maranatha

KATA PENGANTAR
Pertama-tama, puji dan syukur kepada Tuhan Yang Maha Esa karena atas
berkat dan rahmat-Nya, penulis dapat menyelesaikan laporan tugas akhir ini tepat
pada waktunya.
Tugas Akhir yang berjudul “Realisasi Kendaraan Yang Mengikuti
Suatu Lintasan Tertentu Dengan Pengendali Logika Fuzzy“ dibuat untuk
memenuhi persyaratan program studi Strata Satu Fakultas Teknik Jurusan Teknik
Elektro di Universitas Kristen Maranatha.
Dalam menyelesaikan tugas akhir ini bukan suatu hal yang mudah,
banyak halangan dan masalah yang yang harus dihadapi karena keterbatasan
pengalaman dan pengetahuan. Penulis menyadari bahwa tanpa anugerah Tuhan,
serta bantuan dari berbagai pihak, tidak dapat menyelesaikan tugas akhir ini
dengan baik. Oleh karena itu, tidak lupa penulis ucapkan banyak terima kasih
kepada pihak-pihak yang telah membantu dalam pengerjaan kerja praktek ini,
yaitu:

1. Bapak Agustinus, ST.,MT. selaku pembimbing pertama tugas akhir yang
telah memberikan masukan pengetahuan dan ide-ide serta membimbing
dalam pembuatan tugas akhir ini.
2. Bapak Muliady, ST., MT. selaku pembimbing kedua tugas akhir yang
telah mendorong dan memberikan masukan serta pemecahan masalah
dalam menyelesaikan tugas akhir ini.
3. Bapak Ir. Aan Darmawan, MT., selaku Ketua Jurusan Teknik Elektro
perioda 2004-2008 yang telah membantu memberikan kesempatan dan
masukan-masukan dalam menyelesaikan tugas akhir ini..
4. Ibu Ir. Anita Supartono Msc., selaku koordinator TA yang tetap
mendorong serta memberikan kesempatan untuk menyelesaikan tugas
akhir ini.
5. Kepada bapak dan ibu yang bekerja di bagian Tata Usaha Jurusan Teknik
Elektro.

iii

Universitas Kristen Maranatha

6. Kepada bapak Ade dan bapak Endang yang bekerja di Laboratorium

Elektronika dan Laboratorium Fisika yang telah membantu menyediakan
peralatan-peralatan yang dibutuhkan.
7. Kepada bapak dan ibu yang bekerja di bagian Perpustakaan Fakultas
Teknik.
8. Papa, mama, atas dorongan moril dan dukungan doa yang telah
menguatkan penulis.
9. Tony, Heru, Yence, Alex, Andris, Harrison, Tina, Pohan, Citra, Mario
Koba, Willy, Nico, dan Dennis yang telah memberikan dukungan moril
dan bantuan dalam mengerjakan tugas akhir ini.
10. Teman-teman dan pihak-pihak lain yang telah membantu dalam
mengerjakan tugas akhir ini, yang tidak dapat disebutkan satu-persatu.
Demikian tugas akhir ini disusun, sehingga kiranya dapat memberikan
pemahaman dan tambahan pengetahuan bagi pembaca pada umumnya dan
mahasiswa secara khusus. Penulis juga menyadari bahwa laporan ini jauh dari
sempurna sehingga apabila ditemukan kesalahan, penulis mohon maaf yang
sebesar-besarnya. Penulis juga mengharapkan kritik dan saran dari pembaca.

Bandung, Juli 2006

Penulis


iv

Universitas Kristen Maranatha

DAFTAR ISI
Halaman
LEMBAR PENGESAHAN
SURAT PERNYATAAN
ABSTRAK ................................................................................................... i
ABSTRACT.................................................................................................ii
KATA PENGANTAR .................................................................................. iii
DAFTAR ISI ............................................................................................... v
DAFTAR GAMBAR .................................................................................. viii
DAFTAR TABEL ........................................................................................xi
DAFTAR RUMUS ..................................................................................... xii
BAB I

PENDAHULUAN .......................................................................... 1
I.1. Latar Belakang ..................................................................... 1

I.2. Identifikasi masalah .............................................................. 2
I.3. Tujuan .................................................................................. 2
I.4. Spesifikasi Alat ..................................................................... 2
I.5. Pembatasan Masalah........................................................... 2
I.6. Sistematika Penulisan .......................................................... 3

BAB II LANDASAN TEORI ...................................................................... 5
II.1. Definisi Robot ....................................................................... 5
II.1.1. Klasifikasi Robot........................................................... 6
II.1.1.1. Klasifikasi Robot berdasarkan Sistem Koordinat .... 7
II.1.1.2. Klasifikasi Robot berdasarkan Metoda kendali ..... 11
II.2. Sensor ................................................................................ 12
II.2.1. Infra Merah ................................................................. 13
II.3. Logika Fuzzy ...................................................................... 15
II.3.1 Himpunan Fuzzy ........................................................ 16
II.3.1.1. Fungsi Keanggotaan Himpunan Fuzzy ................. 19
II.3.1.2. Aturan Fuzzy Jika-Maka........................................ 22
II.3.2 Fuzzy Interface Systems (FIS) ................................... 22
II.3.2.1. Fuzzifikasi ............................................................. 23


v

Universitas Kristen Maranatha

II.3.2.2. Operator Fuzzy ..................................................... 24
II.3.2.3. Metoda Implikasi ................................................... 25
II.3.2.4. Agresi Keluaran .................................................... 25
II.3.2.5. Defuzzifikasi.......................................................... 26
II.3.2.6. Metoda Fuzzy Tipe Sugeno .................................. 27
II.4. Mikrokontroler..................................................................... 28
II.4.1 Memori ....................................................................... 28
II.4.2 Bagian Input/Output (I/O) ........................................... 29
II.4.3 Peripheral Mikrokontroler ATmega16......................... 30
II.4.4 Sleep Mode ................................................................ 36
II.4.5 Mode Pengalamatan .................................................. 37
II.4.6 Perangkat Lunak ........................................................ 41
II.4.6.1. AVR Studio 4 ........................................................ 43
II.4.6.2. Perangkat Antarmuka antara Komputer dengan
Mikrokontroler ...................................................... 44
II.4.6.2.1. Perangkat Keras Antara Komputer dengan

Mikrokontroler ............................................... 45
II.4.6.2.2. Perangkat Lunak Antara Komputer dengan
Mikrokontroler ............................................... 45
II.4.6.3. Petrafuz ................................................................ 46
BAB III PERANCANGAN PERANGKAT KERAS DAN LUNAK .............. 48
III.1. Diagram Blok...................................................................... 48
III.2. Perancangan Perangkat Keras .......................................... 51
III.3.1. Rangkaian Catu Daya ................................................ 51
III.3.2. Sensor Lintasan Garis................................................ 52
III.3.3. Rangkaian Output Motor DC ...................................... 54
III.3.4. Mikrokontroller ATmega16 ......................................... 55
III.3. Perancangan Perangkat Lunak ......................................... 56
III.3.1. Perancangan Logika Fuzzy ........................................ 57
III.3.1.1. Fungsi Keanggotaan Input Himpunan Fuzzy ....... 59
III.3.1.2. Fungsi Keanggotaan Output Himpunan Fuzzy ..... 60
III.3.2. Perancangan Program Mikrokontroller ....................... 61

vi

Universitas Kristen Maranatha


BAB IV Data Pengamatan Kendaraan Yang Mengikuti Suatu Lintasan
Tertentu ...................................................................................... 70
IV.1. Posisi Sensor dengan Bidang Lintasan.............................. 70
IV.2. Hasil

Input-Output

Pengendali

Logika

Fuzzy

dengan

Software Petrafuz............................................................... 72
IV.3. Pengamatan

Jalan

Kendaraan

Yang

Mengikuti

Garis

Lintasan Tertentu ............................................................... 74
BAB V KESIMPULAN DAN SARAN ...................................................... 77
DAFTAR PUSTAKA................................................................................. 78
LAMPIRAN A Gambar Foto Alat................................................................A
LAMPIRAN B Skema Rangkaian Alat........................................................B
LAMPIRAN C Perangkat Lunak ................................................................C
LAMPIRAN D Datasheet Komponen .........................................................D

vii

Universitas Kristen Maranatha

DAFTAR GAMBAR
Halaman
Gambar 2.1 Robot Cantilevered Cartesian ............................................. 7
Gambar 2.2 Robot Gantry-Style Cartesian............................................... 8
Gambar 2.3 Robot Koordinat Cylindrical .................................................. 8
Gambar 2.4 Robot Koordinat Spherical.................................................... 9
Gambar 2.5 Robot Joint Spherical Murni ................................................. 9
Gambar 2.6 Robot Parallelogram Spherical........................................... 10
Gambar 2.7 Robot Cylindrical Joint........................................................ 10
Gambar 2.8 Diagram Blok Sensor Optocoupler ..................................... 12
Gambar 2.9 Sensor Optocoupler ........................................................... 12
Gambar2.10 Daerah Frekuensi Gelombang Infra Merah ........................ 13
Gambar2.11 Daerah Panjang Gelombang Infra Merah........................... 14
Gambar2.12 Himpunan Fuzzy dan Fungsi Keangggotaannya................ 17
Gambar2.13 Diagram Venn Gabungan Dua Himpunan .......................... 17
Gambar2.14 Diagram Venn Irisan dua Himpunan .................................. 18
Gambar2.15 Diagram Venn Komplemen Dua Himpunan........................ 18
Gambar 2.16a Fungsi Keanggotaan Himpunan Logika Konvensional..... 19
Gambar 2.16b Fungsi Keanggotaan Himpunan Logika Fuzzy................. 19
Gambar 2.17 Fungsi Keanggotaan S ...................................................... 20
Gambar 2.18 Fungsi Keanggotaan π ...................................................... 20
Gambar 2.19 Fungsi Keanggotaan Trapesium ........................................ 21
Gambar 2.20 Fungsi Keanggotaan Segitiga ............................................ 21
Gambar 2.21 Fungsi Keanggotaan Gauss............................................... 22
Gambar 2.22 Arsitektur Fuzzy Interface System ..................................... 23
Gambar 2.23 Proses Fuzzifikasi .............................................................. 23
Gambar 2.24 Proses Aplikasi Operator OR Metoda MAX ....................... 24
Gambar 2.25 Proses Impilkasi Metoda MIN ............................................ 25
Gambar 2.26 Proses Agresi Keluaran dengan Metoda MAX................... 26
Gambar 2.27 Arsitektur Atmega16 .......................................................... 31

viii

Universitas Kristen Maranatha

Gambar 2.28 Blok Diagram ATmega16 ................................................... 32
Gambar 2.29 Mikrokontroller Atmega16 .................................................. 33
Gambar 2.30 Instruksi Sleep Mode ......................................................... 36
Gambar 2.31 Direct Single Register Addressing ..................................... 38
Gambar 2.32 Direct Register Addressing dengan 2 register.................... 38
Gambar 2.33 I/O Direct Addressing ......................................................... 39
Gambar 2.34 Data Indirect Addressing with Pre-Decrement ................... 39
Gambar 2.35 Data Indirect Addressing with Post-increment ................... 40
Gambar 2.36 Program Memory Constant Addressing ............................. 40
Gambar 2.37 Program Memory with post-Increment ............................... 41
Gambar 2.38 Tampilan Programmer AVR Studio 4................................. 44
Gambar 2.39 Diagram Blok AVR ISP ...................................................... 45
Gambar 2.40 Tampilan dari Software downloader ALL-11 ...................... 46
Gambar 2.41 Tampilan Software Petrafuz............................................... 47
Gambar 3.1 Blok Diagram Robot............................................................. 48
Gambar 3.2 Blok Kerja Alat ..................................................................... 49
Gambar 3.3 Rangkaian Catu Daya Mikrokontroler dan Sensor .............. 51
Gambar 3.4 Rangkaian Catu Daya untuk Motor DC................................ 52
Gambar 3.5 Rangkaian Sensor Optocoupler ........................................... 53
Gambar 3.6 Posisi Sensor GP2S28 pada badan PCB ............................ 53
Gambar 3.7 Skema Rangkaian Kendaraan ............................................. 56
Gambar 3.8 Flowchart Logika Fuzzy untuk Line Follower ....................... 58
Gambar 3.9 Bentuk Membership Function untuk Input Error dan Derror 59
Gambar 3.10 Bentuk membership Function Output................................. 60
Gambar 3.11 Flowchart Sistem .............................................................. 63
Gambar 3.12 Flowchart Subroutine PB .................................................. 64
Gambar 3.13 Flowchart Subroutine PS .................................................. 65
Gambar 3.14 Flowchart Subroutine NS .................................................. 66
Gambar 3.15 Flowchart Subroutine NB .................................................. 67
Gambar 3.16 Flowchart Subroutine Z ..................................................... 68
Gambar 3.17 Flowchart Subroutine Tunda ............................................. 68
Gambar 3.18 Flowchart Subroutine Sleep .............................................. 69

ix

Universitas Kristen Maranatha

Gambar 4.1 Pantulan Sensor Terhadap Bidang Lintasan........................ 71

x

Universitas Kristen Maranatha

DAFTAR TABEL
Halaman
Tabel 2..1 Fungsi Pengganti Port B ....................................................... 34
Tabel 2.2

Fungsi Pengganti Port C ...................................................... 35

Tabel 2.3

Fungsi Pengganti Port D ....................................................... 35

Tabel 2.4

Nilai bit SM0, SM1, SM2 untuk menentukan mode sleep .... 37

Tabel 3.1

Membership Function Input dan posisi point-pointnya ......... 60

Tabel 3.2

Membership Function Output dan posisi point-pointnya ...... 61

Tabel 3.3

Hasil Selisih Gain PWM dengan Logika Fuzzy .................... 62

Tabel 4.1

Tegangan Output Sensor ..................................................... 71

Tabel 4.2 Tegangan Output Hasil Deteksi pada Input Sensor ................ 72
Tabel 4.3 Tabel Selisih Gain dengan Pengendali Logika Fuzzy .............. 73
Tabel 4.4 Beberapa Nilai Input dan Output Fuzzy Hasil Petrafuz ............ 73
Tabel 4.5 Pengamatan Gerak Kendaraan ............................................... 74

xi

Universitas Kristen Maranatha

DAFTAR RUMUS
Halaman
Rumus 2.1 .............................................................................................. 13
Rumus 2.2 .............................................................................................. 14
Rumus 2.3 .............................................................................................. 15
Rumus 2.4 ............................................................................................... 16
Rumus 2.5 .............................................................................................. 17
Rumus 2.6 .............................................................................................. 17
Rumus 2.7 .............................................................................................. 18
Rumus 2.8 .............................................................................................. 18
Rumus 2.9 .............................................................................................. 24
Rumus 2.10 ............................................................................................ 24
Rumus 2.11 ............................................................................................ 24
Rumus 2.12 ............................................................................................ 24
Rumus 2.13 ............................................................................................ 25
Rumus 2.14 ............................................................................................ 25
Rumus 2.15 ............................................................................................ 26
Rumus 2.16 ............................................................................................ 26
Rumus 2.17 ............................................................................................ 27

xii

Universitas Kristen Maranatha

LAMPIRAN A
Foto Alat

A

LAMPIRAN B
Skema Rangkaian Alat

B

LAMPIRAN C
Perangkat Lunak

C



Rule-rule Fuzzy Logic Control untuk kendaraan yang mengikuti

suatu lintasan tertentu dengan software Petrafuz.
1. IF error IS NB AND derror IS NB THEN selisihgain IS PB
2. IF error IS NB AND derror IS NS THEN selisihgain IS PS
3. IF error IS NB AND derror IS Z THEN selisihgain IS PS
4. IF error IS NB AND derror IS PS THEN selisihgain IS PB
5. IF error IS NB AND derror IS PB THEN selisihgain IS PB
6. IF error IS NS AND derror IS NB THEN selisihgain IS PS
7. IF error IS NS AND derror IS NS THEN selisihgain IS PS
8. IF error IS NS AND derror IS Z THEN selisihgain IS PB
9. IF error IS NS AND derror IS PS THEN selisihgain IS PB
10.IF error IS NS AND derror IS PB THEN selisihgain IS PB
11.IF error IS Z AND derror IS NB THEN selisihgain IS PB
12.IF error IS Z AND derror IS NS THEN selisihgain IS PS
13.IF error IS Z AND derror IS Z THEN selisihgain IS Z
14.IF error IS Z AND derror IS PS THEN selisihgain IS NS
15.IF error IS Z AND derror IS PB THEN selisihgain IS NB
16.IF error IS PS AND derror IS NB THEN selisihgain IS NS
17.IF error IS PS AND derror IS NS THEN selisihgain IS NS
18.IF error IS PS AND derror IS Z THEN selisihgain IS NB
19.IF error IS PS AND derror IS PS THEN selisihgain IS NS
20.IF error IS PS AND derror IS PB THEN selisihgain IS NB
21.IF error IS PB AND derror IS NB THEN selisihgain IS NB
22.IF error IS PB AND derror IS NS THEN selisihgain IS NS
23.IF error IS PB AND derror IS Z THEN selisihgain IS NB
24.IF error IS PB AND derror IS PS THEN selisihgain IS NS
25.IF error IS PB AND derror IS PB THEN selisihgain IS NB



Program Mikrokontroler

Perintah macro pada file avr.inc
;------------------------------------------------;
; Load/store word dari/ke memori
;
;

ldsw

Z,mem

;

ldiw

Z,imm

.macro

ldiw

ldi

@0L,low(@1)

ldi

@0H,high(@1)

.endm
.macro

ldsw

lds

@0L,@1

lds

@0H,@1+1

.endm
.macro

lddw

ldd

@0L,@1

ldd

@0H,@1+1

.endm
.macro

stsw

sts

@0,@1L

sts

@0+1,@1H

.endm
.macro

stdw

std

@0,@1L

std

@0+1,@1H

.endm
.macro

pushw

push @0H
push @0L
.endm

.macro

popw

pop

@0L

pop

@0H

.endm
;------------------------------------------------;
; Operasi Word dengan dua register
;
.macro

addiw

subi

@0L,low(-(@1))

sbci

@0H,high(-(@1))

.endm
.macro

subiw

subi

@0L,low(@1)

sbci

@0H,high(@1)

.endm
.macro

addw

add

@0L,@1L

adc

@0H,@1H

.endm
.macro

adcw

adc

@0L,@1L

adc

@0H,@1H

.endm
.macro

subw

sub

@0L,@1L

sbc

@0H,@1H

.endm
.macro

.endm

sbcw

sbc

@0L,@1L

sbc

@0H,@1H

.macro

cpw

cp

@0L,@1L

cpc

@0H,@1H

.endm
.macro

cpcw

cpc

@0L,@1L

cpc

@0H,@1H

.endm
.macro

andw

and

@0L,@1L

and

@0H,@1H

.endm
.macro

andiw

andi

@0L,low(@1)

andi

@0H,high(@1)

.endm
.macro

orw

or

@0L,@1L

or

@0H,@1H

.endm
.macro

oriw

ori

@0L,low(@1)

ori

@0H,high(@1)

.endm
.macro

lslw

lsl

@0L

rol

@0H

.endm
.macro

.endm

lsrw

lsr

@0H

ror

@0L

.macro

asrw

asr

@0H

ror

@0L

.endm
.macro

rolw

rol

@0L

rol

@0H

.endm
.macro

rorw

ror

@0H

ror

@0L

.endm
.macro

clrw

clr

@0L

clr

@0H

.endm
.macro

comw

com

@0L

com

@0H

.endm
.macro

movew

mov

@0L, @1L

mov

@0H, @1H

.endm
.macro

tstw

cp

@0L, _0

cpc

@0H, _0

.endm
.macro

.endm

outw

out

@0H, @1H

out

@0L, @1L

.macro

inw

in

@0L, @1L

in

@0H, @1H

.endm
;------------------------------------------------;
; Output port immediate via r16
;

outi

.macro

port,var
outi

ldi

r16,@1

out

@0,r16

.endm
;------------------------------------------------;
; Add immediate to register
.macro
subi
.endm

addi
@0,-(@1)

Program Utama
;------------------------------------------------------------------------------------------;
; Program Line Follower Robot
; Internal Oscillator 8 Mhz, dengan low fuse bit untuk bit CKSEL 01000
dan SUT: 10 (start up time 65ms);
; Mode sleep yang digunakan power-down, dan

;

; Timer0 dan Timer2 dipakai dalam mode PWM

;

;-----------------------------------------------------------------------------------------;

.include "m16def.inc"
.include "avr.inc"
.equ

RAMTOP = 0x60

.equ

bit0

= 0b00000001

.equ

bit1

= 0b00000010

.equ

bit2

= 0b00000100

.equ

bit3

= 0b00001000

.equ

bit4

= 0b00010000

.equ

bit5

= 0b00100000

.equ

bit6

= 0b01000000

.equ

bit7

= 0b10000000

.def simpan1 = r16
.def simpan2 = r17
.def simpan3 = r21
.def err = r25
.def AL = r18
.def AH = r19
.def speed = r20
.def positif = r22
.def Esblm = r29
.def E = r30
.def De = r31

.equ setpoint = 0b00110011
.equ batasns = 0b00000110
.equ batasnb = 0b00001001
.equ batasps = 0b00001100
.equ bataspb = 0b00010100
.equ batasz = 0x00
.equ gainpb = 128
.equ gainps = 64
.equ gainz = 0
.equ gainns = 64
.equ gainnb = 128
.equ batasdens = 0b00000110
.equ batasdenb = 0b00001001
.equ batasdeps = 0b00001100
.equ batasdepb = 0b00010100
.equ batasdez = 0x00
;---------------------------------------------------------------;
;

Tabel Interupsi

;---------------------------------------------------------------;
.cseg
jmp RESET

; interupt RESET

;

jmp 0

; interupt INT0

;

jmp 0

; interupt INT1

;

jmp 0

; interupt TIMER2_COMP

;

jmp 0

; interupt TIMER2_OVF

;

jmp 0

; interupt TIMER1_CAPT

;

jmp 0

; interupt TIMER1_COMPA

;

jmp 0

; interupt TINER1_COMPB

;

jmp 0

; interupt TIMER1_OVF

;

jmp TIM0_0VF

; interupt TIMER0_OVF

;

jmp 0

; interupt SPI_STC

;

;

jmp 0

; interupt USART_RXC

;

jmp 0

; interupt USART_UDRE

;

jmp 0

; interupt USART_TXC

;

jmp 0

; interupt ADC

;

jmp 0

; interupt EE_RDY

;

jmp 0

; interupt ANA_COMP

;

jmp 0

; interupt TWI

;

jmp 0

; interupt INT2

;

jmp 0

; interupt TIMER2_COMP

;

jmp 0

; interupt SPM_RDY

;---------------------------------------------------------------;

;--------------------------------------------------------------;
;

POWER ON RESET/ POWER ON

;

;--------------------------------------------------------------;

RESET

:

ldiw A, RAMEND

; inisialisasi Stack Pointer

outw SP, A

;

clr err
outi DDRA, 0b00000000

; inisialisasi PORTA

outi PORTA, 0b00000000 ; /
outi DDRB, 0b01101011

; Inisialisasi PORTB

outi PORTB, 0b10010100 ; /
outi DDRC, 0b11111111

; Inisialisasi PORTC

outi PORTC, 0b00000000 ; /
outi DDRD, 0b11111111

; Inisialisasi PORTD

outi PORTD, 0b01111111 ; /

ldi Esblm, 0b00000000

; inisialisasi Emin awal

outi TCCR0, 0b01100101

; Inisialisasi TIMER 0 untuk motor

outi TCCR2, 0b01100111

; Inisialisasi Timer 2 untuk motor

kiri

kanan

outi OCR0,

0x7F

outi OCR2,

0x7F

clr positif
clr speed
outi PORTB, 0b0100010 ; start motor kiri dan kanan
call delay
sei
;-------------------------------;
;

Program Utama

;

;-------------------------------;

start:
rcall ceksensor
cpi AL, 0x3F
breq cekerr
ldi simpan3, setpoint
mov simpan1, AL
cp simpan3, simpan1
brsh pos
brlo negatif

ceksensor:
outi PORTD, 0b01101010 ; pemancar sensor 1,3 dan 5 aktif
sbi PORTA, 6

; penerima aktif

rcall wait
in AL, PORTA
mov AH, AL

; baca hasil di portA

outi PORTA, 0b01010101 ; pemancar sensor 2,4 dan 6 aktif
sbi PORTA, 6
rcall wait
in AL, PORTA
or AL, AH
ret
cekerr:
inc err
cpi err, 0x04
breq enter_SLEEP
rcall ceksensor
cpi AL, 0x3F
breq cekerr
ret

enter_SLEEP

:

outi PORTA, 0b00000000
outi PORTB, 0b00100010
outi PORTC, 0b00000000
outi PORTD, 0b01111111
in r16, SREG
clr positif
outi MCUCR, 0b10110011
sleep
ret

terus:
mov Esblm, E
rcall delay
jmp start

; penerima aktif

pos:
sbr positif, 0
sub simpan3, simpan1
mov E, simpan3
cpi E, bataspb
brsh epb
brlo cekeps
epb:
rcall pb
rjmp terus
cekeps:
cpi E, batasps
brsh eps
brlo ez
eps:
rcall ps
rjmp terus
negatif:
cbr positif, 0
mov simpan2, simpan1
sub simpan2, simpan3
mov E, simpan2
cpi E, batasnb
brsh enb
brlo cekens
enb:
rcall nb
rjmp terus
cekens:
cpi E, batasns
brsh ens
brlo ez

ens:
rcall ns
rjmp terus
ez:
rcall zero
rjmp terus
;----------------------------------------;
;

Positif Big

;

;----------------------------------------;
pb:
mov simpan3, E
cp simpan3, Esblm
brsh positifpb
brlo negatifpb
positifpb:
sub simpan3, Esblm
mov De, simpan3
cpi De, batasdepb
brsh depb_pb
brlo cekdepb_ps
negatifpb:
mov simpan2, Esblm
sub simpan2, simpan3
mov De, simpan2
cpi De, batasdenb
brsh depb_nb
brlo depb_ns
depb_pb:
ldi simpan1, gainnb
rcall kurangkec
ret

cekdepb_ps:
cpi E, batasdeps
brsh depb_ps
brlo depb_z
depb_ps:
ldi simpan1, gainns
rcall kurangkec
ret
depb_z:
ldi simpan1, gainnb
rcall kurangkec
ret
depb_nb:
ldi simpan1, gainnb
rcall kurangkec
ret
cekdepb_ns:
cpi E, batasdens
brsh depb_ns
brlo depb_z
depb_ns:
ldi simpan1, gainnb
rcall kurangkec
ret
;--------------------------;
;

Positif Small ;

;--------------------------;
ps:
mov simpan3, E
cp simpan3, Esblm
brsh positifps
brlo negatifps

positifps:
sub simpan3, Esblm
mov De, simpan3
cpi De, batasdepb
brsh deps_pb
brlo cekdeps_ps
negatifps:
mov simpan2, Esblm
sub simpan2, simpan3
mov De, simpan2
cpi De, batasdenb
brsh deps_nb
brlo deps_ns
deps_pb:
ldi simpan1, gainnb
rcall kurangkec
ret
cekdeps_ps:
cpi E, batasdeps
brsh deps_ps
brlo deps_z
deps_ps:
ldi simpan1, gainns
rcall kurangkec
ret
deps_z:
ldi simpan1, gainnb
rcall kurangkec
ret
deps_nb:

ldi simpan1, gainns
rcall kurangkec
ret

cekdeps_ns:
cpi E, batasdens
brsh deps_ns
brlo deps_z
deps_ns:
ldi simpan1, gainns
rcall kurangkec
ret

;---------------------------;
;

Z

;

;--------------------------;
zero:
mov simpan3, E
cp simpan3, Esblm
brsh positifz
brlo negatifz
positifz:
sub simpan3, Esblm
mov De, simpan3
cpi De, batasdepb
brsh dez_pb
brlo cekdez_ps
negatifz:
mov simpan2, Esblm
sub simpan2, simpan3
mov De, simpan2
cpi De, batasdenb
brsh dez_nb
brlo dez_ns

dez_pb:
ldi simpan1, gainnb
rcall kurangkec
ret
cekdez_ps:
cpi E, batasdeps
brsh dez_ps
brlo dez_z
dez_ps:
ldi simpan1, gainns
rcall kurangkec
ret
dez_z:
ldi simpan1, gainz
rcall tetap
ret
tetap:
ldi simpan1, gainz
rjmp tambahkec
ret
dez_nb:
ldi simpan1, gainpb
rcall tambahkec
ret
cekdez_ns:
cpi E, batasdens
brsh dez_ns
brlo dez_z
dez_ns:
ldi simpan1, gainps
rcall tambahkec
ret

;--------------------------;
;

Negatif Big

;

;--------------------------;
nb:
mov simpan3, E
cp simpan3, Esblm
brsh positifnb
brlo negatifnb
positifnb:
sub simpan3, Esblm
mov De, simpan3
cpi De, batasdepb
brsh denb_pb
brlo cekdenb_ps
negatifnb:
mov simpan2, Esblm
sub simpan2, simpan3
mov De, simpan2
cpi De, batasdenb
brsh denb_nb
brlo denb_ns
denb_pb:
ldi simpan1, gainpb
rcall tambahkec
ret
cekdenb_ps:
cpi E, batasdeps
brsh denb_ps
brlo denb_z

denb_ps:
ldi simpan1, gainpb
rcall tambahkec
ret
denb_z:
ldi simpan1, gainps
rcall tambahkec
ret
denb_nb:
ldi simpan1, gainpb
rcall tambahkec
ret
cekdenb_ns:
cpi E, batasdens
brsh denb_ns
brlo denb_z
denb_ns:
ldi simpan1, gainps
rcall tambahkec
ret
;----------------------------;
;

Negatif Small ;

;---------------------------;
ns:
mov simpan3, E
cp simpan3, Esblm
brsh positifns
brlo negatifns
positifns:
sub simpan3, Esblm
mov De, simpan3
cpi De, batasdepb

brsh dens_pb
brlo cekdens_ps
negatifns:
mov simpan2, Esblm
sub simpan2, simpan3
mov De, simpan2
cpi De, batasdenb
brsh dens_nb
brlo dens_ns
dens_pb:
ldi simpan1, gainpb
rcall tambahkec
ret
cekdens_ps:
cpi E, batasdeps
brsh dens_ps
brlo dens_z
dens_ps:
ldi simpan1, gainpb
rcall tambahkec
ret
dens_z:
ldi simpan1, gainpb
rcall tambahkec
ret
dens_nb:
ldi simpan1, gainps
rcall tambahkec
ret
cekdens_ns:
cpi E, batasdens
brsh dens_ns

brlo dens_z
dens_ns:
ldi simpan1, gainps
rcall tambahkec
ret

tambahkec:
in speed, OCR0
add speed, simpan1
out OCR0, speed
ret

kurangkec:
in speed, OCR0
sub speed, simpan1
out OCR0, speed
ret

delay :
rcall wait
rcall wait
rcall wait
ret
clockwait:
push r18
ldi r18, 0x40
loncat:
dec r18
cpi r18, 0x00
brne loncat
pop r18
ret

wait :
push r16
ldi R16, 0xFF
loncat2:
dec r16
rcall clockwait
cpi r16, 0x00
brne loncat2
pop r16
ret

LAMPIRAN D
Datasheet Komponen

LM124
LM224 - LM324



LOW POWER QUAD OPERATIONAL AMPLIFIERS

..
..
..
..

WIDE GAIN BANDWIDTH : 1.3MHz
INPUT COMMON-MODE VOLTAGE RANGE
INCLUDES GROUND
LARGE VOLTAGE GAIN : 100dB
VERY LOW SUPPLY CURRENT/AMPLI : 375µA
LOW INPUT BIAS CURRENT : 20nA
LOW INPUT OFFSET VOLTAGE : 5mV max.

D
SO14
(Plastic Micropackage)

N
DIP14
(Plastic Package)

(for more accurate applications, use the equivalent parts
LM124A-LM224A-LM324A which feature 3mV max)

LOW INPUT OFFSET CURRENT : 2nA
WIDE POWER SUPPLY RANGE :
SINGLE SUPPLY : +3V TO +30V
DUAL SUPPLIES : ±1.5V TO ±15V
P
TSSOP14
(Thin Shrink Small Outline Package)

ORDER CODES

DESCRIPTION
These circuits consist of four independent, high
gain, internally frequency compensated operational
amplifiers . They operate from a single power supply
over a wide range of voltages. Operation from split
power supplies is also possible and the low power
supply current drain is independent of the magnitude of the power supply voltage.

Part
Number

Temperature
Range

Package

LM124

-55 C, +125 C

N


LM224

-40oC, +105oC













o

o

o

o

0 C, +70 C

LM324

D


P


Example : LM224N

PIN CONNECTIONS (top view)

Output 1 1

Output 4

Inve rting Input 1 2

-

-

13

Inve rting Input 4

Non-inve rting Input 1 3

+

+

12

Non-inve rting Input 4

11

VCC Non-inve rting Input 3

VCC + 4

Non-inve rting Input 2

5

+

+

10

Inve rting Input 2

6

-

-

9

Inve rting Input 3

8

Output 3

Output 2

June 1999

14

7

1/14

LM124 - LM224 - LM324
SCHEMATIC DIAGRAM (1/4 LM124)

V CC

6 µA

4µA

100µA

Q5
Q6

CC
Inve rting
inpu t

Q2

Q3

Q1

Q7

Q4

R SC
Q11

Non-inverting
inpu t

Outp ut
Q13
Q10
Q8

Q12

Q9

50µA
GND

ABSOLUTE MAXIMUM RATINGS
Symbol
Vcc
Vi

LM124

Input Voltage

Vid

Differential Input Voltage - (*)

Ptot

Power Dissipation

N Suffix
D Suffix

-

Output Short-circuit Duration - (note 1)
Input Current – (note 6)

Tstg

Operating Free Air Temperature Range
Storage Temperature Range

LM224
±16 or 32

LM324

-0.3 to +32

Iin
Toper

2/14

Parameter
Supply Voltage

Unit
V
V

+32

+32

+32

V

500
-

500
400

500
400

mW
mW
mA

Infinite
50

50

50

-55 to +125

-40 to +105

0 to +70

o

-65 to +150

o

-65 to +150

-65 to +150

C

C

LM124 - LM224 - LM324
ELECTRICAL CHARACTERISTICS
VCC+ = +5V, VCC– = Ground, VO = 1.4V, Tamb = +25oC (unless otherwise specified)
Symbol
Vio

Typ.

Max.

Iib

Avd

SVR

ICC

Vicm

CMR

Isource
Isink

Min.

2

5
7
7
9

Input Offset Current
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.

2

30
100

Input Bias Current (note 2)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.

20

150
300

Input Offset Voltage (note 3)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.

Iio

LM124 - LM224 - LM324

Parameter

Unit
mV

LM324
LM324

nA

nA

Large Signal Voltage Gain
(VCC+ = +15V, RL = 2kΩ, VO = 1.4V to 11.4V)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.
Supply Voltage Rejection Ratio (RS ≤ 10kΩ)
(VCC+ = 5V to 30V)
Tamb = +25oC
Tmin. ≤ Tamb ≤ Tmax.
Supply Current, all Amp, no load
VCC
Tamb = +25oC
VCC
VCC
Tmin. ≤ Tamb ≤ Tmax.
VCC

V/mV
50
25

100
dB

65
65

110
mA

=
=
=
=

0.7
1.5
0.8
1.5

+5V
+30V
+5V
+30V

1.2
3
1.2
3
V

Input Common Mode Voltage Range
(VCC = +30V) - (note 4)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.

0
0

Common-mode Rejection Ratio (RS ≤ 10kΩ)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax

70
60

80

Output Current Source (Vid = +1V)
VCC = +15V, V o = +2V

20

40

Output Sink Current (Vid = -1V)
VCC = +15V, V o = +2V
VCC = +15V, V o = +0.2V

10
12

20
50

VCC -1.5
VCC -2
dB

mA
70
mA
µA

3/14

LM124 - LM224 - LM324
ELECTRICAL CHARACTERISTICS (continued)
Symbol

High Level Output Voltage
(VCC = +30V)
Tamb = +25oC
Tmin. ≤ Tamb ≤ Tmax.
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.
(VCC = +5V, RL = 2kΩ)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.

VOH

SR

R L = 2kΩ
R L = 10kΩ

Slew Rate
VCC = 15V, VI = 0.5 to 3V, RL = 2kΩ, C L = 100pF,
unity gain)

GBP

Gain Bandwidth Product
VCC = 30V, f = 100kHz, Vin = 10mV
RL = 2kΩ, CL = 100pF

THD

Total Harmonic Distortion
f = 1kHz, AV = 20dB, RL = 2kΩ, VO = 2Vpp
CL = 100pF, VCC = 30V

en

LM124 - LM224 - LM324
Min.

Typ.

Max.

Unit
V

Low Level Output Voltage (R L = 10kΩ)
o
Tamb = +25 C
Tmin. ≤ Tamb ≤ Tmax.

VOL

26
26
27
27

27
28

3.5
3
mV
5

20
20
V/µs

0.4
MHz
1.3
%
0.015
nV
√

Hz

Equivalent Input Noise Voltage
f = 1kHz, Rs = 100Ω, VCC = 30V

40

DVio

Input Offset Voltage Drift

7

30

µV/oC

DIIO

Input Offset Current Drift

10

200

pA/oC

Channel Separation (note 5)
1kHz ≤ f ≤ 20kHz

120

VO1/VO2
Notes :

4/14

Parameter

dB

1. Shor t -cir cui t s f rom t he out put t o V C C can cause excessi ve heat i ng if V C C > 15V. T he maxi mum out put cur rent
is appr oxi mat el y 40mA i ndependent of the magni t ude of V C C . D estr ucti ve di ssipat i on can r es ult f r om simul taneous short -cir cuit on al l ampli f iers.
2. The di r ect ion of the i nput cur rent is out of t he IC . Thi s cur r ent is essenti al l y constant, i ndependent of the st ate
of the out put so no l oadi ng change exists on the i nput l i nes.
3. Vo = 1. 4V , R s = 0Ω , 5V < V CC + < 30V , 0 < V ic < V C C + - 1.5V
4. The i nput common- mode vol t age of eit her i nput si gnal volt age shoul d not be allow ed to go negat i ve by mor e
than 0.3V . T he upper end of the common- mode vol tage r ange i s V C C + - 1.5V , but eit her or bot h i nput s can go
to +32V w i thout damage.
5. Due t o the proxi mit y of ex ternal component s insure t hat coupl ing i s not ori gi nat ing vi a str ay capaci t ance betw een these ext ernal par t s. T hi s t ypi call y can be detect ed as t his t ype of capaci tance i ncreases at higher f requences.
6. This input cur rent onl y exi sts w hen t he volt age at any of t he i nput leads is dr iven negat ive. It i s due t o t he
coll ect or - base juncti on of t he i nput PN P transistor becomi ng forw ar d biased and ther eby act ing as input diodes clamps. I n addit i on to thi s di ode act i on, there i s al so N PN par asit i c act ion on the I C chip. t hi s t ransi st or
acti on can cause t he output vol t ages of the Op- amps t o go t o the V CC volt age l evel (or to ground f or a l arge
over dri ve) f or t he ti me dur at ion t han an input i s dr iven negati ve.
This i s not destr uct i ve and nor mal out put wi l l set up again f or i nput vol tage higher t han - 0.3V.

LM124 - LM224 - LM324
INPUT BIAS CURRENT
ve rsus AMBIENT TEMPERATURE

24
21
18
15
12
9
6
3
0
-55-35-15 5 25 45 65 85 105 125
AMBIENT TEMPERATURE ( C)
S UPPLY CURRENT
4
VCC

SUPPLY CURRENT (mA)

IB (nA)

ID

mA

3

-

2
+

Tamb = 0 C to +125 C

1

Ta mb = -55 C
0

10

20

30

POS ITIVE S UPP LY VOLTAGE (V)

5/14

LM124 - LM224 - LM324

6/14

LM124 - LM224 - LM324

TYPICAL SINGLE - SUPPLY APPLICATIONS
AC COUPLED INVERTING AMPLIFIER

Rf
100k Ω

CI

R1
10kΩ

VCC

R2
100kΩ

R1
100kΩ

Rf

RB
6.2kΩ
R3
100kΩ

R2
1MΩ

A V= 1 + R2
R1
(as s hown AV = 11)

R1

(as shown A V = -10)
1/4
LM124

eI ~

AV= -

AC COUPLED NON-INVERTING AMPLIFIER

Co
0
eo

C1
0.1µF
2VPP

Co

1/4
LM124

CI

0
eo

RB
6.2kΩ

RL
10kΩ

eI ~

R3
1MΩ

2VP P

RL
10kΩ

R4
100kΩ

VCC
C1
10µF

C2
10µF

R5
100kΩ

7/14

LM124 - LM224 - LM324
TYPICAL SINGLE - SUPPLY APPLICATIONS
NON-INVERTING DC GAIN

DC SUMMING AMPLIFIER

100kΩ

e1

R2
R1
(As shown A V = 101)

AV = 1 +

10k Ω

R1
10kΩ

R2
1MΩ

eO

100kΩ

+5V

e O (V)

1/4
LM124

e2

100kΩ

e3

100kΩ

eO

1/4
LM124

100kΩ
0

e I (mV)

100kΩ

e4

eo = e1 + e2 - e3 - e4
where (e1 + e2) ≥ (e3 + e4)
to keep eo ≥ 0V

LOW DRIFT PEAK DETECTOR

HIGH INPUT Z ADJUSTABLE GAIN DC
INSTRUMENTATION AMPLIFIER
R1
100kΩ

IB

1/4

e1

R2
2k Ω

1/4
LM124

R3
100kΩ

Gain adjust

eI

1/4
LM124

eO

C

1µF

*

ZI

R
1MΩ

Zo

2IB

2N 929
2IB

R7
100k Ω

eo

I B LM124

1/4
LM124

R5
100k Ω

if R 1 = R5 and R3 = R4 = R6 =R6R7
100k Ω
2R1 1/4
LM124
] (e
eo = [ 1+
2 − e1)
R2
e2
As shown eo = 101 (e2 - e1).

8/14

R4
100k Ω

0.001µF
IB
3R
3MΩ

IB
* Polycarbonate or polyethylene

1/4
LM124
Input current
compensation

LM124 - LM224 - LM324
USING SYMMETRICAL AMPLIFIERS TO REDUCE INPUT CURRENT (GENERAL CONCEPT)

1/4
I

eI

IB

I

eo

I B LM124
2N 929
0.001 µF

IB

IB
3MΩ

1.5MΩ

IB

1/4
LM124
Aux. amplifier for input
current compensation

9/14

LM124 - LM224 - LM324
TYPICAL SINGLE - SUPPLY APPLICATIONS
ACTIVER BANDPASS FILTER

HIGH INPUT Z, DC DIFFERENTIAL AMPLIFIER

R1 R 4
=
R2 R3
(CMRR depends on this resistor ratio match)
For

R1
100k Ω
C1
330pF

1/4
LM124

R5
470kΩ
R4
10MΩ

e1

1/4
LM124

C2
330pF

R3
10kΩ

R1
100kΩ

1/4
LM124

R6
470kΩ
eO

1/4
LM124

R4
100kΩ

R2
100kΩ

R7
100kΩ

R3
100kΩ

+V1
+V2

V CC
R8
100kΩ

C3
10µF

FO = 1kHz
Q = 50
AV = 100 (40dB)

VOLTAGE GAIN AND PHASE vs FREQUENCY

10/14

R4
) (e2− e1)
R3
As shown eo = (e2 - e 1)
eo (1+

1/4
LM124

Vo

LM124 - LM224 - LM324

..
..

LARGE VOLTAGE GAIN : 100dB
VERY LOW SUPPLY CURRENT/AMPLI :
375µA
LOW INPUT BIAS CURRENT : 20nA
LOW INPUT OFFSET VOLTAGE : 2mV

..

LOW INPUT OFFSET CURRENT : 2nA
WIDE POWER SUPPLY RANGE :
SINGLE SUPPLY : +3V to +30V
DUAL SUPPLIES : ±1.5V to ±15V

Applies to : LM124-LM224-LM324
** Standard Linear Ics Macromodels, 1993.
** CONNECTIONS :
* 1 INVERTING INPUT
* 2 NON-INVERTING INPUT
* 3 OUTPUT
* 4 POSITIVE POWER SUPPLY
* 5 NEGATIVE POWER SUPPLY
.SUBCKT LM124 1 3 2 4 5 (analog)
**********************************************************
.MODEL MDTH D IS=1E-8 KF=3.104131E-15
CJO=10F
* INPUT STAGE
CIP 2 5 1.000000E-12
CIN 1 5 1.000000E-12
EIP 10 5 2 5 1
EIN 16 5 1 5 1
RIP 10 11 2.600000E+01
RIN 15 16 2.600000E+01
RIS 11 15 2.003862E+02
DIP 11 12 MDTH 400E-12
DIN 15 14 MDTH 400E-12
VOFP 12 13 DC 0
VOFN 13 14 DC 0
IPOL 13 5 1.000000E-05
CPS 11 15 3.783376E-09
DINN 17 13 MDTH 400E-12
VIN 17 5 0.000000e+00

DINR 15 18 MDTH 400E-12
VIP 4 18 2.000000E+00
FCP 4 5 VOFP 3.400000E+01
FCN 5 4 VOFN 3.400000E+01
FIBP 2 5 VOFN 2.000000E-03
FIBN 5 1 VOFP 2.000000E-03
* AMPLIFYING STAGE
FIP 5 19 VOFP 3.600000E+02
FIN 5 19 VOFN 3.600000E+02
RG1 19 5 3.652997E+06
RG2 19 4 3.652997E+06
CC 19 5 6.000000E-09
DOPM 19 22 MDTH 400E-12
DONM 21 19 MDTH 400E-12
HOPM 22 28 VOUT 7.500000E+03
VIPM 28 4 1.500000E+02
HONM 21 27 VOUT 7.500000E+03
VINM 5 27 1.500000E+02
EOUT 26 23 19 5 1
VOUT 23 5 0
ROUT 26 3 20
COUT 3 5 1.000000E-12
DOP 19 25 MDTH 400E-12
VOP 4 25 2.242230E+00
DON 24 19 MDTH 400E-12
VON 24 5 7.922301E-01
.ENDS

ELECTRICAL CHARACTERISTICS
VCC+ = +5V, VCC- = 0V, Tamb = 25oC (unless otherwise specified)
Symbol
Vio
Avd
ICC
Vicm
VOH
VOL
IOS
GBP
SR

Conditions
RL = 2kΩ
No load, per operator
+

RL = 2kΩ (VCC = 15V)
RL = 10kΩ
VO = +2V, VCC = +15V
RL = 2kΩ, CL = 100pF
RL = 2kΩ, CL = 100pF

Value
0
100
350
-15 to +13.5
+13.5
5
+40
1.3
0.4

Unit
mV
V/mV
µA
V
V
mV
mA
MHz
V/µs
11/14

LM124 - LM224 - LM324

PM-DIP14.EPS

PACKAGE MECHANICAL DATA
14 PINS - PLASTIC DIP

a1
B
b
b1
D
E
e
e3
F
i
L
Z

12/14

Min.
0.51
1.39

Millimeters
Typ.

Max.
1.65

Min.
0.020
0.055

0.5
0.25

Inches
Typ.

0.065
0.020
0.010

20

0.787

8.5
2.54
15.24

0.335
0.100
0.600
7.1
5.1

0.280
0.201

3.3
1.27

Max.

0.130
2.54

0.050

0.100

DIP14.TBL

Dimensions

LM124 - LM224 - LM324

PM-SO14.EPS

PACKAGE MECHANICAL DATA
14 PINS - PLASTIC MICROPACKAGE (SO)

A
a1
a2
b
b1
C
c1
D
E
e
e3
F
G
L
M
S

Min.

Millimeters
Typ.

0.1
0.35
0.19

Max.
1.75
0.2
1.6
0.46
0.25

Min.

Inches
Typ.

0.004
0.014
0.007

0.5

Max.
0.069
0.008
0.063
0.018
0.010

0.020
o

45 (typ.)
8.55
5.8

8.75
6.2

0.336
0.228

1.27
7.62
3.8
4.6
0.5

0.334
0.244
0.050
0.300

4.0
5.3
1.27
0.68

0.150
0.181
0.020

0.157
0.208
0.050
0.027

SO14.TBL

Dimensions

o

8 (max.)

13/14

LM124 - LM224 - LM324
PACKAGE MECHANICAL DATA
14 PINS - THIN SHRINK SMALL OUTLINE PACKAGE

Dim.

Millimeters
Min.

Typ.

A
A1

0.05

A2

0.80

b

0.19

c

0.09

D

4.90

E

1.00

5.00

Inches
Max.
1.20

Min.

0.15

0.01

1.05

0.031

0.30

0.007

0.20

0.003

5.10

0.192

6.40

E1

4.30

e

4.40

o

0

l

0.50

4.50

0.006
0.039

0.041
0.15
0.012

0.196

0.20

0.169

0.173

0.177

0.025
o

0.60

Max.
0.05

0.252

0.65

k

Typ.

o

8

0

0.75

0.09

o

8
0.0236

0.030

Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the
consequences of use of such information nor for any infringement of patents or other rights of third parties which may result
from its use. No license is granted by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not authorized for use as critical components in life support
devices or systems without express written approval of STMicroelectronics.
 The ST logo is a trademark of STMicroelectronics
 1999 STMicroelectronics – Printed in Italy – All Rights Reserved
STMicroelectronics GROUP OF COMPANIES
Australia - Brazil - Canada - China - France - Germany - Italy - Japan - Korea - Malaysia - Malta - Mexico - Morocco
The Netherlands - Singapore - Spain - Sweden - Switzerland - Taiwan - Thailand - United Kingdom - U.S.A.
 http://www.st.com

14/14

This datasheet has been download from:
www.datasheetcatalog.com
Datasheets for electronics components.

L293D
L293DD
PUSH-PULL FOUR CHANNEL DRIVER WITH DIODES
600mA OUTPUT CURRENT CAPABILITY
PER CHANNEL
1.2A PEAK OUTPUT CURRENT (non repetitive) PER CHANNEL
ENABLE FACILITY
OVERTEMPERATURE PROTECTION
LOGICAL ”0” INPUT VOLTAGE UP TO 1.5 V
(HIGH NOISE IMMUNITY)
INTERNAL CLAMP DIODES
DESCRIPTION
The Device is a monolithic integrated high voltage, high current four channel driver designed to
accept standard DTL or TTL logic levels and drive
inductive loads (such as relays solenoides, DC
and stepping motors) and switching power transistors.
To simplify use as two bridges each pair of channels is equipped with an enable input. A separate
supply input is provided for the logic, allowing operation at a lower voltage and internal clamp diodes are included.
This device is suitable for use in switching applications at frequencies up to 5 kHz.

SO(12+4+4)

Powerdip (12+2+2)

ORDERING NUMBERS:
L293DD

L293D

The L293D is assembled in a 16 lead plastic
packaage which has 4 center pins connected together and used for heatsinking
The L293DD is assembled in a 20 lead surface
mount which has 8 center pins connected together and used for heatsinking.

BLOCK DIAGRAM

June 1996

1/7

L293D - L293DD
ABSOLUTE MAXIMUM RATINGS
Symbol

Parameter

Value

Unit

VS

Supply Voltage

36

V

V SS

Logic Supply Voltage

36

V

Input Voltage

7

V

Enable Voltage

7

V

Vi
V en
Io
P tot
Tstg, Tj

Peak Output Current (100 µs non repetitive)
Total Power Dissipation at Tpins = 90 °C
Storage and Junction Temperature

1.2

A

4

W

– 40 to 150

°C

PIN CONNECTIONS (Top view)

Powerdip(12+2+2)

SO(12+4+4)

THERMAL DATA
Symbol

DIP

SO

Unit

Rth j-pins

Thermal Resistance Junction-pins

Decription
max.



14

°C/W

Rth j-amb

Thermal Resistance junction-ambient

max.

80

50 (*)

°C/W

Rth j-case

Thermal Resistance Junction-case

max.

14



(*) With 6sq. cm on board heatsink.

2/7

L293D - L293DD
ELECTRICAL CHARACTERISTICS (for each channel, VS = 24 V, VSS = 5 V, Tamb = 25 °C, unless
otherwise specified)
Symbol

Max.

Unit

VS

Supply Voltage (pin 10)

VSS

36

V

V SS

Logic Supply Voltage (pin 20)

4.5

36

V

IS

Parameter

Total Quiescent Supply Current
(pin 10)

Test Conditions

Min.

Typ.

Vi = L ; IO = 0 ; Ven = H

2

6

mA

Vi = H ; IO = 0 ; Ven = H

16

24

mA

Ven = L
ISS

Total Quiescent Logic Supply
Current (pin 20)

Vi = L ; IO = 0 ; Ven = H

44

4

mA

60

mA

Vi = H ; IO = 0 ; Ven = H

16

22

mA

Ven = L

16

24

mA

– 0.3

1.5

V

2.3

VSS

V

2.3

7

V

– 10

µA

100

µA

– 0.3

1.5

V

VSS ≤ 7 V

2.3

VSS

V

VSS > 7 V

2.3

V IL

Input Low Voltage (pin 2, 9, 12,
19)

VIH

Input High Voltage (pin 2, 9,
12, 19)

VSS ≤ 7 V
VSS > 7 V

IIL

Low Voltage Input Current (pin
2, 9, 12, 19)

VIL = 1.5 V

IIH

High Voltage Input Current (pin
2, 9, 12, 19)

2.3 V ≤ VIH ≤ VSS – 0.6 V

Ven L

Enable Low Voltage
(pin 1, 11)

Ven H

Enable High Voltage
(pin 1, 11)

Ien L

Low Voltage Enable Current
(pin 1, 11)

Ven L = 1.5 V

Ien H

High Voltage Enable Current
(pin 1, 11)

2.3 V ≤ Ven H ≤ VSS – 0.6 V

VCE(sat)H

Source Output Saturation
Voltage (pins 3, 8, 13, 18)

IO = – 0.6 A

VCE(sat)L

Sink Output Saturation Voltage
(pins 3, 8, 13, 18)

VF

30

7

V

– 100

µA

± 10

µA

1.4

1.8

V

IO = + 0.6 A

1.2

1.8

V

Clamp Diode Forward Voltage

IO = 600nA

1.3

V

tr

Rise Time (*)

0.1 to 0.9 VO

250

ns

tf

Fall Time (*)

0.9 to 0.1 VO

250

ns

ton

Turn-on Delay (*)

0.5 Vi to 0.5 VO

750

ns

toff

Turn-off Delay (*)

0.5 Vi to 0.5 VO

200

ns

– 30

(*) See fig. 1.

3/7

L293D - L293DD
Figure 1: Switching Times

TRUTH TABLE (one channel)
Inpu t

Enable (*)

Output

H
L
H
L

H
H
L
L

H
L
Z
Z

Z = High output impedance
(*) Relative to the considered channel

Figure 2: Junction to ambient thermal resistance vs. area on board heatsink (SO12+4+4 package)

4/7

L293D - L293DD
POWERDIP16 PACKAGE MECHANICAL DATA
mm

DIM.
MIN.
a1

0.51

B

0.85

b
b1

TYP.

inch
MAX.

MIN.

TYP.

MAX.

0.020
1.40

0.033

0.50
0.38

0.020
0.50

D

0.055

0.015

0.020

20.0

0.787

E

8.80

0.346

e

2.54

0.100

e3

17.78

0.700

F

7.10

0.280

I

5.10

0.201

L
Z

3.30

0.130
1.27

0.050

5/7

L293D - L293DD
SO20 PACKAGE MECHANICAL DATA
mm

DIM.
MIN.

TYP.

A
a1

MIN.

TYP.

2.65
0.1

MAX.
0.104

0.2

a2

0.004

0.008

2.45

0.096

b

0.35

0.49

0.014

0.019

b1

0.23

0.32

0.009

0.013

C

0.5

0.020

c1

45

1.772

D

1

E

10

12.6

0.039

10.65

0.394

1.27

0.050

e3

11.43

0.450

F

1

7.4

0.496
0.419

e

0.039

0.291

G

8.8

9.15

0.346

0.360

L

0.5

1.27

0.020

0.050

M
S

6/7

inch
MAX.

0.75

0.030
8° (max.)

L293D - L293DD

Information furnished is believed to be accurate