Comments on Measuring the peak voltage of a 1 kHz PWM/square wave using ESP32 ADC without peak detector
Post
Measuring the peak voltage of a 1 kHz PWM/square wave using ESP32 ADC without peak detector
+1
−1
I need to measure the positive peak of a 1 kHz PWM/square wave using an ESP32 ADC. The waveform has variable duty cycle; the minimum positive pulse width is about 100 µs.
After scaling, the ADC input positive levels are approximately 2.2 V, 1.65 V, 0.68 V, and 0.30 V.
I only need to classify these levels, not measure with high precision. Can I sample the ADC at 20–50 kHz and take the maximum value over several PWM cycles, or should I convert the waveform to DC using a peak detector/sample-hold before the ADC?
I want to avoid unnecessary analog peak-detection hardware if firmware-based sampling is reliable enough.

1 comment thread