Limit input voltage to microcontroller pins

Discussion in 'Embedded Systems and Microcontrollers' started by ecka333, Oct 18, 2011.

  1. ecka333

    Thread Starter Active Member

    Oct 1, 2009
    76
    0
    I am trying to measure voltage with PIC18F1320 microcontroller. Power supply to MCU is 5V. Measured voltage will be applied to analog microcontroller input (ADC) and in normal case will not exceed 5V. But in sometimes it can rise to 10V. I think it can be dangerous to my MCU. So i want to limit input voltage to, say 5V maximum. So i want to do voltage limiter with zener diode. What zener should i choose, and how choose series resistance? Zener must do no influence to my measurement results, while input voltage will not reach 4 or 4,5V.
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I have some ideas on this. But I do not have the time right now. If any have not pitched in(feel free) I will look at this as soon as I can
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    How stiff is the source? What kind of input protection diodes can you guarantee on that input pin?

    The simplest way is to just add 1-5K in series with the point. When the input jumps to 10V you only get 1-5mA into the protection diode.

    If you don't like using that ESD diode (or can't guarantee is is actually there) you always have the option of using a schottky diode from pin to power, but I didn't bother even when my input was literally the hot AC line input (kids don't try this at home).

    I had 500K in series and got a line crossing synch signal.

    The zener can influence the reading at the high end (starts getting leaky), or can miss the start of the overage, meaning say 5.5V still gets to the pin.
     
    ecka333 likes this.
  4. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    Put a 1k resistor in series with the a2d input.
     
  5. ecka333

    Thread Starter Active Member

    Oct 1, 2009
    76
    0
    Ok, thank you all for answers. I decided to use following schematics:
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    Belt and suspenders. That works. :D
     
Loading...