Author Topic: ADC input resistance  (Read 5634 times)

0 Members and 1 Guest are viewing this topic.

Offline wigman27Topic starter

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
    • Wiggins Wonderful Websites
ADC input resistance
« on: January 09, 2015, 12:21:38 am »
Hi all,

I have a bit of a noob question, does an ADC have a high resistance similar to an opamp?

In my case, for the MCP3204 datasheet, what would it's input resistance be? What does the 1000 ohm switch resistance mean?

The reason I am asking is could I do away with buffers U2b and U2c in my dummy load schematic?

Thanks very much in advance, I hope that makes sense.

Lee
Need a website designed? Check out my Australian based web development business www.wigweb.com.au for affordable fixed price packages
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5319
  • Country: gb
Re: ADC input resistance
« Reply #1 on: January 09, 2015, 12:36:08 am »
On an iPad at the moment so can't see your schematics, but the data sheet shows that the input on each channel is 7pF plus the 1k analogue switch resistance onto the 20pF sample and hold cap.

So you need to figure out how long to keep that switch closed to sufficuently charge up the S&H cap for the  resolution you need.

In general though, opamp buffers into ADCs are very common, don't be afraid to use them, they are there for a reason, to take a high impedance to the relatively low impedance of many ADCs. On the way they will often add anti alias filtering too. Depending on the design, resolution and speed, a fair bit of care needs to be placed on the opamp's slew rate, gain bandwidth product, inherent noise and whether it's rail-rail I and/or O, and particularly for higher speed stuff, also the stability and layout. A veritable mine of options!
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21675
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: ADC input resistance
« Reply #2 on: January 09, 2015, 02:15:23 am »
The input is a resistor to a switched capacitor.  The capacitor retains its charge from the previous conversion.  Typical DC resistance is in the Mohm range at average sample rates (~10kSa/s).  So for accurate DC readings, you need a source resistance much less than that, i.e. under 1kohm or so.  Which is about what the datasheet suggests.  Quick settling will require somewhat lower resistance, too.

Both those op-amps can probably be removed.  Which is probably a good idea anyway, LM324 won't pull up very far near VCC, which I guess is around 5V?  Nor very near 0V (it can get within ~50mV, but it's not pretty).

I would suggest TLV237x for any op-amps, or better yet, something with even lower offset voltage around the precise parts.  Rail to rail and low Vos are the important factors here.

You have other concerns though:
- Putting bypass caps on op-amp outputs...  Needs a series resistor, else you probably get oscillators, making things much worse.  If U2 b,c get pulled, no problem, but this may apply to U6, U7 still (any hints from the datasheet?).
- Relay switched VCC?  Really?  Not really going to harm anything, but you can do the same thing with a couple cents of transistors, it's not like you need a whole relay to do it...  Also, note that VCC will drop out and power cycle when the adapter is pulled, even if USB is still plugged in.  Since you don't need the voltage overhead (except for M1 threshold voltage? I haven't checked), you could just wired-OR the supplies with a pair of schottky diodes or something.
- Wouldn't hurt to have some protection around the voltage/current sense bits... example, suppose a battery is connected in reverse at the output.  The sense resistors would carry pretty much full load voltage (until they burn out or whatever?).  And that voltage would appear on the ADC (ISENSE).  The ADC inputs should have internal protection diodes, so, if you leave a 10k + 100n filter there, the 10k will limit current.  I tend to add clamp diodes there as a matter of course, just in case.  But probably not a big deal.  Easy solution for reverse, of course: add a series blocking diode.
- Note that R17, R18 must be as precise as the reference for it to all be worthwhile, and the same goes for U2a, and what's sensing ADC-IOUT.  You don't have any gain on the latter, so you'll only get about 10 bits worth of useful range on that ADC input.  Probably about as good as anything, as is, since changing ADCREF to the 0.8V scale reduces its ENOB, or amplifying IOUT back up to the 2V scale requires precision resistors and an amp.
- Not sure what's going on with the fan... you're driving it with a DAC output, but just switching it on and off..?  You're not going to get much controllable range there, and it won't be very linear.  And, ironically enough, very temperature sensitive.
- All those LCD bits scrambled around... is that a good idea?  Looks like it's going to be a pain.  Guessing 4 bit interface will be sufficient so who cares, but then it's like, why bother spending the space routing them? 
- C7, C8 won't really do anything DAC-specific unless isolated a bit from the rest of the supply rail (e.g. with a ferrite bead).  This won't matter as you aren't using high bandwidth anyway; could just as well cut them.  (On the other hand, the ADC samples its inputs relatively instantaneously, so leaving C6 is probably worthwhile.  It could be assisted with a ferrite bead in the same way, but meh?)
- The USB ground looks suspicious.  I suppose the MCU having its own USB ground is good, but the USB power is just carelessly merged in with the rest.  As long as the USB shield is doing its thing (which it should, being tied straight to ground), there shouldn't be much crap on either line, so there shouldn't be much reason to isolate UGND or VUSB.
- Everything else looks good: shouldn't be anything wrong with the ref (as long as it's suggested to use bypass caps, anyway), power (give or take the relay and fan parts), the encoder should be well debounced even if its contacts are terrible, U2a is properly compensated (whether it's optimal I have no idea, but that's easy to play around with and find out), and the MCU and LCD should be happy.  Well, may not hurt to add a reset generator / power monitor IC for global reset (supposedly the POR/BOD in ATmegas is pretty bad), but whatever.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: ADC input resistance
« Reply #3 on: January 09, 2015, 02:25:07 am »
Quote
does an ADC have a high resistance similar to an opamp?

Generally speaking, yes. There are, however, adc modules with input impedance in the <10kohm range and they tend to be high speed adcs or adc onboard a mcu.

Quote
The reason I am asking is could I do away with buffers U2b and U2c in my dummy load schematic?

Almost definitively yes. ADC_VIN has 100n capacitor on it (C1) and ADC_IOUT has an output impedance no greater than 0.1ohm.

So you can safely do away with those buffers.

Having said that, this is a questionable design, by someone who wants to load up opamps with capacitors.

I would hesitate in building one unless someone has tested it thoroughly.

================================
https://dannyelectronics.wordpress.com/
 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 8642
  • Country: gb
Re: ADC input resistance
« Reply #4 on: January 09, 2015, 03:44:07 am »
You have huge capacitors (100nF) across the outputs of your followers (U2b and U2c). Doesn't that cause horrible instability in the op-amps? It should. A comparison of the op-amp's open and closed loop behaviour will show than something interesting and bad happens at high frequencies, as the open and closed loop gain curves cross. You generally need a resistor in series with the output of the op-amp to form an RC LPF to bring the op-amp back to stability.

When an ADC is driven from an op-amp buffer, without an external capacitor, even the little sampling capacitor in the sample and hold circuitry of the ADC can cause instability in the op-amp. However, your ADC has such a huge input resistance (1k) that an additional resistor is unlikely to be needed.

So, your existing circuit is probably quite troublesome. The buffer op-amps in front of ADCs are usually there to isolate the source from the pulsing capacitance of the sample and hold circuit. Your 100nF capacitors swamp that so much, the source won't really notice anything in your case, and you can take the op-amps away.
 

Offline wigman27Topic starter

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
    • Wiggins Wonderful Websites
Re: ADC input resistance
« Reply #5 on: January 09, 2015, 05:06:52 am »
You have huge capacitors (100nF) across the outputs of your followers (U2b and U2c). Doesn't that cause horrible instability in the op-amps? It should.

OK, so it appears I have made an error with the capacitors on the Op amp outputs, this is my very first electronics design and I now know why this was a bad idea! Although it does work and it does work quite well. My first design rev didn't have any capacitance here and it oscillated wildly so I installed these capacitors as a "bodge" until the oscillation stopped. Not fully understanding what I was doing. My load works quite well over all current ranges and sense quite accurately apart from the LM324 offset voltage. So I incorporated them into rev b and is still working very well.

I am working on rev C and one of my considerations was to remove these buffers and capacitors for more stability. I have been reading a lot on phase loop margin stability and am going to tackle it better. I hope. Hence my question.

I would suggest TLV237x for any op-amps, or better yet, something with even lower offset voltage around the precise parts.  Rail to rail and low Vos are the important factors here.

I am considering replacing my lm324 with the AD8630 (or 29 if I can get away with dual) for better offset and full rail to rail output. I will also check out the one you have suggested.

- Relay switched VCC?  Really?  Not really going to harm anything, but you can do the same thing with a couple cents of transistors, it's not like you need a whole relay to do it...  Also, note that VCC will drop out and power cycle when the adapter is pulled, even if USB is still plugged in.  Since you don't need the voltage overhead (except for M1 threshold voltage? I haven't checked), you could just wired-OR the supplies with a pair of schottky diodes or something.

Not being overly familiar with dual supplies I did a lot of asking around, including this forum and it was suggested this was the best way. Plus the Leonardo used a MOSFET to do it but I couldn't as everything was a common rail. I will look at your OR idea and work on that for rev c also.

- Wouldn't hurt to have some protection around the voltage/current sense bits... example, suppose a battery is connected in reverse at the output.  The sense resistors would carry pretty much full load voltage (until they burn out or whatever?).  And that voltage would appear on the ADC (ISENSE).  The ADC inputs should have internal protection diodes, so, if you leave a 10k + 100n filter there, the 10k will limit current.  I tend to add clamp diodes there as a matter of course, just in case.  But probably not a big deal.  Easy solution for reverse, of course: add a series blocking diode.

I had exactly the same thoughts already and will incorporate circuit protection into rev c

- Note that R17, R18 must be as precise as the reference for it to all be worthwhile, and the same goes for U2a, and what's sensing ADC-IOUT.  You don't have any gain on the latter, so you'll only get about 10 bits worth of useful range on that ADC input.  Probably about as good as anything, as is, since changing ADCREF to the 0.8V scale reduces its ENOB, or amplifying IOUT back up to the 2V scale requires precision resistors and an amp.

I had already had this though also and has been suggested, I am getting about 1600 bits of resolution but certainly not 4000 like the set value. I will look at amplifying IOUT into the ADC. I will just have to ensure loop stability with the ADC input capacitance.

- Not sure what's going on with the fan... you're driving it with a DAC output, but just switching it on and off..?  You're not going to get much controllable range there, and it won't be very linear.  And, ironically enough, very temperature sensitive.

The DAC output does vary the speed quite well, no it's not the best way, but I wanted to try it. I might look at PWM controlled fan for rev C

- All those LCD bits scrambled around... is that a good idea?  Looks like it's going to be a pain.  Guessing 4 bit interface will be sufficient so who cares, but then it's like, why bother spending the space routing them?


I'm thinking about going to a tft screen controlled with SPI so this should be eliminated.

- C7, C8 won't really do anything DAC-specific unless isolated a bit from the rest of the supply rail (e.g. with a ferrite bead).  This won't matter as you aren't using high bandwidth anyway; could just as well cut them.  (On the other hand, the ADC samples its inputs relatively instantaneously, so leaving C6 is probably worthwhile.  It could be assisted with a ferrite bead in the same way, but meh?)

They are there because the datasheet advises they should be :-)

- The USB ground looks suspicious.  I suppose the MCU having its own USB ground is good, but the USB power is just carelessly merged in with the rest.  As long as the USB shield is doing its thing (which it should, being tied straight to ground), there shouldn't be much crap on either line, so there shouldn't be much reason to isolate UGND or VUSB.

Isolation is also one think I'm also looking to improve on rev C, not having any experience with it at all, thet USB and micro is basically copied directly off the Arduino Leonardo schematic.

- Everything else looks good: shouldn't be anything wrong with the ref (as long as it's suggested to use bypass caps, anyway), power (give or take the relay and fan parts), the encoder should be well debounced even if its contacts are terrible, U2a is properly compensated (whether it's optimal I have no idea, but that's easy to play around with and find out), and the MCU and LCD should be happy.  Well, may not hurt to add a reset generator / power monitor IC for global reset (supposedly the POR/BOD in ATmegas is pretty bad), but whatever.
Tim

Yay, I got something right! ;D

Thanks everyone for your help re the ADC questions and also suggested improvements. Overall I'm pretty happy with it and I have learnt A LOT, which was the purpose.

Lee
 
Need a website designed? Check out my Australian based web development business www.wigweb.com.au for affordable fixed price packages
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: ADC input resistance
« Reply #6 on: January 09, 2015, 12:09:48 pm »
Quote
I am considering replacing my lm324 with the AD8630

Be careful with that kind of swap. High speed devices should be avoided as much as possible, as they can be a nightmare to deal with from a stability point of view.
================================
https://dannyelectronics.wordpress.com/
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2254
  • Country: ca
Re: ADC input resistance
« Reply #7 on: January 09, 2015, 03:55:39 pm »
Quote
I am considering replacing my lm324 with the AD8630

Be careful with that kind of swap. High speed devices should be avoided as much as possible, as they can be a nightmare to deal with from a stability point of view.
AD8630 looks like an OK choice. Precision, high gain, low voltage, low noise, rail-to-rail, and "just" 2.5 MHz GBP. I'll stop way short of saying it is a drop-in worry-free replacement, especially given the circuit's previous tendency to oscillate.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: ADC input resistance
« Reply #8 on: January 09, 2015, 05:15:02 pm »
Quote
does an ADC have a high resistance similar to an opamp?

Generally speaking, yes. There are, however, adc modules with input impedance in the <10kohm range and they tend to be high speed adcs or adc onboard a mcu.

Quote
The reason I am asking is could I do away with buffers U2b and U2c in my dummy load schematic?

Almost definitively yes. ADC_VIN has 100n capacitor on it (C1) and ADC_IOUT has an output impedance no greater than 0.1ohm.

So you can safely do away with those buffers.

The parameter that many people seem to miss/ignore with ADCs is the input leakage current.  The typical value is very low for the MCP3204, but the maximum is +-1uA.  ADC-VIN has approximately 20k source impedance, so this is a maximum error (from leakage) of ~20mv.
 

Offline wigman27Topic starter

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
    • Wiggins Wonderful Websites
Re: ADC input resistance
« Reply #9 on: January 09, 2015, 10:48:24 pm »
Thanks again everyone, your help is very much appreciate.

My plans for rev c at this stage are,

  • Fully simulate then test the AD8360 as a replacement for the lm324, I am hoping to fully calculate the required compensation circuits properly in order to get a stable phase margin, this is quite a difficult area and if anyone has any suggestions on some good resources to learn about this I would really appreciate it.(If I can ever get the spice model to work)
  • Look at replacing the relay switch over with an OR based system, again if anyone has any examples I would really appreciate it.
  • keep the 4 op-amps, to amplify IOUT to make better use of the of the ADC resolution, also to keep buffering ADC VIN to provide a "low impedance source" and to also limit input leakage current
  • Redesign the board to better suit an enclosure, has anyone ever seen an extruded aluminium case or similar with ventilation holes?
  • Move to an SPI based TFT screen or graphic LCD for a more user friendly display.
  • Incorporate reverse polarity protection for the inputs
  • upgrade to a PWM based fan
  • improving USB isolation and better analog and digital ground planes

That's on hell of a list but hopefully I can tackle it!

Thanks again

Lee
Need a website designed? Check out my Australian based web development business www.wigweb.com.au for affordable fixed price packages
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 9944
  • Country: nz
Re: ADC input resistance
« Reply #10 on: January 09, 2015, 11:03:22 pm »
You can read a signal with 100k impedance using the ADC that expects <10k if you really want to.
Just make sure the ADC clock is as slow as you can go and don't expect to get a high bandwidth from it.
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf