Highest Possible Sampling Rate for Grove EMG

Hello,
I am using the Grove EMG detector with a Grove shield and Arduino Mega, and my code is based on https://www.seeedstudio.com/blog/2019/12/29/what-is-emg-sensor-myoware-and-how-to-use-with-arduino/.
I would like to reach a 1kHz sampling rate, however, each run of the getAnalog function requires over 3ms. Any idea how to speed things up?
Thank you

Upgrade to XIAO

The sale is still on!

ADC

You should be able to call something like the following for max speed of the ADC:
ADCSRA = (0 << ADPS2) | (0 << ADPS1) | (0 << ADPS0);

This sets the ADC prescaler value to the lowest value, you can adjust using the info in the chart above.

3 Likes