Wiki

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
university:courses:electronics:electronics-lab-heartbeat [27 Apr 2017 12:37] Antoniu Miclausuniversity:courses:electronics:electronics-lab-heartbeat [30 Jan 2023 09:19] (current) – [Preamplifier] Antoniu Miclaus
Line 1: Line 1:
-======Activity: Heartbeat Measurement ======+======Activity: Heartbeat Measurement Circuit======
  
-=====Objective:=====+=====Objective=====
  
-The objective of this Lab activity is to collect heartbeat information that is displayed using the Scopy tool. A circuit is designed and implemented that manages to filter and amplify the pulse.+The objective of this Lab activity is to learn how to use a chain of amplifiers for gain and filtering, in a practical example, that aims to recover heartbeat information. The result of the system provides an relevant output that is displayed using the Scopy tool.
  
-=====Background:=====+Going through this lab activity, the students will learn how to drive a IR LED and a Phototransistor, will be able to design and understand the behavior of a low-pass filter and explore functionalities provided by the operational amplifiers in different configurations. 
  
-A pulse oximeter measures blood oxygenation and can monitor heartbeat by clipping onto a finger tip. It does this by shining light through your finger and measuring how much light is absorbed. This goes up and down as blood is pumped through your finger. For the operation as a pulse oximeter-type optical heartbeat detector, a pair of IR LED and Phototransistor is used. The Led emits light through the finger and is detected by the phototransistor, which acts like a variable resistor conducting different amounts of current depending on the light received. The voltage variations above the phototransistor changes with the heartbeat. The small signal obtained is used as input for the circuit, obtaining the behavior of a pulse oximeter. In order to have a relevant output, the input signal must be amplified a and noise filtered by designing a relevant circuit for this situation.  +Combining the previously mentioned electronic devices, the result of the activity will demonstrate how a real world application can be implemented with minimum software and hardware equipment. 
 + 
 +=====Background===== 
 + 
 +A type of Heartbeat Measurement Device consists of an electronic circuit that monitors heartbeat by clipping onto a finger tip. It does this by shining light through your finger and measuring how much light is absorbed. This goes up and down as blood is pumped through your finger. For the operation as a optical heartbeat detector, a pair of IR LED and Phototransistor is used. The LED emits light through the finger and is detected by the phototransistor, which acts like a variable resistor conducting different amounts of current depending on the light received.  
 + 
 +The voltage variations change with the heartbeat and are acquired from the collector of the phototransistor. The small signal obtained is used as input for the circuit, obtaining the behavior of a heartbeat detector 
 + 
 +In order to have a relevant output, the input signal is passed through multiple circuits: 
 +  *Preamplifier - the output signal from the heartbeat measurement setup is decoupled through the series capacitor and amplified using negative feedback resistor(R4). 
 +  *Low-Pass Filter - RC filter that cuts the high frequencies (noise). 
 +  *[[university:courses:electronics:electronics-lab-1|Voltage Follower]] - buffers the output of the low-pass filter and reproduces its voltage with a low impedance output; 
 +  *[[university:courses:electronics:electronics-lab-1|Inverting Amplifier]] with Low-Pass Filter - amplifies the voltage signal and cuts the high frequencies (noise); 
 + 
 +=====Materials=====
  
-=====Materials:===== 
 ADALM2000 Active Learning Module\\ ADALM2000 Active Learning Module\\
 Solder-less breadboard\\ Solder-less breadboard\\
Line 15: Line 28:
 1 - OP484 precision rail-to-rail I/O op amp\\ 1 - OP484 precision rail-to-rail I/O op amp\\
 1 - 100Ω resistor\\ 1 - 100Ω resistor\\
-1 - 500Ω resistor\\+1 - 470Ω resistor\\
 1 - 1KΩ resistor\\ 1 - 1KΩ resistor\\
-- 10KΩ resistor\\ +- 10KΩ resistor\\ 
-100KΩ resistor\\ +47KΩ resistor\\ 
-1 - 100nF capacitor\\ +1uF capacitor\\
-22uF capacitor\\+
 1 - 47uF capacitor\\ 1 - 47uF capacitor\\
-1 - Infrared LED ( QED-123 )+1 - Infrared LED ( QED-123 )\\
 1 - Infrared Transistor ( QSD-123) 1 - Infrared Transistor ( QSD-123)
  
-=====Directions:===== +=====Directions=====
-On your solder-less breadboard construct the pulse measurement circuit (designed in ADIsim) as shown in Figure 1. +
  
-{{ :university:courses:electronics:pulsoxmeter-circuit.png|}}+On your solder-less breadboard construct the heartbeat measurement circuit (designed in LTspice) as shown in Figure 1
  
-<WRAP centeralign> Figure 1 Pulse Measurement Circuit </WRAP>+{{ :university:courses:electronics:heartbeat_measurement.png?800 |}}
  
-The circuit amplifies the input small signal from the the phototransistor(Q1) with respect to ground. Some filtering techniques are added in order to solve the noise issues. There are several stages implemented with op amps before obtaining the final output(Vout): +<WRAP centeralignFigure Heartbeat Measurement Circuit </WRAP>
-  *Virtual ground with op amp (X1) - The op amp is used as current source and fed with half of the power supply voltage (Vp), obtained through the voltage divider (R2,R6). The output is used as virtual ground (Vp -'+'; 0V GND -> '-'). The purpose of this circuit is to maintain the signals at around Vp/2 and it is done by decoupling through the series capacitor(C1). +
-  *Preamplifier(X2) -  The input signals from the pulse oximeter are fed into a chain of 3 opamp stages. The first is a preamplifier. The pulse oximeter output is decoupled through the series capacitor to place it near Vp/2, and amplified using a 10kΩ negative feedback resistor(R4). +
-  *Low-Pass Filter with Buffer(X3) - The 10kΩ resistor(R1) and the 22nF capacitor(C2) describe a RC filter that manages to cut the high frequencies (noise). The opamp serves as a unity gain current source / voltage follower that has high input impedance when measuring the output of the low-pass filter and reproduces its voltage with a low impedance output. +
-  *Final Amplifier with Low-Pass Filter(X4) - Amplifies the signal with a gain ~1000 determined by the ratio of the 100KΩ resistor(R5) and the 100Ω resistor(R3). Low-Pass filtering components are provided by the 100nF capacitor(C3) across the negative feedback resistor. +
-=====Hardware Setup:===== +
-Use the variable positive power supply from the ADALM2000 module set to +5 V to power your circuit. Use scope channel to monitor the voltage at the collector node of V<sub>out</sub>.+
  
-The circuit implemented on the breadboard should look similar to the one in Figure 2. The blue LED represents the IR LED, and the grey one represents the Phototransistor.+The LTspice simulation uses OP284s, included in the standard set of LTspice models. The actual circuit is constructed with the quad OP484FPZ from the ADALP2000 Analog Parts Kit, powered by ± 5V from the ADALM2000 module (a total supply voltage of 10V.)
  
-{{ :university:courses:electronics:pulseoximeter_bb.png|}}+====IR LED====
  
-<WRAP centeralignFigure 2 Breadboard Pulse Measurement Circuit </WRAP>+In order to have a proper current that will not damage the IR LED, a resistor needs to be added in series to limit the current. Varying the value between in the operating range will change the intensity of the emmited signal of the IR LED. The following formula expresses the value of the forward current (I<sub>F</sub>) through the LED, based on the positive voltage supply +5V (V<sub>P</sub>), series resistance (R<sub>1</sub>) and forward voltage drop on the LED (V<sub>F</sub>): 
  
-=====Procedure:=====+<WRAP centeralign><m>I_F={V_P-V_F}/R_1</m></WRAP>
  
-Put the top of your finger between the IR LED(D1) and the Phototransistor(Q1). The emitter and the receiver should be alligned and pointing one to another.\\ +====Phototransistor====
-Observe the voltage waveform seen at the the output of the 3rd stage op amp (X4). An example of output waveform is presented in Figure 3. +
-{{:university:courses:electronics:pulseoxmeter-waveform.png|}} +
-<WRAP centeralign> Figure 3 Pulse Output Waveform </WRAP>+
  
-In the Oscilloscope feature of the Scopy tool activate the measure feature in order to read the frequency of the obtained signal. To get the value of beats per minute(bpm) use te following formula+To acquire information from the phototransistor (Q<sub>1</sub>) when is in contact with the IR light, a common-emmiter amplifier circuit is designed. This circuit generates an output which transitions from a high state to a low state when light in the infrared range is detected by the phototransistor. The output is created by connecting a resistor (R<sub>2</sub>), whose value was determined experimentally, between the voltage supply and the collector pin of the component.  
 + 
 +====Preamplifier==== 
 + 
 +The input signal from the heartbeat measurement setup is fed into a Differentiator Amplifier Circuit(([[http://www.electronics-tutorials.ws/opamp/opamp_7.html|Differentiator Amplifier]])) (C<sub>1</sub>, A<sub>1</sub>, R<sub>3</sub>). The capacitor blocks any DC content, C<sub>1</sub> and R<sub>3</sub> behaving as a high pass filter with the cut-off frequency F<sub>c1</sub> being determined by the following formula: 
 +<WRAP centeralign><m>F_c1=1/{2 pi R_3C_1}</m></WRAP> 
 +Besides filtering, this stage serves also as an amplifier taking as input the current (I<sub>A1</sub>), and generating at the output an inverted voltage (V<sub>A1</sub>) based on the negative feedback resistance (R<sub>3</sub>):  
 +<WRAP centeralign><m>V_A1=-I_A1*R_3</m></WRAP> 
 + 
 +====Active Low-Pass Filter=== 
 + 
 +Active Filters contain active components such as operational amplifiers, within their circuit design. They draw their power from an external power source and use it to boost or amplify the output signal. Active Low-Pass Filter(([[http://www.electronics-tutorials.ws/filter/filter_5.html|Active Low-Pass Filter]])) principle of operation and frequency response is the same as of a simple RC Low-Pass Filter, the only difference being that that it uses an op-amp for amplification and gain control.  
 + 
 +This first-order low pass active filter (A<sub>2</sub>, R<sub>4</sub>, C<sub>2</sub>), consists simply of a passive RC filter stage providing a low frequency path to the input of a non-inverting operational amplifier.  
 + 
 +The filter has the aim to cut the high frequencies that correspond to the noise signal. Taking into account that the heartrate does not exceed a value of 180 beats pe minute (bpm) and the dependecy between the bpm and the frequency is:
  
 <WRAP centeralign><m> bpm = frequency(Hz) * 60 </m></WRAP> <WRAP centeralign><m> bpm = frequency(Hz) * 60 </m></WRAP>
  
-**Return to Lab Activity [[university:courses:electronics:labs|Table of Contents]].**+will result that frequencies that are higher than 3Hz should be cut. The RC Low-Pass Filter is designed for the mentioned frequency value using the formula:
  
 +<WRAP centeralign><m>F_c2=1/{2 pi R_4C_2}</m></WRAP>
  
 +The amplifier is configured as a voltage-follower (Buffer) giving it a DC gain of one, A<sub>V</sub> = +1.
  
 +The advantage of this configuration is that the op-amps high input impedance prevents excessive loading on the filters output while its low output impedance prevents the filters cut-off frequency point from being affected by changes in the impedance of the load.
 +While this configuration provides good stability to the filter, its main disadvantage is that it has no voltage gain above one. However, although the voltage gain is unity the power gain is very high as its output impedance is much lower than its input impedance.
 +
 +====Final Amplifier with Low-Pass Filter===
 +
 +The configuration of the final stage represents a AC Op-amp Integrator with DC Gain Control(([[http://www.electronics-tutorials.ws/opamp/opamp_6.html|AC Op-amp Integrator with DC Gain Control]])). In simpler words, the circuit has the aim to low-pass filter (R<sub>4</sub>, C<sub>2</sub>) the signal from the remaining unnecessary frequencies that are higher than the maximum frequency of the heartbeat and amplify through the inverting amplifier the useful signal with a gain (A<sub>V</sub>)determined by ratio between R<sub>6</sub> and R<sub>5</sub>:
 +
 +<WRAP centeralign><m>A_V=-R_6/R_5</m></WRAP>
 +<WRAP centeralign><m>F_c3=1/{2 pi R_6C_3}</m></WRAP>
 +
 +=====Simulation=====
 +
 +Considering the circuit designed in LTspice, two types of simulation are made:
 +  *Transient - Connect at the input of the circuit a waveform generation source. Configure the source to generate a sine with amplitude of 500uV, frequency 2Hz and 500mV offset. Observe the output signal amplitude in order to determine graphically the total gain of the circuit(Figure 2).
 +
 +{{:university:courses:electronics:heartbeat-graph-tr.png|}}
 +
 +<WRAP centeralign> Figure 2 Output Voltage - Transient Analysis </WRAP>
 +
 +  *AC Sweep - Connect at the input of the circuit a AC Source. Configure the source to have a magnitude of 500uV. Observe the output signal in a chosen frequency domain (100mHz - 1kHz) in order to determine graphically in which frequency range the output signal has the biggest amplification (Figure 3).
 +
 +{{:university:courses:electronics:heartbeat-graph-ac.png|}}
 +<WRAP centeralign> Figure 3 Output Voltage - AC Sweep </WRAP>
 +
 +=====Hardware Setup=====
 +
 +Use the variable positive and negative power supply from the ADALM2000 module set to 5 V to power your circuit. Use scope channel 1 to monitor the voltage at the collector node of V<sub>out</sub>.
 +
 +The circuit implemented on the breadboard should look similar to the one in Figure 4. The blue LED represents the IR LED, and the grey one represents the Phototransistor.
 +
 +{{ :university:courses:electronics:heartbeat-bb.png|}}
 +
 +<WRAP centeralign> Figure 4 Breadboard Heartbeat Measurement Circuit </WRAP>
 +
 +=====Procedure=====
 +
 +Put the top of your finger between the IR LED(D1) and the Phototransistor(Q1). The emitter and the receiver should be alligned and pointing one to another.\\
 +Observe the voltage waveform seen at the the output of the 3rd stage op amp (A<sub>3</sub>). An example of output waveform is presented in Figure 5.
 +
 +{{:university:courses:electronics:heartbeat-waveform.png|}}
 +
 +<WRAP centeralign> Figure 5 Heartbeat Output Waveform </WRAP>
 +
 +In the Oscilloscope feature of the Scopy tool activate the measure feature in order to read the frequency of the obtained signal. To convert the frequency into beats per minute(bpm) use the formula from laboratory directions.
 +
 +=====Questions=====
 +
 +1. Using the values and formulas provided in the laboratory directions compute the following parameters:
 +  *Forward current through the IR LED. (use datasheet of the QED-123)
 +  *Cut-off frequency of the high-pass filter.
 +  *Cut-off frequency of the second stage low-pass filter.
 +  *Cut-off frequency of the third stage low-pass filter.
 +  *Gain of the third stage amplifier
 +
 +2. Using the oscilloscope, capture the voltage signal at the output of the first stage and try to compute the amplitude of the input current.  
 +
 +3. What role has the buffer in the second stage?
 +
 +4. What parameters change if R<sub>5</sub> is modified? How will the signal look on the Oscilloscope?
 +
 +5. What parameters change if R<sub>6</sub> is modified? How will the signal look on the Oscilloscope?
 +
 +6. On the Heartbeat Output Waveform the signal is not centered on 0V, even though the DC component should have been removed. Why is this happening? What should be added at the output of the circuit to reduce the offset?
 +
 +\\
 +<WRAP round download>
 +** Lab Resources:**
 +  * LTSpice files: [[downgit>education_tools/tree/master/m2k/ltspice/heartbeat_ltspice | heartbeat_ltspice]]
 +  * Fritzing files: [[downgit>education_tools/tree/master/m2k/fritzing/heartbeat_bb | heartbeat_bb]]
 +</WRAP>
 +
 +**Return to Lab Activity [[university:courses:electronics:labs|Table of Contents]].**
university/courses/electronics/electronics-lab-heartbeat.1493289462.txt.gz · Last modified: 27 Apr 2017 12:37 by Antoniu Miclaus