Sampling rate for analog input of maxi automation

Post Reply
ramhuzaini
Posts: 1
Joined: Wed Jun 19, 2019 4:52 am

Sampling rate for analog input of maxi automation

Post by ramhuzaini » Wed Jun 19, 2019 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

User avatar
Lukas
Posts: 75
Joined: Tue Dec 18, 2018 3:44 pm

Re: Sampling rate for analog input of maxi automation

Post by Lukas » Wed Jun 26, 2019 4:35 pm

Hi,

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

Code: Select all

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

Post Reply