ADC Sampling rate

ABHISHEK05
Posts: 1
Joined: Wed Mar 01, 2023 11:05 am

ADC Sampling rate

Postby ABHISHEK05 » Wed Mar 01, 2023 11:11 am

I am using ESP32­ WROOM­ 32E for a project.
For this project I am using ADC to get voltage and current sensors value via ADC.
VOLTAGE_PIN ADC1_CHANNEL_7//33
CURRENT_PIN ADC1_CHANNEL_6//34
I need to calculate RMS Voltage & Current from this.
Can someone provide me with the data how much time it takes to get one ADC value and total samples for this calculation.

User avatar
rudi ;-)
Posts: 1727
Joined: Fri Nov 13, 2015 3:25 pm

Re: ADC Sampling rate

Postby rudi ;-) » Wed Mar 08, 2023 11:28 am

ABHISHEK05 wrote:
Wed Mar 01, 2023 11:11 am
I am using ESP32­ WROOM­ 32E for a project.
For this project I am using ADC to get voltage and current sensors value via ADC.
VOLTAGE_PIN ADC1_CHANNEL_7//33
CURRENT_PIN ADC1_CHANNEL_6//34
I need to calculate RMS Voltage & Current from this.
Can someone provide me with the data how much time it takes to get one ADC value and total samples for this calculation.
The ESP32-WROOM-32E has a maximum sampling rate of 2Msps (2 Mega Samples per second) for each ADC channel. The time it takes to get one ADC value can be calculated as follows:

Time to get one ADC value = 1 / Sampling rate = 1 / 2Msps = 0.5 microseconds

To calculate the RMS voltage and current, you will need to collect multiple ADC samples over a period of time. The number of samples required depends on the frequency of the signal you are measuring and the accuracy you require for your measurement. Typically, at least one cycle of the AC waveform is needed for an accurate RMS measurement.

If you are measuring a 50Hz AC signal, for example, you would need to collect at least 100 samples (2 full cycles of the waveform, assuming a 20ms period) to get an accurate RMS measurement. The time required to collect these samples would be:

Time for sampling = Time to get one ADC value * Number of samples = 0.5 microseconds * 100 = 50 microseconds

You can adjust the number of samples based on the frequency and accuracy requirements of your specific application.


"AskRudi"
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

Craige Hales
Posts: 94
Joined: Tue Sep 07, 2021 12:07 pm

Re: ADC Sampling rate

Postby Craige Hales » Wed Mar 08, 2023 5:52 pm

see comments viewtopic.php?f=12&t=31822#p110339 about sampling rate. Above ~280K combined sample rate may not do what you expect.
Craige

Who is online

Users browsing this forum: fedekrum, greycon and 58 guests