€5 PPG – photoplethysmogram amplifier / Arduino circuit

The photoplethysmogram (PPG) is a signal that measures changes in blood volume in some part of the body (e.g. the fingertip) by shining light into the skin and detecting small changes in the level of light absorption that occur due to the blood vessels enlarging and contracting. One common application is heart rate measurement. When the heart beats, blood vessels around the body swell slightly due to the increased blood pressure. This results is variable light absorption over the course of each cardiac cycle.

This circuit is a €5 PPG system that uses a TCRT5000 reflective infrared sensor, an LM358 opamp and an Arduino Nano.

The following Arduino code samples the analog voltage on pin A7 (the sample rate is approximately 100 Hz) and prints the values via the serial connection. The signal can therefore be plotted using the Arduino development environment’s Serial Plotter tool (located under the Tools menu). Normally, the Serial Plotter dynamically scales the vertical axis to fit the displayed signal. To prevent this (and maintain constant scaling), this program actually outputs two additional dummy signals – one which is always 0 and another which is always 1023. These hold the vertical axis limits at constant values.

//
// Photoplethysmogram (PPG) example
// Written by Ted Burke, 3-4-2019
//

void setup()
{
  pinMode(2, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  int du;

  du = analogRead(7);

  Serial.print("0 1023 ");
  Serial.println(du);

  delay(10);
}

This is an example PPG signal recorded using the above circuit (I rested my fingertip directly on top of the TCRT5000) and displayed in the Serial Plotter:

Since the PPG is a very low frequency signal, you may wish to reduce the gain of the amplifier at higher frequencies, which will tend to reduce the visible interference and smooth out the signal. This can be achieved by placing a 100nF capacitor in parallel with the 100kΩ resistor. The following signal was recorded with that capacitor in the circuit.

This entry was posted in Uncategorized and tagged , , , , , , , , , , . Bookmark the permalink.

7 Responses to €5 PPG – photoplethysmogram amplifier / Arduino circuit

  1. chiath1 says:

    Hi Ted,
    I am trying this set up for a project in school. However when I replicate this I was unable to get the same graph of the pulse as you. For my set up it only showed a one-off reading when i placed my hand on the sensor. It peaked as the IR was reflected then it went to 0 again.
    Do you have any tips/advice as to how I can improve it?
    Thanks!

    • batchloaf says:

      Hi chiath1,

      Sorry for the delay responding.

      This circuit is designed to amplify very small changes in the amount of infrared light reflected by the finger. Any sudden large changes will “saturate” the amplifier, meaning that its output will go all the way to the maximum (or minimum) level. This should happen when you first place your finger on the sensor because the change in reflected light is very large (between no finger on the sensor and a finger directly on the sensor). It takes the amplifier a while (about 20-30 seconds maybe) to settle back down when it saturates and return to amplifying the very small changes that occur when the heart beats.

      What I suggest you do is place your finger on the sensor (pressing lightly on it) and hold it very still for about a minute (or until you see the signal on the screen come out of saturation). What it looks like when it’s saturated is the signal is just dead flat, either at the top or the bottom of the graph. When it comes out of saturation, the signal will more like wander around a bit. Hopefully, it will wander to a resting level somewhere in the middle of the graph and you’ll then see the little pulses that occur each time the heart beats.

      If that doesn’t work, maybe I could get you to send me a clear photo of your circuit and I’ll check that everything’s where it should be?

      Ted

  2. Davin says:

    Dear Ted,

    I am very fascinated with your circuit for this PPG, and am currently doing a project in school for constructing a similar form of PPG device. May I ask what is this component in your circuit that has the operational amplifier and what does it do? Is it a differentiator op amp?

    Thank you and I really look forward to your reply. Your posts have been highly educational and I appreciate your feedback!

    Best regards,
    Davin

    • batchloaf says:

      Hi Davin,

      Sorry for the delay in responding. The chip I’m using here is an LM358, which is a dual opamp (i.e. two opamps in one 8-pin chip). I’m only using one of the two opamps here.
      The opamp is basically working as a normal inverting amplifier. The gain is set to 1000 by the ratio of the 100 Ω and 100 kΩ resistors. I can understand why you might think it looks like a differentiator (and in some sense I suppose it is one) because of the 220 μF capacitor between the TCRT5000 and the 100 Ω resistor. Really though, I think of that more as a d.c. blocking capacitor. You want the amplifier to amplify variations in the sensor voltage, but not the d.c. component which is relatively very large. If the amplifier amplified the d.c. part of the sensor signal, it would immediately saturate and stay in saturation constantly. So actually, I suppose it is a differentiator, but that’s not really how I was picturing it!

      Hopefully that kind of answers your question! If not, let me know and I’ll try to explain more.

      Ted

      • Davin says:

        Hi Ted,

        No worries and thank you so much for getting back to me! Your reply has been a great help in my better understanding of the amplifier’s functionality. Just a one more question: the circuit that runs from 5V source –> 10k ohms –> splits into parallel circuit to 10k ohms and 220 uF –> ground and also 10k ohms before going to the positive terminal of the op amp, what does this circuit do?
        Thank you and I look forward to your update!

        Best regards,
        Davin

      • batchloaf says:

        Hi Davin,

        That part of the circuit is used to generate a clean 1.66 V reference voltage in the circuit. I’ve uploaded a short video explanation here:

        https://youtu.be/bIeBIVDoga8

        Hopefully that answers your question, but if not let me know.

        Ted

  3. Davin Hong says:

    Dear Ted,

    I am very fascinated with your circuit for this PPG, and am currently doing a project in school for constructing a similar form of PPG device. May I ask what is this component in your circuit that has the operational amplifier and what does it do? Is it a differentiator op amp?

    Thank you and I really look forward to your reply. Your posts have been highly educational and I appreciate your feedback!

    Best regards,
    Davin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s