I was sent over from the Adafruit forum, since this question seems to concern the chip, not the board. See the original thread here.
I've got an Adafruit HUZZAH32 ESP32 feather board connected to my PC via USB and I'm trying to read from a voltage divider at ADC1 channel 0, powered by the 3V pin. For troubleshooting, I'm using two regular metal-film resistors to be sure the values don't change. What I'm doing in Arduino code is quite straightforward:
Code: Select all
#include <Arduino.h>
void setup()
{
Serial.begin( 115200 );
}
void loop()
{
int raw = analogRead( A0 );
Serial.println( raw );
delay( 10 );
}
Here's a plot of what the values look like over a period of 60 seconds: I realize the ADC of the ESP32 is not perfect and I can furthermore reduce noise by supersampling, but jitter like this is too much to handle. I tried putting the board into a shielded enclosure, that didn't help. I tried with an external constant voltage source, also didn't help. I measured with an Oscilloscope and it turns out the periodic noise is not present at A0, it seems to come from something inside of the board or chip. I tried different channels of both ADCs, also tried different HUZZAZ32 boards to exclude the possibility of broken HW, it's the same on all boards.
Any ideas where this may be coming from and how to get rid of it? Did I forget to disable something, that's turned on by default? Just like the Adafruit forum moderator, I suspected that something is going on in the background that I'm not aware of, e.g. Wifi periodically scanning or what not.