ADC Concept

Discussion in 'General Electronics Chat' started by Litch, Apr 21, 2013.

  1. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    Attached is the concept of my ADC circuit as it stands now.

    Runknown is somewhere from 10KΩ to 1MΩ. Rshunt can be anything I want, but is required to keep the input from floating when Runknown nears open circuit (and the ADC reading is all over the place).

    Now the ADC says its input impedance is 69KΩ.

    That's as far as I've got - is there any "rules of thumb" I should follow?

    I guessing, since my ADC is 69KΩ, then Rshunt should be ≈ 69KΩ so current is equally shared across Rshunt and the ADC - the voltage is parallel so that doesn't matter.

    What about calculating the value of Ruknown? How would I do that - The ADC gives a value from 0 to 4095 representing the voltage on the input pin relative to Vref: 0 = 0v, 2048 = 50% Vref, 4095 = 100% Vref, etc...

    Obviously my reading will never be 100% Vref - the maximum will probably never exceed 50% Vref (Runkown <= 69KΩ).

    Guess I just answered my own question there, but I'd still like some input (excuse the pun) on what the experienced players out there would think of...

    -KB
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    Rshunt should be much less then the ADC, 1/10th at max, less if possible.

    The input impedance is NOT a precise number, hopefully your resistors are. By scaling them that way you toss away the input R's tolerance, and I'm not guessing. :rolleyes:
     
  3. #12

    Expert

    Nov 30, 2010
    16,348
    6,836
    If the input resistance of the ADC is variable from chip to chip, that screws the accuracy, and that is the reason Rshunt should be way less than the advertised Rin.
    That number also wrecks the range of measurement for high input impedances (Runknown). This looks like a weak way to use an ADC. Better to process Runknown with analog methods, then send the result to the ADC.
     
    killivolt likes this.
  4. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    Background: Runknown will be 2 probes in soil, measuring water content by resistance, so for arguments sake, let's say I only require a reference value of "high resistance" (needs watering) and anything below that (adequate water is present)

    I realise to begin with by using the ADC this way it inhibits the accuracy of the device, because the voltage drop across Runknown will generally be 50% or more because of it's inherent high values (compared to the ADC or Rshunt).

    Please elaborate? I am a n00b when it comes to electronics, but I'm a quick learner - if you could explain some theory as to why my circuit is inefficient and then supply and example of a better one?

    -KB
     
  5. killivolt

    Active Member

    Jan 10, 2010
    372
    320
    I'm not sure how #12 would manage this?

    I found this on the net, it seems that electrolysis is developing over time, if your not reversing the voltage. It would be an issue for me, I'm lazy.

    This is worth reading...........analog fed into the arduino.

    voltage is produced with a flipflop resistance is measured by the arduino.

    http://gardenbot.org/howTo/soilMoisture/#The_local_circuit_-_simple_voltage
     
  6. #12

    Expert

    Nov 30, 2010
    16,348
    6,836
    Not a problem. I'm an old analog guy from WAY back.

    What is the supply voltage, max? What is the supply voltage to the ADC? What is the voltage measuring range for the ADC input?

    Yes, it is true that a square wave is good to measure conductivity, but if you're just going to stab some probes in the earth a few times a month, like the ones you can get retail for less than $20, DC will suffice.

    You didn't give me values before I could draw these circuits, so this will have to do.
    Here are 2 ways to do it.
     
    Last edited: Apr 21, 2013
  7. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    Now we're talkin!

    Thanks for that, but wouldn't the low gain of the OP be not-so accurate as the Op Amps generally like a higher gain that x2 ? (Read that somewhere on "ADC Rules and Theory")

    Params:
    • Vmax = 5v (Avalable before the low noise 3v3 VREG - but that defies the purpose of the low noise device - and there is noise before it!)
    • ADC Vdd = 3.3v (via said VREG)
    • ADC Vref = 3.3v (Same bus as Vdd; Vref must <= Vdd, and cannot change since the i2c is 3v3)
    • ADC Input Range = 0.0v to Vref

    Give me a bit and I'll whip up the schematic.
     
  8. WBahn

    Moderator

    Mar 31, 2012
    17,788
    4,807
    If you are only interested in two conditions, why are you using an ADC at all? Why not just a comparator circuit?
     
  9. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    I don't want to adjust a trimpot every time I need to calibrate (I can do it programmatically, to coin a word).

    Plus values will still be logged, and graphed.
     
  10. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    As promised, here's my current design.

    • Some things omitted for brevity.
    • ULN2303 is a Darlington array driving 7 relays, but the 8th unit in the array has been utilised for this relay driving the V supply to the probes (to prevent electrode decay / oxidisation) - the NPN symbol has been used to represent that.
     
  11. #12

    Expert

    Nov 30, 2010
    16,348
    6,836
    Some op amps are not stable at low gains, and some will not run on 3.3 volts. It is up to you to choose an op amp that will do these things. In this case, the Log101 by Texas Instruments needs at least 4.5 volts. Lucky you! You have 5 volts.

    We had op amps that were dead accurate at a gain of 1, in the 1970's. Don't tell me they don't make 'em that good any more:rolleyes:
    You gotta go back and figure out exactly what conditions cause an op amp to be inaccurate at low gain. (I never met that one before.)
     
  12. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    Thanks #12, a couple of questions:
    * Would running the LOG101 on the noisy 5v rail reduce it's output accuracy?
    * I have no knowledge of Op Amps, there are so many categories in the distributor web site - Precision, Low Noise, High Speed, General Purpose, High Gain, Rail to Rail, CMOS - what do I look for?
     
  13. WBahn

    Moderator

    Mar 31, 2012
    17,788
    4,807
    You might start with the datasheet for your ADC as they often have circuit ideas for different things and usually specify part numbers for thngs like opamps.
     
    Litch likes this.
  14. MrChips

    Moderator

    Oct 2, 2009
    12,451
    3,371
    I agree with killovolt. Your electrodes will become polarized if you use DC voltage.
    You need to use AC signal. I would scrap the ADC and use two I/O pins of the MCU and a capacitor between the two pins. Measure frequency instead of voltage.
     
  15. #12

    Expert

    Nov 30, 2010
    16,348
    6,836
    I agree with MrChips and killivolt. You have no right to talk about accuracy if you're going to use DC to measure conductivity. Pick one. Accuracy or DC.
     
  16. Litch

    Thread Starter Member

    Jan 25, 2013
    86
    7
    Ok lets talk range.

    When I say accuracy I mean it's not going to be +/- 20% due to power supply ripple.

    What I don't need to +/- 1% - and reasonable amount of tolerance is acceptable. 5%? 10%?

    My primary concern was if it was feasible - no point building it if I'm going to be reading garbage values.

    Also - MrChips - the measurements will be taken over 100ms every hour or two. The power to the probes is cut via relay. I doubt soil ionisation will be an issue.

    WBahn - Good idea, I'll start there.
     
  17. #12

    Expert

    Nov 30, 2010
    16,348
    6,836
    Feasible? Of course it's feasible. You can buy one in the Garden Shop of Home Depot for less than $20.

    Noisy supply? It's called PSRR, power supply rejection ratio on the amplifier chip datasheets. Usually more than 70db reduction of power supply noise. You would have to build a circuit to inject enough noise to queer the readings.

    What to look for in an op amp: runs on 5 volts or 3.3 volts, your choice, stable at a gain of one, input bias current less than 1% of the 5ua that you are inputting, input offset voltage less than 1% of the 2.5 volt input range you are inputting. If your main concern is accuracy, choose, "precision".
     
Loading...