Adc Vref and Gain consideration(AD7715) - Page 1
Forum section: electronics / beginners

author: tlhsglm
author_rank: Contributor
timestamp: December 02, 2019, 08:18:40 pm
content: Hi fellows,I will make a current measurement, application needs a fast sampling rate and high resolution.Thus i bought an AD7715 ANZ5, i will supply this with +5v and 0v (single supply rail), datasheet is here;https://www.analog.com/media/en/technical-documentation/data-sheets/AD7715.pdfI'm confused about Vref and Gain. My voltage range is 0V to 1V.Some sources tells Vref's purpose is to let ADC know what voltage ranges will come to ADC and ADC makes 16 bit devision based on that.1- Is this true; if tie +Vref to 2.5 volt's(that maximum voltage for my package) and -Vref to ground.Adc will make calculations like this:+2,5volts/65536(16bit).And my max voltage is 1 Volt so i have to put an opamp with gain of 2,5.2- Is this true; But can i tie +Vref to 1 volts? So there is no neccessary to use an opamp?

author: newbrain
author_rank: Super Contributor
timestamp: December 02, 2019, 09:19:32 pm
content: I won't comment on the choice of this ADC, not really my turf, but the following comes from reading the DS.It is possible to use as low as 1V for the reference, but the DS clearly states that noise performance will be affected (page 21, Reference Input)Still you could set an internal gain of 2, so that the actual range in unipolar mide would be 2.5/2=1.25.Using an external calibration, it woul be even possible to get the full codes fo the 0-1V range, as the supported span is 0.8*Vref/Gain, but I imagine this might be a little too complicated... probably a Vref of 2(.048)V might be a reasonable compromise, still setting a gain of 2.You don't specify if the input voltage is referenced to GND, note that for buffered mode the AIN- input cannot be 0V.Since you mention current sensing, I expect the source impedance to be quite low, so you should be fine with keeping the buffer disabled.

author: tlhsglm
author_rank: Contributor
timestamp: December 03, 2019, 10:27:16 pm
content: Quote from: newbrain on December 02, 2019, 09:19:32 pmThank you for detailed answer.I'm confused somewhere again, in page 20 and Bipolar/Unipolar Inputs section, datasheet says;QuoteI didn't understand this part, Is based on the ground 2.5volts?In my circuit when PWM is maximum AIN+ and AIN- voltage difference is 1 volts.But AIN is 10 volts when looking based on circuit's ground.Do you think is this a problem?My circuit is;

author: iMo
author_rank: Super Contributor
timestamp: December 03, 2019, 10:39:19 pm
content: AIN+ and AIN- are referenced to the AD's analog ground AGND (0V).Thus with Vref=2.5V and Gain=2 the max difference (AIN+) - (AN-) will be 2.5V/2 = 1.25V.And because you set AIN- to +2.5V (against agnd) the ADC range will be from 2.5V till 2.5+1.25=3.75V for unipolar operation.Mind you can't go with AIN+ and/or AIN- beyond AGND and AVDD. Both inputs must be inside AGND..AVDD, where AVDD is 3..5V.PS: for bipolar operation, Vref=2.5V, Gain=1 and AIN- set to +2.5V the ADC range will be from +1.25V till 3.75V (ADC will return negative values for voltages < +2.5V because the AIN- is set to +2.5V ).

author: newbrain
author_rank: Super Contributor
timestamp: December 04, 2019, 08:07:26 am
content: What imo said.Some more explanation about unipolar/bipolar vs differential/single ended: this ADC has got differential inputs, so it will measure the difference in voltage between its AIN+ and AIN- terminal.This difference can either be measured in unipolar mode:the code points will span from 0 to maximum (0xFFFF) for positive values of the difference from 0V to Vref/gain V,or in bipolar mode:the total span is the same, but the range is centered on AIN- allowing for positive and negative differences.The circuit as is will not work, look at page 9 of the DS "Absolute Maximum Rating":QuoteYou are largely exceeding this, so no reliable data will be produced (if the chip does not immediately fry...).So, you need to either move the shunt on the low side, or provide an input stage to offset the range into something usable by the ADC (it might also be a current sense amplifier, such as INA139 or similar).

author: tlhsglm
author_rank: Contributor
timestamp: December 04, 2019, 02:24:12 pm
content: Quote from: newbrain on December 04, 2019, 08:07:26 amI have an Ad623 which is a current sense amplifier, if i simply use this with, AIN+(in my circuit below) goes opamp's AIN+, AIN-(in my circuit below) goes opamp's AIN-, and opamp's output will connect to ADC's AIN+ and ADC's AIN- will be connected to ground is it?Opamp's and ADC's Vref voltages will be at same voltage?By the way i really appriciated your help thank you very much

author: newbrain
author_rank: Super Contributor
timestamp: December 05, 2019, 08:19:15 am
content: Quote from: tlhsglm on December 04, 2019, 02:24:12 pmIt is, as AD puts it and can be seen from the block diagram, an "Instrumentation Amplifier".Unfortunately, its common mode range does not include the positive rail so it's not suitable to directly connect to the high side shunt, see the DS "Input voltage Range", bottom of page 3.You could bring down the voltage with a resistive divider, but that will affect noise, offset, increase the needed gain, and, more important, won't solve your problems as the minimum output voltage is 0.2V (for a 10kohm load).To address this last point, you have the possibility to offset the output to a fixed voltage via AD623 REF pin, and use the same reference for the AIN- of the ADC...but it really seem an unneeded complication.I had suggested a current sense amplifier as their common mode voltage largely exceeds the supply voltage, but you should find one with the needed bandwidth, transconductance and input range.But, once again I'll ask: could you move the shunt on the low side and have all of these complications disappear?Since you are after a 1V range, the measured current will be 2A maximum, it's probably even possible to use a lower valued shunt and higher gain directly in the ADC...

author: tlhsglm
author_rank: Contributor
timestamp: December 05, 2019, 09:26:44 am
content: Quote from: newbrain on December 05, 2019, 08:19:15 amI've missed your question, sorry.Yes in this complications i will have to move it, and i will do it right now.I will put the shunt resistor between mosfet and electromagnet.I didn't do it previously because internet pages tells it is not recommended because of ground fluctations but if i not put shunt resistor below of mosfet it will not be problem i guess.

author: newbrain
author_rank: Super Contributor
timestamp: December 05, 2019, 09:49:22 am
content: Quote from: tlhsglm on December 05, 2019, 09:26:44 amStill not so good: when the mosfet is switched off, the ADC inputs will be subjected to the full 12V, exceeding maximum input voltage.

author: tlhsglm
author_rank: Contributor
timestamp: December 05, 2019, 10:45:03 am
content: Quote from: newbrain on December 05, 2019, 09:49:22 amCan i put a resistor(4k-5k) inputs of opamp in this case?If you not recommend then i will put shunt resistor in between mosfet and ground?

author: tlhsglm
author_rank: Contributor
timestamp: December 05, 2019, 11:16:02 pm
content: I have put shunt resistor between mosfet and ground and tracked the signal with pwm increasing one by one from minimum to maximum value and start from minimum again.With this i adjusted gain to move 0volt to 2.5 volts.I will make adc's sofware tomorrow.I will not use PGA of ADC.So i will use unbuffered mode?The circuit is like this;