How to convert ADC values to voltage?

Hello Dears,

My concern is about an analog value that you can read from an ADC from any microcontroller.

Example 1: If I want to read the voltage of a pin of my microcontroller, I need to create a variable that will contain a the analog value but this anlog value is not a voltage yet because I need to convert that into voltage in order to get a real value(I guess it is like that).

1st Question : How many numbers have an analog value in that case?

Example 2: An magnetic sensor that reads the speed of the motor generates a frequency signal

1st Question : How many numbers have an analog value in that case?
2nd Question : How to convert that frequency into a real speed value?

I thank you in advance.

Best regards,

An ADC converts analog signals into digital signals. If you are using an n bit ADC on an analog signal with a reference voltage (Vref), then there will be (2^n) - 1 samples. It’s like dividing the overall voltage (Vref) into (2^n) - 1 chunks. So the resolution of one sample from the chunks is given by Va = {(2^n) - 1}/Vref.

Let’s consider an example, Let’s image a sensor which generates a signal with voltage varying between 0V and 3V. So the reference voltage is 3V. In our example, we will use a 10 bit ADC to break the 3V into chunks (samples). Since we are using 10 bit ADC there will be (2^10) -1 samples, which is 1023.

Now we have broken the 3V into 1023 chunks. So what’s the voltage (resolution) of one chunk? The voltage of one chunk will be 3V/1023, which is 0.0029V. In order to get the voltage of the signal at any time, you have to multiply 0.0029 (resolution) by the sample values from the ADC.


Thanks For the good explaination