# Thread: A/D Voltage, write the value on a serial port

1. ## A/D Voltage, write the value on a serial port

Hi,
I'm new here, so I hope that I've choosen the right thread for my problem. English isn't my mother-language, but I hope you'll understand what i want to explain.

I have a Voltage Range from -10V up to +10V, which I transform to a voltage Range 0V to 5V, with the schematic i've attached, so I can use the A/D converter of my ATMEGA32 processor.

Now I'd like to write the value of the Input Voltage (which moves in the Range of -10V to + 10V) on the serial port, but i don't know how i should calculate this factor. At the moment, I can only write the value of the A/D Converter Input on the serial, but this is only 0V to 5V...
Can somebody help?

2. If your ADC has 1024 steps, and you're working with a range of 20 volts (10V - -10V), you're looking at a resolution of:

20V / 1024 = 19.5mV per step of your input voltage (not the transformed input to the ADC).

So if you multiply the reading by 0.0195 (volts), you have the voltage - but for the range of 0V - 20V.

Then you just subtract 10 from this result to get the "actual" voltage.

3. It works now, like I want. Many thanks to ya, Matticus!