Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
As you are running out of time I would keep the calls where they are and do as Gobbledok suggested I.E. put the LCD code after zeroing count in INT_COUNTER.
Mike.
I did notice in your earlier code that you aren't setting Heart_Beat back to zero. This should be set to zero after doing the LCD stuff.
Mike.
I did notice in your earlier code that you aren't setting Heart_Beat back to zero. This should be set to zero after doing the LCD stuff.
Mike.
Are you able to measure the output of your optical sensor to make sure it is giving an output? Perhaps replaced the optical sensor with a (debounced) switch and see if it works that way.
Are you able to measure the output of your optical sensor to make sure it is giving an output? Perhaps replaced the optical sensor with a (debounced) switch and see if it works that way.
Are you able to measure the output of your optical sensor to make sure it is giving an output? Perhaps replaced the optical sensor with a (debounced) switch and see if it works that way.
Are you able to measure the output of your optical sensor to make sure it is giving an output? Perhaps replaced the optical sensor with a (debounced) switch and see if it works that way.
Do you know if in the input of the PIC should be 5v in order to recognise a peak?
Regards
kokos
Sorry I'm busy at the moment so haven't had a chance to have a proper look at the diagram but the PIC inputs need about 0.25 x VDD for a TTL input and about 0.8 x VDD for a schmitt trigger input.
It's a pity you can't view the output of your optical sensor with an oscilloscope.
Edit: Just saw your other post. Is that line the output of your last op-amp stage or is that the output from your sensor? Edit again: Scratch that, your current buffer should be fine.
Perhaps you need a comparator after the last stage of your signal buffer to square up the signal? Edit again: Scratch that, your current buffer should be fine.
Hi Gobbledok
I did test my sensor yesterday but it doesnt seem to be a correct output. No the signal that i posted is not from my sensor.i just ask if it should looke like something like that? i ve used a debounced switch connected to the input of the PIC and as many times i press the switch it actually gives the correct output on the LCD. so i think something is wrong with my circuit or sensor. also i think there is a mistake with code because when i turn on the power supply it appears on the LCD for some seconds Heart Rate=896 and then it restarts and gives the correct output after 10 seconds.
do you know why is that? and if you can find some time to check the circuit that i uploaded here for any wrong connections i will really appreciate it.
I am using IR Emitter (LED55C) and a photodiode (BPW41N). do you think is a good choice or i should change them?
Thanks for your help
Regards
kokos
Does the LED on the output of our final op-amp light up when you have the pulse meter on your finger? That'll tell you (sort of) what the PIC is seeing.
Are you able to see at all what the output of your final op amp stage is doing?
I'd try using a simple comparator circuit instead.
Try this circuit and see if it works.
You will probably have to tweak the values of R1 (for the photodiode) and R2 (hysteresis).
VR1 adjusts the point where the comparator goes high.
The checked the output of the final stage with an oscilloscope and is square pulses.what values of R1 and R2 do you recommend for the circuit you just send me? i have 100k, 1M, 2.2M, 10K, and 2.2K and 1K.
I would try R1 as it is at the moment. If the IR sensor isn't sensitive enough (as it appears to U1), raise the value of R1. R2 is for hysteresis and its value depends on R1. As it is at the moment there is a lot of hysteresis and you can probably raise it even up to 10M.
For the resistors you have at the moment, try 100K for R1 and 2M2 for R2.
Edit: you will have to limit the output of the op amp to 5v so you don't damage your PIC. Probably the best way to do this is to use a rail-to-rail op amp and run the whole circuit of regulated 5v.
Hi Gobbledok
Thanks for your help.i will try it and see what i can get
today i bought TSL235R photodiode which it converts the current to frequency and it can be directly connected to PIC. do you think that my code for the PIC will response to the output of TSL235R?
No, your PIC will not respond to the output of the TSL235R unless you rewrite your program or add more hardware.