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.

Parents
• 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?

Reply
• 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?

Children
• 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;
//SystemInit();
delay_init();
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_4);
uart_init(115200);
IIC_Init();
CN0349_FunInit();
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);
delay_ms(5);

// 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);

delay_ms(30);
ADG715reset();            //clear out switches
delay_ms(30);
ADG715writeChannel(8, 1); //turn on switchs
delay_ms(30);
ADG715writeChannel(2, 1);
delay_ms(30);
sweep1();

while(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
else
*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

for(;;)
// 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

convert(real_data,binary);
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");

binary[0x0]='\0';

convert(imag_data,binary);
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");

binary[0x0]='\0';

// 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);
break;
}

} // 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) {
//Wire.begin();
delay_ms(500);
delay_ms(500);
//setControlRegister2(); //set PGA=1,set exciting voltage=2.00v;
delay_ms(20);
//setControlRegister3();
//setNumberOfSettlingTimes(settlingTimes);
setStartFrequency(startFreq);
setFrequencyIncrement(freqIncr);
setNumberOfIncrements(numIncr);
}
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.

• I might not have written it clearly: if R11 is removed, R10 should remain on the board. If R10 is shorted with a wire, R11 can either stay on the board or be removed with virtually the same effect. This turns the input OPAMP in the AD5933 into a unity gain voltage follower that passes the DC voltage of Vdd / 2 to the ADC and, if the "DFT" works correctly, the output theoretically should be zero.

The values you posted are under a couple hundred, at least not in thousands, where they should be in the presence of signal, which is an indication that your software is working OK. If you put R10 back (or replace it with a piece of wire) while keeping R11 off the board, the output Re and Im readings should become lower than the ones you posted (ideally about twice lower). Could you also increase the frequency to 50 or 100 KHz to see if the readings become even more noticeably lower?

• The two sets of data previously sent were tested by two different AD5933 when R11 was disconnected and R10 was short circuited. It is not normal that the measured magnitude is more than 100. At present, the most confusing problem is that when the feedback resistance is set to 100 ohm, when the measured unknown impedance is 100 ohm to 1K ohm, the received magnitude is more than 20000 (over range). Similarly, when the feedback resistance is 1K, When the unknown impedance is 1K ohm to 10K ohm, the received magnitude is also more than 20000 (over range). What is the reason for this phenomenon? Then there is also a question about whether the resistance values of R11 and R10 affect the gain factor? The following data are magnitudes measured at different frequencies.

```R10 = 20K, R11 removed frequency = 10K
magnitude = 89.140339
original  Real register = 0x52
original  imag register = 0xd
R10 = 20K, R11 removed frequency = 50K
original  Real register = 0x1b1
original  imag register = 0x1c4
magnitude = 625.933703
R10 = 20K, R11 removed frequency = 100K
original  Real register = 0x68
original  imag register = 0x2ed
magnitude = 756.185824```

• It is not normal that the measured magnitude is more than 100.

It is certainly not normal, values should be no more than ±10-20 counts. If you have access to an oscilloscope, can you check whether the AD5933 outputs the frequency you programm into the chip? Can you also verify that the Start Frequency code your software is writing into the chip are larger than 250000 (0x3d00) or so? One more thing to check is the Number of Settling Cycles, it should be ≥1. Not likely, but does your software poll the status register 0x8F to see if the output data is ready?

Unless we can figure out why the no-signal readings are not near zero, there is no point trying to measure resistors. Something is wrong with the software or hardware. Not likely, but is your board power supply voltage is clean +3.3V, with no excessive spikes, etc.?

• About 50 within what range of frequencies or, better yet, Frequency Codes? You might want to check the paper found by  tsoft. it shows the “DFT” systematic error plus noise in Re and Im data on Fig 6c. If both your boards and the software show the same performance with no input signal it is a good indication that it all functions well enough to proceed with the measurements.

With the settings you listed everything should work as advertised.

As much as can be deciphered from this data, the evaluation board works and the CN0349 (or possibly the software it is controlled with) – does not. The magnitude data from the Eval board is linear as a function of the inverse impedance and the data from the CN0349 is not.

The magnitude from CN0349 is considerably higher than from the evaluation board, the signal on CN0349 might me saturating. Can you check whether the feedback resistor for the U1-B OPAMP on the Eval board (RFB) is of the same value as the one selected for the U2B OPAMP on the CN0349 (presumably R8?).

Not sure about the different values of components on different boards, only somebody from ADI can answer this question. Perhaps the exact value of the bias resistors and the capacitor are not that important as long as the circuit operates at the frequencies considerably higher than the cutoff frequency of the high-pass filter created by these resistors and the capacitor.

The type of capacitors should not affect the circuit performance at these relatively low frequencies.

You can always zip the code and insert the zip archive into the message..