Hi I was testing 2 soil humidity sensors with ESP32 DevKit and Arduino UNO. The sensor supplier told me that with 5V the value should be around 310 ~ 565, and Arduino UNO looked as expected but ESP32 DevKit got wrong. Here is the code:
Thanks for your quick reply!
I'm a software engineer who is quite familiar with code but I have almost zero concept of hardware/electricity. Is there anyway I can change the code and pinout of ESP32 to make it work like Arduino UNO?
You can specify the resolution of the ESP32 ADC to be 10 bits. But it does not work as well as the Arduino 10 bit ADC, by a long shot. For example, you cannot measure voltages less than about 0.2V with it. The red curve below
You can't change the ESP32 pinout arbitrarily, although with advanced programming techniques (accessing the HAL), some flexibility is built in.