Voltage Clamp for ADC pins (again)

Discussion in 'General Electronics Chat' started by Metalfan1185, Aug 8, 2015.

  1. Metalfan1185

    Thread Starter Active Member

    Sep 12, 2008
    Ok so i have found several posts about protecting adc pins from over/undervoltage and such is my issue here. My case is a bit different.

    I would like to use an arduino essentially as a voltmeter/ to monitor voltage. From what i have researched online i have found 3 possible solutions.

    1) voltage clamp shottkey diodes with current limiting resistors.
    2) op amp circuit with a MOSFET in the feedback that reduces the gain as the input voltage passes the upper extreme for the ADC pin (5v max).
    3) Zener diodes which have little effect on accuracy but seem a bit sloppy with the breakdown voltage curve and "standard" values seem to be slightly out of my range.

    I read the first things are to assess the inputs. I would like to have different selectable scales say 0-2.5v, 0-5v, 0-10v, 0-20v, 0-100v, and if possible 0-200V. The math for these conversions is already taken care of in code. I have a 11 position rotary switch to select this, or possibly rotate though the scales using a pushbutton and some code maybe? Is it safe to assume i need a separate resistor/shottkey diode setup for each scale? I have some 10k 10 turn trimmer pots that i could use as dividers before the shottkey diodes. Current isnt really a big thing here i just need enough to get the voltage through.

    Now we all know how important it is that the ADC pins do not exceed the +5v. (I believe that the datasheet on arduinos say it may exceed this by just a hair but its not much 100mV if I remember correctly). If you guys would be so kind I would like some input as to how to go about this. Im pretty sure that at the cost of some accuracy i can map the ADC value (or maybe it was to change the Analog reference voltage? Ill have to go back and check) but im pretty sure this means instead of having 0-5v translate to 0-1023 adc, I can change it so that maybe 0-4.75v would be 0-1023 adc. I dont know if that is of use to what im trying to apply here it seems like its heading in the opposite direction.

    Any thoughts?

    ***Not so relevant info:
    The arduino is also connected to a T6963c controlled GLCD and it displays the voltage and plots a line similar to a oscope (just much much slower). It has a variable speed, records peak voltage, and will soon have a button to pause and im working on possibly adding some serial goodies to make it talk to a PC. but im getting ahead of myself here lol. This is not for anything important its more me trying to build something that is a useful tool for me for monitoring voltage and get some use out of these cool little arduinos hahaha. I also own a Due which has 0-3.3V max ADC ins with a 10bit resolution (0-4096) which would prove more accurate but more strict protection is required. So thats also possibly of use.
  2. Reloadron

    Active Member

    Jan 15, 2015
    I noticed this post early this morning and assumed there would be a dozen replies? Crickets chirping.... :)

    Personally rather than getting fancy with active components I would just go with a zener diode and be done with the input protection. Design yourself an attenuation network, taking the ADC input impedance into consideration, much as found on the front end of a DMM. I have seen a few examples of an Arduino uC used as a DMM and many did not even bother with input over voltage protection, those that did seemed content with a zener diode for the task. A Google of Arduino Digital Voltmeter will bring up many examples.

    Just My Take....
  3. dl324

    Distinguished Member

    Mar 30, 2015
    Since no Arduino experts have weighed in, I'll offer my 2 cents...

    • I'm surprised the input doesn't have protection if it's that sensitive.
    • A schottky diode can't clamp to 0.1V, some can get close but you make it seem like 100mV is the max tolerated.
    • Zener diode won't work. Any that will protect from 5.1V will affect readings long before that.
    • Series resistor might work (I don't know what needs protection) if you can tolerate reduced accuracy.
    My suggestion is to use a voltage follower as a buffer between the voltage being monitored and the Arduino input. Use a comparator to clamp the opamp output to ground when input exceeds 5V.