AGND or GND

Status
Not open for further replies.

gripner

Well-known member
Hello

I have an output from an ina128 amplifier. Max output is above 3.3V so I use a voltage devider with 2 resitors.

INA128 ------- Resistor 1 ------ signal to teensy3.1 A0 ----------- Resistor 2 ----------- GND

Should i use AGND instead of GND?
 
On circuits like this, AGND could be considered the 'true ground' -- where 0 V is connected to; the voltage reference for the ADC is relative to this ground. The rest of the chip (logic, CPU core, I/O drivers) also have a 'ground' connection (VSS) which is (eventually) connected together with AGND via some internal and external wires. These wires have some resistance and inductance. These circuits consume fast-changing currents, and this generates noise -- their version of 0 V is not precisely zero because the changing currents flowing through their wiring back to ground means that VSS is different from AGND by varying amounts (noise). Not precisely being 0 V doesn't matter for the logic.

A slightly different ground is the USB power ground -- this also has varying currents flowing in it and will have deviations from 0 V.

For instance, you might expect that an I/O pin driven to logic '0' will generate precisely 0 V -- it won't -- the internal driver connects this to VSS, and if with a good enough 'scope you could see the noise on this w.r.t AGND.

The Teensy chip will work well when these grounds are not equal; as long as the difference doesn't get more than a few 100 mV.

On the Teensy schematic, you will see that VREF is decoupled directly to VSSA (== AGND) with 0.1 uF. AGND and VSS are connected with a ferrite bead (to filter VSS noise from AGND).

So--in general--analog signals and things to do with ADC inputs should always be referenced to AGND. If the current they consume is small and doesn't change quickly (i.e. doesn't have a sharp clock), it might be OK to connect the power supply ground of these blocks to AGND also; if not, they should be powered from VSS/GND.
 
Thanks a lot for the clarification.
I'm trying to get the most out of the adc, but the USB noice is very hard to get rid off.
I'm powering the teensy from the USB. The readings are rather stable, but as soon as I disconnect and reconnect the USB cable the reading changes. Let's say around 10 ish up or down.
Plug in USB cable and use the serial monitor, value is 10029
Unplug USB and reinsert, the value is 10017
Repeat and value is 10023

I have gotten it much more stable by cutting The vusb and supply voltage from a 7805 instead.

Tomorrow I will try to retrieve the data via real uart instead ,
 
What if you just read 10 times in a row ? do you get a similar variation ? Look up the ADC specs; without filtering (averaging) I don't think your results are unsurprising.
 
Sorry if I was unclear.
Every value in my post is an avg of 600 reads

The number will be the same all the time plus minus 1 with my avg of 600 reads.
But if I disconnect USB and reconnect the value I get is still moving as expected plus minus 1 but around a different base number


Connect USb
Loop
Read analog and avg the 600 reads
Value is 10034. +/- 1
End loop

Disconnect USB
Connect USb
Loop
Read analog and avg the 600 reads
Value is 10025. +/- 1
End loop

Disconnect USB
Connect USb
Loop
Read analog and avg the 600 reads
Value is 10042. +/- 1
End loop
 
Last edited:
If you connect a multimeter with 4.5 or more digits (some handheld meters have a special hi-res mode) between the analog pin and AGND, does the actual voltage change slightly. In other words, is this strange 0.1% change in results actually a real voltage on the pin, perhaps because the power supply voltage changes slightly?
 
Hello

Do not have a highresolution multimeter, only xx.xxx would need xx.xxxx atleast.
But I have done alot of testings today.

To recap,

INA128 instrumental amplifier amplify a small signal around 2mV to 1V from a loadcell. the loadcell is driven by a 7808. loadcell negative i tried connected to gnd and AGND no difference, INA128P GND is connected to GND not AGND
INA128P output connected to a voltagedevider, the "ground" in the devider is connected to AGND
From voltage devider A0 on teensy3.1 is feed. There is as close as posible to A0 pin a cap, tried tantal and ceramic. cap connected to AGND
AREF have a cap to agnd (tested both tantal and ceramic.

My program do 600samples and avg them, as said earlier the value is stable just go up and down a little, since i use all the 16bit it can never be 100% stable.

value should be say 10000. depending on wich computers USB or USB port in the same computer I connect the teensy to the vaue of 10000 will be different!
around 10ish points per 10000, but sometimes 20points.
 
What is the type of load cell you are using? I assume you are using the 3.3V as the reference voltage, so that means you are getting 0.000005 V/bit resolution (however using 16bit you actually won't get this). Depending on what you are powering your load cell with, so if using 5V and at 2mv/V, your max voltage would be 10mV. How accurate is the 7808, is it giving you a very precise voltage reference? What is the gain of the INA128? Are you sure you can use the INA128 with a single power supply? I know the INA125p can be, but you really have to pay attention to common mode difference, since you won't get a linear response from the load cell. Another thing, why are you saying you should be seeing 10000? You using some sort of calibration system.
Bottom line is, there can be a lot of variables causing your difference, and you need to determine the resolution you need to measure
 
Are you saying it is different with different USB ports ? Is it the same if you use the same USB port ?

As well as the bottom of the R divider being connected to AGND, you need the REF pin of the INA connected to a stable reference. Its output is generated w.r.t. this signal. You might be able to use AREF directly for that. If you had been using a R divider from VDD, that would give you a supply sensitivity. Alternatively you could use a R divider from the 7808 also for this.

How fast is your sampling done ? How long are the wires ? Is there any chance that you are picking up 50/60 Hz interference from the AC line ? Do your results change if you touch the load cell with your finger (changes the AC line interference) ?
 
Last edited:
Jp3141, different results in different USB ports, if I plug it out and back in to same USB port I normally get around 1/10000 diff only not 10 or 20ish.

I overlooked ref on ina128, will connect it to agnd instead of normal gnd, I assume the gnd get a lot of noice from USB.
 
Are you using the INA128 single-ended ? i.e. with just a +8 V supply ? If so, it might work better with its REF connected to AREF, not AGND. If your load cell has a bipolar output and you need to get the negative case, then connecting REF to AREF and using a R divider from OUT to feed the ADC will work; else you'll be trying to convert a negative signal with the ADC.
 
I use the ina128 singel ended.
Loadcell is a normal 4 wire version, plus/minus and output plus and minus. The output with no load is around 1mv, maxes out at 16mV with full load. Wheatstone bridge.

If I connect the ina128 ref to gnd to not get any offset modifications. If I connect to aref won't I get for example when the ina128 should output 1v get 4.4v out ?
Ina128 ain't rail to rail so don't want to go high in output voltage. The ina128 is supplied from same 7808.

Just grasping for straws now, the load cells minus, should not be connected to agnd right?

Actually best would it not be to supply the Loadcell with plus from teensy3 aref since it is connected to the 3.3v and Loadcell gnd to agnd?
 
What is the voltage of the 7808? You can program the gain of the INA128 so you don't go over 3.3V. The calculation is in the reference sheet for the INA128. If your full range is 16mv, then a gain of 206 should keep you under 3.3V, to be safe, i'd go down to 200. So from the sheet it actually tells you the resistor to use, which would be a resistor of 249ohm. If you use a 500ohm pot, then you can dial it in to what you need. Also, what is the quality of the load cell? Is it a $600 omega, or a $7 cheap ebay load cell? You don't want to attach S- to ground. Like I said before, I am not sure how well the 128 responds to single supply, since the info sheet does not even show an example. If you look at the 125P sheet, it will give you an example of single supply and what to expect.
 
The output of the INA can go positive and negative w.r.t. its REF pin. If you need bidirectional outputs, then you can't connect REF to AGND because the ADC can't convert negative outputs. So, you have to connect it to AREF, and use a R divider (like you have) from its output to AGND. Fundamentally, you're always going to have to compromise when you have a bipolar signal going to a single-ended ADC.

Even so, you have to be careful not to overdrive the ADC's input -- I'm not sure it can handle more than 3.3 V (e.g. if the loadcell gets disconnected or overloaded). Safest is to add a ~ 10kohm between the INA and the ADC's input.

Note your loadcell's sensitivity depends on the accuracy&stability of the 7808 voltage. You might be able to power the loadcell from VOUT33 (the INA still from the 7808). This will give about half the sensitivity, but be more stable for gain if you need that (in fact then the output sensitivity is independent of the VOUT33 voltage level).

Edit -- perhaps you can use AREF (1.2V) for the REF pin of the INA; power the loadcell from VOUT33 (3.3 V), and don't use a R divider (just a 10k protection R) from its output to the ADC input. Configure the ADC to use the 3.3 V reference (I don't know if AREF remains at 1.2 V if the ADC is configured to use the 3.3 V as a reference).
 
Last edited:
I only go from around 1-2mV to 16mV both positive from the loadcell to the ina128. So ina128 ref should work connected to agnd.
 
BTW, what capacitors to use for decupling aref, A0 etc to agnd ? I read / hear tantalum is very good but expensive, are they better then ceramic once ? Perhaps a electrolyt as a tantalum is is totaly wrong ?
 
Ceramic is best for this application -- decoupling high frequency signals. Use ~ 0.1 uF. Tantalums are better for decoupling lower frequency noise e.g. from power supplies etc. Typically they would be 10-100 uF.

How long are the wires from the load cell to the ADC ?
 
the wires are les then 50cm. the cable is shielded.

Since i have very stable readings , but the reading change 10 to 20ish points in 10000 when i move usb port but remains stable around the new value im 99% sure the problem is must likely HF induction from the USB ?
 
Done some more testing now, runnig the program without the USB cable connected so serial.print wont show but i hooked up a i2c-lcd and print the data to it. I can disconnect the power and reconect it with much much les chnages in values.
So it is the garbage USB
 
If you are re-doping this, look into an INA that can run from low voltages -- e.g. INA827. You should be able to power everything from VOUT33 (can sopurce > 100 mA). Set the ADC to use that as a reference, and connect REF to a voltage divider across VOUT33 (to generate 1.65 V). Setup the ADC to use VOUT33 as its reference, and put some filtering caps on the 1.65V wire and at ~ 1k between the opamp and the ADC input.
 
Thanks for all the input!
Why use 1.65V to feed the ina827 ref ? Why not feed the ref with AGND ? Maby i missunderstood the ref function. but i thought that was to "offset" the output. For example if you with ref = aref you have 1V out, change ref to 1.65V you will have 2.65V output instead ?
 
Status
Not open for further replies.
Back
Top