ADC'ing higher DC voltage dilemna


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2009
    Posts
    653

    Default ADC'ing higher DC voltage dilemna

    Here's my problem...I need to monitor/track the "health" of a 9V battery (in order to make PWM adjustments as its voltage fades).

    The battery is 9V ...not good wrt a PIC IO pin

    ok, no problem let's do potential divider...and configure it so the junction voltage equals approximately the PIC's supply voltage - this means when a fresh battery is installed, I'll get the maximum ADC reading, which will get less and less as the battery fades - all is good thus far.

    Hmm...but this potential divider is going to eat current all the time ...ok, maybe not a lot, but remember this is a 9V battery...which isn't bestowed with a lot of power delicvery in the first place, so tens of microamps count! Therefore what I need is a potential divider where I can 'lift' up one of the connections at either end of the potential divider (are you following this at the back?!).. but the problem if I lift the ground end of the chain, then the pic ADC pin will float up to 9V - which might not be to good for the PIC IO Pin! (has anyone tested when a PIC faces certain death by pushing the IO pin DC levels?

    So to my question...

    What's the slickest way of ADC'ing a DC voltage some two to three times higher than the PIC supply itself *but* without incurring constant current draw?

    Can any one particular PIC pin withstand much higher voltage (I keep reading about open drain/open collectors wrt PICS...with some implication-rightly or wrongly - that such pins might be able to take higher voltage on the chin?!)

    Many thanks,
    Hank

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    Hi Hank,
    As far as I know all I/O pins have internal clamp diodes, Vss->Pin->Vdd. As long as the top end resistor of the divider is large enough to limit the current going into the pin and up thru the diode to a safe level you should be fine. Use a logic level MOSFET and "disconnect" the bottom of the divider from GND/Vss.

    If you look at the SERIN command in the PBP manual they are actually using this scheme, a 22k resistor in series with the TX-line from the PC makes it work just fine even though the TX-line toggles between something like +/-12V or there abouts.

    Give it a try.

    /Henrik.

  3. #3
    Join Date
    Aug 2011
    Posts
    412


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    I see a lot of references to using the internal clamp diodes of chips for a number of purposes.

    Those interested may want to read the following Microchip documents:
    TB3009 (http://ww1.microchip.com/downloads/e...tes/93009A.pdf)
    TB3013 (http://ww1.microchip.com/downloads/e...tes/93013a.pdf)

    And then see if they still want to recommend doing this.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    Hi,
    That's an excellent read, thank you for the links!
    As with most things the way you choose to do something may differ from time to time and recommendations changes. There are limitations to using the internal diodes, as described in those docs but, depending on the application it may still work fine.

    However, passing current thru the internal diode kind of defeats the purpose (I didn't think it thru properly). The idea was to disconnect the voltage divider from ground to lower the current consumption but if we're passing current thru the pin diode (or external diode) into Vcc we haven't gained much....ooops.

    Perhaps a second MOSFET or analog switch in series with the pin....

    /Henrik.

  5. #5
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    Hank, take a look at http://www.electricstuff.co.uk/picav...tery%20voltage

    Its precisely what you are looking for. And while there, do check out the other neat things on the home page!

    Regards,

    Anand

  6. #6
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    Quote Originally Posted by ardhuru View Post
    Hank, take a look at http://www.electricstuff.co.uk/picav...attery voltage

    Its precisely what you are looking for. And while there, do check out the other neat things on the home page!

    Regards,

    Anand
    Thanks Anand mate ....a clever low parts count solution - job done! (curious as to how long that tranny is switched on to allow an ADC sample of the potenetial divider junction voltage to take place though!)

    (thanks Henrik & tumbleweed for the input too)
    Last edited by HankMcSpank; - 26th September 2011 at 14:12.

  7. #7
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    I'm glad it worked for you. Did you actually try it out yet?

    Anand

  8. #8
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default Re: ADC'ing higher DC voltage dilemna

    No not yet....another 2-3 days before I get around to knocking up the associated circuit on breadboard - I'll report back.

Members who have read this thread : 1

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