Site icon Elektrologi

Pengukuran Detak Jantung Dengan Sensor Detak Jantung

Pengukuran Detak Jantung dengan sensor yang dibahas di artikel Sensor Detak Jantung

Data mentah, delimited dengan semicolon:

Interval sampling adalah 1 ms

Board yang dipakai adalah Arduino Nano V3 clone

Software yang dipakai adalah Arduino sebagai berikut:

/*
Sumber: http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
*/

// constants won’t change. Used here to set a pin number :
const int ledPin =  13;      // the number of the LED pin
// Variables will change :
int ledState = LOW;             // ledState used to set the LED
// Generally, you shuould use “unsigned long” for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0;        // will store last time LED was updated
// constants won’t change :
const long interval = 1;           // interval at which to blink (milliseconds)
unsigned long counter=0;
int sensorPin = A0;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor
void setup() {
// set the digital pin as output:
pinMode(ledPin, OUTPUT);
Serial.begin(115200);
}

void loop()
{
// here is where you’d put code that needs to be running all the time.

// check to see if it’s time to blink the LED; that is, if the
// difference between the current time and last time you blinked
// the LED is bigger than the interval at which you want to
// blink the LED.
unsigned long currentMillis = millis();

if(currentMillis – previousMillis >= interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
// set the LED with the ledState of the variable:
digitalWrite(ledPin, ledState);
counter++;
sensorValue = analogRead(sensorPin);
Serial.print(counter);
Serial.print(“;”);
Serial.println(sensorValue);

}
}

 

Grafik hasil pengukuran (sekitar 30000 sampel pertama). Nampak amplitude maksimum berubah-ubah, tergantung posisi dan tekanan jari pada sensor.

Pengukuran detak jantung 2900 sampel

 

Grafik hasil pengukuran (hanya sekitar 1000 sampel pertama saja). Nampak ada noise pada hasil pengukuran.

Pengukuran detak jantung 1000 sampel

 

Rentang angka ADC adalah 0 sampai 1023 (ADC 10 bit di ATMega328)

Angka maksimum yang tercatat adalah 536. Angka minimum yang tercatat adalah 496. Rentang angka yang tercatat adalah 40. Hal ini konsisten dengan hasil tampilan dengan software Processing di artikel Sensor Detak Jantung yang menunjukkan rentang angka pengukuran sempit dibandingkan dengan sensor asli.

Tampilan sensor ex Banggood. Rentangnya sempit

 

Data mentah:

Exit mobile version