Author Topic: Help with ADC Converter  (Read 2461 times)

0 Members and 1 Guest are viewing this topic.

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Help with ADC Converter
« on: January 22, 2024, 03:38:47 pm »
Hi All,

This is my first time working with an ADC, I purchased this an Adafruit 4-Channel ADC based on the TI ADS1015 chip. 

https://learn.adafruit.com/adafruit-4-channel-adc-breakouts

Here is a picture of it:


The (4) pigtail wires are soldered directly to the analog in channels on the board.  When I run it in single-ended mode just like you see pictured I am getting a voltage reading on all four channels:



When I run it in differential mode it bounces around between a fraction of a millivolt or two.  I have spent the last several days researching things, especially causes of noise and I am still stuck on why I get a reading when the wires are not attached to anything?

Can someone give me a nudge in the right direction?

Thanks!
Axis





 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14348
  • Country: de
Re: Help with ADC Converter
« Reply #1 on: January 22, 2024, 04:02:24 pm »
The ADC is not made to be used with open inputs. There is not defined voltage and it can easily pick up mains hum. For a test one would more connect the input to ground.
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #2 on: January 22, 2024, 04:16:01 pm »
Thanks for the reply and that makes sense.  I did have it hooked up to my project (differential mode) and was getting very noisy readings which is why I thought I would start with the bare minimum and move up to finding the source of the interference.  I will hook it back up and work with it some more.  Hope I can reach back out if I get stuck again.
« Last Edit: January 22, 2024, 04:23:21 pm by AxisCat »
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #3 on: January 22, 2024, 05:01:12 pm »
I guess my mistake was I thought this ADC would work like a DMM.  Using my DMM i had stable measurements from a few millivolts up to the max of about 3 volts I was measuring.  I understand I need to determine the source of the noise before I can address it.  Do you have any suggestions on how I can start?  With my limited experience I don't even know if that is a reasonable question to even ask.
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: gb
Re: Help with ADC Converter
« Reply #4 on: January 22, 2024, 07:42:56 pm »
Most ADCs require a low impedance source, typically an opamp follower, to drive them due to all the switched capacitance involved during conversion.

Some ADCs have built-in opamps which can simplify things.

Without low impedance sources you can also get crosstalk between inputs with a multiplexed ADC.

One way to lower the dynamic impedance on an ADC input is with a capacitor to ground - of course this only works well for low frequency signals.  100nF is usually enough.

Mine the datasheet for suggested circuits, often that's the route to trouble-free use of a chip.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19619
  • Country: gb
  • 0999
Re: Help with ADC Converter
« Reply #5 on: January 22, 2024, 11:27:01 pm »
The ADS1015 has a programmable gain amplifier on the input, which will internally connect the ADC to a low impedance source.

It sounds like an issue with the common mode range being exceeded. The issue with connecting an input to ground is, it would mean that negative voltages, would take the other input negative, which will cause problems. It's better to bias the inputs to half the supply voltage, so both positive, as well as negative voltages can be measured. Connect a high value resistor, try 1M, from both power supply rails to one of the inputs, it doesn't matter whether it's the - or +. That will ensure said input sits at half the power supply voltage.
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14348
  • Country: de
Re: Help with ADC Converter
« Reply #6 on: January 23, 2024, 11:58:47 am »
The PGA in the ADS1015 and many other SD ADCs is not a real amplifier, but realized by more frequent sampling of the input. One can see this from an input impedance that goes down with gain.
In addition to the average impedance, the input current is in pulses to charge sampling capacitors. If the source is not low impedance there should be added capacitance - though the right choice here can be a bit tricky and effect the linearity. So one would still want a reasonable low impedance signal source. For the differential mode this also means a DC path to ground, not just a connection between the 2 inputs. With chip internal clamping diodes it may work with only the signal between the differential inputs, but not guaranteed and possibly with added errors.

Even with a real amplifier at the input one would still need a defined voltage to make sense of the result. The readings with an open input are just not relevant and not need to worry about this.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 4844
  • Country: vc
Re: Help with ADC Converter
« Reply #7 on: January 23, 2024, 12:09:58 pm »
First step to get an advice is to show your schematics.
How are the inputs of your 1115 wired.
This is how people here communicate the technical details..
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: gb
Re: Help with ADC Converter
« Reply #8 on: January 24, 2024, 11:17:28 am »
The PGA in the ADS1015 and many other SD ADCs is not a real amplifier, but realized by more frequent sampling of the input.
That's not what the datasheet says - it has a differential PGA before the sigma-delta ADC.
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #9 on: January 24, 2024, 02:14:39 pm »
Hi All,

I will post a complete schematic of what I am doing a bit later so everyone can see.  I have been playing around with low pass RC filters along with smoothing in software and the results are promising.

Thanks!
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #10 on: January 24, 2024, 04:14:00 pm »
It is a bit messy but here is my schematic.  The power supply was a kit I bought from Jamco.  I am running it at +/- 10 volts.  The MCU is powered via a USB cable from my PC.  At the moment I am running single end on A0.

multi hosting
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #11 on: January 24, 2024, 06:25:12 pm »
I can sorta visualize how the low pass filter between my signal and ADC works.  The cutoff frequency is about 7hz.  With being that low would it not filter out AC main hum?
 

Offline Kleinstein

  • Super Contributor
  • ***
  • Posts: 14348
  • Country: de
Re: Help with ADC Converter
« Reply #12 on: January 24, 2024, 07:11:07 pm »
With low pass filter will reduce mains hum, but it is still only a 1st oder low passe and thus an attenuation factor of some 7 or 14 for 50 / 100 Hz.
A similar, additional filter action can be obtained from a larger capacitor (e.g. 1 nF) at the TIA in parallel to the 20 M.

The more effective way to suppress hum is averaging over a number of ADC readings to cover a multiple of 20 ms, so some 66 readings or a multiple of this with a 3300 SPS reading rate.
Depending on how good the frequencies match, the suppression may well reach a factor of 100 to 1000  (0.1% error in the frequency).

It still makes sense to have both the analog low pass filter and the suppression by integration of a multiple of mains periods, as one has to get the hum small enough, not to get saturation for the single readings or signal in bettween. The analog low pass also help with some other noise.

The PGA in the ADS1015 and many other SD ADCs is not a real amplifier, but realized by more frequent sampling of the input.
That's not what the datasheet says - it has a differential PGA before the sigma-delta ADC.

The datasheets shows the PGA in a functional block diagram - so there is a PGA functionality, but this tells nothing about how this function is realized. On a quick look I have not found an exlicite mentioning how this is done, but there are tell tale signs that this uses more frequent sampling: the input impedance goes down with more gain and the accuracy for the gain is rather good, with simple powers of 2 for the gain.  It is common to find this version of PGA. E.g. the ADS1213 explicitely explains using the more frequent sampling to get similar gain steps.
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1128
  • Country: lt
Re: Help with ADC Converter
« Reply #13 on: January 24, 2024, 07:22:17 pm »
So from the photo I see that you soldered wires to A0-A3 and I understand that you want to use these as single ended channels. In any single ended signal chain ground is critical, because everything else is measured relative to it. How you connected your ground? Have you noticed, that this module's GND is not ADC GND? There is ferrite bead in between. ADC ground is actually called A-, you should use that. You also should ensure that no other currents except signal is flowing through that ADC ground connection.
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #14 on: January 25, 2024, 01:36:10 am »
Thanks for the help and I did not pickup on that A- is the ADC ground.  My initial plan was to run differential mode but I don't know what I would gain from that, maybe you can advise me.  So I need to ground A- correct?
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #15 on: January 25, 2024, 01:50:25 am »
Thanks for sticking with me on this.  At one time i did have a larger feedback capacitor and the circuit started ringing.  I don't remember the exact value I was using.  I did a fair amount of reading on to select the feedback capacitor but to be honest it wasn't very clear to me so I used a spreadsheet I downloaded:

This stabilized the circuit.  But I can try a 1nf to see what it does.

Also the averaging I did in the software was just a simple running average of 20 values taken 50ms apart.  But it was as close to magic as I have ever seen in bringing dark signal down to a stable < 1 mV.  Really cool.
 

Offline dobsonr741

  • Frequent Contributor
  • **
  • Posts: 685
  • Country: us
Re: Help with ADC Converter
« Reply #16 on: January 25, 2024, 02:47:43 am »
Powering the opamp from +/-10V can send the same voltage to the ADC. You have a current limiting 2.2K, so you are within the absolute maximum 10mA. It’s not a precision device, and it’s cheap - so allowing the ESD protection diodes to conduct is forgivable.
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #17 on: January 25, 2024, 03:29:39 am »
Thanks for the reply.  I have to be very careful that I don't send too much voltage to the ADC because it can send close to the full 10 volts if I allow it to see ample light.  In my project the signal is very weak and it takes the 20M resistor just to get it up to close than 3 volts.  The 2.2k resistor is part of my RC filter so I didn't think of it in terms of a current limiting device.  I admit I am struggling with a lot of aspects on this project. 

But since you brought it up I have thought about what would be the ideal voltage to run the TIA at.  Looking at the data sheet is shows 10 volts typical so that is what I chose.  Here is a link to the photodiode module:
 https://www.lasercomponents.com/de/?embedded=1&file=fileadmin/user_upload/home/Datasheets/luna/si-pin/det-amp-no-fr/sd100-42-22-231.pdf&no_cache=1
 

Offline radiolistener

  • Super Contributor
  • ***
  • Posts: 3483
  • Country: ua
Re: Help with ADC Converter
« Reply #18 on: January 25, 2024, 10:51:34 am »
Thanks for the reply and that makes sense.  I did have it hooked up to my project (differential mode) and was getting very noisy readings which is why I thought I would start with the bare minimum and move up to finding the source of the interference.  I will hook it back up and work with it some more.  Hope I can reach back out if I get stuck again.

In order to reduce noise, you're needs to power ADC module from low noise PSU and use wire pair (GND+signal) for every input. Don't use GND from MCU module, you're needs to provide signal source with ground from ADC module and keep signal and ground wires close as a pair in order to reduce receiving RFI on the wires.

For better noise isolation, there is needs power filter for ADC, buffer to isolate noise through data lines and special measures for wires layout. But with external module it's almost impossible to keep noise stable and low enough, because it uses wires with flexible geometry, which will receive a lot of noise from environment.
« Last Edit: January 25, 2024, 10:56:29 am by radiolistener »
 

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1128
  • Country: lt
Re: Help with ADC Converter
« Reply #19 on: January 25, 2024, 11:35:44 pm »
Thanks for the help and I did not pickup on that A- is the ADC ground.  My initial plan was to run differential mode but I don't know what I would gain from that, maybe you can advise me.  So I need to ground A- correct?

No, you don't need to ground A-, it IS ground, ADC ground. You need to use it as your signal ground. So for instance, in the schematic diagram which you posted, 10uF capacitor (your low pass filter) should be connected to A- and your amplifier ground should also be connected to A-. Hopefully it makes sense.

Ground is just a concept, you may call any point "ground" if you want. So there may be multiple "grounds" in a circuit. In signal processing circuits there are usually two, which we call digital ground (or simply ground) and analog ground, abriaviated GND and AGND. Ground (in other words - point of reference) for single ended analog signals must be clean from noise, that's why it is separated. Any other currents should ideally never flow through that path. It is sometimes difficult to avoid other currents to flow and ground loops. That is where differential mode shines. But it is quite possible to make decent single ended systems too if we follow best practices and know basic rules.
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #20 on: January 26, 2024, 11:37:45 am »
10uF capacitor (your low pass filter) should be connected to A- and your amplifier ground should also be connected to A-. Hopefully it makes sense.

Yes, that makes perfect sense.  I appreciate everyone's help as I only have a couple of months of really trying to understand this stuff.

I am going to move on to differential mode now which was my intention from the start.  I guess I expected this ADC to read voltage 'out of the box' like my DMM does and wasn't understanding why the ADC was so noisy.   Maybe because the DMM's power is isolated (9v battery?)

Zero999 mentioned earlier in a reply about negative voltage messing with the ADC and biasing one input to halfway between the power rails would resolve this. 
Connect a high value resistor, try 1M, from both power supply rails to one of the inputs, it doesn't matter whether it's the - or +. That will ensure said input sits at half the power supply voltage.

I need to investigate what he was saying to do so I understand it more clearly
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: gb
Re: Help with ADC Converter
« Reply #21 on: January 26, 2024, 01:11:26 pm »
DMM's use dual-slope integration to do analog->digital conversion, so their effective noise bandwidth is close to 1Hz, whereas many ADC's have a bandwidth measured in MHz, so the noise power is 6 orders of magnitude greater for an ADC, but they can measure many orders of magnitude faster as a result.
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #22 on: January 26, 2024, 02:00:44 pm »
Gotcha... so for my application speed is not an issue.  I can take whatever amount of time i need for a measurement within reason.  Like 2-5 seconds.  Based on this what would your recommendation be for filtering?
 

Offline MarkT

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: gb
Re: Help with ADC Converter
« Reply #23 on: January 26, 2024, 02:26:17 pm »
RC filter with R*C = 1.44 * settling time / bit resolution.

So for 12 bit, R*C ~= 0.6, so maybe 560k and 1µF
 

Offline AxisCatTopic starter

  • Contributor
  • Posts: 34
  • Country: us
Re: Help with ADC Converter
« Reply #24 on: January 26, 2024, 04:15:01 pm »
Thanks for the formula... that helps a lot
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf