• AVR Freaks

Hot!ADC protection for PIC microchip

Author
georges
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2018/01/29 08:33:36
  • Location: 0
  • Status: offline
2019/12/03 07:46:43 (permalink)
0

ADC protection for PIC microchip

I need to protect the ADC pin of my PIC18F27K40 from over-voltage and reverse voltage for a 0-10V input measurement.
After searching the web, I found the following attached solution.
 
When testing with the following PIC configuration for PIN RB0: WPUB0=0 TRISB0=1 ANSELB0=1 D1 = D2 = Zener Diode 3.6V 1N4729A. I have Vrb0 between 1.4 and 1.5 V for Vin between 0 and 1.5 V.
When I take away the 2 diodes, the RB0 voltage works fine.
Can you please help me ? Am I missing something ?

Attached Image(s)

#1

10 Replies Related Threads

    BMD
    Super Member
    • Total Posts : 434
    • Reward points : 0
    • Joined: 2003/12/02 21:42:52
    • Location: UK
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 09:09:39 (permalink)
    +1 (1)
    Hi,
     
    Replace the diodes with ordinary signal diodes. (thats what the symbol indicates NOT zener diodes)

    Regards

    Brandon
    #2
    1and0
    Access is Denied
    • Total Posts : 10005
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 09:22:13 (permalink)
    0
    georges
    I need to protect the ADC pin of my PIC18F27K40 from over-voltage and reverse voltage for a 0-10V input measurement.
    After searching the web, I found the following attached solution.
     
    When testing with the following PIC configuration for PIN RB0: WPUB0=0 TRISB0=1 ANSELB0=1 D1 = D2 = Zener Diode 3.6V 1N4729A. I have Vrb0 between 1.4 and 1.5 V for Vin between 0 and 1.5 V.
    When I take away the 2 diodes, the RB0 voltage works fine.
    Can you please help me ? Am I missing something ?

    As said, the symbol in that drawing is NOT zener diode. Anyway, when using zener diode, remove the top diode D1 and it will clamp the voltage within about -0.7V to Vz, where Vz is the zener voltage.
     
    Or, replace both diodes with germanium diodes or Schottky diodes to clamp the voltage within about -Vf to Vdd+Vf, where Vf is the forward voltage of the diode. Germanium diodes have Vf ~0.3V and Schottky diodes have Vf ~0.2V.
     
    post edited by 1and0 - 2019/12/03 09:27:59
    #3
    oliverb
    Super Member
    • Total Posts : 245
    • Reward points : 0
    • Joined: 2009/02/16 13:12:38
    • Location: 0
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 09:22:39 (permalink)
    0
    They might be meant to be schottky types, with a Vf much lower than the internal protection diodes.
     
    Also be aware of what you are protecting against, you're unlikely to get anywhere near destructive currents with 20K in series, but what you are likely to see is analogue functions misreading on ALL channels if the supply range is exceeded on a pin.
     
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 18061
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: ADC protection for PIC microchip 2019/12/03 11:10:59 (permalink)
    0
    Zener diodes can be leaky at low currents.
    This can cause non-linearity at the top end.
    Your 20K series will probably be too high without some additional capacitance.
    #5
    sborden
    Super Member
    • Total Posts : 1958
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 14:29:03 (permalink)
    0
    From the data sheet:
     
    3. The maximum recommended impedance for analog sources is 10 kΩ. This is required to meet the pin leakage specification.

     
    See figure "Figure 31-4. Analog Input Model"
     
    That 30K bridge will not work.
     
    You do not have to worry about negative polarity protection on the input unless you have an actual negative signal.
     
    To make your life easier, change that 500-Ohm resistor to a value that better suits your input range. Unless you expect a 10V signal, you do not need that bridge. A 150 Ohm resistor instead of 500 Ohm gets you down to 3V. Then use a 5.1K resistor in series to the input to limit any current. A TVS diode on the input side of the 5.1K resistor, such as a SP4020-01FTG-C, should protect from over voltage and reverse voltage. The 5.1K resistor will limit the current to the pin from exceeding 5mA, which should be OK for the PIC protection diodes. Place a capacitor on the PIC side of the 5.1K resistor, value depending on your ADC sampling speed. The 5.1K can be increased if you want, just keep less that 10K.
     
     
    #6
    1and0
    Access is Denied
    • Total Posts : 10005
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 15:21:09 (permalink)
    +2 (2)
    sborden
    From the data sheet:
    3. The maximum recommended impedance for analog sources is 10 kΩ. This is required to meet the pin leakage specification.

     
    See figure "Figure 31-4. Analog Input Model"
     
    That 30K bridge will not work.

    That 30K bridge has a Thevenin impedance of 6.67 kΩ, well under 10 kΩ.
    #7
    sborden
    Super Member
    • Total Posts : 1958
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 17:37:46 (permalink)
    0

    That 30K bridge has a Thevenin impedance of 6.67 kΩ, well under 10 kΩ.



    Fine and dandy. Problem is, there is only 20mA of current available. That bridge drops current, causing errors, which are compounded by the pin leakage current, sucking out what little current flows through the ladder. The value for 4-20mA should be 2.0 ~ 10.0V. With the ladder, it will only measure 1.97 ~ 9.84V. This will be compounded at the ladder output after scaling by the leakage current since the current through the 2x10K resistors is very small.
     

    Attached Image(s)

    #8
    PStechPaul
    Super Member
    • Total Posts : 2447
    • Reward points : 0
    • Joined: 2006/06/27 16:11:32
    • Location: Cockeysville, MD, USA
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/03 21:49:17 (permalink)
    0
    I don't see any indication that the OP is measuring a 4-20 mA signal, although the 500 ohm resistor in "current mode" could be a clue. The specification is 0-10 VDC. The 1.5% error introduced by the voltage divider impedance can be easily corrected by choosing a 508 ohm sampling resistor. If greater accuracy is required, standard 1% resistors will be insufficient, so either 1/4% or 0.1% resistors will be needed, or a calibration means must be provided, either hardware or software. Then there is also the issue of the voltage reference - most voltage regulators for Vdd are 2% or even 5%.

     
    #9
    sborden
    Super Member
    • Total Posts : 1958
    • Reward points : 0
    • Joined: 2010/08/05 02:12:53
    • Location: 0
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/04 10:21:49 (permalink)
    +1 (1)
    wink: wink Yeah. Gotta consider the application. No need for perfection. 508 Ohm should get close enough. As others have said, use of low-leakage diodes is critical. Temperature also needs to be considered for the diodes, as the leakage current can vary drastically with temp. NKurzman also mentioned capacitors, which should be there, especially for high-speed measurements.
    #10
    1and0
    Access is Denied
    • Total Posts : 10005
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: ADC protection for PIC microchip 2019/12/04 20:48:01 (permalink)
    +1 (1)
    I think OP found that drawing on the internet, and I don't think he's using the 500 ohm resistor. ;)  If the input is really within 0-10V then there is no need for the diodes at all. I also agree adding a capacitor across the lower resistor R4.
    #11
    Jump to:
    © 2019 APG vNext Commercial Version 4.5