If you look at the 2.txt data you will see that there is a DC offset across your data of around 0,12. When you subtract the DC offset from the data, you get a good looking plot. There is a function called 'AC&DC Estimator' that will give you the number to subtract from your data. Add this to your program before you take the integral. Also, it wouldn't hurt to apply a lowpass filter as with your ECG data, you seem to have 50/60 Hz riding on your signal.
As for getting your data, you really need to start from a known state. If I were you, I would have your subject take as big a deep breath as he can and hold it until you start the acquisition and then exhale as much as he/she can. Have the subject repeat two or three more times (in the same acquisition) and then breathe in whatever way you want. The first few will give you a max/min reference for (assuming the exhale is the minimum volume or zero reference point) the rest of your analysis.
Randall Pursley