LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic HR Monitor LABVIEW/LINX

Solved!
Go to solution

Hi im a student currently creating a basic heartrate monitor using a sensor wired to an arduino and linx in labview. Essentially everytime the voltage goes over a certain threshold i want to time the amount of time till it goes over the next threshold. I have tried using a case statement pushing into an array but am not very proficient in labview and am struggling to do so.

 

Any ideas on how i can implement this?

0 Kudos
Message 1 of 6
(2,395 Views)
Solution
Accepted by topic author renzsato

This is one way you could achieve this. Let me know if this is what you are after.

 

This calculates the time between threshold crossings when they are received by your serial port. Obviously if there is jitter in your software/serial comms this will introduce errors into your measurement. I realised after I posted this that a better way to do this would be to count the number of samples between crossings, assuming that the sample rate is accurately timed on your Arduino (I have not used the Linx toolkit before so I am not sure how it works) rather than relying on your computers 1kHz clock. It all depends how accurate you want to be.

0 Kudos
Message 2 of 6
(2,376 Views)

Thank you! This has worked perfectly, can i ask the use of the boolean crossing?

0 Kudos
Message 3 of 6
(2,363 Views)

Glad to hear it. I am not sure what you mean by 'can I ask the use of the boolean crossing?'

0 Kudos
Message 4 of 6
(2,360 Views)

As in why you put it there?

0 Kudos
Message 5 of 6
(2,354 Views)

If you read the detailed help for the boolean crossing function (ctrl+H, hover over the function and press detailed help) you will get more of an idea of what is going on.

 

Basically the Boolean crossing will only return true when the input changes from being false to true. This means that the case structure will only run once when the threshold has been exceeded. The voltage then has to drop below your threshold and then rise above it once again before the case structure will run again.

 

With how you had wired it, with the output of the comparison straight into the conditional terminal of the case structure, the true case which is calculating the period of heartbeats would run on every iteration that the voltage is above your threshold. This would result in a load of measurements that are just your sampling period followed by one longer measurement which is the time between the voltage dropping below your threshold and then rising above it.

 

I hope this makes sense

0 Kudos
Message 6 of 6
(2,343 Views)