LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to count pulse by detecting both rising and falling edge

Solved!
Go to solution

I'm having this heart rate monitor by using a pulse sensor HW 827. The problem is I can only detect a pulse when the signal is greater than a set value, because of this it will count multiple pulses if the wait timing is short. My question is how to count 1 pulse: when detecting a point greater than a set value and later lower than that value, the counter will +1. I have an image to demonstrate: the counter will +1 when 2 red points is detected. Thank you!

Download All
0 Kudos
Message 1 of 4
(352 Views)
Solution
Accepted by topic author mnakhoi

I used a flag to switch between rising and falling detection.

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 4
(322 Views)

I forgot to mention, my teacher told me to only use shift register for this pulse detecting so if anyone have a solution using it would be great!

0 Kudos
Message 3 of 4
(294 Views)

Hi mnakhoi,

ZYOng provided you with a solution that you can easily convert in to what you need i.e. using shift registers instead of feedback node. Your homework is for a reason. It is for you to learn and when you learn you become more confident by knowing more.

Try something on your own first and then reply here if you get stuck or if you have specific questions.

Read about:

1) Shift registers

2) Select function

3) Comparison Pallet 

4) Understand LabVIEW data flow

5) Understand how FOR loop works

6) How to index array element, understand how they are auto indexed in a for loop

 

Showcase what you have learned then I can share my version of possible solution with you (Already made the VI for you).

 

You cannot ONLY use shift registers to get the desired result. There will be other elements that will go along with it.

0 Kudos
Message 4 of 4
(281 Views)