Team Silver – Monday Lab, Friday Discussion Project Report Sam Jones, Ranjay Krishna, Daniel WyleczukStern, Mengxian Jiang, TaeSung Jung 04 May 2011 Team Silver Project Contents Executive Summary of the Project Discussion of the Primary Use Context of the Device Functional Requirements of the Prototype Discussion of Alternative Concepts Discussion on the Rationale for Deciding on the Final Design Presentation of the Final Architecture Circuit Diagrams for Each Subsystem Table of Components and Estimate Cost Discussion of Possible Failure Modes for the Device Discussion of the Methods Used to Verify and Validate the Design Conclusion Executive Summary of Project This project is a finger-based plethysmograph. A light is shined at receiver and, when a finger is placed between the two, a buzzer and light respond on every pulse. In addition, the signal can be saved on a computer and put through a simulated digital circuit to give a pseudo-real time pulse count. At a high level, the project involves the use of photo diodes and photo detectors, passive and active filters, anolog circuit design, anolog to digital conversion and digital system design. As a person inserted their finger into the clip, it would detect the subjects heartbeat and output a signal into the amplifier. The amplifier would then amplify the signal and send it to the filter to remove all the low and high frequency disturbances and noise. The filter would then send the clean signal across to the analof to digital convertor to create a digital signature corresponding to the heartbeat. This digital signal was then responsible for running the buzzer, LED and the digital readout. Design Summary: the design of the project focused on breaking the project into individual components and assigning each of those components to a team member. The project was broken into five parts with “owners” as follows: Digital component - Mengxiang: The digital readout uses four different counters to keep track of the heart rate. The 3.75 second counter keeps the most immediate value while the 60 second counter keeps the most accurate value, and the 15 and 30 second counters act as intermediates that trade off accuracy to immediacy. The circuit selects the best value to display based on different factors such as how much the heart rate has changed and how long the heart rate has been monitored. Clip (light, phototransistor, and associated components) - Sam: The clip uses an IR LED and a 4/25/11 2 Team Silver phototransistor in order detect a person’s heartbeat. The components are placed at opposite sides of a protoboard and face each other. When a person’s finger is placed in between the two components a voltage change occurs from the phototransistor. This is passed into the next part of the circuit. Amplifier - Ranjay: This then goes to an amplifier which turns the voltage, which as previously of the order of 1mV with the finger inside into to a usable voltage of around 3 V. This amplification was completed in two stages, using two inverting op-amps with a gain of -33 V/V each, ensuring that the output would be inverted twice to ensure a non-inverting sun-system. Filter - Ranjay: The output from the amplifier goes into a Sallen-key filter. This filter is designed to remove most of the noise from the circuit and allow a clearer picture of the signal. The filter consisted of two Sallen Key active filter designs in series cascaded together. A/D Converter - Daniel: The A/D converter is created using a simple comparator. The input voltage goes into V+ and the threshold voltage goes into V-. The threshold voltage is created with a voltage divider and a potentiometer. The potentiometer allows us to vary the threshold voltage from person to person. Buzzer and LED - Tae Sung: A relaxation oscillator was used to power the buzzer and LED. The output of the A/D convertor is used to power the op amp. If the convertor gives high output, the oscillator output is passed to the buzzer and LED which both turn on synchronously. Construction: Each part was constructed by their respective owners initially. Due to complications that arose, certain parts were finished early and people would rotate among different parts as described below. Clip: The clip involved a fair amount of work initially because it involved circuitry that was unfamiliar to most team members. On 1 April, the clip design was finalized. It output a lot of noise, but discern-able differences in the signal based on the pulse were observed. The signal was observed using a simple LabVIEW VI. Filter: The filter was a Sallen-key filter. Construction was impeded by decisions regarding cut-off frequencies as well as the steepness of the drop-off. Ideally, a very steep drop-off is ideal because the noise is a much higher frequency than the pulse signal. Thus, the Sallen-key filter seemed the most appropriate. We cascaded two Sallen key filters in series, one low pass at 5Hz and the other a high pass at 0.5Hz. The design of the low pass filter kept altering as we were trying to eliminate the more amount of noise possible without affecting the heartbeat. We finally decided on 5Hz as the best frequency. Amplifier: Construction of the amplifier was done using a inverting op amp amplifier. The only trouble with construction was a result of a broken op amp. After overcoming that, the two inverting op-amp amplifiers were cascaded in series with a gain of -33 V/V individually. The total gain of the sub-system was expected to be around 1089 V/V. A/D Converter: Construction was simple. Once the design was decided upon, there was vary little difficulties in construction. Some research was required in how to properly use a potentiometer, but once that was full researched, construction required around 15 minutes. Buzzer+LED: Since Buzzer+LED required only a small number of components; a few different designs were completely built at the start of the project. After other subsystems were built, the prepared designs were tested and the best one was chosen. Digital Circuit: Many frequently used sub-components that were not included in the components provided by Multisim such as 12-bit adders were first created as sub circuit components using smaller components such as 4-bit adders. Then these sub-components are tested and then wired with the main circuit. Testing was done on a piece by piece basis. So, whenever a part was built, it was first tested with the function generator. Then, once the clip was running, it was tested with the clip. For instance, 4/25/11 3 Team Silver once the filter was done, it was hooked up to the function generator and a scope. Once it was determined that the filter worked, it was put aside until the clip worked. Once the clip was determined to work, the clip signal was put into the filter and the output of that was read. This sequence of events continued for every component until it was determined the entire plethysmograph worked. Clip Testing: Testing on the clip was initially done part by part. In the beginning there was not much knowledge regarding how each LED and phototransistor functioned, so first the best LED/Phototransistor combination had to be found. Initial testing was difficult because there was no set output to look for. Without a working filter and amplifier, the pulse could not be read yet. Initial testing made sure there was some change in the clip output when a finger was inserted in between the LED and the phototransistor. The next step was to integrate the clip with the filter/amplifier. That brought about lots of needed changes. Some of those changes included: adding a passive high pass, using rectifier diodes and using a voltage divider in the log amplifier. Once the clip worked with the filter and amplifier, the mechanical portion of the clip. Once created, it was tested to ensure that it created less noise. In conclusion, there were three major steps needed to be taken in testing the clip: first getting a working subsystem, then testing with the filter/amplifier and finally testing the mechanical clip. Amplifier testing: The initial testing for the amplifier was done by first checking the resistor values that were chosen and ensuring that those values were closest to the ideal values as possible. Second, testing for the gain of each amplifier and making sure that the total gain is around 1089 V/V. However, after testing, the gain was measured to be around 930V instead. Fortunately, this did not affect the functionality of the circuit as it was sufficient to drive the filter. Filter testing: The filter initially had a low pass cut-off of around 3Hz. This caused a large junk of the heartberat signal to be lost due to such a small cut-off. To fix this, the cut off was changed to 10Hz, just like the lab 4. However, this cut-off was too high and let a lot of high frequency noise to disrupt the actual signal. Finally, the cutoff was finalized at 5Hz. The filter was then combined with the clip and the amplifier and was outputting a clean signal of around 10 mV. A/D Converter: Testing was first done with a function generator. A sine wave from the function generator was put in and the signal was observed with the MyDaq oscilloscope. The threshold voltage was adjusted. Variation in the width of the digital pulse was observed confirming a working circuit. Testing was then done with the real pulse output. A working digital pulse was confirmed and testing was complete. Buzzer + LED: Testing was done by using square wave provided by a function generator. Both the tone of buzzer and brightness of LED was adjusted prior to the integration of all subsystems. Digital Readout: Testing was done by adding 7 segment displays to each of the subcomponents to act as indicator of the signal. Different inputs of VCC and Ground are then fed into the sub-components individually to check if the output is correct. Once each individual subcomponent worked by themselves, they were hooked up into the larger circuit and then still tested by the same method of adding 7 segment displays. This proved quite successful, as it is easy to locate the sources of bugs and easily debug them. There was a specifc routine to test the Digital Readout with .lvm files once our circuit was completed. These are the steps for testing in Multisim using .lvm files: 1. Open up a blank VI on labview 2. Add an input DAQ assistant. 3. Choose to only include 1 voltage output. 4. Choose continuous sample, 10k sample size, and 1k sample rate. 5. Right click inside the loop (the rectangle with the DAQ assistant inside) and choose output --> Write to Measurement File 6. In the X Value Columns, choose one column only, and leave all the options unchanged. 4/25/11 4 Team Silver 7. Wire up the output of the DAQ assistant to the Write to Measurement File. 8. Click run and after ten seconds or so, click stop. The lvm file will be Written Discussion of the Primary Use Context of the Device Use Cases Priority Explanation of the Primary Use Context Tables Patient remains connected to the device M Patient reconnects himself/herself to the device (in case of disconnect) M Patient informs the nurse in case of discomfort L Nurse keeps his/her ears open for aberrant beepings M Nurse calls the A/S center in case of malfunctions L Doctor sets up the device Doctor reads the displayed data Doctor diagnoses the symptoms Doctor informs patient/nurse of the diagnosis Doctor Patient Device Tech Support H H We established different relations between the aforementioned groups. Of significant importance was how the doctor, nurse, patient, and tech support interacted with the device. The relation between those groups is important, but not as important as the relation between them and the device because the latter influences the former. M Nurse directs Doctor Nurse H In terms of deciding the primary uses of the device, we identified the various types of people who would interact with the device once constructed. We determined that patients, doctors, nurses, and technical experts on the device (e.g. employees of the same company who produced the device who are responsible for troubleshooting and fixing the device). We decided that the relations between the doctor and the device were very important. It is the doctor who decides to purchase the device and it is the doctor who will use the device. Also of importance is the relation between the patient and the device. The patient has to feel comfortable when wearing the device. If they aren’t, they will complain to the doctor who will not purchase further devices. seeks direction receives medical attention attracts requests services alerts and provides info gives technical advice Patient diagnose/treats Device purchases monitors prepares is monitored by Tech Support request help monitor fixes 4/25/11 5 Team Silver Functional Requirements of Prototype Requirement type Clip Filter Amplifier Main function Logarithmically read heartbeat of every person Remove noise caused by ambient light Amplify the signal by a set amount Output signal around 1 mV Remove noise caused by patient movement Have cutoff frequencies of 0.5 Hz and 5 Hz Need an input voltage of about 3V and the output was in mV Secondary function Tertiary function Input/Output constraints A/D Converter Light + Buzzer Turn on an LED and buzzer at the peak of the user's pulse Do not distort the waveform Convert the analog signal to a 1 bit digital signal Have the conversion based on a set voltage threshold that is easily changed by the user Digital Readout Display an accurate measurement of the beats per minute as determined by the input data Insure neither the buzzer of the LED is annoying to the user Read .lvm data saved by the user Input needed to be in mV and output needed to be around 5V Minimize jitter Input needed to be in the 1V - 8V range and the output should be high (9V) or low (9V) Input needed to be around 5-10V and have a square waveform Input needed to be in an .lvm data file with appropriate formatting Explanation: Starting the project, the team needed to decided not only what the subsystems were, but what the requirements of each subsystem were. Some decisions were self-explanatory: the amplifier should amplify. But others, such as should the filter also amplify, required more thought. Thus, we established requirements for each substyem. Before constructing any device, it was necessary that each person was aware of how the other subsystems worked. Because everything would eventually be linked together, it was necessary that every team member let the others be aware of the required inputs of their device. That way, they would be able to tailor their device’s output to the necessary input of the next subsystem. Thus, each owner could then generate specific technical requirements for their subsystem. For the clip, it was necessary that it perform the logarithmic scaling because it had the best access to the pulse’s original signal. In addition, it was necessary that the output of the clip be in the mV range. Much lower and any amplification could fail to distinguish the pulse waveform from any background noise. It was decided that, for the filter, it would need to remove both unwanted high and low frequencies caused by movement, ambient light, and any other sources. The cutoff frequencies were determined after testing various other frequencies. It was decided that there would be no gain on the filter in order to simplify the circuit and prevent unforeseeable interference. Thus, the filter would take in an input in the range of around 3 V and output in the mV range. The amplifier had simplifier requirements. It needed to not distort the signal (invert it, etc) 4/25/11 6 Team Silver and it should take in a signal in the mV range and output a signal in the V range. The A/D converter needed to take in the amplified and filter signal and convert it to a digital signal. The conversion should be consistent and not jitter back in forth. There needs to be a one to one correspondence between the user’s heartbeat and the digital pulse. In order for the A/D converter to work cleanly, it needed a certain voltage range to operate. It also needed to output a voltage range varied enough so that the digital pulse was clearly distinguishable. The light and buzzer needed to turn on at the peak of the digital voltage so the user had an immediate auditory and visual indication of their pulse rate. It also needed to not annoy the user. Various buzzer frequencies caused the user to become annoyed, so testing was required to fix this. The digital readout could not operate in real time under the current constraints. Thus, it needed to be able to read in an .lvm file saved by the user. It needed to display a reasonable calculation of the BPM. Discussion of Alternative Concepts Clip: One decision for the clip was to use a red LED or an IR LED. We chose an IR LED because it did not emit visible light to annoy the user, but the red LED worked as well. In addition, the initial design revolved around either using a logarithmic amplifier or a Common Emitter amplifier. We chose a logarithmic amplifier for our final design. However, we explored and tested a simple Common Emitter amplifier. Instead of a diode connected to the collector, a resistor was connected there. This produced some different output voltages and in some case were better than the outputs of the log amplifier depending on the resistor, but in the end the log amplifier excelled at minimizing output change from user to user. Filter: there were a number of alternative designs for the filter. The first design considered was to use a standard bandpass which is a low pass filter in series with a high pass filter. The second design was a Sallen-key filter which combines the effects of a low and high pass filter into one circuit. The third design was to use a passive RC bandpass filter. This filter does not involve an op amp but instead just resistors and capacitors. The fourth design considered was to use an amp band pass filter without any gain. Amplifier: there were five different designs for the amplifier. The first design was to build a non-inverting operational amplifier with gain. This would use resistor ratios to determine an amplification ratio. The second design was to cascade two inverting amplifiers. The inversions would cancel out and the amplifiation would stack such that Atotal = A1 * A2. The third design was to use a MOSFET. The fourth design was to use a JFET. The final design was to use build an inverting amplifier. A/D Converter: There were three possible implementations considered: a Schmitt Trigger, a comparator, and a transistor. The Schmitt Trigger involved setting a low and high threshold voltage and anything higher would result in a high output, anything lower than the low would result in a low output. Anything in between would hold the previous output. A comparator is a simple op amp function. The input voltage goes into V+ and the threshold voltage goes into V-. If V+ is more than V-, a high is output. If it’s lower, a low is output. V- is controlled by a voltage divider on Vcc. The voltage divider includes a potentiometer which allows V- to be varied quickly and easily. A transistor is simply using a transistor. The input goes into the middle pin of the transistor. If the voltage is high, the transistor allows a high signal (Vcc) to be passed through. If the voltage is low, no voltage is passed. Buzzer and LED: the primary decision involved here was what oscillator to use. The first design considered was a non-inverting Schmitt Trigger and integrator. This has a standard noninverting amplifier hooked into an integrator. The output of the integrator goes into the input of the first op-amp. This gives a triangle wave. Another oscillator design considered was a Wein bridge 4/25/11 7 Team Silver oscillator. This is again similar to a non-inverting amplifier with some changes. A capacitor in series with a resistor connects V- and the output. Another capacitor in parallel with another resistor connects V- to GND. This gives a sine wave that slowly grows until it hits a max. Other than the oscillator, a transistor could be used both to power the op amp and effectively shut off any current leakage during each heart beat. Adding a transistor would have been useful if our A/D converter were not good enough to provide clean signals to drive the Buzzer+LED subsystem. Digital Circuit: There are many ways of creating a digital readout for the heart rate using digital logic. The simplest implementation of the heart rate is probably one in which a slow clock with period of 1 minute acts as a reset signal for a counter while the heart rate is used as the actual input clock for the counter, therefore the counter will always have the correct count. However, the problem with this simplest design is that it will take 1 full minute before a reading of the heart rate is displayed. Therefore, an alternative is to use a faster slow clock such as one with 30 second period and therefore multiply the count by 2 to get the heart rate. However the problem with this approach is that once we get down to 3.75 seconds, the heart rate will be in multiples of 16 which is a fairly huge error margin. One solution to get rid of this error margin is to actually implement multiple counters in which the counter have different periods and therefore gradually reduce the error of the count as time goes on, which was our approach. We used 4 counters (3.75, 15, 30, 60) which would switch over to the long time periods as time went on. However, this approach seems quite wasteful since once the 60 seconds has passed, the other counters contribute nothing to the display. Since a heart rate can change rapidly, 60 seconds is still a long time to wait for an updated display. Therefore, we also implemented a selection system in which if the 60 second value is off from the 3.75 second one by a certain threshold (we set it to 32), it would change to the 30 second value, and if the 30 second is also off, then 15, and then finally the 3.75 if the 15 is also off. An alternative design to this multiple clock that also solves the problem of reducing error margin as well as fast update time is to use the heart rate as the reset for the counter and to use a very fast clock as the counter clock input. This approach does not directly count the heart rate but rather the heart beat period, which is then fed into a look-up table which translates the period into a heart rate. This is extremely fast as it requires only to heart beats for a display which should normally take only a few seconds. The error is also low if the very fast clock is extremely fast. However, there is also a trade off in terms of the very fast clock speed and the size of the look-up table since a faster clock would require a bigger table. One drawback of the look-up table design is that there is no memory of what the heart rate was in the past. Therefore a potential problem is that the heart rate display could give a reading such as 67, 73, 69, 75, 71, 65 where the value keeps jumping from each heart rate. This may be undesirable if one merely wishes to check whether the heart rate is just within a certain range. Like how an air conditioning unit does not merely turn on or off when a certain temperature is reached but rather when the temperature has went past it, this may be the case for the heart rate monitor as well. In this case, our design of multiple clocks would work better than the look-up table. Discussion on the Rationale for Deciding on the Final Design Clip: The clip consisted of a photo-diode and a photo-detector followed by signal diodes. The signal diodes minimized change in output from user to user in the form of a logarithmic amplifier. The final design of the clip also included a passive RC filter to remove the DC offset that we were receiving. The mechanical portion needed to limit the amount of noise we received from users making small movements. This was achieved by using a spring loaded clip. Also padding was added on the clip to ensure comfort for the user. 4/25/11 8 Team Silver Filter: The Sallen-key filter was chosen because it allowed us to build both a high pass and a low pass separately, allowing us to test the two filters individually. Even though the Sallen-key design is much more complicated to implement, its steeper roll-off guaranteed a better filter, especially since the frequencies are so close together. Also, we decided against having the filters amplify because it created harder test cases for the filter and also cause the voltage to hit the rails if the voltage was amplified too much. Amplifier: The amplifier receives its input from the clip and is around 1-5 micro-Volts. So, an amplification of around 900-1000 is required to output a voltage in the milli-volt range. After considering all the alternatives in the Pugh matrix, two inverting amplifiers in series displayed the most stable and predictable behavior. A/D Converter: A comparator was chosen for a number of reasons. Primarily, it allowed us to easily adjust the threshold voltage. A transistor did not give us this functionality while the Schmitt trigger was much harder to adjust. The comparator also used fewer parts than the Schmitt trigger and it was also easier to construct. The transistor was easier to use than both of those, but it had other flaws. In terms of accuracy, the comparator and Schmitt trigger gave equally good results while the transistor gave poor results. We valued functionality and the number of parts, with fewer being better, the most. Therefore, the comparator was chosen. Buzzer + LED: For the buzzer, three potential designs - Schmitt trigger and integrator, relaxation oscillator, wien bridge oscillator - were compared using Pugh matrix. These three were the candidates for Buzzer subsystem because they are the most widely used designs that do not contain an inductor. Using a design containing an inductor was not desirable because it would create electromagnetic fields that increase the overall noise of the circuit. After going through Pugh matrix comparison, relaxation oscillator was chosen, primarily because it is the design that contains the least amount of components. A transistor in common collector mode was initially chosen to provide current to LED. However, using a transistor would significantly deform the shape of the digital pulse. So a simple series resistance was connected with LED, with power from the digital signal being used to provide current to it. Digital Circuit: For the digital readout, four potential designs were compared using a Pugh matrix. The designs were a 3.75 second period counter, a 15 second period counter, a 3.75 and 15 counter, and a 3.75, 15, 30, and 60 counter. A fifth candidate, the heart rate as reset with extremely fast clock, also known as the look-up table design, was not considered due to the fact that it initially looked like it required a microcontroller which broke the project constraint. After going through Pugh matrix comparison, the four counter design was chosen due to the fact that it allowed the smallest error margin in the heart rate display (within 1 heart beat) as well as providing the fastest output (every 3.75 seconds). It is true that the fifth candidate, the look-up table could potentially be faster since it requires only the time for two heart beats, it is limited by the fact that it uses only two samples to extrapolate the heart beat. This means that the look-up table display will very likely change on every heart beat rather than displaying a constant output for a long period of time even though the heart rate has not changed considerably. Like how an air conditioning unit does not merely turn on or off when the set temperature is reached but rather when the temperature has went past it by a certain amount, our readout design reacts to the heart rate in a similar fashion while the look-up table display will needlessly switch between relatively close values. 4/25/11 9 Test Thread Specification Output event ("buzz and beep") The system shall buzz a buzzer and turn on an LED. LED and Buzzer Output System Analog Circuit Software Requirements Specification Information event ("store on computer") The system shall take the digital signal and store it as data for the computer Digital Input System Digital Circuit Outputting data Awaiting input System State Test Thread Specification Output event ("digital display") The system shall display a real-time digital Outputting pulse count Data Digital Output System .5 Seconds Timing Target Team Silver Presentation of the Final Architecture -Operational Description Template 4/25/11 10 Information event ("voltage input") The system shall detect that a finger was placed into the clip and read the changes in voltage. Clip System Hardware Requirements Specification Data event ("filter") The system shall filter the signal. Filter System Hardware Requirements Specification Data event ("amplify") The system shall amplify the signal Amplification System Hardware Requirements Specification Data event ("convert") The system shall convert the analog signal to a digital signal A/D Converter System Team Silver 4/25/11 11 Human Interface Specification Saves data on computer using available software Information event ("finger placed") Patient places finger into the clip Operator (Patient) Team Silver 4/25/11 12 Team Silver Reasons and Rationale Behind the Final Architecture Operational Description Template: there was a clear order of steps in the workings of the plethysmograph, so our operational description template (ODT) codifies that. Initially, the main, and most important, user action is the placing of the finger into the clip, i.e. the space between the system’s IR LED and phototransistor. Then, the next system is the filtering system. This takes the output from the clip and removes the high frequency noise. It then outputs the filtered signal to the amplifier. The amplifier amplifies the signal to a usable level because, previously, the signal was in the millivolt range and a signal in the volt range is preferred. The amplified signal then goes two places as demonstrated in the ODT. It goes to the buzzer and LED analog display, which gives a realtime output of whenever the pulse peaks. The amplified signal can also be saved as data on a computer, which is moved to the next system, the digital system. The digital system runs the data as if it were real time and gives a pseudo real time pulse count. The even types were decided based on whether data was moved from one discreet system to another (say, finger to hardware or hardware to output). So the filtering of the signal was an information event whereas the buzzer emitting sound was an output event. Also, the systems were classified into user interface, hardware, software, and test in order to best illuminate how the entire plethysmograph can be broken up into four main parts. Functional Flow Diagram: this diagram presents an easy to understand picture of the steps of the system. These steps can be read in the description for the ODT, so they are omitted for brevity. The choice of dotted or solid lines demonstrates where real time, user driven effects on the system can cause changes or delays. For example, the user can choose to not save the digital data and completely omit the digital display step. State Change Diagram: There were five different details that were chosen to describe each state: the presence of a finger, if analog processing was occurring, if digital processing was occurring, if there was analog output, and if there was digital output. These characteristics were chosen because they easily allow one to see breaks in the four different system classifications (user interaction, hardware, software, and output). The states also represent where user action can impact which state happens next (the user choice to examine digital data or not). Circuit Diagrams for Each Subsystem Clip: 4/25/11 13 Team Silver The functional behavior of the clip is that it outputs a voltage signal with a hidden AC pulse and that it will be comfortable for the user. The user interacts with the clip by placing his or her finger in between both pads on the spring clip. By placing his or her finger there, it is in between the IR LED and Phototransistor. The light travelling through the finger creates a base current in the phototransistor which then creates a respective collector current. When the heart beats, blood flows through the finger in a way that allows less light to pass through the finger, which then creates a smaller base current. Because the collector current will then be smaller, the output voltage will be higher (see circuit diagram). There are two diodes placed from Vcc to the collector terminal to create a logarithmic amplifier so the output voltage does not vary too much from user to user. The diode is controlled by the Shockley Equation: and the inverse relation is: . It can be seen that the voltage will not vary that much because of the log relation. At the collector of the phototransistor a passive high pass with a very low cut-off is placed to get rid of any DC bias. The output is then fed to the filter/amplifier. This meets the functional behavior by producing a consistent hidden AC pulse through a log amplifier and passive high pass. Also it is comfortable for the user through the padded spring mechanical design. Filter: The filter had two Sallen Key designs cascaded in series. The first op-amp served as the low pass filter with a cut-off frequency of 5 Hz. The second op-amp was a high pass with cut-off at 0.5 Hz. The low pass removed all the excess high frequency noise from the clip and kept the heartbeat signal intact which the high pass took care of all the low frequency disturbances occurring because of finger movements. The circuit was also very compact as it used only 0.1 micro-farad capacitors and didnt require larger capacitors because of the use of high resistances. The filter did not amplify the signal because after testing it was found to be much more reliable with any gain associated with it. Amplifier: 4/25/11 14 Team Silver The amplifier had two levels of amplification, both inverting with a gain of -33 V/V. Overall, the amplifier subsystem created a non - inverting gain of 1089 V/V. It used four resistors: two of 1K-Ohm and two of 33 K-Ohms. The input expected at the amplifier was approximately 1mV and was expected to output 1-2 V signal after amplification. A/D Converter: The functional behaviour is that Vout is positive at the peak of the heartbeat and zero or negative otherwise. Voltage in is the heartbeat signal coming from the amplifier. Because this signal varies from around zero volts to seven volts, we chose to vary V- with a voltage divider on Vcc. An equation for Vout is given below. Rp = the resistance of the potentiometer. Vout=Vcc if V+>VV- = (Vcc*Rp)/(10k + Rp) If Rp is at its max (10k), V- = 5V. If Rp is at its minimum, V- = 0V. We can therefore vary V- between zero and five volts easily. This allows us a decent range of values, which are between the ranges of Vin. This gives us complete control on the threshold voltage. Therefore, we can insure that Vout only goes high if and only if the heartbeat peaked. Buzzer/LED: 4/25/11 15 Team Silver This subsystem is turned on at the positive peak of the signal that is fed from the A/D converter subsystem. When turned on, the circuit provides enough power for the LED to shine brightly, and provide a voltage signal at an appropriate oscillating frequency for the buzzer to beep at an appropriate tone. The subsystem was able to deliver enough current to the LED without use of any transistors. The oscillating frequency was given by the formula The frequency was originally adjusted at 2kHz but lowered later on after testing multiple times with our own ears. The final values of resistors and capacitors were chosen to make the frequency to be around 370 Hz, which was the tone found to be most soothing to our ears. Digital Circuit: This subsystem consists of four differently clocked counters, one at a 3.75 second period, one at 15, one at 30, and one at 60. The counts of each of the not 60 counters are already the heart rate in beats per minute since multiplication is done ahead of time. This is done through the use of multiplying the input heart rate frequency. The simplified circuit diagram explains how the frequency multiplication works. Basically the heart rate acts as a reset for a counter with a very fast clock that counts to what you wish to multiply the heart rate by. Once that the counter reaches that amount, a mux switches the output from the fast clock to the ground thus multiplies the heart rate frequency. The heart rates of each counter are fed into logic that selects the best out of them. The selection works as follows: first it checks whether 15, 30, or 60 seconds has passed yet, and if so chooses the longest timed counter based on time passed. However, if the 60 second counter differs from the 3.75 by a certain amount (we set ours to 32), use the 30 second, and if the 30 also differ, use the 15, and if the 15 also differ, use the 3.75 value for display. One critical component required for this selection logic is the use of an absolute value subtractor. The simplified circuit diagram for the subtractor is shown below: Rather than subtracting two values and trying to take the absolute value which requires that the comparator be able to tell negative values, the circuit first compares the two values, take the negative of the smaller one and put them into the adder, therefore guaranteeing a positive difference. This difference is then compared with a threshold (which we set to 32 for our project) for the selection logic to determine which heart rate to output. 4/25/11 16 Team Silver Table of Components and Estimate Cost **Most price estimations are based on purchasing quantities between 100 and 1000** Table of Components and Estimate Cost (Analog Circuit) Component P/N (If applicable) Resistor .68uF Capacitor 100nF Capacitor Op Amp IC 100k-ohm Variable Resistor IR LED Piezo Buzzer Clothes Pin Padding Copper Wire Phototransistor Rectifier Diodes Red LED LF353 276-143 PDF:142KB PNZ150-ND 1N4007 160-162-ND Quantity 21 3 5 4 1 1 1 1 1 1 1 2 1 Price Per Component Total Price $0.20 $4.20 $0.65 $1.95 $0.35 $1.75 $0.60 $2.40 $0.75 $0.75 $0.50 $0.50 $0.50 $0.50 $0.04 $0.04 $0.10 $0.10 $0.20 $0.20 $0.75 $0.75 $0.06 $0.12 $0.30 $0.30 Total: $13.56 Table of Components and Estimate Cost (Digital Circuit) Component Counter Flip Flop NAND gate 7 segment disp. Clock P/N (if applicable) 74LS163 74AHCT1G79GW 74HC1G00GW HDSP-C3E1 CD4046BPWR Quantity Price Per Component Total Price 15 $0.75 $11.25 50 $0.05 $2.65 300 $0.05 $13.50 3 $0.38 $1.14 1 $0.16 $0.16 Total: $28.70 Discussion of Possible Failure Modes Failure Identification Mode of Item or No. Function Failure Mode F.1 Pulse Reader Failure to detect light F.2 Failure to emit light Signal Processing F.3 System Failure to filter signal F.4 F.5 F.6 Failure to amplify signal Analog Output System Failure to buzz Failure to display output LED Failure Effects (a. local; b. system; c mission) b. pulse not read c. failed mission b. pulse not read c. failed mission b. signal not usable c. failed mission b. signal not usable c. failed mission b. no user communication c. failed mission b. no user communication c. failed mission 4/25/11 17 Team Silver F.7 F.8 F.9 Power System Digital Output System Failure to provide adequate power or provides too much power b. system cannot turn on c. failed mission Failure to convert from analog to digital signal Failure to accurately display pulse count b. signal not usable by digital system c. failed mission b. no accurate information conveyed to user c. failed mission Discussion of the Methods Used to Verify and Validate the Design After constructing each of our subsystems, we used the criteria described below to verify that the designs were good enough to be used for the final product and no further changes were necessary. Clip Criteria: The clip had to hold the finger firmly but without discomfort, so that it could accurately detect heartbeat of the user. Also, the clip had to be designed in a way to efficiently shut out ambient light so that the photodiode did not produce any significant electric signal in the absence of finger. Test/Result: The clip was tested with each member’s index finger, and for every finger, sufficiently fulfilled all criteria. Filter/Amplifier Criteria: Filter/Amplifer subsystem had to filter out all noise in the electric signal it received from the clip and amplify it large enough to be converted to digital signal. Also, the electric signal at the end of filter/amplifier subsystem had to have a wave form that corresponds to the actual heartbeat without any undesirable peaks or troughs. Test/Result: The wave form produced by filter/amplifier as shown below sufficiently fulfilled all criteria. A/D Converter Criteria: A/D converter had to convert the analog signal to digital signal. It had to detect heartbeats of the analog signal without over counting or failing to count one, and convert them into a noise-less square wave of consistent and appropriate amplitudes. Test/Result: The wave form produced by A/D converter as shown below sufficiently fulfilled all criteria. 4/25/11 18 Team Silver Buzzer/LED Criteria: Buzzer/LED subsystem had to provide sound and light synchronous to the heartbeat. The loudness and tone of the sound and brightness of the light had to be easily detectable and yet cause no discomfort to the user. Test/Result: The sound and light produced by the subsystem was approved by all members and TAs, and thus sufficiently fulfilled all criteria. Digital Readout Criteria: The digital readout had to quickly and accurately calculate the heartbeat rate in units of beats per minute. It also had to have the ability to ignore sudden drop or increase in the heart rate that are caused by malfunctioning of other subsystems. Test/Result: Several LVM files containing different data was used to test the simulation of the digital readout. The result sufficiently fulfilled all criteria. Conclusion The completed plethysmograph functioned well without any noticeable problems. It was able to consistently detect heartbeats, make appropriate displays, and accurately calculate the beating rate. The plethysmograph could tolerate some movements of the finger, so that the user had a certain degree of freedom to move while his finger was put inside the clip. Such achievement can be accredited to not only the clip structure, but also the noise-reducing quality of filter, amplifier and A/D converter subsystems. The buzzer and LED functioned synchronously and consistently, at amplitudes big enough to distinguish yet not too big to create any significant discomfort. The digital readout could quickly compute the heartbeat rate in beats per minute, only after 3.75 seconds after the user’s finger is inserted inside the clip. It could also detect any abrupt changes in the heartbeat rate and ignore them for the calculation of beats per minute. The analog wave form of the heartbeat was shown above in the validation section. The wave form accurately represents the heartbeat, with large peaks representing the ventricular systole and small peaks representing the atrial systole phase. This is the real time wave form of the electric signal after it passed through a series of filter and amplifier, and before it passes through another amplifier and A/D converter. The digital wave form of the heart beat is shown in the above section as well. This is the real time wave form of the electrical signal after it passed the A/D converter. The digital signal ranges from about -1 to 10. Because the off state of the digital signal is below zero, buzzer/LED subsystem could be built without incorporating a switch that blocks out all electric signals in the off state of the digital signal. The plethysmograph was tested for fingers of different skin color and thickness. For some fingers, the threshold values of the A/D converter had to be adjusted. This was done by changing the 4/25/11 19 Team Silver value of resistance of the potentiometer. For most fingers, however, the plethysmograph worked well without the need of changing threshold levels. There are several ways to improve our plethysmograph in the future. First is to make the plethysmograph portable. This would require reducing the overall size of the circuit, by manufacturing the circuit on the printed circuit board and minimizing the use of large capacitors. The plethysmograph would also have to be able to operate on batteries. This is a difficult challenge because of power consumption problems. Second is to make the plethysmograph more stable. Although the current plethysmograph can tolerate small movements of the finger, the tolerance level needs to be improved a lot if the device is to be used for a wider range of applications, such as reading the heartbeat when the user is exercising. Third is to find a better tool to replace digital readout. The current digital readout has two limitations; it cannot compute heartbeat in real time, and it is extremely slow. Finding a faster software that can directly transfer data with the analog part of the circuit, or building a microcontroller on PCB would solve these problems. Finally, more functions could be added to the plethysmograph. These include volume control, brightness control, the ability to alert the user in case of aberrant heartbeat, etc. Improving our plethysmograph in such ways would bring our device one step closer to becoming competent in the real world market. 4/25/11 20