Activity Forums Questions & Troubleshooting Software & Firmware Sampling rate for analog input of maxi automation

  • Sampling rate for analog input of maxi automation

     Lukas updated 5 years, 6 months ago 2 Members · 2 Posts
  • ramhuzaini

    Member
    June 19, 2019 at 4:58 am

    Hi,

    I would like to ask what is the maximum sampling rate of controllino maxi automation for its analog input channel

    best regards

    Ramhuzaini

  • Lukas

    Member
    June 26, 2019 at 4:35 pm

    Hi,

    based on my simple test – just calling analogRead in a loop, you can reach something like 8 kHz.

    Code:

    void loop() {
    // print the results to the Serial Monitor:
    Serial.print(“Millis before:”);
    Serial.println(millis());

    for (int i = 0; i < 1000; i++)
    {
    // read the analog in value:
    sensorValue = analogRead(analogInPin);
    }

    // print the results to the Serial Monitor:
    Serial.print("Millis after:");
    Serial.println(millis());

    }

    If you need to be faster, you have to write your own solution to control the Analog to Digital Converter – please see the ATmega2560 datasheet for more details. ATmega2560 is running at 16 MHz in the CONTROLLINO MAXI Automation.

    Best regards,

    Lukas

Viewing 1 - 2 of 2 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now