• 0
irfiee

PMOD AD5 external reference voltage of 3.3V

Question

Dear @JColvin,

I am using PMOD AD5 to measure the voltage of current and voltage transformer. I set the output voltage of current and voltage transformer to maximum 3.3V. I would like set the external reference voltage of AD5 to 3.3V, So, how would I set AD5 reference voltage to 3.3V?

Also, please explain the difference between Analog supply voltage (AVdd) and REFIN2+ and REFIN2-, Which pin will be use as external reference voltage pin?

Furthermore, I am using  AD7193.h  library created by Anne Mahaffey and he define variable named  mVref = 2.5, I think it represent a default reference voltage. Suppose if change the AD5 reference voltage to 3.3V. Do I have to change this number to 3.3V in AD7193.h file?

image.png.20999992d15eea75296cdc93fcebf2e2.png

 

Lastly,  Is the mentioned/attached library is suitable for 24-bit ADC?

 

Many thanks

 

AD7193-master.zip

Edited by irfiee

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hi @irfiee,

The AD7193 datasheet here shows that:

P1/REFIN2(+) is the digital Output Pin/Positive Reference Input. This pin functions as a general-purpose output bit referenced between AVDD and AGND. When the REFSEL bit in the configuration register = 1, this pin functions as REFIN2(+). An external reference can be applied between REFIN2(+) and REFIN2(−). REFIN2(+) can lie anywhere between AVDD and AGND + 1 V. The nominal reference voltage, (REFIN2(+) − REFIN2(−)), is AVDD, but the part functions with a reference from 1 V to AVDD.

P0/REFIN2(−) is the digital Output Pin/Negative Reference Input. This pin functions as a general-purpose output bit referenced between AVDD and AGND. When the REFSEL bit in the configuration register = 1, this pin functions as REFIN2(−). This reference input can lie anywhere between AGND and AVDD − 1 V.

The power supply has AVDD(Analog power) is from 3 V to 5.25 V  and DVDD(digital power) is from 2.7 V to 5.25 V.  

If you want the Vref to be 3.3v then you will need to change the Vref in the library as well as physically on the PmodAD5 as described in the reference manual here. The reference select bit from the default reference of 2.5V to the user supplied reference voltage between pins REFIN2+ and REFIN2-.

Here is a forum that has addition information about the Pmod AD5 that should be helpful.

thank you,

Jon

Share this post


Link to post
Share on other sites
  • 0

Thank you for the reply @jpeyron. This been very helpful. 

I have  a problem with measuring of 0 - 24 V DC with PMOD AD5 using Arduino UNO. As we know from datasheet, any incoming input voltage to be measured must be within ±(AVDD-1.25V). So,  a Voltage divider to step down the input voltage to below 2 V used. The set up of a Voltage divider is,image.png.d99253557bf26bf8f8fa6c45cf5441fe.png

  • The PMOD AD5 is operating at 3.3V,  which means, reference voltage is 2.5V.
  • AD7193.h library is used (same one which I mentioned in my first post)

The functions that they have used in the library to measured the voltage are; 

image.png.3375cb15c47ec1a60ac15e3cf76498a0.png

By applying the above code, I am  getting right reading of the voltage divider should give but this Voltage function is missing a voltage divider ratio, so that's why I am trying to use my function to calculate voltage. The code I am using is;

image.png.36ab193e10ab4db3a88ce3ff63c012e1.png

image.png.ad3932d2359e237d2a988a6311704277.png

The output of the above code is 1.25V, Even if there is not input voltage, which mean that it does not work.

My questions are;

Firstly,  I don't know what is mPolarity means in the AD7193.h library?

Secondly, why he used half of 24-bit ADC resolution (float)8388608 ? 

Finally, how would I use my own function to calculate voltage by getting raw data from the PMOD AD5 ADC?

Many thanks

 

Share this post


Link to post
Share on other sites
  • 0

Hi @irfiee,

1) mPolarity deals with the BIPOLAR/UNIPOLAR CONFIGURATION as discussed on page 33 of the AD7193 datasheet here

2) You will need to look more closely to the BIPOLAR/UNIPOLAR section to better understand why they divide the raw data by  (float)8388608.

3. I would first confirm what the Pmod AD5 is configured to. Then make sure that your code reflects the conversion formulas the datasheet gives you.

thank you,

Jon

 

Share this post


Link to post
Share on other sites
  • 0

Hi @irfiee,

If you are not already, I would also recommend using the libraries I posted on this thread since it defines and uses mPolarity whereas from what I remember other libraries online did not use this parameter.

Thanks,
JColvin

Share this post


Link to post
Share on other sites
  • 0

Thank you @jpeyron @JColvin for your help. I think, the library currently, I am using using mPolarity function but any way i will try to use the new library as well. If i have a problem again, I will come back to you. thanks 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now