PROBLEM TO CONVERT ECG READING FROM voltage to bpm

Hello, Im having problem to convert the data obtained from electrocardiogram(ecg) from voltage form to breath perminute(bpm).. how to solve this problem? I've got the reference about the result from heart rate which using electrocardiogram is in bpm (beat perminute) form. But in the coding provided is appeared in voltage form.. This is the image Imgur: The magic of the Internet ... Is it I have to create a new function for the bpm calculation?? If yes, please guide me about the coding.. Thank you so much..

You have to detect slopes or min/max values of the signal, and measure the time between their occurrences. Your code should exclude signal distortions, where relative minima/maxima should be filtered out, so that only absolute minima/maxima are taken into account. Another algorithm is FFT, useful with a mix of frequencies; then you should know the expected (lowest) frequency, in order to separate it from other frequencies.

sparkfun

you will need to detect the trigger point to find the start of the diagram, i would trigger on 90% of maximum reading.
the wait until next trigger and calcualte the time used to get there.

Any coding that having similar studies like this? Actually I dont understand how to calculate the min or max value.. If there have some example with code might be good.. In order to calculate the min/max value, is it used the original coding as attach below? The code will display in the voltage form.. I need the result in bpm.. Is there any formula?

#include <eHealth.h>

// The setup routine runs once when you press reset:
void setup() {
  Serial.begin(115200);  
}

// The loop routine runs over and over again forever:
void loop() {

  float ECG = eHealth.getECG();

  Serial.print("ECG value :  ");
  Serial.print(ECG, 2); 
  Serial.print(" V"); 
  Serial.println(""); 

  delay(1);	// wait for a millisecond

the sensor measures the voltage, almost same as from the walletsocket. to get the frequency you will need more moments to measure and make a diagram of the measurements, then with MIN and MAX you can find a trigger signal.
and yes it does exist, check the link above.

Hello, Im having problem to convert the data obtained from electrocardiogram(ecg) from voltage form to breath perminute(bpm).. how to solve this problem?

If the voltage varies with each breath in a cyclic pattern, then set a low voltage trigger point to count a breath and set a flag. Select a higher voltage trigger point to reset the flag allowing for the next low voltage breath count.

Please clarify: do you mean (heart) beats per minute, or breath per minute?
I doubt that ECG signals can be used for figuring out a breath rate.