Bluetooth heart rate monitor or photoplethysmograph device. Part 1
In this article, you will get acquainted with the design of the device, which allows you to measure the pulse wave and transmit data over the air to the android device.
Lyrical introduction
Photoplethysmograph is a device that determines the change in the size of human organs using photosensitive elements. It can be used to measure heart rate. In this case, a change in the intensity of light from an artificial source is recorded due to the passage of a pulse wave. Typically, the last phalanx of the finger, earlobe, wrist or temple is used for registration. Very often the principle of photoplethysmography is used in various sports accessories.
To register a photoplethysmogram, a light source and a photodetector are needed. The source is usually an LED, and the receiver is a phototransistor or photodiode. The light emitted by the source is absorbed by the human body. In a first approximation, we can say that the degree of absorption depends on the amount of blood at that point in the body where the sensor is located. When the amount of blood changes, the absorption of light and the signal at the output of the photodetector change.
In relation to each other, the source and the receiver can be arranged in two ways. These methods are called “reflection” and “transparency”. In the case of “reflection”, the receiver and source are located in the same plane. The light from the source enters the skin, is partially absorbed and, reflected, enters the receiver. The following figure is a sensitive element of our own production. It consists of a printed circuit board, with a phototransistor soldered to it and an LED. The wire goes to the measuring box.
In the “clear” version, the source and receiver are located on opposite sides of the body part. In the following figure, they are located in different halves of the heart rate clip. The emitted light passes through the finger and enters the photodetector. This clip is designed to measure heart rate from an earlobe. There’s a finger in the picture, because it’s more convenient to take pictures.
The signal from the photodetector arrives at the amplification and filtering circuit. An example of such a circuit is shown in the following figure. Resistors R1 and R2 set the LED current and the operating point of the phototransistor, respectively. The isolation capacitor C1 removes the constant component, which occurs due to the illumination of the room where the measurement takes place. The pull-up resistor R3 shifts the voltage to the positive region (since the amplifier is unipolar). Shear stress is also fed into the amplifier feedback to avoid saturation. After amplification, the signal enters another separation stage to completely remove the shear stress. Then the data is digitized using the ADC.
This pattern is common, but not the only one. Everyone can follow the linkto an interesting article by Microchip. In addition to measuring the pulse with the help of photodiodes, you will read about the principles of measuring blood oxygen saturation (oxygenation) there, the typical circuit solutions used, and programs for the microcontroller are also given there. By the way, more recently, the Microchip has a demo board for heart rate monitoring.
Description of photoplethysmograph
To increase the mobility of measuring the pulsogram, a device was developed that contains a “reflection” sensor, an amplification circuit, a microcontroller, and an HC-05 bluetooth standard radio module.
Operating principle
The main element of the sensor is the PIC16F1705 microcontroller. He has on board a built-in operational amplifier, ADC, DAC, COM port and enough resources for simple calculations. The initially developed amplifier switching circuit corresponded to the above. After testing, some components were changed. In particular, a 47 μF capacitor was added to the feedback instead of the bias voltage. It performs the function of eliminating the DC component that is created by the voltage divider. To reduce power consumption, the LED is connected to the DAC output, which only works when the ADC data is sampled. The supply voltage comes from a Li-Ion LP502030 battery with a capacity of 250 mAh. Charging occurs through the mini-USB connector and the circuit implemented on the MCP73831 charge controller. Radio communication is provided by the HC-05 module. A character protocol is used to communicate with a computer or smartphone. The sensor is located in the housingOKW minitec , which comes with a wrist strap.
The sensor has the following characteristics:
- pulse wave measurement;
- sampling rate 200 Hz;
- 250 mAh battery, charge from USB;
- at least five hours of continuous operation;
- dimensions 50 x 45 x 16 mm;
- weight 20 g
Android program, data processing
An android application was developed to display a pulse wave on a graph and save data. The bluetooth module subroutine uses codes from the freely distributed BlueTerm terminal program . From the bluetooth adapter, the data is transmitted to the decoder class for decryption, and then to the handler class to form an array of samples and, possibly, perform the necessary calculations. At the moment, libraries for calculating heart rate and other significant parameters are not connected. After the handler, the data enters the main application window, where it is displayed on the chart and saved to a file that can be opened by a third-party application. While working on a project, I came across a good LabChart program, which works with several file formats, including text. There are paid and free versions of this program. The free one displays the data on the chart and allows performing mathematical processing: smoothing, filtering and Fourier analysis. The following figure shows the window of this program with a graph of data received from the sensor. A high pass filter is applied.
The paid version of the program has not yet come into my hands. On the developer's site very interesting characteristics are described. The program allows you to calculate heart rate, mode, mode amplitude, build intervalograms and much more.
To be continued
In the following articles, I will talk about some of the details that you need to consider when designing the hardware of a photoplethysmograph, methods for processing data, eliminating interference and artifacts.
PS
You can get acquainted with the drawings and the sensor program , as well as with the source codes of the android application .
Added (05/20/2015)
- a file with a pulsogram recording was added to the info / folder in the repository in 10 minutes;
- added the frequency response of the analog part of the sensor, its original file is also in the repository;