Best way to determin "pin" state with +13.8 V


Closed Thread
Results 1 to 4 of 4
  1. #1
    JDM160's Avatar
    JDM160 Guest

    Default Best way to determin "pin" state with +13.8 V

    Hi all,

    I'm new at this game and looking to use a PIC in an automotive application. I want to have 4 input pins monitor the "state" of 4 different automotive lamps - either ~0V or +13.8V (off/on).

    How can i effectively do this with a PIC? Can I use the digital inputs and just read if they are 0 or 1? Would false triggering be a problem with the PIC? At what voltage level does a digital input read 1 on a PIC?

    I figure I have to limit the input voltage to <5V, so how can I effectively do this? I guess I can use a simple voltage divider, but then again, I'm monitoring 4 different lines, so maybe placing the ground of the PIC at +9V with a positive regulator will do the trick? This way the voltage would be only +4.8v on the input pins right?

    Thanks in advance for your input!

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


    Did you find this post helpful? Yes | No

    Default

    You can also use the digital input with a simple serie resistor. Inside the PIC, you have protection diodes. But always great to have a voltage divider.

    The false ground reference can also work. i prefer the serie resistor
    Steve

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

  3. #3
    JDM160's Avatar
    JDM160 Guest


    Did you find this post helpful? Yes | No

    Default

    Yea, I was looking into the false ground option and found that this might not work well because in the specs for the PIC I've chosen (16F684) it says not to let Vil fall below Vss. If I have Vss at +9v, then I'm going to have a problem.. (at least it reads that way to me).

    So, tell me more about this internal protection.. You saying I can have a 100k resistor (or something like that) simply inline with the pins and expose them to the full +13.8V? Nothing will happen to the chip? It says Vih max is VDD..

    ??

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


    Did you find this post helpful? Yes | No

    Default

    usually 1k-10k is safe. If you're reading from lamps, when there's no power on (and if they're not blow) the lamp resistor will be more than sufficient to provide you the low level or '0'. Also with that, if you want to monitor if a lamp is blow, you can... a little bit tricky but not impossible. BUT if you don't want to monitor if your lamp is blow and want to be sure that you'll never get any odd results, use a simple voltage divider.

    Your false ground can also work... if voltage on the pin is lower than VSS and you have a serie resistor, the internal diodes will do the job. On each input you have a diode to VDD and one to VSS. That's a really usefull feature in some application.
    Steve

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

Similar Threads

  1. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 22:27
  2. State machine programming
    By tjstevens in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 17th April 2007, 22:45
  3. Replies: 2
    Last Post: - 27th March 2007, 12:48

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