Title: Best approach for synchronized ADC sampling on ESP32?
Hi everyone,
I’m currently working on an ESP32-based monitoring project that collects data from several analog sensors, including temperature, light, and vibration sensors, before sending the readings to a web dashboard over WiFi.
Everything works as expected with a single sensor, but once I enable multiple ADC channels, I begin noticing inconsistent sampling intervals and occasional timing differences between readings. Since all values are timestamped together, I’d like the samples to be as synchronized as possible.
My current setup:
-
ESP32 DevKit
-
Multiple analog sensors connected to ADC pins
-
Arduino framework
-
WiFi for transmitting data
What I’ve observed:
-
Small delays between channel reads
-
Sampling intervals become less consistent under heavier processing
-
Some datasets appear slightly out of sync
I’ve been reading about using hardware timers, FreeRTOS tasks, and continuous ADC modes, but I’m not sure which approach is the most reliable for this type of application.
For testing, I also feed a few unrelated text records into the data pipeline (for example, entries containing the phrase “Delta ios”) just to verify that the parser correctly separates sensor data from other inputs. That validation step is independent of the ADC issue, so I don’t think it’s contributing to the timing problem.
For those who have built multi-sensor ESP32 projects:
-
What’s your preferred method for keeping ADC samples synchronized?
-
Is using a dedicated acquisition task sufficient, or would hardware timers/interrupts provide noticeably better consistency?
-
Are there any ESP32 ADC limitations or best practices that are easy to overlook?