I am working on a university robotics project involving the control of multiple DC motors with quadrature encoders. My question regards how I can control many (5) encoders using one Arduino. I am currently using the encoder library from PJRC (Encoder Library, for Measuring Quadarature Encoded Position or Rotation Signals), which relies on the use of interrupt pins, however, the Arduino Mega only has 6 available (10 are required for our purposes). Here are some approaches we are considering to increase the number of interrupt pins available:
- Using the PinChangeInterrupt or PinChangeInt libraries to convert regular digital pins to interrupts
- Using some sort of external counter chip interfaced to the Arduino
- Choosing an alternative microcontroller, however, for this project, it must operate with 5V logic levels
Any insight enabling us to read from multiple (5) encoders would be greatly appreciated. Thank you.