This project uses a NI myRIO, a photoresistor, and natural lighting in order to determine your heart rate. When a button is pushed on the myRIO, the voltage from the photoresistor is read for 10 seconds. The beats per minute are then displayed on an LCD display using the Pmod Adapter for NI myRIO.
Note - the Analog Parts Kit from Digilent contains all required resistors, capacitors, wires, and op-amps for this project.
Step 1: Materials
1) NI myRIO
4) Pmod Adapter for NI myRIO from Digilent
8) 2x 4.7 uF capacitors
10) ADTL082 Op- Amp
Step 2: Basic Idea and Connecting the Parts to MyRIO
The photoresistor is used to view changes in blood volume in your finger. As the blood volume changes, the amount of light that is absorbed by your finger changes. At different times in a heart beat cycle, the blood volume in your finger will be different. Check out the picture above for a graphical view of this concept.
Now, connect the Pmod Adapter to the MXP port A on the myRIO and then connect the SPI (J1) terminal on the PmodCLS to the SPI connector on the Pmod Adapter. Then connect the myProto board to the MSP connector on the myRIO.
Step 3: Circuit
Above is a picture of the circuit. It contains a voltage divider for the photoresistor, an ADTL084 Op-Amp, a passive low pass filter, and a passive high pass filter.
The myRIO 5V output on the MSP port is used to supply 5V to the 10kΩ and 4.7kΩ in series with the photoresistor. The voltage across the photoresistor is then fed into the positive terminal of the op-amp and the negative terminal is attached to the voltage output to make a buffer which helps protect the voltage source from the load. The supply voltages of +10V and -10V for the op-amp are supplied by the analog output signal of the myRIO (set up in the code for the myRIO).
The output voltage from the buffer is then put into the passive first order bandpass filter. The cutoff frequency for both the high pass and low pass filters is 2Hz since a 60 bpm heart rate is 1Hz and a 120 bpm heart rate is 2Hz. To make a cutoff frequency of 2Hz, I used a 16.8kΩ resistor (10k + 6.8k in series) and a 4.7uF capacitor for both the high pass and low pass filters.
Next, the voltage is fed to the op amp to create a non-inverting amplifier with a gain of 101 using a 10kΩ and a 1MΩ resistor. The resulting voltage is then fed to the analog input of the myRIO.
Step 4: LabVIEW Code
Below is the attached VI for your myRIO. Download it and then open it in a myRIO project. Click the run button and when you push the "Button0" on the myRIO, LED1 on the myRIO will turn on, the photoresistor voltage will be read for 10 seconds, and the heart rate will be displayed on the front panel and on the LCD display. When the myRIO is not reading values, LED0 will be on.
If you want to learn how to deploy the VI to the myRIO so that it runs on startup without a computer, check out this video.
If you are in low-light, you may decide to add another non-inverting amplifier to further increase the voltage reading.