• Tidak ada hasil yang ditemukan

American Heart Association (2010). Heart disease & stroke statistics – 2010 Update.

Dallar, Texas: American Heart Association

Astri, 2008. Penggunaan GSR untuk Mengetahui Tingkat Emosional Seseorang dengan Menggunakan Metode Neural Network. Surabaya : PENS-ITS,

Bejo, Agus. 2008. C & AVR Rahasia Kemudahan Bahasa C dalam Mikrokontroler Atmega8535. Yogyakarta : Graha Ilmu

Duarte, Ramiro. 2011. Pulse Detector Using Infrared Light to Detect a Heartbeat.

The Ohio State University.

Elizabeth, J. Corwin. 2007. Buku Saku Patofisiologi. Edisi Ketiga. Jakarta : Buku Kedokteran ECG

Hari, Bagus. 2012. Pemrograman Mikrokontroler dengan Bahasa C.

Yogyakarta : Andi Yogyakarta.

Madona, Puteri. 2013. Pengujian Parameter Tekanan Darah dan Detak Jantung Pada Alat Pendeteksi Tingkat Stress Manusia. Riau : Politeknik Caltex Riau.

Millman, Halkias. 1976. Electronic Devices and Circuits. Singapore : McGraw-Hill.

Nadesul, Handrawan. 2009. Resep Mudah Tetap Sehat. Jakarta : Buku Kompas.

Nevid, Jeffrey S. 2003. Psikologi Abnormal. Jakarta : Erlangga.

Putra, Agfianto Eko. 2006. Belajar Mikrokontroler Teori dan Aplikasi. Yogyakarta : Gava Media.

Rohmad, Ali. 2009. Perancangan Alat Pendeteksi Awal Ketegangan (Stress) Pada Manusia Berbasis PC Diukur Dari Suhu Tubuh, Kelembaban Kulit dan Detak Jantung. [Skripsi]. Surakarta : Universitas Muhammadiyah Surakarta.

Sarafino, Edward P. 2006. Health Psychology. America : The College of New Jersey.

Sukadiyanto. 2010. Stress dan Cara Menguranginya. Yogyakarta : UNY

Supri Ono, 2013. MPX5700+ATMEGA8+BASKOM AVR2013. http://mekatronika-corner.blogspot.com/2013/01/mpx5700-atmega8-bascom-avr-huahahah.html.

(diakses Rabu, 22 Agustus 2018).

Tooley, M. 2002. Rangkaian Elektronik Prinsip dan Aplikasi. Erlangga : Jakarta

Widjanarka, W. 2006. Teknik Digital. Erlangga : Jakarta.

Widyastuti. 2003. Manajemen Stres. Jakarta : Penerbit Buku Kedokteran.

Wijaksono, Yohanes Andri. 2012. Rancang Bangun Alat Pendeteksi Stress Menggunakan GSR dan Detak Jantung. Surabaya : Politeknik Elektronika Negeri Surabaya.

Zoel, Ivo. 2016. Pembuatan Alat Bantu Stress Detector Menggunakan Sensor HIR333, GSR, dan DS18B20 Berbasis Mikrokontroler Atmega 8. [Skripsi].

Medan : Universitas Sumatera Utara.

LAMPIRAN 1

Rangkaian Lengkap

LAMPIRAN 2

Tampilan Pengujian Power Supply

LAMPIRAN 3

Tampilan Alat Keseluruhan

LAMPIRAN 4

Program Keseluruhan

/*******************************************************

This program was created by the CodeWizardAVR V3.12 Advanced Automatic Program Generator

© Copyright 1998-2014 Pavel Haiduc, HP InfoTech s.r.l.

http://www.hpinfotech.com

Project : Version :

Date : 26/11/2018 Author :

Company : Comments:

Chip type : ATmega8535 Program type : Application

AVR Core Clock frequency: 11,059200 MHz Memory model : Small

External RAM size : 0 Data Stack size : 128

*******************************************************/

#include <mega8535.h>

#include <delay.h>

// Alphanumeric LCD functions

#include <alcd.h>

// Declare your global variables here unsigned char data_adc[16];

int adcmpx,status,hasil_adcmpx,adcmpx_lama,selisih,sistole,diastole;

int counter,bpm,status1, nilai_g, nilai_h, nilai_b, kondisi;

float adcgsr,datagsr;

// Standard Input/Output functions

#include <stdio.h>

#define FIRST_ADC_INPUT 1

#define LAST_ADC_INPUT 2

unsigned int adc_data[LAST_ADC_INPUT-FIRST_ADC_INPUT+1];

// Voltage Reference: AVCC pin

#define ADC_VREF_TYPE ((0<<REFS1) | (1<<REFS0) | (0<<ADLAR))

// ADC interrupt service routine // with auto input scanning

interrupt [ADC_INT] void adc_isr(void) {

static unsigned char input_index=0;

// Read the AD conversion result adc_data[input_index]=ADCW;

// Select next ADC input

if (++input_index > (LAST_ADC_INPUT-FIRST_ADC_INPUT)) input_index=0;

ADMUX=(FIRST_ADC_INPUT | ADC_VREF_TYPE)+input_index;

// Delay needed for the stabilization of the ADC input voltage delay_us(10);

// Start the AD conversion ADCSRA|=(1<<ADSC);

}

void main(void) {

// Declare your local variables here

// Input/Output Ports initialization // Port A initialization

// Function: Bit7=In Bit6=In Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=Out DDRA=(0<<DDA7) | (0<<DDA6) | (0<<DDA5) | (0<<DDA4) | (0<<DDA3) | (0<<DDA2) | (0<<DDA1) | (1<<DDA0);

// State: Bit7=T Bit6=T Bit5=T Bit4=T Bit3=T Bit2=T Bit1=T Bit0=0 PORTA=(0<<PORTA7) | (0<<PORTA6) | (0<<PORTA5) | (0<<PORTA4) | (0<<PORTA3) | (0<<PORTA2) | (0<<PORTA1) | (0<<PORTA0);

// Port B initialization

// Function: Bit7=In Bit6=In Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=Out DDRB=(0<<DDB7) | (0<<DDB6) | (0<<DDB5) | (0<<DDB4) | (0<<DDB3) | (0<<DDB2) | (0<<DDB1) | (1<<DDB0);

// State: Bit7=T Bit6=T Bit5=T Bit4=T Bit3=T Bit2=T Bit1=P Bit0=0 PORTB=(0<<PORTB7) | (0<<PORTB6) | (0<<PORTB5) | (0<<PORTB4) | (0<<PORTB3) | (0<<PORTB2) | (1<<PORTB1) | (0<<PORTB0);

// Port C initialization

// Function: Bit7=In Bit6=In Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=In DDRC=(0<<DDC7) | (0<<DDC6) | (0<<DDC5) | (0<<DDC4) | (0<<DDC3) | (0<<DDC2) | (0<<DDC1) | (0<<DDC0);

// State: Bit7=T Bit6=T Bit5=T Bit4=T Bit3=T Bit2=T Bit1=T Bit0=T PORTC=(0<<PORTC7) | (0<<PORTC6) | (0<<PORTC5) | (0<<PORTC4) | (0<<PORTC3) | (0<<PORTC2) | (0<<PORTC1) | (0<<PORTC0);

// Port D initialization

// Function: Bit7=In Bit6=In Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=In DDRD=(0<<DDD7) | (0<<DDD6) | (0<<DDD5) | (0<<DDD4) | (0<<DDD3) | (0<<DDD2) | (0<<DDD1) | (0<<DDD0);

// State: Bit7=T Bit6=T Bit5=T Bit4=T Bit3=T Bit2=T Bit1=T Bit0=T PORTD=(0<<PORTD7) | (0<<PORTD6) | (0<<PORTD5) | (0<<PORTD4) | (0<<PORTD3) | (0<<PORTD2) | (0<<PORTD1) | (0<<PORTD0);

// Timer/Counter 0 initialization // Clock source: System Clock // Clock value: Timer 0 Stopped // Mode: Normal top=0xFF // OC0 output: Disconnected

TCCR0=(0<<WGM00) | (0<<COM01) | (0<<COM00) | (0<<WGM01) | (0<<CS02)

| (0<<CS01) | (0<<CS00);

TCNT0=0x00;

OCR0=0x00;

// Timer/Counter 1 initialization // Clock source: System Clock // Clock value: Timer1 Stopped // Mode: Normal top=0xFFFF // OC1A output: Disconnected // OC1B output: Disconnected // Noise Canceler: Off

// Input Capture on Falling Edge // Timer1 Overflow Interrupt: Off // Input Capture Interrupt: Off // Compare A Match Interrupt: Off // Compare B Match Interrupt: Off

TCCR1A=(0<<COM1A1) | (0<<COM1A0) | (0<<COM1B1) | (0<<COM1B0) | (0<<WGM11) | (0<<WGM10);

TCCR1B=(0<<ICNC1) | (0<<ICES1) | (0<<WGM13) | (0<<WGM12) | (0<<CS12) | (0<<CS11) | (0<<CS10);

OCR1BH=0x00;

OCR1BL=0x00;

// Timer/Counter 2 initialization // Clock source: System Clock // Clock value: Timer2 Stopped // Mode: Normal top=0xFF // OC2 output: Disconnected ASSR=0<<AS2;

TCCR2=(0<<WGM20) | (0<<COM21) | (0<<COM20) | (0<<WGM21) | (0<<CS22)

| (0<<CS21) | (0<<CS20);

TCNT2=0x00;

OCR2=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization

TIMSK=(0<<OCIE2) | (0<<TOIE2) | (0<<TICIE1) | (0<<OCIE1A) | (0<<OCIE1B) | (0<<TOIE1) | (0<<OCIE0) | (0<<TOIE0);

// External Interrupt(s) initialization // INT0: Off

// INT1: Off // INT2: Off

MCUCR=(0<<ISC11) | (0<<ISC10) | (0<<ISC01) | (0<<ISC00);

MCUCSR=(0<<ISC2);

// USART initialization

// Communication Parameters: 8 Data, 1 Stop, No Parity

// USART Receiver: Off // USART Transmitter: On // USART Mode: Asynchronous // USART Baud Rate: 9600

UCSRA=(0<<RXC) | (0<<TXC) | (0<<UDRE) | (0<<FE) | (0<<DOR) | (0<<UPE) | (0<<U2X) | (0<<MPCM);

UCSRB=(0<<RXCIE) | (0<<TXCIE) | (0<<UDRIE) | (0<<RXEN) | (1<<TXEN) | (0<<UCSZ2) | (0<<RXB8) | (0<<TXB8);

UCSRC=(1<<URSEL) | (0<<UMSEL) | (0<<UPM1) | (0<<UPM0) | (0<<USBS) | (1<<UCSZ1) | (1<<UCSZ0) | (0<<UCPOL);

UBRRH=0x00;

UBRRL=0x47;

// Analog Comparator initialization // Analog Comparator: Off

// The Analog Comparator's positive input is // connected to the AIN0 pin

// The Analog Comparator's negative input is // connected to the AIN1 pin

ACSR=(1<<ACD) | (0<<ACBG) | (0<<ACO) | (0<<ACI) | (0<<ACIE) | (0<<ACIC)

| (0<<ACIS1) | (0<<ACIS0);

// ADC initialization

// ADC Clock frequency: 86,400 kHz // ADC Voltage Reference: AVCC pin // ADC High Speed Mode: Off

// ADC Auto Trigger Source: ADC Stopped

ADMUX=FIRST_ADC_INPUT | ADC_VREF_TYPE;

ADCSRA=(1<<ADEN) | (1<<ADSC) | (0<<ADATE) | (0<<ADIF) | (1<<ADIE) | (1<<ADPS2) | (1<<ADPS1) | (1<<ADPS0);

SFIOR=(1<<ADHSM) | (0<<ADTS2) | (0<<ADTS1) | (0<<ADTS0);

// SPI initialization // SPI disabled

SPCR=(0<<SPIE) | (0<<SPE) | (0<<DORD) | (0<<MSTR) | (0<<CPOL) | (0<<CPHA) | (0<<SPR1) | (0<<SPR0);

// TWI initialization // TWI disabled

TWCR=(0<<TWEA) | (0<<TWSTA) | (0<<TWSTO) | (0<<TWEN) | (0<<TWIE);

// Alphanumeric LCD initialization // Connections are specified in the

// Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:

// RS - PORTC Bit 0 // RD - PORTC Bit 1 // EN - PORTC Bit 2 // D4 - PORTC Bit 4 // D5 - PORTC Bit 5 // D6 - PORTC Bit 6 // D7 - PORTC Bit 7 // Characters/line: 16 lcd_init(16);

// Global enable interrupts

#asm("sei") lcd_gotoxy(0,0);

lcd_putsf(" Deteksi Stres ");

lcd_gotoxy(0,1);

if(status1==1 && adcmpx<=350){status=2; diastole=0; sistole=0; counter=0;

if(selisih<=-10){diastole=hasil_adcmpx+26;}

sprintf(data_adc,"mpx=%d",hasil_adcmpx);

while(status==3)

while(status==4)

if(kondisi>3&&kondisi<=6){lcd_gotoxy(0,0); lcd_putsf("...Tenang..."); } if(kondisi>6&&kondisi<=9){lcd_gotoxy(0,0); lcd_putsf("...Cemas..."); } if(kondisi>9){lcd_gotoxy(0,0); lcd_putsf("...Tegang..."); }

sprintf(data_adc,"%d/%d",sistole,diastole);

lcd_gotoxy(0,1);

lcd_puts(data_adc);

sprintf(data_adc,"%d",bpm);

lcd_gotoxy(8,1);

lcd_puts(data_adc);

sprintf(data_adc,"%0.02f",datagsr);

lcd_gotoxy(12,1);

lcd_puts(data_adc);

delay_ms(9000);

lcd_clear();

status=0;

} } }

LAMPIRAN 5

DATA SHEET MPX5050dp

SEMICONDUCTOR TECHNICAL DATA by MPX5050/D

The MPX5050 series piezoresistive transducer is a state±of±the±art monolithic silicon pressure sensor designed for a wide range of applications, but particularly those employing a microcontroller or microprocessor with A/D inputs. This patented, single element transducer combines advanced micromachining techniques, thin±film metalliza-tion, and bipolar processing to provide an accurate, high level analog output signal that is proportional to the applied pressure.

Features

2.5% Maximum Error over 0 to 85C

Ideally suited for Microprocessor or Microcontroller±Based Systems

Temperature Compensated Over ± 40 to +125C

Patented Silicon Shear Stress Strain Gauge

Durable Epoxy Unibody Element

Easy±to±Use Chip Carrier Option

*'

Figure 1. Fully Integrated Pressure Sensor Schematic

INTEGRATED PRESSURE device connections. Do not connect to external circuitry or ground. Pin 1 is noted by the notch in the lead.

MAXIMUM RATINGS(NOTE)

Parametrics Symbol Value Unit

Maximum Pressure (P1 > P2) P

max 200 kPa

Storage Temperature T

stg ±40 to +125 C

Operating Temperature TA ±40 to +125 C

NOTE: Exposure beyond the specified limits may cause permanent damage or degradation to the device.

OPERATING CHARACTERISTICS (VS= 5.0 Vdc, TA= 25C unless otherwise noted, P1 > P2. Decoupling circuit shown in Figure 4

required to meet electrical specifications.)

Minimum Pressure Offset(3)

(0 to 85C) V

off 0.088 0.20 0.313 Vdc

@ VS = 5.0 Volts

Full Scale Output(4)

(0 to 85C) V

1. 1.0kPa (kiloPascal) equals 0.145 psi.

2. Device is ratiometric within this specified excitation range.

3. Offset (Voff) is defined as the output voltage at the minimum rated pressure.

4. Full Scale Output (VFSO) is defined as the output voltage at the maximum or full rated pressure.

5. Full Scale Span (VFSS) is defined as the algebraic difference between the output voltage at full rated pressure and the output voltage at the minimum rated pressure.

6. Accuracy (error budget) consists of the following:

Linearity: Output deviation from a straight line relationship with pressure over the specified pressure range.

Temperature Hysteresis: Output deviation at any temperature within the operating temperature range, after the temperature is cycled to and from the minimum or maximum operating temperature points, with zero differential pressure applied.

Pressure Hysteresis: Output deviation at any pressure within the specified range, when this pressure is cycled to and from minimum or maximum rated pressure at 25C.

TcSpan: Output deviation over the temperature range of 0 to 85C, relative to 25C.

TcOffset: Output deviation with minimum pressure applied, over the temperature range of 0 to 85C, relative

to 25C.

Variation from Nominal: The variation from nominal values, for Offset or Full Scale Span, as a percent of VFSS at 25C.

7. Response Time is defined as the time for the incremental change in the output to go from 10% to 90% of its final value when subjected to a specified step change in pressure.

8. Warm±up Time is defined as the time required for the product to meet the specified output voltage after the Pressure has been stabilized.

9. Offset Stability is the product's output deviation when subjected to 1000 hours of Pulsed Pressure, Temperature Cycling with Bias Test.

MECHANICAL CHARACTERISTICS

Characteristics Typ Unit

Weight, Basic Element (Case 867) 4.0 grams

Figure 3 illustrates the Differential/Gauge Sensing Chip in the basic chip carrier (Case 867). A fluorosilicone gel isolates the die surface and wire bonds from the environment, while allowing the pressure signal to be transmitted to the sensor diaphragm.

The MPX5050 series pressure sensor operating charac-teristics, and internal reliability and qualification tests are based on use of dry air as the pressure media. Media, other than dry air, may have adverse effects on sensor perfor-mance and long±term reliability. Contact the factory for

information regarding media compatibility in your application.

Figure 2 shows the sensor output signal relative to pres-sure input. Typical, minimum, and maximum output curves are shown for operation over a temperature range of 0 to 85C using the decoupling circuit shown in Figure 4. The output will saturate outside of the specified pressure range.

Figure 4 shows the recommended decoupling circuit for interfacing the output of the integrated sensor to the A/D in-put of a microprocessor or microcontroller. Proper decoup-ling of the power supply is recommended.

#)($)(*

Figure 2. Output versus Pressure Differential

*

Figure 3. Cross±Sectional Diagram Figure 4. Recommended power supply decoupling

(Not to Scale) and output filtering.

For additional output filtering, please refer to Application Note AN1646.

P I

NOTE: The Temperature Multiplier is a linear response from 0 to ±40C and from 85 to 125C.

Pressure Error Band

PRESSURE (P1) / VACUUM (P2) SIDE IDENTIFICATION TABLE Motorola designates the two sides of the pressure sensor

as the Pressure (P1) side and the Vacuum (P2) side. The Pressure (P1) side is the side containing fluorosilicone gel which protects the die from harsh media. The Motorola MPX

pressure sensor is designed to operate with positive differen-tial pressure applied, P1 > P2.

The Pressure (P1) side may be identified by using the table below:

Pressure (P1)

Part Number Case Type Side Identifier

MPX5050D 867 Stainless Steel Cap

MPX5050DP 867C Side with Part Marking

MPX5050GP 867B Side with Port Attached

ORDERING INFORMATION

The MPX5050 pressure sensor is available in differential and gauge configurations. Devices are available in the basic element package or with pressure port fittings that provide printed circuit board mounting ease and barbed hose pressure connections.

MPX Series

Device Type Options Case Type Order Number Device Marking

Basic Element Differential 867 MPX5050D MPX5050D

Ported Elements Differential Dual Ports 867C MPX5050DP MPX5050DP

Gauge 867B MPX5050GP MPX5050GP

PACKAGE DIMENSIONS

PRESSURE SIDE PORTED (AP, GP)

PACKAGE DIMENSIONS±CONTINUED

PRESSURE PORT #1 POSITIVE

N . ' 2. '

PRESSURE AND VACUUM SIDES PORTED (DP)

Motorola reserves the right to make changes without further notice to any products herein. Motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does Motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages.

ªTypicalº parameterswhich may be provided in Motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. All operating parameters, including ªTypicalsº must be validated for each customerapplication by customer's technical experts. Motorola does not convey any license under its patent rights nor the rights of others. Motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the Motorola product could create a situation where personal injury or death may occur. Should Buyer purchase or use Motorola products for any such unintended or unauthorized application, Buyer shall indemnify and hold Motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that Motorola was negligent regarding the design or manufacture of the

part. Motorola and are registered trademarks of Motorola, Inc. Motorola, Inc. is an Equal Opportunity/Affirmative Action Employer.

How to reach us:

USA/EUROPE/Locations Not Listed: Motorola Literature Distribution; JAPAN: Motorola Japan Ltd.; SPS, Technical Information Center, 3±20±1, P.O. Box 5405, Denver, Colorado 80217. 1±303±675±2140 or 1±800±441±2447 Minami±Azabu. Minato±ku, Tokyo 106±8573 Japan. 81±3±3440±3569

Technical Information Center: 1±800±521±6274 ASIA/PACIFIC: Motorola Semiconductors H.K. Ltd.; Silicon Harbour Centre, 2, Dai King Street, Tai Po Industrial Estate, Tai Po, N.T., Hong Kong.

852±26668334

HOME PAGE: http://www.motorola.com/semiconductors/

LAMPIRAN 6

DATA SHEET MIKROKONTROLER

Dokumen terkait