Go Down

Topic: {Answered} Precision of digital inputs of Arduino Uno (Read 100 times) previous topic - next topic

matthewadkinsee

Sep 20, 2016, 04:46 pm Last Edit: Sep 23, 2016, 02:16 pm by matthewadkinsee
I am looking to use an encoder (such as something from https://ecatalog.dynapar.com/ecatalog/incremental-encoders/en/flt=1111/Optical)  and have an Arduino Uno (or other if suggested for better performance) process the data which my c# program will then poll for.  What I am wondering is "What is the precision of an Arduino Uno's digital inputs"?  In other words, will the digital inputs handle 1000 pulses/sec, 100 pulses/sec, 10 pulses/sec???  Obviously the more the merrier.

I have contacted Arduino support and they didn't have anything in way of a datasheet, so I can understand if no one out there can give me exacts, but at this point I'll take personal experiences over nothing at all.

As stated above, if the Uno isn't the best option then I will take suggestions.

p.s. If you could also tell me which encoder you use/recommend that would also be appreciated.

Thank you.

CrossRoads

Inputs can be read really quickly - 1000 pulses per second is change in level (for a square wave) every 500uS. 2000 clock cycles at 16 MHz. It takes a couple microseconds to process an interrupt, say 8 uS, so a rate 50-60x that could be managed even (depending on what your code does of course).
The Atmega328P or whatever microcontroller datasheet  that you are using is what you need to review.
http://www.atmel.com/products/microcontrollers/avr/megaAVR.aspx
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

cattledog

Quote
In other words, will the digital inputs handle 1000 pulses/sec, 100 pulses/sec, 10 pulses/sec???  Obviously the more the merrier.
I have been able to benchmark quadrature encoder reading with a 16MHz Arduino Uno at around 95K counts per second. The program is not doing anything else except processing the interrupts from the encoder.

To get faster than that you will need external hardware or a faster processor.

What is your application?

matthewadkinsee

95k counts per second  :o

That is more than accurate enough for my purposes.  I haven't purchased an Arduino Uno yet but will do so now that I have that info.

My c# application includes mapping events in a conveyor belt (several thousand meters long).  I will be polling the Arduino for the current number of pulses (0 to some number) to determine speed and location.

Thanks for the answers!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy