Protected Analog Input

During the development of one light controller (more on this later) I had a requirement for two analog inputs that would allow connection of external LDRs to enable operation only in low light conditions. Normally you would just use a basic voltage divider with an LDR going to supply voltage and feed the output directly to an ADC. But since this particular LDR was supposed to be connected via long cable I wanted to have a robust analog input that would survive any transients and/or crazy connections that might occur during installation and normal operation.

Basic analog input schematic

This is not it. This is the basic circuit that will be used as a starting point: a voltage divider with a non-inverting unity gain amplifier as an input buffer. It works as a universal 0-5V analog input and can be easily expanded to 0-10V using a different value for resistor R2 (see notes below). Another advantage of R2 is that it provides a known reference when nothing is connected to the input so you can also detect broken wire conditions for resistive sensors.

When you connect any source to this input using a long cable you will inevitably get some noise as a bonus. If this input is hooked up to a microcontroller it can be filtered out in the firmware but I don’t like it, especially when the problem can be fixed with a single cheap component – a capacitor. Adding a capacitor in parallel with R2 forms an RC low-pass filter (R1/C1) that attenuates high frequency noise. Now to take care of transients and overvoltage conditions. Transient protection is typically implemented using a TVS diode to clamp high voltage spikes and I have done the same thing here. Overvoltage protection is handled by a Zener diode. Alternative solution would be to use two diodes from an input pin to VDD/GND but my PCB space was a bit limited so I chose the Zener instead (I also don’t like the idea of shunting excess current into the power rail). Here is the final schematic:

Protected analog input schematic

It’s not a revolutionary design but rather a reliable one that works well. I have used unprotected analog inputs numerous times and never had any problems but since this product was inteded for an end user I couldn’t risk the possibility of product failure or damage due to the missing input protection.


A few notes about this circuit. Read them, they might help you. Or don’t. Up to you.

  • With the values shown the cut-off frequency is around 160Hz meaning that any frequency above 160Hz will be attenuated. Perfectly suited for slow-changing signals such as light level, temperature, etc. Capacitor value is not critical and you can use any value from 1nF to 1uF depending on your bandwidth requirements.
  • Because of the low input current requirements any Zener diode with a 3.3-5.1V rating will do. Since the Zener diode adds some capacitance to the input (around 200pF for 5.1V Zener; check the diode’s datasheet for exact values), you can remove the capacitor completely in some cases.
  • If you want to use this circuit for 0-10V input signal, replace R2 with a 3.3k resistor.
  • If you want to use it for 0-20mA current measurement, place a 250R resistor from input to ground (before R1).


Schematic in PDF:
Arc’s Circuits – Protected Analog Input

Leave a Reply

  • 2014: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
  • 2013: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
  • 2010: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec