How i ken read 7.2v with pic


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133

    Exclamation How i ken read 7.2v with pic

    I need help to divider the 7.2v to read with pic ..

    + 7.2v -----------R2 = ?k
    |
    | R1= ?k
    ---
    -
    Some Help or Idea
    Thanks all for the Help..

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    <table><tr><td valign=top>That thread shows how to calculate the voltage once you know the resistor values. But, as I read the question again, apparently you are looking for the resistor values themselves.

    First, determine the Maximum voltage that you will need to read. If you want to read 7.2 volts, then you should be prepared to read higher than that. Let's say 7.5 is the max (up to you though).

    Vin = 7.5 <-- max Input to voltage divider
    Vout = 5 <-- max Output voltage to pic

    Using your best educated guess, choose a value for R1. Say, 2700 ohms.

    R2 = R1/(1-(Vout/Vin))-R1
    R2 = 2700/(1-(5/7.5))-2700
    R2 = 5400 ohms

    Use the closest Standard Value 5.6K

    Then to do the reverse, just plug those resistor values into the formulas in the other thread.
    http://www.picbasic.co.uk/forum/showthread.php?t=541</td><td valign=middle></td></tr></table>
    HTH,
    &nbsp; Darrel

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Actually, I'd like to add a little here... sure use the formulas as given, but for a PIC input I like to ensure that R2 is at least 10K (optimal for an ADC)... or even higher, otherwise the current flow through the Resistor chain is excessive, especially important if you are going to use it as a Battery Low indicator.

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Interesting,

    I was purposely trying to keep it Under 10K to stay within the "maximum recommended impedance for analog sources".

    I can see the advantage with a battery application, but would you also need to increase ADC_SAMPLEUS?
    Or is it OK as long as R1 stays below 10K?
    <br>
    DT

  6. #6
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    I use this concept in many of my designs, and with "R1" being equal or below 10k I have never seen any problem at all.
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    For most PICs the recommended maximum input impedance is 10K... although it does vary (example 12F675 it's 2.5K). I've actually used the 12F675 with the same 10K input circuitry I use with a 16F876 and the same default 50uS settling time without problems. I don't use ADCIN but prefer to set and poll the GO/DONE bit for a completed conversion. Like with all things, it's a case of try it and see, and if it works for you - use it. For Battery-Low applications with Comparator Inputs, I've had 470K/220K R1/R2 combinations before now just to keep the current down.

  8. #8
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Great, thanks you two!

    Well, I've learned my 1 thing for today. I guess I can take the rest of the day off.

    But before I do that, let's see if we can finish off jetpr's question.

    Assuming now that R1 can always be 10K (or 2.5K), we can forget about the guessing part and just calculate R2 with the same formula.

    Vin = 7.5 <-- max Input to voltage divider
    Vout = 5 <-- max Output voltage to pic
    R1 = 10000

    R2 = R1/(1-(Vout/Vin))-R1
    R2 = 10000/(1-(5/7.5))-10000
    R2 = 20000 ohms

    Hmmm, Nice round numbers too.

    <br>
    Last edited by Darrel Taylor; - 23rd February 2006 at 01:10. Reason: 2.5K
    DT

  9. #9
    serandre's Avatar
    serandre Guest


    Did you find this post helpful? Yes | No

    Default

    Hi,

    I need to read a car battery, it ranges from 10v to 14.8v. In my circuit i have used a zener 10v to drop the voltage to 0-4.8v.

    Should i modify it to use voltage divider (10K/5K) instead ?

    Sorry eletronic is just a hobby to me, just learning :-)

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


    Did you find this post helpful? Yes | No

    Default

    You should use the voltage divider with simple resistor... also add a 10-100nF at the PIC a/d input to smooth the results. It's amazing how much noise you can remove. Also, doing multiple reading then average them to avoid odd results it's just a better practice in, at least, car application.
    Steve

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

  11. #11
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by serandre
    Hi,

    I need to read a car battery, ...i have used a zener 10v to drop the voltage to 0-4.8v.

    Should i modify it to use voltage divider (10K/5K) instead ?

    Sorry eletronic is just a hobby to me, just learning :-)
    Hi, Serandre

    Your Zener idea is not so bad ... but zener voltage is not stable with temp .!!! so, your measurement will be somewhat false ( in a car temp is not so constant ...).

    There would be a simple solution : use a cheap TL431 trimmable "zener" instead of the diode. see TL431 datasheet for that.

    http://pdf1.alldatasheet.com/datashe...OLA/TL431.html

    Alain
    Last edited by Acetronics2; - 18th June 2006 at 09:46.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. How to read PIC serial no. from EEPROM with PBP?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th December 2009, 10:27
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. Help GPS read with serin
    By leinske in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 5th September 2007, 02:33
  4. Changing declared variables names on the fly
    By jessey in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 16th December 2006, 06:34
  5. Controlling power to a PIC with another PIC
    By jswayze in forum Off Topic
    Replies: 3
    Last Post: - 28th May 2005, 19:44

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