Measure negative voltage with Arduino. FYI

If you ever need to measure a negative voltage with an Arduino you can use the circuit below.
If you don’t like the click, click, click, use four H11F2 opto FETs instead of the relay or an inverting opamp.

An interesting concept but you also need to fit a discharge resistor across the capacitor otherwise the capacitor will tend to read peak voltage only. You also need to consider the transient load the capacitor presents to your negative voltage as it charges up.

A rather more simple circuit (requiring only 2 resistors) is this:


I'd add a shottky protection diode to Tom's circuit in case the voltage goes more negative than planned, otherwise that looks good.

It should be noted that Rbottom must include the Z_In of the voltage source.

Assuming a battery, this would be the battery internal resistance, Rs is the Z (impedance) which is very low compared to Rbottom and can be typically excluded.

With an AC input, Z is complex and a capacitor is generally used to bypass the higher frequencies, that is, low-pass filter.

Finally, the two resistors are generally higher values to prevent "loading" the V_in, but too high (> 20K Ohm each) may not match the Atmel suggested 1OK Ohm analog input resistance.

Good news is that for most common input sources, one can use the general two resistor equations.