Will it flood the ESP to poll ADC every ms?

I have this code:

  - platform: adc
    pin: GPIO34
    name: "CD-spiller"
    id: "cd_motor"
    update_interval: 5ms
    attenuation: 11db
    internal: true
    filters:
      - sliding_window_moving_average:
          window_size: 10
          send_every: 10
          send_first_at: 10

But I wonder if it will create a problem polling as often as every 5 ms? Or doesn’t it matter? Could I even go to 1 ms without problems? I need to capture changes in this as fast as I possibly can, so I won’t slow down the script that’s dependant on it.

From espressif.com:

1 Like

https://docs.espressif.com/projects/esp-faq/en/latest/software-framework/peripherals/adc.html

Thanks! So if I understand that correcly (which I didn’t when I read it, mhz doesn’t tell me anything…) does that mean 1 ms samples for ADC works? That’s 1000 times per second with wifi, right? But is this when there’s only one thing running on it? I have several relays and other sensors on the same ESP32.

Not 100% sure, but probably mentioned 16 ms is a minimum time…

1 Like

Ok, thanks a lot! :+1:

There’s also a loop_time: sensor as part of the debug component which may be of some use during testing.

I understand there are lot of things going on “behind curtains” but 16ms is a lifetime to microcontroller…

10 ms seems to work very well, and it does what I need it to. So I’m going for that, thanks all for your input! :+1: