A circuit to Measure Negative and positive voltage with protection against AC voltage

A simple passive resistor bipolar to unipolar circuit will convert a -20V to 20V signal to a 0 to 5V signal. If the output is 0 - 2.5V the inputs signal is -20 to 0V. If the output is 2.5 to 5V the input is 0 to 20V. For AC the Arduino cannot handle negative voltages but the output in this case will be a 0-5V sine wave. The gotcha is that if you say 20VAC and that means 20VAC RMS your peak voltage of ~28 volts would exceed the 5V and the pin input maximum and blow the arduino.

Bipolar to Unipolar

The 25K resistor is not a typical size, (although they can be obtained) is shown as one resistor in the circuit diagram but you would probably use more common resistors to obtain the 25K.

Other than that "around 20V" is not very descriptive. You need to pin down what around means to avoid exceeding the maximum pin voltage. Maybe a better description of what you are trying to do and how things like "accidentally connecting" AC happen?