Closed
Description
#4072 # Hardware:
Board: ESP32-S2 Saola
Core Installation version: esp32s2 branch lates commit
IDE name: Arduino IDE
Description:
Hi, I was trying ESP32-S2 Saola breakout board, I would read analog values. I had used a variable lab bench power supply to test the ADC, but function analogReadMilliVolts() gives values 60% higher than the right value: i.e. if I set 1V, analogReadMilliVolts returns 1.6V. This behavior is constant all over the range (from 0 to 2.5V).
I think that the problem is about the fixed 13bit width in esp32-s2 while in esp32 ranges between 9 and 12.
Am I missing something?
Temporarily, I manage to use the following line to read input voltage:
int sensorValueRaw = analogRead(analogInPin);
int sensorValue = map(sensorValueRaw, 0, 8192, 0, 2600);
No other configuration were made to the ADC.