HEART BEAT SENSOR INTERFACE WITH ARDUINO

 



In this tutorial we are going to discuss about heart beat sensor module interface with Arduino.

The basic principle of Heart beat sensor is, when the finger is placed in between the IR transmitter and Photodiode receiver, the IR signal passes through our finger based on the blood flow and it gives the pulse as input to the controller

REQUIREMENTS

·         HB sensor module

·         Lcd 16 x 2


CODE



CODE EXPLANATION:

In the above coding, LCD 16 X 2 is connected to Arduino UNO in 4 bit mode

RS -7, EN -8, D4 -9, D5-10, D6-11, D7-12

Arduino pin No A1 is assigned as variable name data.

Variables count and temp are assigned as 0.

In Void setup ()

·         LCD is initialized as 16 x 2

·         Serial communication is enabled with 9600 baud rate(bits/sec).

·         Pin A1 (data) is assigned as INPUT

·         In LCD it prints “HEART BEAT MONITORING”

In void loop ()

·         In serial window it prints place the finger and in LCD it prints “HB:”

·         Initially the OUTPUT from the HB module is HIGH

While (digital Read (data) ==1);

·         In while it continuously checks whether the Input becomes low and the condition become false.

·         The temp variable stores the current millis ().

·         Temp variable is added with additional of 5000 millis

·         The while condition is true for next 5000 millis or 5 sec.

·         Whenever the Input pulse goes low the count vairble is incremented with 1.

·         This process is repeated for next 5 sec. Once the millis reaches the next 5 sec then the condition become fasle and the value is stored in count.

·         The count having 5 sec of pulses and it is multiplied with 12 to get 60 sec or 1 min of Heart beat pulse.

·         The value is displayed in LCD and the variables are cleared with 0.

·         This process is repeated for every 5 sec of time delay.

 

Comments