0

as I checked on Arduino website, they mentioned all boards: UNO, Nano, Mini, Mega have maximum sample rate 10kHz for each analog pin. So my concern is: 1) is there any difference between sampling rate when reading a single analog pin and multiple analog pins? For example, if we read only 1 analog input, maximum sample rate can reach 10kHz. How about maximum sample rate when we want to read 6 analog inputs? Maximum sample rate will be 10kHz or (10/6)kHz? Can we do analog input reading simultaneously or not?

2) What if I want to get sampling rate at least 1kHz for each Arduino board (assume 5 analog inputs)?

3) In case we need to connect several Arduino boards via I2C or SPI protocol, is sampling rate related to these 2 protocols?

1 Answer 1

2

1) You only have one ADC on board and all the pins run through a mux. You can only read one pin at time. If you're willing to give up some resolution then you might can read a little faster but it gets tough. What's worse is that when you are switching pins really fast it can mess with your readings so that for some things, especially when input impedance is high, you have to read twice and throw away the first reading. So that essentially cuts your sampling rate in half right there.

2) That may be doable. Or at least something close to it. You'd run in free-running mode and write a tight ISR to read the interrupt when the analog read is finished and record every other value and switch the pin every other time. Theoretically you should get pretty close to 1kHz with 5 pins. Maybe a little faster if you give up a little resolution.

3) Those communications protocols run at light speed compared to the analog read.

7
  • What if I need to get sample rate 5kHz for each analog input? Only use 1 analog pin in each Arduino board? Is there any better way?
    – Hector Ta
    Jul 15, 2019 at 6:07
  • Get an ADC chip. They make some really fast ones. That would make more sense than buying a bunch of Arduino's.
    – Delta_G
    Jul 15, 2019 at 6:57
  • Thanks. By the ways, is there any correlation between baud rate & sample rate? Can you share me a sample code how to do the sample rate settings?
    – Hector Ta
    Jul 15, 2019 at 7:03
  • Baud rate is how many bits per second a serial connection sends out. Sample rate is how many samples per second of a measurement you take. Thye are two completely different concepts.
    – Delta_G
    Jul 15, 2019 at 7:07
  • I'm sure professor google can find examples of how to run the ADC on the Arduino in free running mode.
    – Delta_G
    Jul 15, 2019 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.