2020
http://repositori.usu.ac.id/handle/123456789/27984
Downloaded from Repositori Institusi USU, Univsersitas Sumatera Utara
SISTEM MONITORING KESEHATAN DENGAN
INSTRUMENTASI PENGUKURAN ELEKTROKARDIOGRAM
DAN SUHU TUBUH BERBASIS IOT
SKRIPSI
DEPARTEMEN FISIKA
FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM
UNIVERSITAS SUMATERA UTARA
MEDAN
2020
SKRIPSI
PERNYATAAN ORISINALITAS
SKRIPSI
Saya mengakui bahwa skripsi ini adalah hasil kerja saya sendiri, kecuali beberapa
kutipan dan ringkasan yang masing-masing disebutkan sumbernya.
PENGESAHAN SKRIPSI
Disetujui di
Medan, 11 Agustus 2020
ABSTRAK
ABSTRACT
A health monitoring system has been made with vital signs check. In this research
measurement of heart rate and body temperature using AD8232 ECG’s sensor as
measurement instrumentation of electrocardiogram and DS18b20 to check body
temperature. Monitoring is done in real time based on IoT (Internet of Things)
system which using Thingspeak server. How the device to work is so simply, with
send analog signals to microcontroller that are data of body temperature and heart
rate in the form of ECG fluctuating waves which is displayed on the serial plotter of
Arduino UNO then which will be processed into BPM Value and transmit to
thingspeak server. With the result that making possible to person monitors the other
person. The device work properly based on testings that have been done with ralat
percentage by 1,83% for BPM measurement by ECG’s sensor and 0,636% for
measurement of body temperature by DS18b20.
PENGHARGAAN
Puji syukur kehadirat Tuhan Yesus Kristus yang telah memberikan rahmat,
berkat, serta atas penyertaannya yang menjadikan dunia dapat berkembang dalam
kemajuan ilmu pengetahuan dan teknologi, sehingga penulis dapat menyelesaikan
penulisan skripsi yang berjudul “SISTEM MONITORING KESEHATAN
DENGAN INSTRUMENTASI PENGUKURAN ELEKTROKARDIOGRAM
DAN SUHU TUBUH BERBASIS IOT.” Terimakasih kepada Bunda Maria yang
telah menjadi teladan dan pendoa dalam kehidupan penulis hingga saat ini.
Skripsi ini ditulis untuk melengkapi tugas dan memenuhi syarat mencapai gelar
sarjana sains. Penulis menyadari bahwa tersusunnya skripsi ini berkat dukungan, doa,
motivasi, serta bimbingan dari beberapa pihak. Sehingga dengan keikhlasan dan
kerendahan hati penulis mengucapkan terimakasih dan penghargaan yang sebesar-
besarnya kepada :
1. Bapak Prof. Dr. Runtung Sitepu, S.H., M.Hum. selaku Rektor Universitas
Sumatera Utara
2. Bapak Dr. Kerista Sebayang, M.S selaku dekan FMIPA USU
3. Bapak Dr. Perdinan Sinuhaji, M.S, selaku ketua program studi S-1 Fisika dan
bapak Awan Maghfirah, S.Si., M.Si. selaku sekretaris jurusan
4. Bapak Junedi Ginting, S.Si., M.Si. selaku dosen pembimbing yang telah
memberikan waktu, bimbingan, serta arahan kepada saya dalam melakukan
penelitian dan penulisan skripsi ini
5. Bapak Drs.Takdir Tamba, M.EngSc dan Bapak Lukman Hakim, S.Si., M.Si.
selaku dosen penguji yang telah banyak memberikan masukan dan arahan
selama penulisan skripsi ini
6. Teristimewa skripsi ini dipersembahkan untuk Orangtua penulis, Ayah P. A.
Rumapea dan Ibu L. br Manik yang telah memberikan kasih sayang yang tulus,
doa, serta bimbingan secara jasmani maupun rohani kepada penulis
7. Clara Duwi Pani Rumapea yang telah memberikan doa, dukungan, nasihat
serta kekesalan selama ini, aku mengasihimu
8. Personil Calon Parumaen Idaman yang telah menemani penulis sejak awal
sebelum perkuliahan hingga saat ini. Yunita Baringbing, Debora Erdyanur
Naibaho, Sarah Dumani Pangaribuan. Terimakasih atas kebersamaan yang
sangat berarti dalam awal bulan maupun akhir bulan, terimakasih buat
pelajaran hidup terlebih kekeluargaan, nasihat percintaan, dan kasih sayang
kalian sebagai sahabat.
9. Frika N. Simanihuruk dan Santi Novika Sihombing sebagai partner penulis di
jurusan Fisika ini, yang telah membantu penulis dalam menuntaskan segala
tugas, praktikum, serta urusan skripsi. Aku mengasihimu.
10. Teman-teman seperjuangan, specially : Julprianto, Eka, Bonar, Sry Ningsih,
Yoga, Nesya, Teo, Harapan, Nisa Gulo, Mutiara, Nesya, Nadha, Syukur, Jose,
Desse, Roy, dan semua anggota Fisika 2016
11. Teman-teman UKM Studi Pedesaan, Divisi Kewirausahaan PEMA FMIPA
USU 2019 yang mengajarkan penulis dalam hal berorganisasi..
12. Serta seluruh pihak yang tidak dapat disebutkan satu per satu. Terimakasih.
Penulis menyadari bahwa dalam penyusunan skripsi ini masih terdapat banyak
kekurangan dan kelemahan. Untuk itu penulis mengharapkan kritik dan saran dari
semua pihak guna penyempurnaan penelitian dan penulisan laporan kedepannya.
Akhir kata, penulis mengucapkan terimakasih dan semoga skripsi ini dapat
bermanfaat bagi pembacanya serta menambah pengetahuan dan dapat menjadi
referensi untuk pengembangan penelitian lebih lanjut.
Penulis
DAFTAR ISI
Halaman
PERNYATAAN ...................................................................................................... i
PENGESAHAN SKRIPSI ..................................................................................... ii
ABSTRAK............................................................................................................. iii
ABSTRACT............................................................................................................ iv
PENGHARGAAN .................................................................................................. v
DAFTAR ISI ........................................................................................................ vii
DAFTAR TABEL ................................................................................................. ix
DAFTAR GAMBAR .............................................................................................. x
DAFTAR LAMPIRAN ........................................................................................ xii
DAFTAR TABEL
DAFTAR GAMBAR
DAFTAR LAMPIRAN
BAB 1
PENDAHULUAN
monitoring suatu keadaan secara real-time serta dapat diakses dimanapun berada
ketika terhubung dengan internet.
Sesuai dengan uraian latar belakang diatas maka penulis akan melakukan
penelitian dengan judul “SISTEM MONITORING KESEHATAN DENGAN
INSTRUMENTASI PENGUKURAN ELEKTROKARDIOGRAM DAN SUHU
TUBUH BERBASIS IOT ” Penelitian tentang monitoring dan pengukuran aktivitas
jantung dan suhu tubuh juga sudah pernah dilakukan yaitu Perancangan Sistem
Pengukur Detak Jantung Secara Jarak Jauh Berbasis ATmega 8535 Dengan
Tampilan PC (Sibagariang,K.W., 2016). Rancang bangun sistem pengukuran suhu
tubuh dan detak jantung menggunakan sensor Infrared berbasis mikrokontroller
Atmega8535 (Pratiwi,Y., 2019). Rancang bangun instrumentasi pengukuran
elektrokardiogram dan suhu tubuh untuk pemantauan kondisi kesehatan berbasis
Arduino (Rafi.M., 2018).
Berbeda dengan penelitian sebelumnya dalam sistem monitoring ini
mengaplikasikan modul Wi-Fi untuk mengirim data ke internet, Thingspeak sebagai
server IoT (Internet of Things) dengan menggunakan mikrokontroler Atmega 328p
Arduino UNO.
Dengan membangun sebuah sistem monitoring kesehatan dengan pe
instrumentasi elektrokardiogram dan suhu tubuh berbasis IoT ini, diharapkan kondisi
kesehatan dengan data pemeriksaan tanda vital dapat dipantau secara real time. Hal
ini dapat mendukung pemantauan terhadap pasien oleh para medis secara tidak
langsung dari jarak jauh.
BAB 1 : PENDAHULUAN
Dalam bab ini berisikan mengenai latar belakang penelitian, tujuan penulis,
batasan masalah, rumusan masalah serta sistematika penulisan.
DAFTAR PUSTAKA
BAB 2
TINJAUAN PUSTAKA
ventrikel dan tidak sebaliknya. Ventrikel mengembang ketika terisi dengan tekanan
yang dihasilkan oleh aliran darah dalam atrium. Ventrikel berkontraksi beberapa saat
setelah atrium memompa darah sebagai hasil waktu tunda elektrik antara atrium dan
ventrikel. Ventrikel memompa darah sampai ke arteri yang dipisahkan oleh katup
sehingga membentuk aliran satu arah. Ventrikel kiri memompa darah sampai ke
aorta dan dipisahkan oleh katup untuk menghindari aliran balik. Aorta menyuplai
darah ke seluruh bagian tubuh. Ventrikel kanan memompa darah yang akan disaring
menuju arteri pulmonalis, dan dipisahkan oleh katup pulmonalis, untuk selanjutnya
masuk ke sirkulasi darah paru-paru (Rizal, 2014).
2.4 Elektrokardiogram
Elektrokardiogram adalah grafik hasil pencatatan aksi potensial atau
perubahan kelistrikan yang dihasilkan oleh kontraksi otot jantung (atrium dan
ventrikel). Aksi potensial adalah aktivitas listrik yang menyebabkan kontraksi otot.
Kondisi ini berlangsung karena adanya konduktivitas sel miokard. Konduktivitas
adalah kemampuan sel-sel otot jantung untuk mengirim impuls sepanjang membran-
membran selnya.
Elektrokardiogram diperoleh melalui pengukuran potensial listrik diantara
berbagai titik ditubuh dengan menggunakan biomedical instrumentation amplifier.
Sadapan (lead) merekam sinyal listrik jantung dari kombinasi tertentu electrode yang
ditempatkan pada titik tertentu di tubuh klien. Prinsip kerja mesin elektrokardiogram
(EKG) menggunakan prinsip galvanometer. Apabila gelombang depolarisasi
bergerak menuju elektrode positif, maka stilus akan mencatat gelombang positif
2.3.6 Gelombang S
Gelombang S merupakan defleksi negatif pertama setelah R yang
menggambarkan depolarisasi ventrikel.
2.3.7 Gelombang T
Gelombang T merupakan gelombang panjang setelah QRS yang
menggambarkan repolarisasi ventrikel. Gelombang T inverted : gelombang T yang
berada dibawah baseline atau negatif T (Saryono,2014).
2. Sadapan Unipolar
Unipolar Ekstremitas
Merupakan sandapan yang merekam beda potensial pada satu titik. Sadapan
ini dipasangkan pada kedua kaki dan tangan yang disambungkan dengan kabel
seperti sadapan bipolar. Sudut pandang terhadap jantung disebabkan oleh vektor dari
sadapan unipolar.
Unipolar Prekordial
Sadapan unipolar prekordial terjadi karena adanya beda potensial listrik pada
elektroda eksplorasi yang dipasangkan pada dada. Elektroda indiferent (potensial 0)
terjadi akibat pengabungan 3 elektroda ekstremitas. Sadapan ini melihat jantung
secara horizontal (jantung bagian posterior, anterior, lateral, septal dan ventrikel
kanan). Sadapan unipolar prekordial dapat diperlebar hingga ke posterior dan
ventrikel kanan guna melihat sudut jantung. Pada posterior ditambahkan V7, V8, dan
V9, sedangkan pada ventrikel kanan dapat ditambahkan dengan V1, V2, V3, V4, V5,
V6, V7, V8, V9.
Penempatan Elektroda
Daerah kiri
V1: Ruang interkiostal IV garis ekternal kanan
V2: Ruang interkiostal IV garis ekstemal kiri
V3: antara V2 dan V3
V4: Ruang interkiostal V midcavikula kiri
V5: lurus denganV4 garis aksilia depan
V6: lurus dengan V4 garis mid aksilia kiri
Bagian posterior
2.5 Elektrode
Agar fenomena bioelektrik dapat diukur oleh alat ukur listrik, diperlukan
transduser yang dapat mengubah dari aliran ion ke aliran elektron. Transduser yang
digunakan untuk keperluan tersebut biasa dinamakan dengan bioelektrode. Dengan
bantuan elektrode sinyal-sinyal bioelektrik seperti EKG dapat diakuisisi untuk
kemudian diolah dan ditampilkan ke perangkat penampil. Terdapat 3 jenis elektrode :
Elektrode permukaan, makroelektrode, dan mikroelektrode.
Sifat permukaan kulit yang elektris dapat dimodelkan sebagai larutan
elektrolit sedangkan elektrode dapat dimodelkan sebagai elektrode metal seperti pada
sel basah. Ketika elektrode logam direndam dalam larutan elektrolit, akan terjadi
pelepasan ion logam ke dalam larutan. Ion-ion dalam larutan elektrolit, beberapa
diantaranya akan bereaksi dengan elektrode logam. Karena ada beda konsentrasi ion-
ion yang dilepaskan oleh logam dan elektrolit, akan muncul gradien muatan yang
akan menimbulkan beda potensial.
Penggunaan elektrode sebagai transduser yang menyebabkan terjadinya
potensial elektrode akan membawa konsekuensi yaitu potensial elektrode yang
mencapai 1,5 V akan menyebabkan DC drift, sementara sinyal
bioelektrik/biopotensial biasanya 1000 kali lebih rendah dari potensial tersebut. Hal
ini akan menyebabkan perbedaan besar antara tegangan DC yang timbul dengan
2.8 DS18b20
Untuk bisa mengukur suhu tubuh digunakan sebuah sensor yang memiliki
fungsi merubah suhu panas menjadi besaran fisis. Pada penelitian ini digunakan
sensor ds18b20, sensor ini tahan terhadap air dengan tingkat akurasi yang tinggi.
Sensor ini memiliki 3 buah kaki dengan fungsi berbeda-beda.
Kaki pertama berfungsi sebagai sumber daya, kaki kedua berfungsi sebagai
jalur data, sedangkan kaki ketiga berfungsi sebagai ground. kaki sensor tersebut
dibedakan menggunakan kabel warna merah, kuning, dan hijau. Sensor ini memiliki
beberapa karakteristik, salah satunya adalah sebagai berikut :
1. Pembacaan data dapat langsung dibaca ke dalam celcius
2. Faktor linier + 10mV/°C. dengan artian bahwa setiap perubahan suhu 1°C maka
terjadi perubahan tegangan sebesar 10mV dan seterusnya
3. Tingkat akurasi 0,5°C saat suhu kamar (25°C)
4. Rentang suhu antara -55°C sampai 150°C
5. Tegangan kerja sebesar 3 volt hingga 5,5 volt.
Tegangan ideal pada sensor memiliki perbandingan 100°C sama dengan 1
volt. Sensor ini dapat beroperasi menggunakan power supply tunggal dan bisa
dihubungkan dengan arduino sebagai antar muka (interface) rangkaian kontrol.
Pada dasarnya sensor ini bekerja dengan tegangan antara 3-5.5V yang
dipasangkan pada kaki 1 atau kabel merah, untuk ground dipasangkan pada kaki 2
atau kabel hitam, dan untuk kaki nomer 3 atau kabel warna biru dapat dipasangkan
pada pin arduino. Sensor akan membaca suhu apabila mendapatkan tegangan pada
kaki 1 dan selanjutnya mengirimkan data single bus dari kaki nomer 3 dikirimkan
menuju arduino. Pada sensor ini dipasangkan sebuah resistor pull-up sebagai
pengaman data yang dihubungkan antara kaki 1 dan kaki 3 sensor (Maxim, 2015)
Modul WiFi ini merupakan SoC (System on Chip) dengan stack protokol
TCP/IP yang telah terintegrasi, sehingga memungkinkan mikrokontroler untuk
mengakses jaringan WiFi.
Modul WiFi ini bekerja dengan catu daya 3,3 volt. Salah satu kelebihan
modul ini adalah kekuatan transmisinya yang dapat mencapai 100 meter, dengan
begitu modul ini memerlukan koneksi arus yang cukup besar (rata-rata 80 mA,
mencapai 215 mA pada CCK 1 MBps, moda transmisi 802.11b dengan daya pancar
+19,5 dBm belum termasuk 100 mA untuk sirkuit pengatur tegangan internal).
Untuk komunikasi, model ini menggunakan koneksi 115200,8,N,1 (115.20)bps, 8
data-bit, no parity, 1stop bit).
ESP-12E merupakan bagian dari esp8266 yang terintegrasi MCU
mikrokontroler 32 bit dengan 16 bit RISC. Dengan clock speed 80 MHz dengan
maksimum 160MHz. Wi-fi 2,4 GHz, mendukung WPA/WPA2 serta mampu
melakukan transmisi data kurang dari 2 ms.
- SPI: 10 (SS), 11 (Mosi), 12 (MISO), 13 (SCK). Pin ini mendukung komunikasi SPI
menggunakan SPI library.
- LED: 13. Ada built-in LED terhubung ke pin digital 13. Ketika pin bernilai nilai
HIGH, LED on, ketika pin bernilai LOW, LED off.
Uno memiliki 6 masukan analog, berlabel A0 sampai dengan A5, yang masing-
masing menyediakan 10 bit dengan resolusi (yaitu 1024 nilai yang berbeda).
Selain itu, beberapa pin memiliki fungsi khusus:
- I2C : A4 (SDA) dan A5 (SCL). Dukungan I2C (TWI) komunikasi menggunakan
perpustakaan Wire.
- Aref: Tegangan referensi (0 sampai 5V saja) untuk input analog. Digunakan
dengan fungsi analogReference ().
- Reset : Baris ini LOW untuk reset mikrokontroler. (Arduino.cc, 2017).
Titik cahaya yang jumlahnya puluhan ribu bahkan jutaan inilah yang
membentuk tampilan citra. Kutub kristal cair yang dilewati arus listrik akan berubah
karena pengaruhpolarisasi medan magnetik yang timbul dan oleh karenanya akan
hanya membiarkan beberapa warna diteruskan sedangkan warna lainnya tersaring.
Dalam menampilkan karakter untuk membantu menginformasikan proses dan
kontrol yang terjadi dalam suatu program robot kita sering menggunakan LCD. Ada
beberapa jenis LCD perbedaanya hanya terletak pada alamat menaruh karakternya.
Salah satu LCD yang sering dipergunakan adalah LCD 16x2 artinya LCD tersebut
terdiri dari 16 kolom dan 2 baris.
LCD ini sering dipergunakan karena harganya relatif murah dan
pemakaiannya yang mudah. LCD yang digunakan masih membutuhkan agar dapat
dikoneksikan dengan sistem minimum dalam suatu mikrokontroller. Driver tersebut
berisi rangkaian pengaman, pengatur tingkat kecerahan backlight maupun data serta
untuk mempermudah pemasangan di mikrokontroller (portable-red). LCD Display 16
X 2 diperlihatkan pada gambar 2.3, sebagai berikut.
BAB 3
PERANCANGAN ALAT DAN SISTEM
AD8232
Sistem IoT
NodeMCU
(Thingspeak
ESP8266
Server)
Adaptor
Arduino UNO
LCD Display
DS18b20
merepresentasikan hasil pengukuran suhu tubuh dan sinyal EKG yang dapat dilihat
secara visual pada monitor. Pada mikrokontroler juga akan dilakukan pengukuran
jumlah detak jantung berdasarkan data yang didapatkan dari grafik sinyal ekg. Hasil
pengukuran suhu dan detak jantung ditampilkan pada LCD serta dikirim ke server
IoT Thingspeak melalui modul Wi-Fi NodeMCU ESP8266 yang sebelumnya sudah
terhubung dengan jaringan Wi-Fi. Dalam sistem IoT ini terdapat 3 bagian penting
yaitu ESP8266 sebagai host, Thingspeak sebagai server dan operator/user yang
mengakses data sebagai client.
untuk menurunkan tegangan 12V menjadi 5V agar tegangan yang terpasok ke sistem
tetap 5V DC. Hal ini diperlukan agar sistem tidak rusak.
SW1
SW-SPST
L2 U6
Out 12VDC 7805
V2 Out 5V
220VAC 1 3
VI VO
GND
BR2 C5 C3
1N4002 220uF/50V
2
1000u/50V
ARD1
12 V input
LS1
ON
Reset BTN
3.3V
www.TheEngineeringProjects.com
AREF
SPEAKER
13
PB5/SCK
12
PB4/MISO
RESET 11
~ PB3/MOSI/OC2A Vcc
10
~ PB2/OC1B LO-
9
~ PB1/OC1A
8 LO+
PB0/ICP1/CLKO
Output
ATMEGA328P-PU
1121
7
ANALOG IN
PD7/AIN1 Vcc
6
A0 ~ PD7/AIN1
5
PC0/ADC0 AD8232
A1 ~ PD5/T1/OC0B
4
PC1/ADC1
A2 PD4/T0/XCK
3
PC2/ADC2
A3 ~ PD3/INT1/OC2B
2
PC3/ADC3 PD2/INT0
A4 1
PC4/ADC4/SDA PD1/TXD
A5 0
PC5/ADC5/SCL PD0/RXD
ARDUINO UNO
ARD1
12 V input
U1
3
VCC
ON
2 50.5
Reset BTN
DQ
1
www.TheEngineeringProjects.com
GND
AREF DS18S20
13
PB5/SCK
12
PB4/MISO
RESET 11
~ PB3/MOSI/OC2A
10
~ PB2/OC1B
9
~ PB1/OC1A
8
PB0/ICP1/CLKO
ATMEGA328P-PU
1121
7
ANALOG IN
PD7/AIN1
6
A0 ~ PD7/AIN1
5
PC0/ADC0
A1 ~ PD5/T1/OC0B
4
PC1/ADC1
A2 PD4/T0/XCK
3
PC2/ADC2
A3 ~ PD3/INT1/OC2B
2
PC3/ADC3 PD2/INT0
A4 1
PC4/ADC4/SDA PD1/TXD
A5 0
PC5/ADC5/SCL PD0/RXD
ARDUINO UNO
10
11
9
8
7
6
5
4
3
2
1
0
D7
~ PD3/INT1/OC2B
PB4/MISO
PB5/SCK
PD0/RXD
~ PB3/MOSI/OC2A
~ PD5/T1/OC0B
~ PD7/AIN1
PB0/ICP1/CLKO
PD1/TXD
PD7/AIN1
~ PB2/OC1B
PD4/T0/XCK
AREF
PD2/INT0
~ PB1/OC1A
D6
www.TheEngineeringProjects.com
D5
D4
D3
D2
D1
D0
www.TheEngineeringProjects.com E
RW
ATMEGA328P-PU RS
VEE
12 V input
1121
VDD
ON
VSS
5V
PC4/ADC4/SDA
PC5/ADC5/SCL
ARDUINO UNO
ANALOG IN
PC0/ADC0
PC1/ADC1
PC2/ADC2
PC3/ADC3
RESET
ARD1
LCD 16X2
LCD1
Reset BTN
A0
A1
A2
A3
A4
A5
Inisialisasi Sistem
YES
Selesai
Pada sistem ini menggunakan komunikasi serial dimana data akan dikirim
dalam format ASCII sehingga dapat dikirimkan per bit data. Penggunaan multisensor
dalam sistem ini membutuhkan parsing data, yaitu mengurai suatu paket data untuk
memisahkan data hasil pengukuran dua sensor yang berbeda.
Step 4 : Mulai proses pengiriman data dari mikrokontroler oleh nodeMCU ESP8266
ke server
Step 5 : Pendefinisian alamat jaringan serta IP SSID dan password pada server.
Step 6 : Apabila alamat jaringan sesuai maka lanjut ke langkah berikutnya jika tidak
sesuaikan kembali.
Step 7 : ESP 8266 telah terhubung ke jaringan
Step 8 : Transfer data lokal ke server Thingspeak melalui internet akan berlangsung.
MULAI
Masukkan
Channel ID
Masukkan API
Key
SELESAI
BAB 4
HASIL DAN PEMBAHASAN
Hasil penelitian yaitu sebuah alat pengukur detak jantung dan suhu tubuh
secara real time dan ditampilkan melalui jaringan internet. Alat ini dirancang untuk
mempermudah monitoring kondisi pasien oleh tim medis secara jarak jauh dengan
praktis dan efisien. Rangkaian alat dirancang menggunakan board AVR yaitu atmega
328 sebagai mikrokontroler, AD8232 sebagai instrumentasi pengukuran
elektrokardiogram untuk mengukur detak jantung, ds18b20 untuk mengukur suhu
tubuh, serta esp8266 untuk mengirim data yang telah diolah oleh mikrokontroler ke
server IoT.
Pengujian II
Tabel 4.2 Hasil pengujian II sensor DS18B20
Responden Termometer Hasil ukur % error
portable (°C) DS18B20 (°C)
A 36,8 36,51 0,788%
B 36,0 35,81 0,528%
C 35,5 35,35 0,423%
D 36,1 35,82 0,776%
E 36,2 35,99 0,580%
F 35,2 34,96 0,682%
Dari hasil kedua pengujian diatas diperoleh persentase error alat sebesar
0,568 %. Hal ini memberi kesimpulan bahwa hasil pengukuran suhu oleh DS18B20
cukup akurat dan stabil.
Data pada tabel menunjukkan bahwa sistem yang dibuat mampu membaca
nilai BPM (Beat Per Menit) dengan persentase kesalahan yang cukup kecil yakni
1,83%. Ini artinya masih berada dalam batas toleransi pengukuran.
Untuk mengetahui efektifitas sensor EKG dalam penelitian ini juga dilakukan
pengujian dengan menggunakan osiloskop dengan pengaturan skala perioda 200 ms
dan skala tegangan 200 mV disesuaikan dengan standard EKG. Melalui pengujian
yang dilakukan didapat hasil dengan hasil ralat perbandingan perhitungan
pengukuran manual osiloskop dengan tampilan pengukuran pada LCD sekitar 1,33
%. Dimana hasil pengukuran dapat dilihat dalam tampilan seperti gambar berikut :
BAB 5
KESIMPULAN DAN SARAN
5.1. Kesimpulan
Setelah dilakukan beberapa pengujian sistem monitoring kesehatan dengan
menggunakan instrumentasi pengukuran elektrokardiogram dan suhu tubuh maka
dapat ditarik kesimpulan sebagai berikut :
1. Alat monitoring yang terdiri atas sensor EKG dan DS18b20 berbasis IoT
(Internet of Things) dapat direalisasikan dengan komponen utama yaitu sensor
AD8232, sensor DS18b20, board Arduino UNO, dan ESP8266 dengan tampilan
pada LCD akan menunjukkan kondisi “normal” responden ketika detak jantung
berkisar 60 s/d 100 BPM dan suhu tubuh 36°C s/d 37,5°C, dan tampilan ”Harap
periksakan diri anda” ketika hasil pengukuran diluar angka normal pengukuran.
2. Alat monitoring ini dapat berfungsi dengan baik berdasarkan pembahasan dan
analisa data yang telah dilakukan melalui beberapa kali pengujian dengan
persentase ralat pengukuran detak jantung melalui AD8232 sebesar 1,83% dan
sebesar 0,568% untuk pengukuran suhu dengan ds18b20.
3. Sistem komunikasi berbasis internet dapat dirancang dengan bantuan sebuah
server ,host dan client. Dalam hal ini server yang digunakan adalah thingspeak
dan host adalah sistem rangkaian nodemMCU yang diprogram untuk mengirim
data ke server. Sedangkan client adalah operator atau user yang berperan dalam
mengakses data dan melakukan monitoring.
5.2. Saran
Untuk menyempurnakan penelitian ini, ada beberapa tambahan yang dapat
meningkatkan kemampuan alat ini yaitu :
1. Dibutuhkan penelitian lebih lanjut dalam penggunaan komponen serta desain
guna penyempurnaan alat
2. Sebaiknya ditambahkan fitur untuk dapat menyimpan grafik sinyal EKG
kemudian mengirimkannya ke internet guna pemantauan yang lebih baik.
3. Sebaiknya penelitian selanjutnya menggunakan kontroler dengan kecepatan yang
lebih tinggi guna mendapatkan tampilan sinyal EKG secara langsung pada sistem.
DAFTAR PUSTAKA
Budioko, Totok. “Sistem Monitoring Suhu Jarak Jauh Berbasis Internet Of Things
Menggunakan Protokol Mqtt,” Seminar Riset Teknologi Informasi (SRITI),
2016.
M. A. Saputro, E. R. Widasari and H. Fitriyah, "Implementasi Sistem Monitoring
Detak Jantung dan Suhu Tubuh Manusia Secara Wireless," Jurnal
Pengembangan Teknologi Informasi dan Ilmu Komputer, Vols. 1, No. 2, pp.
148-156, 2 Februari 2017.
N. M. E. M, "Penyebab Bradikardia, Denyut Jantung Lemah Berakibat Fatal,"hello
Sehat, 20 Januari 2017. [Online]. Available:
https://hellosehat.com/bradikardia-denyut-jantung-lemah/.
Pasha, Sharmed. “Thingspeak Based Sensing and Monitoring System for IoT with
Matlab Analysis,” International Journal of New Technology and Research
(IJNTR), Volume-2, Issue-6, pages 19-23, June 2016.
Prayogo. I. “Sistem Monitoring Denyut Jantung Dan Suhu Tubuh Sebagai Indikator
Level Kesehatan Pasien Berbasis IoT (Internet Of Thing) Dengan Metode
Fuzzy Logic Menggunakan Android.” Jawa Timur: Jurnal
Salli. S, "Health Monitoring System Using Wireless Sensor Network" Int.Journal of
Engineering research and Application, vol. 8, no. 1, p. 9, 2018.
Udjianti, Wajan J. 2010. Keperawatan Kardiovaskular. Jakarta: Salemba Medika
Utomo. Ari, Negoro. E.H.P, Sofie. M, “Monitoring Heart Rate Dan Saturasi Oksigen
Melalui Smartphone,” Jurnal SIMETRIS, Vol. 10 No. 1 April 2019
https://idcloudhost.com
Diakses pada tanggal 27 Desember 2019
https://www.dewaweb.com/blog/internet-of-things/
Diakses pada tanggal 27 Desember 2019
LAMPIRAN
Lampiran 1
Lampiran 2
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal.h>
#include <SoftwareSerial.h>
int RXPin = 2;
int TXPin = 3;
SoftwareSerial MySerial(RXPin, TXPin);
// Setup a oneWire instance to communicate with any OneWire devices (not just
Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
void setup(void)
{
pinMode(11,INPUT);
pinMode(12,INPUT);
pinMode(13,OUTPUT);
void loop(void)
{
if ((digitalRead(11))||(digitalRead(12))){Serial.print('!');}
else {Serial.println(analogRead(A0));}
x = analogRead(A0);
if((State)&&(analogRead(A0)>500)){heartRate++;State=0;digitalWrite(13,HIGH);}
if (analogRead(A0) < 500){State = 1;digitalWrite(13,LOW);}
x1:
delay(1);j++;
if(j == 1500){
sensors.requestTemperatures(); // Send the command to get temperatures
tempC = sensors.getTempCByIndex(0)+2.4;
int tempC2=tempC*100;
if(tempC != DEVICE_DISCONNECTED_C)
if(heartRate > 30) {heartRate = 30;}
MySerial.print(tempC2);MySerial.print("!");
MySerial.print(heartRate*8);MySerial.print("!");
j=0;
digitalWrite(13,HIGH);delay(100);digitalWrite(13,LOW);
if (((tempC >= 36)&&(tempC <= 37.5))&&((heartRate*8 >=
60)&&(heartRate*8<= 100))){lcd.clear();lcd.print(" STATUS : NORMAL");}
else {lcd.clear();lcd.print("HARAP PERIKSAKAN"); lcd.setCursor(0,
1);lcd.print(" DIRI ANDA!");}
delay(2000);
lcd.clear();
lcd.print("TEMP : ");
lcd.print(tempC);
lcd.setCursor(0, 1);
lcd.print("H.R. : ");
lcd.print(heartRate*8);
heartRate = 0;
}
}
Lampiran 3
digitalWrite(2, LOW);
int parse_value(){
int x, val = 0;
do{
x = Serial.read();
if ('0' <= x && x <= '9'){
val = val*10 + (x-'0');
}
} while(x != '!');
return val;
}
void loop(){
while (Serial.available()> 0) {
int IAA = parse_value();
int VAA = parse_value();
delay(10);
temperature = IAA/100.0;
heartrate = VAA;
}
Serial.print("--");
if (client.connect("api.thingspeak.com",80)) {
Serial.print("data yang dikirim : ");
Serial.print(temperature);
Serial.print(" ");
Serial.println(heartrate);
request_string = thingSpeakAddress;
request_string += "api_key=";
//Write API key
request_string += "CR5Y6P6833OIAH5C";
request_string += "&field1=";
request_string += temperature;
request_string += "&field2=";
request_string += heartrate;
http.begin(request_string);
http.GET();
http.end();
delay(15000);
}
}
Lampiran 4
%% Read Data %%
%% Visualize Data %%
stem(time, data);
2. Tampilan Visualisasi
Lampiran 5
Arduino Uno R2 Front Arduino Uno SMD Arduino Uno Front Arduino Uno Back
Overview
The Arduino Uno is a microcontroller board based on the ATmega328 (datasheet). It has 14 digital
input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz ceramic
resonator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything
needed to support the microcontroller; simply connect it to a computer with a USB cable or power it
with a AC-to-DC adapter or battery to get started.
The Uno differs from all preceding boards in that it does not use the FTDI USB-to-serial driver chip.
Instead, it features the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial
converter.
Revision 2 of the Uno board has a resistor pulling the 8U2 HWB line to ground, making it easier to put
into DFU mode.
Revision 3 of the board has the following new features:
1.0 pinout: added SDA and SCL pins that are near to the AREF pin and two other new pins
placed near to the RESET pin, the IOREF that allow the shields to adapt to the voltage provided
from the board. In future, shields will be compatible both with the board that use the AVR,
which operate with 5V and with the Arduino Due that operate with 3.3V. The second one is a
not connected pin, that is reserved for future purposes.
Stronger RESET circuit.
Atmega 16U2 replace the 8U2.
"Uno" means one in Italian and is named to mark the upcoming release of Arduino 1.0. The Uno and
version 1.0 will be the reference versions of Arduino, moving forward. The Uno is the latest in a series
of USB Arduino boards, and the reference model for the Arduino platform; for a comparison with
previous versions, see the index of Arduino boards.
Summary
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage (recommended) 7-12V
Universitas Sumatera Utara
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
EAGLE files: arduino-uno-Rev3-reference-design.zip (NOTE: works with Eagle 6.0 and newer)
Schematic: arduino-uno-Rev3-schematic.pdf
Note: The Arduino reference design can use an Atmega8, 168, or 328, Current models use an
ATmega328, but an Atmega8 is shown in the schematic for reference. The pin configuration is identical
on all three processors.
Power
The Arduino Uno can be powered via the USB connection or with an external power supply. The power
source is selected automatically.
External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The
adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads
from a battery can be inserted in the Gnd and Vin pin headers of the POWER connector.
The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however,
the 5V pin may supply less than five volts and the board may be unstable. If using more than 12V, the
voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
The power pins are as follows:
VIN. The input voltage to the Arduino board when it's using an external power source (as
opposed to 5 volts from the USB connection or other regulated power source). You can supply
voltage through this pin, or, if supplying voltage via the power jack, access it through this pin.
5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied
with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of
the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can
damage your board. We don't advise it.
3V3. A 3.3 volt supply generated by the on-board regulator. Maximum current draw is 50 mA.
GND. Ground pins.
Memory
The ATmega328 has 32 KB (with 0.5 KB used for the bootloader). It also has 2 KB of SRAM and 1 KB
of EEPROM (which can be read and written with the EEPROM library).
Each of the 14 digital pins on the Uno can be used as an input or output, using pinMode(),
digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a
maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms. In
addition, some pins have specialized functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins
are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low
value, a rising or falling edge, or a change in value. See the attachInterrupt() function for
details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
Universitas Sumatera Utara
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication
using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the
LED is on, when the pin is LOW, it's off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e.
1024 different values). By default they measure from ground to 5 volts, though is it possible to change
the upper end of their range using the AREF pin and the analogReference() function. Additionally, some
pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to
shields which block the one on the board.
See also the mapping between Arduino pins and ATmega328 ports. The mapping for the Atmega8,
168, and 328 is identical.
Communication
The Arduino Uno has a number of facilities for communicating with a computer, another Arduino, or
other microcontrollers. The ATmega328 provides UART TTL (5V) serial communication, which is
available on digital pins 0 (RX) and 1 (TX). An ATmega16U2 on the board channels this serial
communication over USB and appears as a virtual com port to software on the computer. The '16U2
firmware uses the standard USB COM drivers, and no external driver is needed. However, on Windows,
a .inf file is required. The Arduino software includes a serial monitor which allows simple textual data to
be sent to and from the Arduino board. The RX and TX LEDs on the board will flash when data is being
transmitted via the USB-to-serial chip and USB connection to the computer (but not for serial
communication on pins 0 and 1).
A SoftwareSerial library allows for serial communication on any of the Uno's digital pins.
The ATmega328 also supports I2C (TWI) and SPI communication. The Arduino software includes a
Wire library to simplify use of the I2C bus; see the documentation for details. For SPI communication,
use the SPI library.
Programming
The Arduino Uno can be programmed with the Arduino software (download). Select "Arduino Uno from
the Tools > Board menu (according to the microcontroller on your board). For details, see the
reference and tutorials.
The ATmega328 on the Arduino Uno comes preburned with a bootloader that allows you to upload new
code to it without the use of an external hardware programmer. It communicates using the original
STK500 protocol (reference, C header files).
You can also bypass the bootloader and program the microcontroller through the ICSP (In-Circuit
Serial Programming) header; see these instructions for details.
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available . The
ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:
On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy)
and then resetting the 8U2.
On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground,
making it easier to put into DFU mode.
You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to
load a new firmware. Or you can use the ISP header with an external programmer (overwriting the
DFU bootloader). See this user-contributed tutorial for more information.
The Arduino Uno has a resettable polyfuse that protects your computer's USB ports from shorts and
overcurrent. Although most computers provide their own internal protection, the fuse provides an extra
layer of protection. If more than 500 mA is applied to the USB port, the fuse will automatically break
the connection until the short or overload is removed.
Physical Characteristics
The maximum length and width of the Uno PCB are 2.7 and 2.1 inches respectively, with the USB
connector and power jack extending beyond the former dimension. Four screw holes allow the board to
be attached to a surface or case. Note that the distance between digital pins 7 and 8 is 160 mil
(0.16"), not an even multiple of the 100 mil spacing of the other pins.
S2
Single-supply operation: 2.0 V to 3.5 V
10kΩ A1
Integrated reference buffer generates virtual ground
Rail-to-rail output SW OPAMP+ REFOUT OPAMP– OUT
6 7 8 9 10
Internal RFI filter
8 kV HBM ESD rating
Shutdown pin
20-lead 4 mm × 4 mm LFCSP package
APPLICATIONS
10866-001
Fitness and activity heart rate monitors
Portable ECG Figure 1.
Remote health monitors
Gaming peripherals
Biopotential signal acquisition
GENERAL DESCRIPTION
The AD8232 is an integrated signal conditioning block for ECG
and other biopotential measurement applications. It is designed
to extract, amplify, and filter small biopotential signals in the
presence of noisy conditions, such as those created by motion or
remote electrode placement. This design allows for an ultralow
power analog-to-digital converter (ADC) or an embedded
microcontroller to acquire the output signal easily. To improve common-mode rejection of the line frequencies in
The AD8232 can implement a two-pole high-pass filter for the system and other undesired interferences, the AD8232
eliminating motion artifacts and the electrode half-cell potential. includes an amplifier for driven lead applications, such as right
This filter is tightly coupled with the instrumentation architec- leg drive (RLD).
ture of the amplifier to allow both large gain and high-pass The AD8232 includes a fast restore function that reduces the
filtering in a single stage, thereby saving space and cost. duration of otherwise long settling tails of the high-pass filters.
An uncommitted operational amplifier enables the AD8232 to After an abrupt signal change that rails the amplifier (such as a
create a three-pole low-pass filter to remove additional noise. leads off condition), the AD8232 automatically adjusts to a
The user can select the frequency cutoff of all filters to suit higher filter cutoff. This feature allows the AD8232 to recover
different types of applications. quickly, and therefore, to take valid measurements soon after
connecting the electrodes to the subject.
The AD8232 is available in a 4 mm × 4 mm, 20-lead LFCSP
package. Performance is specified from 0°C to 70°C and is
operational from −40°C to +85°C.
SPECIFICATIONS
VS = 3 V, VREF = 1.5 V, VCM = 1.5 V, TA = 25°C, FR=low, SDN=high, AC/DC = low, unless otherwise noted.
Table 1.
Parameter Symbol Test Conditions/Comments Min Typ Max Unit
INSTRUMENTATION AMPLIFIER
Common-Mode Rejection Ratio, CMRR VCM = 0.35 V to 2.85 V, VDIFF = 0 V 80 86 dB
DC to 60 Hz
VCM = 0.35 V to 2.85 V, VDIFF = ±0.3 V 80 dB
Power Supply Rejection Ratio PSRR VS = 2.0 V to 3.5 V 76 90 dB
Offset Voltage (RTI) VOS
Instrumentation Amplifier Inputs 3 8 mV
DC Blocking Input1 5 50 µV
Average Offset Drift
Instrumentation Amplifier Inputs 10 µV/°C
DC Blocking Input1 0.05 µV/°C
Input Bias Current IB 50 200 pA
TA = 0°C to 70°C 1 nA
Input Offset Current IOS 25 100 pA
TA = 0°C to 70°C 1 nA
Input Impedance
Differential 10||7.5 GΩ||pF
Common Mode 5||15 GΩ||pF
Input Voltage Noise (RTI)
Spectral Noise Density f = 1 kHz 100 nV/√Hz
Peak-to-Peak Voltage Noise f = 0.1 Hz to 10 Hz 12 µV p-p
f = 0.5 Hz to 40 Hz 14 µV p-p
Input Voltage Range TA = 0°C to 70°C 0.2 +VS V
DC Differential Input Range VDIFF −300 +300 mV
Output
Output Swing RL = 50 kΩ 0.1 +VS − 0.1 V
Short-Circuit Current IOUT 6.3 mA
Gain AV 100 V/V
Gain Error VDIFF = 0 V 0.4 %
VDIFF = −300 mV to +300 mV 1 3.5 %
Average Gain Drift TA = 0°C to 70°C 12 ppm/°C
Bandwidth BW 2 kHz
RFI Filter Cutoff (Each Input) 1 MHz
OPERATIONAL AMPLIFIER (A1)
Offset Voltage VOS 1 5 mV
Average TC TA = 0°C to 70°C 5 µV/°C
Input Bias Current IB 100 pA
TA = 0°C to 70°C 1 nA
Input Offset Current IOS 100 pA
TA = 0°C to 70°C 1 nA
Input Voltage Range 0.1 +VS − 0.1 V
Common-Mode Rejection Ratio CMRR VCM = 0.5 V to 2.5 V 100 dB
Power Supply Rejection Ratio PSRR 100 dB
Large Signal Voltage Gain AVO 110 dB
Output Voltage Range RL = 50 kΩ 0.1 +VS − 0.1 V
Short-Circuit Current Limit IOUT 12 mA
Gain Bandwidth Product GBP 100 kHz
Slew Rate SR 0.02 V/µs
Voltage Noise Density (RTI) en f = 1 kHz 60 nV/√Hz
Peak-to-Peak Voltage Noise (RTI) en p-p f = 0.1 Hz to 10 Hz 6 µV p-p
f = 0.5 Hz to 40 Hz 8 µV p-p
Rev. C | Page 3 of 28
Universitas Sumatera Utara
AD8232 Data Sheet
Parameter Symbol Test Conditions/Comments Min Typ Max Unit
RIGHT LEG DRIVE AMPLIFIER (A2)
Output Swing RL = 50 kΩ 0.1 +VS − 0.1 V
Short-Circuit Current IOUT 11 mA
Integrator Input Resistor 120 150 180 kΩ
Gain Bandwidth Product GDP 100 kHz
REFERENCE BUFFER (A3)
Offset Error VOS RL > 50 kΩ 1 mV
Input Bias Current IB 100 pA
Short-Circuit Current Limit IOUT 12 mA
Voltage Range RL = 50 kΩ 0.1 +VS − 0.7 V
DC LEADS OFF COMPARATORS
Threshold Voltage +VS − 0.5 V
Hysteresis 60 mV
Propagation Delay 0.5 µs
AC LEADS OFF DETECTOR
Square Wave Frequency FAC 50 100 175 kHz
Square Wave Amplitude IAC 200 nA p-p
Impedance Threshold Between +IN and −IN 10 20 MΩ
Detection Delay 110 μs
FAST RESTORE CIRCUIT
Switches S1 and S2
On Resistance RON 8 10 12 kΩ
Off Leakage 100 pA
Window Comparator
Threshold Voltage From either rail 50 mV
Propagation Delay 2 µs
Switch Timing Characteristics
Feedback Recovery Switch On Time tSW1 110 ms
Filter Recovery Switch On Time tSW2 55 ms
Fast Restore Reset tRST 2 µs
LOGIC INTERFACE
Input Characteristics
Input Voltage (AC/DC and FR)
Low VIL 1.24 V
High VIH 1.35 V
Input Voltage (SDN)
Low VIL 2.1 V
High VIH 0.5 V
Output Characteristics LOD+ and LOD− terminals
Output Voltage
Low VOL 0.05 V
High VOH 2.95 V
SYSTEM SPECIFICATIONS
Quiescent Supply Current 170 230 µA
TA = 0°C to 70°C 210 µA
Shutdown Current 40 500 nA
TA = 0°C to 70°C 100 nA
Supply Range 2.0 3.5 V
Specified Temperature Range 0 70 °C
Operational Temperature Range −40 +85 °C
1
Offset referred to the input of the instrumentation amplifier inputs. See the Input Referred Offsets section for additional information.
Rev. C | Page 4 of 28
Universitas Sumatera Utara
Data Sheet AD8232
Rev. C | Page 5 of 28
Universitas Sumatera Utara
AD8232 Data Sheet
20 HPSENSE
19 IAOUT
18 REFIN
16 GND
17 +VS
HPDRIVE 1 15 FR
+IN 2 14 AC/DC
AD8232
–IN 3 TOP VIEW 13 SDN
RLDFB 4 (Not to Scale) 12 LOD+
RLD 5 11 LOD–
OPAMP– 9
OUT 10
OPAMP+ 7
REFOUT 8
SW 6
10866-002
NOTES
1. CONNECT THE EXPOSED PAD TO GND OR
LEAVE UNCONNECTED.
Rev. C | Page 6 of 28
Universitas Sumatera Utara
DS18B20
Programmable Resolution
1-Wire Digital Thermometer
DESCRIPTION User-Definable Nonvolatile (NV) Alarm
The DS18B20 digital thermometer provides 9-bit Settings
to 12-bit Celsius temperature measurements and Alarm Search Command Identifies and
has an alarm function with nonvolatile user- Addresses Devices Whose Temperature is
programmable upper and lower trigger points. Outside Programmed Limits (Temperature
The DS18B20 communicates over a 1-Wire bus Alarm Condition)
that by definition requires only one data line (and Available in 8-Pin SO (150 mils), 8-Pin SOP,
ground) for communication with a central and 3-Pin TO-92 Packages
microprocessor. It has an operating temperature Software Compatible with the DS1822
range of -55°C to +125°C and is accurate to Applications Include Thermostatic Controls,
0.5C over the range of -10°C to +85°C. In Industrial Systems, Consumer Products,
addition, the DS18B20 can derive power directly Thermometers, or Any Thermally Sensitive
from the data line (“parasite power”), eliminating System
the need for an external power supply.
PIN CONFIGURATIONS
Each DS18B20 has a unique 64-bit serial code,
which allows multiple DS18B20s to function on
the same 1-Wire bus. Thus, it is simple to use one MAXIM
microprocessor to control many DS18B20s N.C. 1 8 N.C.
18B20
distributed over a large area. Applications that
MAXIM
N.C. 2 7 N.C.
18B20
can benefit from this feature include HVAC 123
environmental controls, temperature monitoring VDD 3 6 N.C.
systems inside buildings, equipment, or GND
DQ 4 5
machinery, and process monitoring and control
systems. SO (150 mils)
(DS18B20Z)
FEATURES
Unique 1-Wire® Interface Requires Only One
DQ 1 8 VDD
Port Pin for Communication
18B20
N.C. 2 7 N.C.
GND
DQ
1 of 22 REV: 042208
Universitas Sumatera Utara
DS18B20
ORDERING INFORMATION
PART TEMP RANGE PIN-PACKAGE TOP MARK
DS18B20 -55C to +125C 3 TO-92 18B20
DS18B20+ -55C to +125C 3 TO-92 18B20
DS18B20/T&R -55C to +125C 3 TO-92 (2000 Piece) 18B20
DS18B20+T&R -55C to +125C 3 TO-92 (2000 Piece) 18B20
DS18B20-SL/T&R -55C to +125C 3 TO-92 (2000 Piece)* 18B20
DS18B20-SL+T&R -55C to +125C 3 TO-92 (2000 Piece)* 18B20
DS18B20U -55C to +125C 8 SOP 18B20
DS18B20U+ -55C to +125C 8 SOP 18B20
DS18B20U/T&R -55C to +125C 8 SOP (3000 Piece) 18B20
DS18B20U+T&R -55C to +125C 8 SOP (3000 Piece) 18B20
DS18B20Z -55C to +125C 8 SO DS18B20
DS18B20Z+ -55C to +125C 8 SO DS18B20
DS18B20Z/T&R -55C to +125C 8 SO (2500 Piece) DS18B20
DS18B20Z+T&R -55C to +125C 8 SO (2500 Piece) DS18B20
+Denotes a lead-free package. A “+” will appear on the top mark of lead-free packages.
T&R = Tape and reel.
*TO-92 packages in tape and reel can be ordered with straight or formed leads. Choose “SL” for straight leads. Bulk TO-92 orders are straight
leads only.
PIN DESCRIPTION
PIN
NAME FUNCTION
SO SOP TO-92
1, 2, 6, 2, 3, 5,
— N.C. No Connection
7, 8 6, 7
Optional VDD. VDD must be grounded for operation in
3 8 3 VDD
parasite power mode.
Data Input/Output. Open-drain 1-Wire interface pin. Also
4 1 2 DQ provides power to the device when used in parasite power
mode (see the Powering the DS18B20 section.)
5 4 1 GND Ground
OVERVIEW
Figure 1 shows a block diagram of the DS18B20, and pin descriptions are given in the Pin Description
table. The 64-bit ROM stores the device’s unique serial code. The scratchpad memory contains the 2-byte
temperature register that stores the digital output from the temperature sensor. In addition, the scratchpad
provides access to the 1-byte upper and lower alarm trigger registers (T H and TL) and the 1-byte
configuration register. The configuration register allows the user to set the resolution of the temperature-
to-digital conversion to 9, 10, 11, or 12 bits. The T H, TL, and configuration registers are nonvolatile
(EEPROM), so they will retain data when the device is powered down.
The DS18B20 uses Maxim’s exclusive 1-Wire bus protocol that implements bus communication using
one control signal. The control line requires a weak pullup resistor since all devices are linked to the bus
via a 3-state or open-drain port (the DQ pin in the case of the DS18B20). In this bus system, the
microprocessor (the master device) identifies and addresses devices on the bus using each device’s unique
64-bit code. Because each device has a unique code, the number of devices that can be addressed on one
VPU
CONFIGURATION REGISTER
POWER- (EEPROM)
VDD SUPPLY
SENSE
8-BIT CRC GENERATOR
OPERATION—MEASURING TEMPERATURE
The core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the
temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5C,
0.25C, 0.125C, and 0.0625C, respectively. The default resolution at power-up is 12-bit. The DS18B20
powers up in a low-power idle state. To initiate a temperature measurement and A-to-D conversion, the
master must issue a Convert T [44h] command. Following the conversion, the resulting thermal data is
stored in the 2-byte temperature register in the scratchpad memory and the DS18B20 returns to its idle
state. If the DS18B20 is powered by an external supply, the master can issue “read time slots” (see the 1-
Wire Bus System section) after the Convert T command and the DS18B20 will respond by transmitting 0
while the temperature conversion is in progress and 1 when the conversion is done. If the DS18B20 is
powered with parasite power, this notification technique cannot be used since the bus must be pulled high
by a strong pullup during the entire temperature conversion. The bus requirements for parasite power are
explained in detail in the Powering the DS18B20 section.
The DS18B20 output temperature data is calibrated in degrees Celsius; for Fahrenheit applications, a
lookup table or conversion routine must be used. The temperature data is stored as a 16-bit sign-extended
two’s complement number in the temperature register (see Figure 2). The sign bits (S) indicate if the
temperature is positive or negative: for positive numbers S = 0 and for negative numbers S = 1. If the
DS18B20 is configured for 12-bit resolution, all bits in the temperature register will contain valid data.
For 11-bit resolution, bit 0 is undefined. For 10-bit resolution, bits 1 and 0 are undefined, and for 9-bit
resolution bits 2, 1, and 0 are undefined. Table 1 gives examples of digital output data and the
corresponding temperature reading for 12-bit resolution conversions.
S = SIGN
OPERATION—ALARM SIGNALING
After the DS18B20 performs a temperature conversion, the temperature value is compared to the user-
defined two’s complement alarm trigger values stored in the 1-byte TH and TL registers (see Figure 3).
The sign bit (S) indicates if the value is positive or negative: for positive numbers S = 0 and for negative
numbers S = 1. The TH and TL registers are nonvolatile (EEPROM) so they will retain data when the
device is powered down. TH and TL can be accessed through bytes 2 and 3 of the scratchpad as explained
in the Memory section.
Figure 3. TH and T L Register Format
Only bits 11 through 4 of the temperature register are used in the T H and TL comparison since TH and TL
are 8-bit registers. If the measured temperature is lower than or equal to T L or higher than or equal to TH,
an alarm condition exists and an alarm flag is set inside the DS18B20. This flag is updated after every
temperature measurement; therefore, if the alarm condition goes away, the flag will be turned off after the
next temperature conversion.
In parasite power mode, the 1-Wire bus and CPP can provide sufficient current to the DS18B20 for most
operations as long as the specified timing and voltage requirements are met (see the DC Electrical
Characteristics and AC Electrical Characteristics). However, when the DS18B20 is performing
temperature conversions or copying data from the scratchpad memory to EEPROM, the operating current
can be as high as 1.5mA. This current can cause an unacceptable voltage drop across the weak 1-Wire
pullup resistor and is more current than can be supplied by CPP. To assure that the DS18B20 has sufficient
supply current, it is necessary to provide a strong pullup on the 1-Wire bus whenever temperature
conversions are taking place or data is being copied from the scratchpad to EEPROM. This can be
accomplished by using a MOSFET to pull the bus directly to the rail as shown in Figure 4. The 1-Wire
bus must be switched to the strong pullup within 10s (max) after a Convert T [44h] or Copy Scratchpad
[48h] command is issued, and the bus must be held high by the pullup for the duration of the conversion
(tCONV) or data transfer (t WR = 10ms). No other activity can take place on the 1-Wire bus while the pullup
is enabled.
The DS18B20 can also be powered by the conventional method of connecting an external power supply
to the VDD pin, as shown in Figure 5. The advantage of this method is that the MOSFET pullup is not
required, and the 1-Wire bus is free to carry other traffic during the temperature conversion time.
The use of parasite power is not recommended for temperatures above +100C since the DS18B20 may
not be able to sustain communications due to the higher leakage currents that can exist at these
temperatures. For applications in which such temperatures are likely, it is strongly recommended that the
DS18B20 be powered by an external power supply.
In some situations the bus master may not know whether the DS18B20s on the bus are parasite powered
or powered by external supplies. The master needs this information to determine if the strong bus pullup
should be used during temperature conversions. To get this information, the master can issue a Skip ROM
[CCh] command followed by a Read Power Supply [B4h] command followed by a “read time slot”.
During the read time slot, parasite powered DS18B20s will pull the bus low, and externally powered
DS18B20s will let the bus remain high. If the bus is pulled low, the master knows that it must supply the
strong pullup on the 1-Wire bus during temperature conversions.
VPU
DS18B20
GND DQ VDD
VPU
P
4.7k
TO OTHER
1-Wire BUS
1-WIRE DEVICES
MEMORY
The DS18B20’s memory is organized as shown in Figure 7. The memory consists of an SRAM
scratchpad with nonvolatile EEPROM storage for the high and low alarm trigger registers (T H and TL)
and configuration register. Note that if the DS18B20 alarm function is not used, the TH and TL registers
can serve as general-purpose memory. All memory commands are described in detail in the DS18B20
Function Commands section.
Byte 0 and byte 1 of the scratchpad contain the LSB and the MSB of the temperature register,
respectively. These bytes are read-only. Bytes 2 and 3 provide access to T H and TL registers. Byte 4
contains the configuration register data, which is explained in detail in the Configuration Register section.
Bytes 5, 6, and 7 are reserved for internal use by the device and cannot be overwritten.
Byte 8 of the scratchpad is read-only and contains the CRC code for bytes 0 through 7 of the scratchpad.
The DS18B20 generates this CRC using the method described in the CRC Generation section.
Data is written to bytes 2, 3, and 4 of the scratchpad using the Write Scratchpad [4Eh] command; the data
must be transmitted to the DS18B20 starting with the least significant bit of byte 2. To verify data
integrity, the scratchpad can be read (using the Read Scratchpad [BEh] command) after the data is
written. When reading the scratchpad, data is transferred over the 1-Wire bus starting with the least
significant bit of byte 0. To transfer the TH, TL and configuration data from the scratchpad to EEPROM,
the master must issue the Copy Scratchpad [48h] command.
Data in the EEPROM registers is retained when the device is powered down; at power-up the EEPROM
data is reloaded into the corresponding scratchpad locations. Data can also be reloaded from EEPROM to
the scratchpad at any time using the Recall E 2 [B8h] command. The master can issue read time slots
following the Recall E2 command and the DS18B20 will indicate the status of the recall by transmitting 0
while the recall is in progress and 1 when the recall is done.
Figure 7. DS18B20 Memory Map
SCRATCHPAD
(POWER-UP STATE)
Byte 0 Temperature LSB (50h)
(85°C)
Byte 1 Temperature MSB (05h) EEPROM
Byte 2 TH Register or User Byte 1* TH Register or User Byte 1
Byte 3 TL Register or User Byte 2* TL Register or User Byte 2
Byte 4 Configuration Register* Configuration Register
Byte 5 Reserved (FFh)
Byte 6 Reserved
Byte 7 Reserved (10h)
Byte 8 CRC*
*Power-up state depends on value(s) stored in EEPROM.
© 2008 Maxim Integrated Products Maxim is a registered trademark of Maxim Integrated Products, Inc.
Universitas Sumatera Utara
Preambles
ESP-12E WiFi module is developed by Ai-thinker Team. core processor ESP8266 in smaller sizes of the module
encapsulates Tensilica L106 integrates industry-leading ultra low power 32-bit MCU micro, with the 16-bit short mode,
Clock speed support 80 MHz, 160 MHz, supports the RTOS, integrated Wi-Fi MAC/BB/RF/PA/LNA, on-board antenna.
The module supports standard IEEE802.11 b/g/n agreement, complete TCP/IP protocol stack. Users can use the
add modules to an existing device networking, or building a separate network controller.
ESP8266 is high integration wireless SOCs, designed for space and power constrained mobile platform designers.
It provides unsurpassed ability to embed Wi-Fi capabilities within other systems, or to function as a standalone
application, with the lowest cost, and minimal space requirement.
ESP8266EX offers a complete and self-contained Wi-Fi networking solution; it can be used to host the application
or to offload Wi-Fi networking functions from another application processor.
When ESP8266EX hosts the application, it boots up directly from an external flash. In has integrated cache to
improve the performance of the system in such applications.
Alternately, serving as a Wi-Fi adapter, wireless internet access can be added to any micro controllerbased design
with simple connectivity (SPI/SDIO or I2C/UART interface).
ESP8266EX is among the most integrated WiFi chip in the industry; it integrates the antenna switches, RF balun,
power amplifier, low noise receive amplifier, filters, power management modules, it requires minimal external circuitry,
and the entire solution, including front-end module, is designed to occupy minimal PCB ar
1.1. Features
• 802.11 b/g/n
• Support Smart Link Function for both Android and iOS devices
• Support Smart Link Function for both Android and iOS devices
• SDIO 2.0, (H) SPI, UART, I2C, I2S, IRDA, PWM, GPIO
Table 1 Parameters