This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Single lead ECG ( RA- LL )

Other Parts Discussed in Thread: ADS1291, ADS1298, TINA-TI

Hello 

 I want to design an single lead ECG ( 2 electrodes) no RLD ; 

I think ADS1291 is good solution ; but my problem is how to set the common mode and I can not use RLD ; my sampling rate will be 8khz because I want to detect pacemaker signal too . 

How would lead detect work here and there is no RLD electrode? 

Do you suggest other better solution rather than ads1291 ? 

Could you provide a shematic to  how I set it in single lead ? 

Thank you inadvanced 

  • Hey Hector,

    The easiest way to bias the inputs in a one lead system would just be to place a DC blocking capacitor in series with the input and bias the other end with a simple voltage divider. The blocking cap will reject whatever bias is on the body and the voltage divider will set the common mode to whatever voltage you want. For the most range, set it to mid-supply. Be aware, though, that the cap and divider combination is a high pass filter with cutoff 1/(w(R1||R2)C), so try to set that cutoff low.

    Regards,
    Brian Pisani
  • Thank you Brain ;

    What about lead detect here ; ( no RLD) ;

    in the configuration you suggest we cant use Dc lead detect; if we use AC lead detect I think it will interface pace signal .
    is it a must to use the DC blocker capacitors?
  • Hey Hector,

    If you are only going to use two leads you are going to have to AC couple them. You are right, this will mean you have to use AC lead-off detection. However I'm not convinced that this would prevent you from doing pacemaker detection. You could potentially notch out the lead-off signal using a digital filter before you attempt to detect a pacemaker. To get a good notch, you would see a trade-off between a huge filter in the case of an FIR solution and a long settling time in the case of an IIR filter. I'm not familiar with what resources you will be using to perform the signal processing, but I wouldn't count that possibility out quite yet.

    Regards,
    Brian
  • Hello Brain ;

    To summary what you suggest I draw the shematic please could you comment on it ?  

    and Do you think I need pullup on the IN1P and pull down on IN1N ?

    What is the kind of the Dc blocker capacitor) ceremic ones ?    what about the values  capacitors and resistors ? 

    Thank you inadvanced 

    ads1291.PDF

  • Hey Hector,

    Your schematic looks ok so far, but for further guidance on the inputs, I'd recommend looking at Figure 95 of the ADS1298 datasheet for an example (the ADS1298 is similar to the ADS1291). For the DC clocking caps I see no reason to use electrolytic caps since this is just for signal filtering. For choosing the values, you'll want to decide based on setting a low cutoff frequency since the DC blocks C1 and C2 and the pull-up resistors R5 and R6 form a high pass filter with -3dB point located at f_c = 1/(2piR*C). For your current setup, that would be 0.016 Hz which is pretty good.

    Regards,
    Brian Pisani
  • Again Thank you Brian ;
    I looked to the page figure 95 ; its recommends an antialliasing filter before the DC blocking caps . Right?
    İs there any advantages or disadvantges of using uniplar or bipolar analog supply ?

    Could you share an application note or example code shows how to use the AC lead off detection ?
  • Hey Hector,

    It does recommend putting the anti-aliasing filter before the high-pass filter as convention. It will affect the circuit behavior minimally (you may simulate this to be certain).

    There is no performance advantage between unipolar and bipolar analog power supply; the advantage would only be one of convenience.

    Unfortunately we do not have an algorithm built up, but I can explain the core functions relatively briefly. This assumes that the register settings are correctly configured for AC lead off detection. You'd begin by collecting the data as you might normally do so via the SPI. Once a sample has been collected, you can pass it through separate "channels" with different functions. One might be QRS peak detection, another may be pacemaker detection, and another might be lead-off detection.

    The lead-off detection "channel" in your code (HDL if you are using an FPGA) would band-pass filter data points in real time with the proper band containing f_dr/4. In your case, that frequency would be 8000/4 = 2000 Hz. The result would a sine wave with some magnitude which can be approximated as the magnitude of I_leadoff specified in the register settings of the ADS1291 multiplied by the impedance in the path from the positive input to the negative input.

    You can see that a high impedance indicates poor electrode to body contact. The threshold for what impedance constitutes a "lead-off" condition would be determined by you through testing. Does this method make sense?

    Regards,
    Brian Pisani
  • Hi Brain ; 

    We discussed this with my team ; we already have a design based on ADS1291 ; so the aim now is to  use the blocking DC capacitor ; but that would create an headache  to detect pace signal since pace signal and AC lead signal will interface . And also we need to add a huge FIR filter ; we decide to add an external lead detect circuit with  comparator; 

    Do you think my shematic now is ok ? thank you Brain 2350.ads1291.PDF

  • Hey Team Hector,

    I do not believe that lead-off detection circuit will work as intended. The body's DC bias is not actively regulated and as a consequence, R41 will pull that bias to somewhere in the neighborhood of 3.3V. This will lead to your comparator constantly detecting the lead-off condition even when that condition is not present. This type of DC lead off detection can only be performed when there is a RL electrode who is actively regulating the DC bias of the body.

    Have you considered using an IIR filter to notch out the lead-off signal? One negative consequence of this might be that your pacemaker signal will not settle quickly and you will see ripples for some time after the pulse has occurred.

    Regards,
    Brian Pisani
  • Hi Brain ; 

    Sorry I was out the office the last 2 days I could not reply ; thank you for your effort to help us . 

    I modified the drawing ; Do you think we need C26  for DM filter ? What is your comments about our anti alliasing filter and the values ? 

    for RLD we set to VDD/2  ; do we need to  mux IN1P and IN1N to the RLD opamp ? 

    For the lead off detect ; 

    We will sample at 8khz ;  then  LPF at cut off 1800 hz and then pacemaker detect algorithm ;  ( FIR ) 

    a HPF  or BAND PASS FILTER ( 1800-2200) ( FIR or IIR  )  for AC lead detect. 

    7181.ads1291.PDF

  • I forget to say we left unused pin floating ; to mimimize the pcb ; any problem ?
  • Hey Hector,

    The quantity of resistance or the anti-aliasing filter is much too great. You will definitely cut off most signals in your desired passband. Remember that f_c = 1/(2pi*RC).

    C26 will be helpful to include since it will help to reduce poor common mode rejection produced by passive component mismatch.

    No need to mux the RLD amplifier into the input; that is only if you want to measure it.

    You will need to connect all of the power supply pins and VCAP pins according to the datasheet. They cannot be left floating. The datasheet will have the definitive guide to all the necessary electrical connections you will need to make.

    Regards,
    Brian Pisani
  • Hello Brian ;

    The cutoff now is about 5Khz ; I will change it to about 15khz .

    I mean RLD1P and RLD1N should I close them ?
    if you notice I used RLD as buffer there is no feedback resistor and capacitor.

    I mean the unused pins GPIOs ; the second channel inputs . and PGA2N PGA2P ; I left them floating .
  • Hey Hector,

    According to my simulation, you'd actually see a cutoff frequency at around 232 Hz with the configuration in your schematic:

    In regards to your question about RLD1P and RLD1N, clear those bits. You want the RLD amplifier to be a unity gain amplifier for the mid-supply voltage.

    You should be fine floating those pins.

    Regards,

    Brian Pisani

  • Sorry my image did not attach properly. It is attached to this post.

  • Hello Brain ;
    Thank you for your effort ; but I still could not understand why the simulation give a cutoff freq of 232 .

    for low pass filter R=10k+22k=32K ; C=1nF then cutoff freq=1/2*pi*32k*1nF=4973Hz
    for the high pass filer R=10M C= 1uf then cuttoff Freq = 0.016Hz

    Did I miss something in my calculation ?
    Thank you
  • Hey Hector,

    You have the capacitor C26 placed between the inputs as well which serves as another AC short.

    Brian Pisani
  • Yes Brain you are right I forget this capacitor ; because we think not to mount it if we mount it ; the capacitor will be 1nF and the others ( 100pF)
    Thank you alot ; I am preparing a prototype I will tell you the result .
  • Hello ; 

    I am back after I get the prototype PCB on my office ; 

    We could not make the circuit works ; 

    we can see in the scope the 2khz AC lead signal but it is very difficult to analysis it in the digital world; 

    we tried to send 6nA and 6microA ; but  it seems it s very noisy ; 

    what we did is the bandpass filter about 2khz  ; and we calculate the  power of 8 samples ( at 8khz )  

    in open circuit the power should be he highest ; in short circuit the power is the lowest  ; some times it works. 

    when we attach it to human body it not stable . 

    our VADD is 4.6V   RLDout is 2.3V;

    internal gain PGA : 6 

    internal REF : 4.033V 

    the shematic of the prototype is here 

    5001.ads1291.pdf

    5001.ads1291.pdf

    Please could you guide us to find the problem and solve ; we already tried everything 

    Thank you in advanced 

    Regards 

  • Hey Hector,

    Do you have data that I can look at? The best that I can do is simulate to see what output you should expect in different scenarios. There does not seem to be anything wrong with your schematic that I can immediately see.

    Regards,
    Brian Pisani
  • Hi Brain

    i will post some graphics when i go ofice. I think we have problem in the algorithm of analysis the signal. we are calculating the power of the signal only. Do you suggest a diffirent algorithm?

    Thank you

  • Hello Hector,

    I can really only give advice if I were to get some example data and your filter coefficients. Then I could see exactly what is going on. Can you provide those?

    Brian Pisani
  • Hello

    I am sorry for the delay ;

    I post some FFT result of the signal ;

    We collect 512 data at 8000 and we perform a 256 FFT ; and we connect the electrodes to human body; open and short and with one electrodes.

    As we noticed  if the electrodes are open a good 2khz signal is reflected ; same for short electrodes with less magnitude;  but for real human body other frequencies apprears on the FFT ; also with one electrode connected .

    please could you commend of the graphics ; and could you guide us to resolve this

    Thank you in advanced for your effort

    electrodes.pdf

  • Hey Hector,

    I'm not really sure what the graph is showing. What is the y-axis unit? Where is DC? If it's possible you can just send me the time domain data and I can analyze it.

    Regards,

    Brian

  • Hello Brain ; 

    Sorry for the Delay ; I needed time to go to the clinic inorder to connect the device to human . 

    Here are  down I attach many result ; 

    the first case are :  

    we get samples at 8000Hz ; then (101 TAPs) low pass  120Hz FIR  filter then decimante to 250hz ; then again low pass  35Hz   (252TAPs) FIR filter ; then IIR filter to remove DC  with cofficient = 0.95 . . 

    when we get the result from Fluke simulator the result is ok ; but when we connect to Human there is no ECG . 

    the second case for impedance track ( the impedance of the electrodes ) we sample at 8000hz to any filter  I stored 1000 samples and I send put the data of each of : open circuit, shortcircuit , to 50ohm resistance and human body . 

    8000hz_50ohm.xlsx

    8000hz_human_2.xlsx

    8000hz_human_1.xlsx

    8000hz_open.xlsx

    ecg_1.xlsx

    I have other question please could you answer : is it a must to use AC lead detection method incase no RLD electrode ? even in battery powered application ? 

    Thank you in advanced 

    human_1.xlsx

    noise_5mv_ECG_50hz.xlsx

  • Hey Hector,

    I'm still a little unclear about what all this data is showing. It looks like you are showing data after you run it through your filters. I could only identify ECG in a couple of them. You mentioned that in the case where you connect the system to a live patient that you are unable to see ECG when doing lead-off detection. Are you able to see ECG when you're not doing lead-off detection? Ideally to detect the electrode impedance you'd want to filter out the relatively low frequency ECG content.

    To answer your second question, yes you'd have to use AC lead-off detection if you are not using an RLD because you will likely have AC coupled the inputs which will prevent DC current from flowing.
  • Thank you Brain for your effort ;

    I will test that in the clinic and  inform you about disable lead detect signal and measure ECG.

    for impedance tracking you main I should use an HPF about 2Khz ; and track the power or the FFT ? Do you suggest any thing about the filter for example IIR with how many db ?

    Thanks

  • Hey Hector,

    It could definitely be done in the time domain. No reason to burn MIPS by converting to frequency domain in real time. For testing and analysis I would definitely take a look at the spectrum to see if the content was visible.

    It would be hard to generalize about the filter. As long as you could get superfluous signal information to a low enough level to clearly see the lead off signal in the case where the electrode is no longer on the body, then that is enough. I don't want to give hard numbers unless I've studied a lot of data and test cases.

    Regards,
    Brian Pisani
  • In the previous posts I have uploaded 8000hz data without any filtering , on human , open electrodes, short electrodes and 50 ohm resistor ; please could check if I am on the right road ?
    Thank you advanced Mr Brain

  • Hector,

    First, is this data in 24-bits? Converting to volts by multiplying by 2.42/(2^23-1) produced magnitudes well in excess of the supply rails. Instead assuming that the codes were 32 bit values the voltages seem more reasonable, but since I don't actually know it's hard for me to make statements about magnitudes.

    I filtered all the data with an IIR filter using Matlab (equation: y[n] - 1.459y[n-1] + 0.0104y[n-2] - 0.1978y[n-3] = 0.4459x[n] - 1.3377x[n-1] + 1.3377x[n-2] - 0.4459x[n-3]). In only the open circuit case could I clearly identify the lead-off signal at 2 kHz. The magnitude was just a few mV whereas I expected it to be a few hundred mV, but again, I'm not sure on magnitudes because I don't know the resolution.

    In some of the human body cases, there is not even an identifiable QRS complex, which suggests that that there is some other issue unrelated to lead-off detection. The lead-off excitation signal is small enough that it should not appear larger than the ECG in the case where the patient is connected properly. Let me know if you are able to obtain a proper QRS in the scenario where the patient is properly connected to the electrodes.

    Regards,
    Brian Pisani
  • Hello Brain ;

    I think the last result is mixed ;

    I will go to the clinic now and after few hours I will send you  a new data :

    open circuit electrodes

    short circuit electrodes

    50 ohm electrodes

    1k ohm electoredes

    and connect to human  data .

    we  use only 20 bits according to data sheet noise free bits are 22bits ; so we read 24 and shift the data  to use only  20 bits .

    #define FULL_SCALE         0xFFFFF // 20 bits fıll scale

    #define  VREF                                          2.42f
    #define LSB_weight                                 VREF/ 524287  
    #define adc_gain    6                                // PGA gain
    #define adc_total_gain                             (float)(1000*LSB_weight/adc_gain) // to get the volt directly


       if ((adc_data& 0x00080000) == 0x00080000)   // check if negative
       {
      
        adc_data_1=FULL_SCALE-adc_data;
        adc_volt_8000=((float)adc_data_1)*adc_total_gain*-1.0f;
        
        }
        else
        {
         
        adc_volt_8000=((float)adc_data)*adc_total_gain;
         }   

    Today I will send better data from the clinic .

    Thank you for support Mr Brain ;

  • Hector,

    This formula will output voltages in millivolts, not volts. I'm still unsure what the data you sent me represents since it looks like there are negative values, but you don't change the sign of the data until you convert it to mV. In addition, the DC is removed because the waveform is centered at 0. What are the exact steps taken from raw binary output from the device to the data that you have given me?

    Brian
  • Hello Brain ;

    I have arrived from the clinic ; I could only connect to 4 people;

    the data is  collected 22 bits as mVolt you are right ; in order to send the data to PC for debug purpose we multibly by 1M ;

    we get data from ADS1291 by this code :

     for(i=0;i<6;i++)
      {
       spi_buffer[i]=readspi_data_adc();
       
       }
       adc_data=0;
       adc_data_1=0;
       adc_data=(signed int)((spi_buffer[3]<<16))|(signed int)((spi_buffer[4]<<8))|(signed int)(spi_buffer[5]);

       adc_data=adc_data>>4;
      
       if ((adc_data& 0x00080000) == 0x00080000)   // check if negative
       {

        adc_data_1=FULL_SCALE-adc_data;
        adc_volt_8000=((float)adc_data_1)*adc_total_gain*-1.0f;
        
        }
        else
        {
         
        adc_volt_8000=((float)adc_data)*adc_total_gain;
         }   
     

    we first check if negative them we change it to mv ;

    For the previous question I forget to answer about QRS  when we connect to fluke we could see the QRS very clear as in the previous attached, but for human body it is very noise

    here the clinical data for today ;

    7080.8000hz_human_1.xlsx

    8156.8000hz_human_2.xlsx

    8000hz_human_3.xlsx

    8000hz_human_4.xlsx

    8000hz_opencircuit_electodes.xlsx

    8000hz_shortcircuit_electrodes.xlsx

    Thanks a lot Brain

  • Hector,

    So this data is 1,000,000 times larger than the output voltage measured in millivolts? That is to say that the data is measured in nanovolts?

    Regards,
    Brian Pisani
  • Mr Brian ;
    Yes before we send to the PC to get ride of the decimal point we multiply by 1000 000 ; this just in debug mode to put the data to excel , in the device we will use mv ; you can divid the data my 1000 000 to get the mv value ;
    about converting the result to negative do you think our code is ok ?
    Thank you again
    Regards
  • Hello Hector,

    I wouldn't necessarily be worried about debugging the ac lead-off detection until you could measure a clean QRS waveform from your system. It's tough to say anything about the status of the leads when you can't get a good measurement when they are fully attached. Once you get that problem resolved then I'd be happy to help you with ac lead-off detection.

    Regards,
    Brian
  • Hi Brain ; 

    Thank you for your support and interest; 

    the problem of not getting the QRS is the electrodes quality ; in few days we will go to teh clinic with better electrodes. 

    However ; today we just wanted to see the power of the signal open short and one electrode conencted the right and the other to the left hand of human ;

    we use order 4  bandpass IIR filter 1950-2050 HZ  . 

    we noticed that we can see good 2000hz signal ; 

    we read 200 samples and calculate the power of the signal ; we noticed that  the power of the open electrodes is higher than the power of short electrodes and that is expected. But with electrodes with right and left hand the power is even less than of short circuit electrodes. 

    It is a little strange for us ; any idea about it ?  because we expect a power somewhere between open electrodes and short electrodes. 

    Thank you inadvanced 

  • Hey Hector,

    What was the measured impedance in each case? This can be found by dividing the peak voltage in the output by the current magnitude set in the LOFF register. Do you know what impedance to expect from this connection? From what I understand electrode impedance can be influenced by a wide range of factors. This functionality was really only to detect if the impedance is very high to indicate that the electrode is no longer in contact with the skin. The accuracy of the current source is not good enough to perform precise impedance measurements

    Regards,
    Brian Pisani
  • Infact in our application we want only 3 level indicator;  not connected electrodes; low contact electrodes and high contact electrodes;

    the measuring of 5 impedances of human all  between 12k ohms to 40k ohms ; 

    with open circuit electrodes it is : 65k ohms

    short circuit: 56k ohms  (  closed to the open circuit ..)any idea?

    one electrode connected to the human and other floating : 180K

      

  • Hey Hector,

    I'm not really sure what to expect with different electrode setups. Can you post the schematic? I could perhaps simulate the setup so I can tell you what to expect.

    Brian
  • Hello Brain ; 

    Here is the shematic ; 

    ECG_P= 4.8V 

    RLOUT= 2.4 V 

    Thank you inadvanced 4064.ads1291.pdf

  • Hey Hector,

    I simulated with a couple of ideal current sources and measured the voltage that would appear at the inputs to the device. I did not simulate the diodes, but I imagine their contribution is only a few pF. When the current sources were set to 6nA and the electrodes were left open, a 13.5mVp waveform appeared at the inputs. When they were shorted (I shorted the wires, not sure how you guys are doing it), it produced a 511uVp waveform.

    I changed the current magnitude to 22uA. If the inputs are left open, the input would read above full scale. When they were shorted, a 1.76Vp input was received.

    I'm not sure how much you can trust this since it may not be an exact model to your setup, but I would expect numbers around this. By the way, I simulated using TINA-TI. It's handy in these sorts of scenarios: http://www.ti.com/tool/tina-ti

    Regards,
    Brian Pisani
  • Hello Brain after few months we are back ;
    First thank you all the time for support ; but we have a general problem with the device ads1291 ; may be from our circuit but we are looking for solution for it and i would be thankful if you could support us .
    we are testing 750 pcb of the ads1291 circuit we posted earlier in this forum with sngle lead and AC lead detection ; we power all of them from battery ; we have fluke 7000Dp simulator ; when we put the charger of the simulator on ; the ECG we read is distroyed ; we checked data at 8000khz before filtering we found high peaks 50hz AC noise; after filtering with 80db FIR 30Hz filter we get the ecg but a little distroyed ;
    when the chatger is of every thing is great .
    Now how can we improve the 50hz AC line performance with single lead readings ; any suggestions , ideas ?
    Thank you in advanced
  • Hey Hector,

    If I remember correctly, you guys are not using the RLD circuit on the ADS1291. This will make it rather difficult to reject 50 Hz interference in the analog domain. Your only real option would be to filter it out digitally, which it looks like you are trying to do. Can you send me your filter coefficients? I can see if you could try to improve on anything there.

    Regards,
    Brian Pisani
  • low_pass.h

    Hi Brain; 

    Here the low pass filter it is 25hz ; 252 order fir ; sampling frequency is 250hz . 

    Do you suggest an analog circuit that improve the single lead reading before ADS1291? 

  • Hello Hector,

    I analyzed your filter and I have a few comments. The filter is good. It will eliminate any 50 Hz signal that comes to the inputs. In fact, the attenuation is so good at 50 Hz (-133 dB), that even a full scale 50 Hz input would be attenuated beneath the noise floor of the ADS1291. This leads me to believe that the interference is either not being caused by 50 Hz noise or that you are collecting data with a data rate besides 250 SPS but passing it through the filter that is used for 250 SPS sampling rate. Can you speak to any of these two theories? If you are still not sure, send me the raw output data from the device and I can pass it through your filter and analyze the results.

    Regards,
    Brian Pisani
  • Hello Brain ; 

    Yes we are sampling at 8Khz  then a nyqest filter of 120hz ; then DECIMATOR by 32 to get 250sps ECG . 

    Thank you again 

  • Hello Hector,

    So do you filter with the 252 order FIR when the sampling frequency is 8 kHz or after it is decimated to 250 Hz?

    Brian
  • Hello Brain ; 

    The 252 order FIR is after decimated ; it is at 250 sps data ;  but before decimated we use 120hz fir at 8khz data .

  • Hey Hector,

    Please send me your data to analyze. Again, I don't think the problem is 50 Hz interference since the filter performance is so good at that frequency.

    Regards,
    Brian Pisani