Hi all,I'm about to measure the heart-rate beats-per minute.I'll be using the technique of passing IR through ring finger and detecting the IR by photo transistor.This Photo transistor output will be amplified and filtered.The output frequency of this signal is around 1.3Hz, an extremely low frequency sinusoid.This signal will be converted into square using a comparator.

Now, how should I do the low frequency processing (amplification and filtering) with PSoC1(29466-24pxi)?Can anybody help me with some application notes? or any other relevant information.

The documents attached shows different techniques in measuring heart-rate.But the one I would like use is based on near infra-red spectroscopy. I attach the relevant paper for Ur reference.Requesting U to pay particular attention to fig.7 & 8. I want to implement this with PSoC1. Any reference would be of great support.

If you look at this circuit its DC G is the product of the first gain stagefollowed by the next, or ~ 121 x 561, ~ 67K, or pretty high. Plus that designhas limited 60 Hz CM rejection, even though both G stages rolled off. Youcould use a simple spice simulation to determine where the response curvebreaks, probably around a few hundred hertz.

You could use external IA to get the CM rejection, and the high G. And/or usea much higher powered IR LED to get more source signal.

The last amp is being used as nothing more that a comparator, PSOC easilyhandles that.

Hi all,I managed to get a pulse and with the comparator am now generating approximate square pulses of frequency approximately 1.4Hz.Now, I want to measure the width with PSoC1.How do I measure this with PSoC1 timer or any other facility available with PSoC1.

1) Using sleep timer, set it to fire at resolution you want for PW measurement.Set a variable, say myPW so that when sleep timer ISR fires it is incrementedby 1. Now poll the comparator output, when it rises set a flag, set myPW = 0. When it falls test if rise flag set, read myPW, thats your PW in sleep timerT increments. Reset flag.

If you do not want to poll you can setup comparator ISR. See following.

2) Use a counter, route comparator output to counter enable. Set counter periodto its full scale value, eg. 255 for 8 bit, 65535 for 16 bit. When comparator out ishigh, either by ISR or polling, start the counter, when low stop counter, read it,subtract that from full scale value, that is your PW in terms of its clock periodincrements you choose when you set it up.

HiI followed the second method.The logic I followed is as follows:P0[0] is connected to the comparator (external comparator)..I'm reading the value of this port pin and test it for high.if the pin is enabled counter is started.If not the counter will be stopped.But am getting few errors of the project.

I've attached the Archive of the project...My humble request isKindly go through the entire project from settings to code and suggest me for corrections..(My frequency of the input signal is <10 Hz approx. 1.3 Hz)

Note: I should complete my work in a day time for my M.tech thesis and help accordingly will be of great help. I should not mention this.But, its situation.Sorry, if am mistaken..

Some more bugs: What is, when your program main() has finished the last statement? main() exits and this would be a reboot.you need an initialization part and a loop that executes forever (or as long as the PSoC is powered). Since the PSoC is very fast you should think about to wait for having a result ready and then display it.

To the displaying: You position to Line 0, column 5 and write some text "BPM Count:0" you should write "BPM Count:" to position 0,0 and then within the Loop position to line 0 column 10 and print your value which should be a 16 bit unsigned integer (which is a word)I did not look at your settings yet.

Now I included the two headers #include "stdlib.h" & #include"string.h" and now the warning gets cleared and getting only the second point as errorc(29):type error in argument 1 to 'LCD_PrString':found 'pointer to __flash char' expected 'pointer to char'.

No Dana,its not working the way it is expected...In the last archive attachment the only change I've done was I replaced LCD_PrCString(" "); and errors got cleared..

Now the problem seems to be different..When I place my finger I get the pulse of less than 10Hz(attached the screenshot)...Now the counter starts and counts untilsome value say 105...then after a short while again counts to some value say 400 or so..this cycle continues forever...

Am stuck at this point...trying to troubleshoot it the whole day with failure..

I attach the archive of the current project..Kindly go through it...

Not yet done the subtraction of counter value from 65535..before that I faced with this problem..(attaching the CRO screenshot in the next post)

1) Start counter with API, then its enable with a high from a pin or from comparator starts it counting2) Counter starts counting down from 655353) When enable pin or comparator goes low (by polling or an interrupt on comparator out going low) a. Stop counter with API (its already stopped because of enable going low, but you have to do this to insure all logic is stopped) b. Read counter with API c. Subtract value in b. from 65535, thats the number of counter clks in time pulse was high d. Reload counter with 65535 c. Restart counter with API

Your clock to counter is CPUclk/2 / VC1 / VC2 / VC3 = 12 Mhz / 16 / 16 / 256 =~ 183 hz =$ 5.5 mS.That is the time value associated with each count of the counter, is that the T resolution incrementyou want ? If not change the VC1/ VC2 / VC3 divide chain to get the time increment you need.

I do not see any of this code or the comparator or any analog in design ?