# heart rate circuit...

Thread Starter

#### Mil Nik

Joined Nov 26, 2016
12
hello..
i trying to get pulse from CNY70 or any other sensor like this for heart rate....I added LCD with atmega32 to show heart rate but result was nothing without any heart rate or maybe on LCD....my circuit is here..
what is the problem and what i must to do ?
this my program its simple for now:

C:
#include<mega32.h>
#include<delay.h>
#include<lcd.h>
#include<stdio.h>
#include<stdlib.h>
#asm
.equ __lcd_port=0x1b
#endasm

int x;
char s[5];

void main(void)
{
DDRB=0x00;
lcd_init(16);
lcd_clear();
TCCR0=0x06;
while(1)
{
x=TCNT0;
itoa(x,s);
lcd_clear();
lcd_puts(s);
delay_ms(30);
}
Mod note: Applied CODE-tags.

#### Attachments

• 214.2 KB Views: 36
Last edited by a moderator:

#### AlbertHall

Joined Jun 4, 2014
10,579
R5 and C2 form a low pass filter with a cut-off frequency of 0.16Hz so most of the pulse signal is filtered out here. You need to allow signals up to perhaps 200Hz, so replace the 10uF with 8.2nF - 10nF would give you a cut-off of 160Hz.

Thread Starter

#### Mil Nik

Joined Nov 26, 2016
12
R5 and C2 form a low pass filter with a cut-off frequency of 0.16Hz so most of the pulse signal is filtered out here. You need to allow signals up to perhaps 200Hz, so replace the 10uF with 8.2nF - 10nF would give you a cut-off of 160Hz.
Now i could see pulse but i have new problem ...it work on my finger move not my heart beat what can i do now ? could be from sensitivity of sensor ??

#### AlbertHall

Joined Jun 4, 2014
10,579
Now i could see pulse but i have new problem ...it work on my finger move not my heart beat
I don't understand. You can see the pulse but not the heart beat - aren't they the same thing?
There is another problem with your diagram. Q1 has no power supply. R8 should connect to +5V not ground.

Thread Starter

#### Mil Nik

Joined Nov 26, 2016
12
I don't understand. You can see the pulse but not the heart beat - aren't they the same thing?
There is another problem with your diagram. Q1 has no power supply. R8 should connect to +5V not ground.
u right Q1 need power supply its just simulation mistake....
i've made this circuit .if put my finger on sensor their is no pulse(no heart rate) but if i move my finger on.. its start pulsing for every move..I want to put my finger on the sensor then it began to count my heartbeat ....The problem is that the heart beat does not count unless I shake my finger ..get it ?

#### AlbertHall

Joined Jun 4, 2014
10,579
R5 and C2 form a low pass filter with a cut-off frequency of 0.16Hz so most of the pulse signal is filtered out here. You need to allow signals up to perhaps 200Hz, so replace the 10uF with 8.2nF - 10nF would give you a cut-off of 160Hz.
This is wrong!
A pulse of, say, 60 is 60 beats per MINUTE, 1 beat per second, not 60 beats per second. So to allow for a pulse up to 200 bpm you need to allow signals up to 200/60 = 3Hz, so the capacitor should be about 0.5uF

Thread Starter

#### Mil Nik

Joined Nov 26, 2016
12
This is wrong!
A pulse of, say, 60 is 60 beats per MINUTE, 1 beat per second, not 60 beats per second. So to allow for a pulse up to 200 bpm you need to allow signals up to 200/60 = 3Hz, so the capacitor should be about 0.5uF
i find the problem...resistors of photodiod and Q1 are the problems.Resistors of photodiod need be set correctly to receive better because this sensor is so sensitive to every noise like lcd ,battery,op-amp near sensor or like this.
resistor of IRdiod must be set 120-220 but about photodiod's resistor after Setting up IRdiod i use ohmmeter to know photodiod Resistance it was 80k so i used 33k ,a smaller amount than half to connected photodiod to vcc.photodiods Resistance are different u must setting up irdiod first then measurement the Resistance...heart rate is like this picture so resistors of Q1 must set correcly why ? because the problem is Q1 gonna show pulse for every peak so we see so many heart rate in lcd like mine about 330 pulse so we need to set resistors correcly to get pulse just for highest peak in each periodicity but if we dont want details of heart rate we can use op-amp like picture to filter low peaks....maybe this will help someone and sry for my bad drawing

#### Attachments

• 104.9 KB Views: 17
• 131.5 KB Views: 18
Similar threads