# What is the Uno's maximum interupt speed? or max speed of encoder spin?

Hi Guys

Do you know how many interupts per millisecond an Arduino Uno can handle?

I am make a punching rig for my martial arts club. This current (flexible) plan is to mount a punching pad on the end of 500mm arm. Attached to the arms pivot rod will be a 2000p/r (according to data sheet) rotary encoder https://www.sparkfun.com/products/11102. I will do some maths on pulses over time to calculate peak speed and then G-Force.

My concern is this: if a fast & heavy strike will take 30ms to move the pad 45degrees (an approximate worst case senario for the arduino) that would deliver the ardiuno 8.3 (x 2 channels) interupts per millisecond.

Do you know if this is too much for the Uno to handle? If so would a bigger Arduino do a better job?

Thanks :)

Nick Gammon has a page for interrupts and speed, http://gammon.com.au/interrupts

The microcontroller on the Arduino board is capable to count pulses and determine pulse length without software interrupt.

All Arduino boards with AVR chips (a family of microcontrollers used in the Arduino boards) have the same timing. Only the Arduino Due uses a faster processor.

I did a bit more digging and found this:

"It is difficult for me to give you an exact number since it depends heavily on how much else is running on the controller. In my case I seem to get accurate counts up to about 4000 ticks per second. This is based on the controller program I use on my robot. It includes three PI loops, odometry calculations, and quite a bit of serial communication. I know this is not a very satisfying answer but it provides at least a ballpark number."

Be sure to keep the ISR routine itself as small as possible, keep your math integer or long and only use float if you see no other option. Be aware that long has more digits than float. keep the number of division minimal as they are most expensive of the simple math functions