Arduino votlmeter to measure from -20v to 20v

Hi,

I’m doing a project where I need to read voltage from -20v to 20v .I have already done a voltage divider to read the positive voltage but i don’t know how to read the negative voltage ,so please help me.
thank you

Basically you can't !!

You will need to build an op amp circuit to condition the input so it is always positive.

Have a Google for "precision regulators" to make the voltage always positive , use maybe a comparator to tell the Arduino when the input is actually negative .

hammy:
Basically you can’t !!

You can’t. Others can.

Divider formed from 22k to 0V, 22k to 5V, and 100k to the input voltage.

The junction of the three resistors will be at 2.252V with the input at 0V, and will vary
with the input x 0.0991. So +20V → 4.23V, -20V → 0.27V

The only downside to this technique is that the dividers apply an assymetrical bias to the input value, so you
need it to be low impedance (but that’s always the case for accurate measurement with a divider).