The ESP32 Analog to Digital Converter (ADC) is not linear. We measured the value returned by the ADC and the real voltage on the pin. We compared these signal to better understand the properties of the ADC.

The following has been performed with an ESP32 FireBettle DFR0654.

We measured twice the real voltage on the ADC pin with an oscilloscope and with a multimeter.

The oscilloscope voltage is considered as the more accurate measurement since the device average a large number of measurements.
In the following, the oscilloscope voltage is considered as the *real voltage*.

The following data can also be found in this Google Sheet.

Oscilloscope Voltage [V] | Multimeter Voltage [V] | ADC Raw | ADC Voltage [V] | Error [V] |
---|---|---|---|---|

0.000 V | 0.000 V | 0 | 0.000 V | 0.000 V |

0.098 V | 0.100 V | 0 | 0.000 V | 0.098 V |

0.193 V | 0.200 V | 115 | 0.093 V | 0.100 V |

0.296 V | 0.300 V | 240 | 0.193 V | 0.103 V |

0.388 V | 0.400 V | 364 | 0.293 V | 0.095 V |

0.486 V | 0.500 V | 479 | 0.386 V | 0.100 V |

0.581 V | 0.600 V | 605 | 0.488 V | 0.093 V |

0.677 V | 0.700 V | 725 | 0.584 V | 0.093 V |

0.784 V | 0.800 V | 849 | 0.684 V | 0.100 V |

0.875 V | 0.900 V | 973 | 0.784 V | 0.091 V |

0.980 V | 1.000 V | 1103 | 0.889 V | 0.091 V |

1.070 V | 1.100 V | 1227 | 0.989 V | 0.081 V |

1.170 V | 1.200 V | 1351 | 1.089 V | 0.081 V |

1.270 V | 1.300 V | 1473 | 1.187 V | 0.083 V |

1.370 V | 1.400 V | 1602 | 1.291 V | 0.079 V |

1.470 V | 1.500 V | 1726 | 1.391 V | 0.079 V |

1.570 V | 1.600 V | 1844 | 1.486 V | 0.084 V |

1.670 V | 1.700 V | 1967 | 1.585 V | 0.085 V |

1.770 V | 1.800 V | 2093 | 1.687 V | 0.083 V |

1.880 V | 1.900 V | 2214 | 1.784 V | 0.096 V |

1.980 V | 2.000 V | 2343 | 1.888 V | 0.092 V |

2.080 V | 2.100 V | 2459 | 1.982 V | 0.098 V |

2.180 V | 2.200 V | 2586 | 2.084 V | 0.096 V |

2.270 V | 2.300 V | 2711 | 2.185 V | 0.085 V |

2.380 V | 2.400 V | 2835 | 2.285 V | 0.095 V |

2.470 V | 2.500 V | 2961 | 2.386 V | 0.084 V |

2.570 V | 2.600 V | 3115 | 2.510 V | 0.060 V |

2.680 V | 2.700 V | 3262 | 2.629 V | 0.051 V |

2.770 V | 2.800 V | 3433 | 2.767 V | 0.003 V |

2.870 V | 2.900 V | 3642 | 2.935 V | -0.065 V |

2.970 V | 3.000 V | 3872 | 3.120 V | -0.150 V |

3.070 V | 3.100 V | 4094 | 3.299 V | -0.229 V |

3.180 V | 3.200 V | 4094 | 3.299 V | -0.119 V |

3.270 V | 3.300 V | 4094 | 3.299 V | -0.029 V |

The following chart represents the real voltage (oscilloscope voltage) vs the ADC voltage:

The next chart is the error vs pin voltage (oscilloscope voltage).

If you need an accurate measurement, you have several options:

- measure only voltage between 0.2 and 2.5V and apply a linear correction ;
- measure only voltage between 0.2 and 3V and apply a non-linear correction ;
- use an external ADC (I²C or SPI external ADC).

- Built-in RGB led on an ESP32 FireBeetle DFR0654
- How to install ESP32 boards in the Aduino IDE?
- ESP32-DevKitC V4 real current consumption in deep sleep mode
- ESP32 FireBeetle DFR0478 real current consumption in deep sleep mode
- ESP32 FireBeetle DFR0654 real current consumption in deep sleep mode
- ESP32 real current consumption in deep sleep mode

Last update : 02/24/2023