ADC circuit help " is this possible "


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Aug 2011
    Posts
    20

    Default ADC circuit help " is this possible "

    can the ADC in the pics test a circuit that only changes resistance in 3 ohm increments?

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    3ohm on what? Input Voltage matter, not the impedance step....How about Vref VS Vdd?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    The PIC measures voltage, not resistance. There is not enough information here to give an intelligent answer.
    Charles Linquist

  4. #4
    Join Date
    Aug 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    ok, sorry, i know it measures voltage and resistance effects voltage. so, i guess i will try to explain what im trying to convey. lol

    basically i need to test a circuit, to see if its open or closed. the item that closes the circuit is an ematch and they are only 3 ohms, and there could be multiple ematches in series or parallel, i was thinking it would be nice to be able to tell by the adc reading, how many and maybe how they are wired. i was also thinking of using just a simple ressistive voltage divider, where R2 would be the ematch and R1 would be 10k. Vdd 3.3 , Vref 3.3 maybe less. Vout would go to the adc pin. there would also be a diode in series with R1 and R2, the adc pin would connect after R1, have to shield the pic (18lf6622 ) from the 24Vdc that would also be there every now and then. When i do the math, it is a drastic change when going from R2 being 0 and R2 being 3 ohms, but a very small change when R2 changes from 3 to 6 ohms or even 9 ohms. So what im wondering is will the adc even register this small of a change?
    Attached Images Attached Images  

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    Simple answer: If full scale =0 - 3.3V, and the adc is 10 bit, LSB = 3.3/1024 = 3.22265mV. I would think you should plan for 1LSB error so you could detect ~6mV worst case. Now there are plenty of debate around here about 1024 vs 1023, but I live in 1024 world
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    Even though the A/D is 10 bits, you won't get a lot of accuracy unless you have a dedicated Vref and you average a lot of readings. You might get 9 bits of accuracy in that case.

    You can do a lot better if you amplify the signal with a rail-to-rail input / rail-to-rail output op amp.

    If you don't want to go that route, you are going to have to get a bigger voltage change than you will get with your setup. First, R1 will have to be smaller than 10K. I don't know how many "ematches" you plan to have, but 330 ohms would seem to be a good value. Of course, the resistor would have to be a 5W type. This will give you 72mA through the resistor, and .218V across 3 ohms. You will also need a 2K 1/2W resistor between the junction of R1 and R2 and the PIC input to protect it when the switches are open. That should give you enough signal to work with.
    Charles Linquist

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    Charles Are you saying it won't detect 6mV changes?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  8. #8
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    I'm saying that it won't detect 6mV changes reliably. If you can't tolerate the current draw of a smaller R1, you should use an op amp with a gain of 10 or so.
    You CAN detect 60mV changes reliably.
    Charles Linquist

  9. #9
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    I'm with charles...what made you choose 10k for the upper resistor?<br>
    <br>
    If you fed say a fixed voltage 1.024V to the top of the resistor chain, and brought R1 down top something more appropriate like 100 Ohms. (the chain would be a draw about 10mA so would need external power)<br>
    <br>
    If you then go with a PIC12lf1822...you can set its ADC poistive reference to its internal vref of 1.024V (even if it's supply is 3.3V)<br>
    <br>
    if you used 10 bits, this in theory would yield 1mV resolution (can't predict how noise will start impacting here though!) ....which ought to be sufficient.<br><br>Another idea would be to have the 3 ohm device turn on/off a mosfet, which IN TURN&nbsp;then kicKs in higher value resistors in your divider chain ...which would make the whole thing a lot easier.<br><br>Without seeing more details, I'm not sure ADC is the solution ....can you ground these 3 ohm devices so they could for example&nbsp;pull a PIC IO pin down to ground - this would be a far more robust method of establishing which device is on or off....simply&nbsp;use an&nbsp;IOC interrupt.<br><br>
    Last edited by HankMcSpank; - 28th September 2011 at 09:33.

  10. #10
    Join Date
    Aug 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: ADC circuit help " is this possible "

    well, i picked the 10k for a couples reasons -

    1. i wanted the least amount of current going thru the circuit, there is 10 different circuits that will be tested. Also the device will be powered by a 4 AA battery pack most of the time.

    2. you can only put so much current thru an E-match before you have a violent reaction, , NFPA 1123 regulates me to 30ma.
    But 30ma will kill some AA batts pretty quick.

    I was thinking about using a 1k, but then i would want the device to be able to have some way of connecting each circuit one at a time for test and then grounding it while it's not tested, i was thinking of using a shift reg, or maybe even using 10 pins on the pic. I was thinking that this would help with not wasting battery power and maybe even keep th RF interference down from the MRF89XAM9A-I/RM transceiver.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts