How fast can "Arduino Due" read the inputs?

Hi guys,
I am a mechanical engineer and not so familiar with this kind of devices. But I want to use an “Arduino Due” for a test bench. To measure a revolution speed, I want to use an incremental sensor.

http://www.distrelec.ch/de/Drehgeber,-inkremental-5-VDC-100-Hengstler-RI32-O-100AR-11KB/p/13759663

My question is: How many impulses can the “Arduino Due” read per second? Or how many I/O-reading-writing-cycles? Is 100 impulses per second realistic?
In case that it depends on the program/code size: It shouldn’t be very big one. I just want to read 2 digital inputs from the incremental sensors / 2 analogical inputs for a torque sensor / 2 analogical outputs to control a breaking system + PID regulation function + measuring data transfer to computer.

Hello and welcome,

matbu:
Is 100 impulses per second realistic?

It's most likely much faster than that :wink:

I mean, even a 16Mhz Arduino can read analog inputs at ~10Khz

ok thanks :slight_smile:
So I guess I will not have any troubles with the input reading speed. But is there an easy way to estimate the number of reading cycles? I am designing this test bench for my bachelor thesis and I need some kind of proof.

The easy way is try it and see.
Make a note of the time with millis, then do 10000 digital read operations and then see how much the time has advanced. Print it out.

I think that you can estimate by using the same formula used in this post (but replace with values of the Due): Faster Analog Read? - #3 by jmknapp - Frequently-Asked Questions - Arduino Forum

matbu:
My question is: How many impulses can the “Arduino Due” read per second? Or how many I/O-reading-writing-cycles? Is 100 impulses per second realistic?

An Arduino Uno can do millions. The Due should be able to do even more than that.

matbu:
ok thanks :slight_smile:
So I guess I will not have any troubles with the input reading speed. But is there an easy way to estimate the number of reading cycles? I am designing this test bench for my bachelor thesis and I need some kind of proof.

I suggest you spend some time with the data sheet for the ARM chip on the Due. A thesis typically requires a more analytical approach than just "I measured it.". The data sheet will provide you with the clock cycles required by every operation. Just determine what operations (assembly not C) your task requires, then do some basic math.

You can use the Arduino to generate an assembly listing of your C++ code, which is what you would use to provide the list of operations.

The basic instruction rate of the Due is 84 MIPS, so handling 100 events a second isn't
even remotely an issue.

However you probably should use interrupts to read an encoder, then you can do other
stuff without losing encoder pulses.

Check the Due library thread for encoder libraries that may have been ported?

matbu:
Hi guys,
I am a mechanical engineer and not so familiar with this kind of devices. But I want to use an “Arduino Due” for a test bench. To measure a revolution speed, I want to use an incremental sensor.

http://www.distrelec.ch/de/Drehgeber,-inkremental-5-VDC-100-Hengstler-RI32-O-100AR-11KB/p/13759663

My question is: How many impulses can the “Arduino Due” read per second? Or how many I/O-reading-writing-cycles? Is 100 impulses per second realistic?
In case that it depends on the program/code size: It shouldn’t be very big one. I just want to read 2 digital inputs from the incremental sensors / 2 analogical inputs for a torque sensor / 2 analogical outputs to control a breaking system + PID regulation function + measuring data transfer to computer.

Be aware of voltages when using the Arduino Due - it can't handle 5V DC devices without some form of level shifting - Due runs at 3.3V anything more can potentially (likely) damage it.