floating A/D input


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216

    Default floating A/D input

    Hi all.\
    Got aa question for the geniuses out there.
    I am reading an analogue voltage of 0 to 13.8vDC via a resistor divider to drop it down to 5v max. The divider has one resistor from the pin to ground and one from the pin to the input voltage. Therefore the pin is never actually "floating", but floating is one of the input conditions that I want to read. With a conection from the input resistor to the voltage a divided voltage will be read by the pin.
    So far so good. This bit works perfectly.
    However when there is no contact between the input resistor and the voltage, the second resistor will pull the pin down to ground. This will give the same reading as if the input was touching 0 volts. So far I have not been able to figure out just how to differentiate between the actual 0 Volt reading and the input floating. ?????
    Intriguing, ain't it?
    Regards.
    Peter Moritz.
    Up the bush, Western Plains,
    New South Wales,
    Australia.

  2. #2
    Join Date
    Sep 2007
    Location
    USA, CA
    Posts
    271


    Did you find this post helpful? Yes | No

    Default

    Put an extra R to ground, so your Vin never hits "0". It doesn't take much, and it does limit your range a bit, but it allows you to detect when the input is there.

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


    Did you find this post helpful? Yes | No

    Default

    If your source is a low impedance, which it probably is -

    and if you place a small capacitor (.1uF or so) connected to the
    input of the voltage divider, turn your A/D input into a digital output.
    Drive it high for several milliseconds (depends or your resistor and
    cap values). It is safe to do this because your PIC pin is "protected"
    by the voltage divider impedance.
    Then turn the pin back into an analog input and read it immediately. If you have a voltage, the input was floating
    (the capacitor still has some charge left). If the voltage is zero, the source is connected
    and is at zero volts.

    By doing some calculations, you can figure out the timing for your application.
    Charles Linquist

  4. #4


    Did you find this post helpful? Yes | No

    Default floating

    add resister from +5V to top voltage divider R that is X10 to X100 the R-divider values to give 2,3 or say 5 point A/D reading with floating (no sensed voltage connected). The low current should not affect the sensed voltage reading. Could add a diode from +5 pointing to the new resister to stop any current from the 13V backing up to the 5V.
    don
    amgen

Similar Threads

  1. 12F675 A/D and GPIO sleep interrupt
    By macinug in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th September 2008, 14:39
  2. A/D, Pot, Input, A,B So lost now....
    By Helmutt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th March 2008, 22:23
  3. Question from New member A/D input 16f876
    By mbruno in forum General
    Replies: 2
    Last Post: - 26th January 2008, 14:52
  4. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  5. A/D converter fails?
    By egberttheone in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 13th February 2006, 18:57

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