Post Go back to editing

problems of AD5933 measure impedance

Hello, I would like to ask whether the solution of cn0349 can be replaced by AD5933 chip. When we replaced the chip, we found that there was a deviation between the calibration results of AD5933 and ad5934, which led to inaccurate measurement of unknown impedance. At the same time, when comparing the ad5933evaluation board, it is found that the resistance of the four bias resistors at the same direction end of the operational amplifier is 49.9k and the capacitance at the output port of AD5933 is 47nF. There is a difference between the circuit here and the cn0349 solution. What is the reason for the difference between the bias resistance and capacitance here.

  • Let's see if somebody from ADI can comment.

    In the meantime, the AD5933 should be a drop-in replacement for this particular circuit if you adjust frequency code calculations in your software. If software is the same your output frequency and frequency steps with the AD5933 are 4 times higher than with the AD5934. Please compare the formulas in the datasheets for the AD5933page 14 and AD5934, page 13, beginning with formula 1. Perhaps you can trick your software by specifying the required frequency and frequency steps 4 times lower than with the AD5934. Can you check the output frequency with an oscilloscope or a frequency counter?

    The bias resistors and the DC-blocking capacitor (R1, R5 and C1 in CN-0349 circuit) act as a high-pass filter with a cut-off frequency of  1 / (2 * π * (R1 || R5) * C1) ≈ 68 Hz. Same thing happens with the circuit on the evaluation board, except the cut-off frequency is 2 times higher. As long as your excitation frequency is noticeably above this cut-off frequency, the exact values of the blocking capacitor and the bias resistors should not matter much for your measurements.

    How large is the discrepancy that you are seeing? Within what frequency range, at what excitation voltage and PGA gain?

  • Firstly, this is our actual experimental situation. In the case of the same circuit (cn0349), the measured value can be accurately obtained when using ad5934 to measure the external impedance, but the measured value deviates after using AD5933 (there is a big gap with the actual value), When using AD5933, we modified the output frequency to a fixed value of 100Hz (the oscilloscope has seen that the output frequency value is normal). For the calculation of gain coefficient, system offset and unknown impedance, the formula given in cn0349 solution is used. However, during commissioning, it is found that when AD5933 is used to measure the system offset of different gears, the measurement result is significantly higher than ad5934. Secondly, for the circuit of cn0349, we only divide the range into two higher gears 20K ~ 20 0k, 200K ~ 500K, other parts have not been modified.

  • It appears that you are performing your measurements at 100 Hz. Both AD5933 and AD5934, while can synthesize low frequencies, generally speaking, cannot measure at the frequencies lower than 10 KHz due to systematic errors introduced by the "DFT" version implemented in those chips. The formulas from cn0349 are not working at low frequencies. The easiest way to make those chips operate at frequencies this low is to reduce the chip's clock frequency (MCLK). 

    One suggestion would be to check if the chips perform as expected at higher frequency, say 10 KHz.

  • First of all, thank you for your suggestion. Unfortunately, I modulated the starting frequency to 10kHz, and the measurement results are not correct. At the same time, I also compared that the system error values under different frequencies are very close. At the same time, I also did the same operation for ad5934. The change of frequency does not affect the accuracy of measuring unknown impedance. Another question is about the difference between the real part and imaginary part values returned by AD5933 and 5934. What is the reason?

  • If you see much difference at 10 KHz, something is not right and debugging it remotely might be difficult. We can still try, but you would need to post more specifics about your system and measurements you perform.

    What software are you using in your measurements? Is it CN0349 evaluation software from the disc that came with the board or something else?

    Can you connect test resistor between pins 4 and 5 of the connector J1 instead of the measurement cell? 

  • OK, can you provide email? I can send test code, schematic diagram, measured data and specific description of the problem by email

  • The whole idea of this forum is to publicly discuss the problems and solutions, so that all participants can hopefully learn from each other and from reading earlier discussions on the subject of interest. Email is for private consultations - not something that forum participants can possibly benefit from, so no email.

    You can easily ZIP all the files you would like to share and insert in the message by going Insert->Image/Video//File. Image files, PDFs and TXTs can be inserted directly.

  • DOCX

    	short int status_register;   //
    	unsigned char binary[16];    //  
     int main(void)
    	 uint8_t switch1;
    	 uint8_t switch2;
        MyCN0349.configureAD5934(030,2000, 200, 10);//( Uint_8 settlingTimes, float startFreq, float freqIncr, uint8_t numIncr)
     	//  calibrateCN0349(&GF_low,&NOS_low,&GF_high,&NOS_high,&GF_Middle,&NOS_Middle);
    	 // place the AD5933 in standby mode
    	 AD5934byteWrite( 0x80, 0xB0);
       // Choose the internal system clock
       AD5934byteWrite( 0x81, 0x00);
       // Choose range 1 (2vp-p, 1.6v) PGA = x1	 
       AD5934byteWrite( 0x80, 0x01);
       // initialise the sensor with contents of start frequency regsister with range 1 (2vp-p, 1.6v) PGA = x1
       AD5934byteWrite ( 0x80, 0x10);
       // start of frequency sweep  (2vp-p, 1.6v) PGA = x1
       AD5934byteWrite( 0x80, 0x20);
       ADG715reset();            //clear out switches
       ADG715writeChannel(8, 1); //turn on switchs
       ADG715writeChannel(2, 1);
     void convert (short bin, unsigned char *str) // converts from 2s complement to hex.
       unsigned short mask;      // used to check each individual bit, unsigned
                                 //    to alleviate sign extension problems
       mask = 0x8000;           // Set only the high-end bit
       while(mask)             // Loop until MASK is empty
          if(bin & mask)     // test the masked bit
             *str = '1';   // if true, value is 1
             *str = '0';   // if false, value is 0
          str++;              // next character
          mask >>= 1;         // shift the mask 1 bit
       *str = 0;               // add the trailing null
    	void sweep1 (void)
       unsigned int real_byte_high;
       unsigned int real_byte_low;
       unsigned int imag_byte_high;
       unsigned int imag_byte_low;
       signed short int imag_data;
       signed short int real_data;
    	 double magnitude;
       //write(output3,25); // output "start sweep" to uart
       printf ("Start of Frequency sweep\n");       // printf function call   
       // status reg D0 = valid temp, D1 = valid real/imag data, D2 = frequency sweep complete
          // D1 status reg loop
          status_register = AD5934byteRead(0x8F);     // read the status register
          status_register = (status_register & 0x2); // mask off the valid data bit
          if( ((status_register)| 0xFD )==  0xFF)  // valid data should be present after start freqy command
             // D1 true condition
             //printf ("Status register is %u (dec) \n",status_register);       // printf function call
             if( (AD5934byteRead(0x8F)| 0xFB )!=  0xFF)// D2 test condition
                real_byte_high = AD5934byteRead(0x94);
                real_byte_low = AD5934byteRead(0x95);
                imag_byte_high = AD5934byteRead(0x96);
                imag_byte_low =  AD5934byteRead(0x97);
                real_data = ((real_byte_high << 8) |  real_byte_low);
                imag_data = ((imag_byte_high << 8) |  imag_byte_low);
    						magnitude = sqrt(pow((real_data), 2) + pow((imag_data), 2));
                // real data
                printf ("magnitude = %f\n",magnitude);       // printf function call
                //printf ("processed Real register = %s (binary equivilant of above)\n",binary);
                // printf ("\n%s ",binary);
    			//printf ("processed real register = %d(decimal equivilant)\n",(int)real_data);
                //printf ("\n");
                printf ("original  imag register = 0x%x\n",(unsigned int)((unsigned short)imag_data));       // printf function call
                //printf ("processed imag register = %s (binary equivilant of above)\n",binary);
    			//printf ("\n%s",binary);
                //printf ("processed imag register = %d(decimal equivilant)\n%d\r",(int)imag_data);
                //printf ("\n");
                // increment to the next frequency
                AD5934byteWrite ( 0x80, 0x30);
                } // end of D2 test condition
             else // End of frequency sweep exit loop
                //printf ("Status register is %u (dec) \n",status_register);
             } // end of D1 true condition
          } // end of for loop
       }// end of sweep f
       void configureAD5934(uint8_t settlingTimes, float startFreq, float freqIncr, uint8_t numIncr) {
            //setControlRegister2(); //set PGA=1,set exciting voltage=2.00v;
    uint8_t frequencyCode(float freqInHz, uint8_t byteNum) {
        long value = (long)((freqInHz / (CLOCK_SPEED / 4)) * pow(2, 27));//王改
        uint8_t code[3];
        code[0] = (value & 0xFF0000) >> 0x10;
        code[1] = (value & 0x00FF00) >> 0x08;
        code[2] = (value & 0x0000FF);
        return code[byteNum];
    bool setStartFrequency(float freqInHz) {
        bool statusValue;
        uint8_t n;
        for (n = 0; n < 3; n++) {
            statusValue = AD5934byteWrite(START_FREQUENCY_REGISTER[n], frequencyCode(freqInHz, n));
        return statusValue;
    bool setFrequencyIncrement(float freqInHz) {
        bool statusValue;
        uint8_t n;
        for (n = 0; n < 3; n++) {
            statusValue = AD5934byteWrite(FREQ_INCREMENT_REGISTER[n], frequencyCode(freqInHz, n));
        return statusValue;
    bool setNumberOfIncrements(uint16_t n) {
        bool i2cStatus;
        uint16_t numIncrements = (n) < (511) ? (n) : (511);
        i2cStatus = AD5934byteWrite(NUM_INCREMENTS_REGISTER[0], numIncrements >> 8);
        i2cStatus = AD5934byteWrite(NUM_INCREMENTS_REGISTER[1], numIncrements & 255);
        return i2cStatus;

    Start of Frequency sweep   frequence = 1K
    magnitude = 20525.126285original  imag register = 0xafd3
    magnitude = 20832.608910original  imag register = 0xaea7
    magnitude = 21292.619754original  imag register = 0xacd6
    magnitude = 21295.330004original  imag register = 0xacd2
    magnitude = 20858.573873original  imag register = 0xae8e
    magnitude = 20532.909804original  imag register = 0xafd0
    magnitude = 20570.411979original  imag register = 0xafa8
    magnitude = 20716.077452original  imag register = 0xaf18
    magnitude = 20756.702652original  imag register = 0xaef4
    magnitude = 20643.930488original  imag register = 0xaf6b
    Start of Frequency sweep  frequence  =  2K
    magnitude = 20509.220024original  imag register = 0xafe3
    magnitude = 20816.161918original  imag register = 0xaeb7
    magnitude = 21277.466978original  imag register = 0xace5
    magnitude = 21278.353531original  imag register = 0xace3
    magnitude = 20845.926916original  imag register = 0xae9b
    magnitude = 20515.826720original  imag register = 0xafe1
    magnitude = 20555.116979original  imag register = 0xafb7
    magnitude = 20696.218833original  imag register = 0xaf2b
    magnitude = 20741.534104original  imag register = 0xaf02
    magnitude = 20629.492771original  imag register = 0xaf78
    Start of Frequency sweep  frequence = 4K
    magnitude = 20454.295784original  imag register = 0xb01a
    magnitude = 20759.463697original  imag register = 0xaeef
    magnitude = 21219.092653original  imag register = 0xad1f
    magnitude = 21225.794496original  imag register = 0xad18
    magnitude = 20785.671315original  imag register = 0xaed8
    magnitude = 20458.330773original  imag register = 0xb01b
    magnitude = 20496.482552original  imag register = 0xaff2
    magnitude = 20633.723949original  imag register = 0xaf6a
    magnitude = 20683.800424original  imag register = 0xaf3c
    magnitude = 20570.676921original  imag register = 0xafb3
    Start of Frequency sweep  frequence =6k
    magnitude = 20361.255487original  imag register = 0xb077
    magnitude = 20665.823042original  imag register = 0xaf4d
    magnitude = 21128.187144original  imag register = 0xad7a
    magnitude = 21131.624263original  imag register = 0xad76
    magnitude = 20694.470300original  imag register = 0xaf33
    magnitude = 20366.286284original  imag register = 0xb077
    magnitude = 20405.431483original  imag register = 0xb04d
    magnitude = 20550.854313original  imag register = 0xafbd
    magnitude = 20589.863647original  imag register = 0xaf9a
    magnitude = 20475.412694original  imag register = 0xb012
    Start of Frequency sweep frequence =8K
    magnitude = 20230.262208original  imag register = 0xb0fa
    magnitude = 20539.634198original  imag register = 0xafcb
    magnitude = 20998.044314original  imag register = 0xadfc
    magnitude = 21003.813463original  imag register = 0xadf6
    magnitude = 20569.989815original  imag register = 0xafb0
    magnitude = 20234.552553original  imag register = 0xb0fb
    magnitude = 20276.767519original  imag register = 0xb0ce
    magnitude = 20419.056638original  imag register = 0xb041
    magnitude = 20461.594708original  imag register = 0xb01b
    magnitude = 20351.383098original  imag register = 0xb08f
    Start of Frequency sweep frequence =9K
    magnitude = 20150.243200original  imag register = 0xb14a
    magnitude = 20459.814100original  imag register = 0xb01b
    magnitude = 20918.282363original  imag register = 0xae4c
    magnitude = 20922.716482original  imag register = 0xae47
    magnitude = 20486.535920original  imag register = 0xb003
    magnitude = 20158.526558original  imag register = 0xb147
    magnitude = 20197.647239original  imag register = 0xb11d
    magnitude = 20336.934110original  imag register = 0xb093
    magnitude = 20381.454757original  imag register = 0xb06b
    magnitude = 20264.032570original  imag register = 0xb0e6
    Start of Frequency sweep frequence =10K
    magnitude = 20061.078336original  imag register = 0xb1a4
    magnitude = 20371.146507original  imag register = 0xb071
    magnitude = 20829.752039original  imag register = 0xaea3
    magnitude = 20827.764930original  imag register = 0xaea8
    magnitude = 20401.235575original  imag register = 0xb05d
    magnitude = 20067.081128original  imag register = 0xb1a7
    magnitude = 20100.900328original  imag register = 0xb181
    magnitude = 20251.164757original  imag register = 0xb0ed
    magnitude = 20291.881579original  imag register = 0xb0cb
    magnitude = 20178.673742original  imag register = 0xb143
    Start of Frequency sweep frequence =20K
    magnitude = 18544.590586original  imag register = 0xb790
    magnitude = 18843.494076original  imag register = 0xb66a
    magnitude = 19302.175266original  imag register = 0xb49b
    magnitude = 19310.374673original  imag register = 0xb495
    magnitude = 18874.022412original  imag register = 0xb653
    magnitude = 18551.881980original  imag register = 0xb791
    magnitude = 18588.114079original  imag register = 0xb769
    magnitude = 18737.078881original  imag register = 0xb6d6
    magnitude = 18758.731220original  imag register = 0xb6c6
    magnitude = 18666.613110original  imag register = 0xb72a
    Start of Frequency sweep frequence =30K
    magnitude = 14870.006389original  imag register = 0xc5eb
    magnitude = 15208.123125original  imag register = 0xc4a0
    magnitude = 15672.058448original  imag register = 0xc2ca
    magnitude = 15713.731893original  imag register = 0xc2a1
    magnitude = 15263.954927original  imag register = 0xc46c
    magnitude = 14935.334211original  imag register = 0xc5b0
    magnitude = 14982.104859original  imag register = 0xc57d
    magnitude = 15108.458062original  imag register = 0xc500
    magnitude = 15169.156404original  imag register = 0xc4c9
    magnitude = 15028.171978original  imag register = 0xc55c
    Start of Frequency sweep frequence =40K
    magnitude = 11259.208587original  imag register = 0xd407
    magnitude = 11488.933850original  imag register = 0xd32c
    magnitude = 11999.593701original  imag register = 0xd125
    magnitude = 12008.358755original  imag register = 0xd11a
    magnitude = 11557.839115original  imag register = 0xd2e6
    magnitude = 11234.127692original  imag register = 0xd424
    magnitude = 11262.552553original  imag register = 0xd403
    magnitude = 11395.464800original  imag register = 0xd37f
    magnitude = 11467.083718original  imag register = 0xd33c
    magnitude = 11341.767279original  imag register = 0xd3bf

  • Thanks for sharing this info. The behavior described in the document is certainly abnormal. It also looks like you are running your own software to control the board. I will not be able to check the software and there seem to be no code for functions CN0349_FunInit, AD5934byteWrite,  ADG715reset, ADG715writeChannel, AD5934byteRead, etc., so it would make sense to assume that the code is functioning and check the resulting circuit behavior.

    First thing to check would be the switch that might not connect the expected ports or connects some additional ports. Could you just reset the switch, run the sweep and post the Re and Im values from the output registers? At 10 KHz those should be close to zero ± several counts of noise. If not - the switch (or the code) might not be behaving correctly. In this case could you temporarily short R10 with a piece of wire (or, alternatively, remove R11 from the board, or do both), run the sweep and see if Re and Im values are close to zero? If not - could you check if the frequency generated by the AD5933 is indeed 10KHz?

    If everything is OK, then could you set the switch channels 2 and 5 to ON and the rest - to OFF, run the sweep and post the Re and Im data? And then channels 2 and 6 o ON and the rest - to OFF, run the sweep and post the Re and Im data? 

  • Start of Frequency sweep
    original  Real register = 0x8d
    original  imag register = 0x13
    magnitude = 142.274383
    original  Real register = 0x8b
    original  imag register = 0x19
    magnitude = 141.230308
    original  Real register = 0x84
    original  imag register = 0x15
    magnitude = 133.660016
    original  Real register = 0x8b
    original  imag register = 0xd
    magnitude = 139.606590
    original  Real register = 0x97
    original  imag register = 0xb
    magnitude = 151.400132
    original  Real register = 0x9e
    original  imag register = 0x11
    magnitude = 158.911925
    original  Real register = 0xa3
    original  imag register = 0x1c
    magnitude = 165.387424
    original  Real register = 0x9e
    original  imag register = 0x21
    magnitude = 161.409417
    original  Real register = 0x9c
    original  imag register = 0x20
    magnitude = 159.248234
    original  Real register = 0x9f
    original  imag register = 0x1d
    magnitude = 161.623018
    Start of Frequency sweep
    original  Real register = 0x8e
    original  imag register = 0x13
    magnitude = 143.265488
    original  Real register = 0x8b
    original  imag register = 0x17
    magnitude = 140.890028
    original  Real register = 0x87
    original  imag register = 0x14
    magnitude = 136.473441
    original  Real register = 0x8b
    original  imag register = 0xd
    magnitude = 139.606590
    original  Real register = 0x95
    original  imag register = 0xb
    magnitude = 149.405489
    original  Real register = 0x9f
    original  imag register = 0x12
    magnitude = 160.015624
    original  Real register = 0xa0
    original  imag register = 0x1e
    magnitude = 162.788206
    original  Real register = 0xa0
    original  imag register = 0x21
    magnitude = 163.367683
    original  Real register = 0x9b
    original  imag register = 0x20
    magnitude = 158.268759
    original  Real register = 0x9f
    original  imag register = 0x1f
    magnitude = 161.993827

    We conducted the open circuit treatment at the input pin of 5933 (R10 and R11 removed). The test results are as shown above. The output value is not close to 0. The output frequency is 10K after using the oscilloscope, and the chip has also been replaced (purchased from different suppliers). For adg715, we have measured its switch with a multimeter and there is no problem.