Binary to Decimal from ADC


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Posts
    93


    Did you find this post helpful? Yes | No

    Wink

    That worked great

    can you suggest a voltage divider schematic for using a range of 12 - 15v knocking it down to the 0-5v needed by the pic? I dont think im doing it right...when i multiply the voltage dividers output by 3 it doesnt equal my source input level ( currently from adjustable power, but eventually will be 12v battery)

    Thanks for any additional suggestions.. :

    would the solution mentioned here: http://www.picbasic.co.uk/forum/show...oltage+divider be suitable?
    Last edited by RYTECH; - 16th July 2005 at 06:48.

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


    Did you find this post helpful? Yes | No

    Default Resistor Potential Divider

    Consider the appended drawing.

    Assuming a 3:1 ratio (ratio determined by R1+R2:R2), Resistor R1 has to drop 2 volts for every one volt appearing across R2. So, if we have 15v input, R1 has to drop 10v across it for R2 to drop 5v. Apply the same ratio for your Resistor Values... if we have 10K for R2, we will need 20K for R1.

    The voltage the PIC will see will be Vin/(R1+R2)*R2... so if we have... R1=22K, R2=10K and Vin=12, we get...

    12/(22000+10000)*10000 and the PIC sees 3.75v

    10K is a good value for R2. Choose R1 so that the PIC never gets more than Vdd (most probably 5v) at the maximum possible applied input voltage to the divider.
    Attached Images Attached Images  

  3. #3
    vastator's Avatar
    vastator Guest


    Did you find this post helpful? Yes | No

    Default info about dec dig and dec3 ?

    Where can I find information on dec dig and dec3 modifiers? I searched through the PBP manual but came up empty.

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


    Did you find this post helpful? Yes | No

    Default

    DIG is explained in the Math Operators section. DEC is a data modifier, and
    is shown in sections of the manual for PBP commands that allow data modifiers like LCDOUT, SEROUT2, HSEROUT, etc,,.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Convert long binary number to ASCII Decimal
    By Joe Rocci in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th July 2009, 13:58
  2. Binary Coded Decimal
    By -Dan- in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 25th May 2009, 09:23
  3. How to convert binary to decimal?
    By Cabomba in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th October 2007, 01:27
  4. Decimal to Binary Conversion
    By schlaray in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2006, 14:58
  5. Decimal to binary conversion
    By Demon in forum Code Examples
    Replies: 9
    Last Post: - 25th February 2005, 20:05

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