# Controlling several gear motors with encoders from one Arduino

I am working on a project making a robotic hand that uses several (around 20) gear motors with encoders. I'm using this dual motor driver to drive the motors. The motors are paired into ten sets of two where they are rotating opposite their mate (so I have connected two motors to each motor output pair on the driver with opposite polarities which means I have four motors per driver - see image below). I'm running this off of an Adafruit metro mini. My question revolves around how to read multiple encoders to be able to control position of the motors. I only need one encoder per pair, but that's still 10 encoders. It'll be going at around 50-75rpm so definitely not maximum rate. if I can get all of the motors running at once, that would be best, but it's not necessarily a requirement of the design. Any ideas on how I can best do this?(best being inexpensive and simply/quickly implemented) I only have experience using one encoder and I used it on the 2, 3 interrupt pins but I'm not sure how to scale this up. I have an I/O expander but it doesn't have any built-in interrupt pins. Open to creative solutions or breakout boards.

• I also think you need to drive the motors separately. So 20 motors and 20 encoders (unless otherwise convinced.) Looks like 700 'pulses' per rev, though a later sentence about a 'new' encoder can be read to either justify the figure or be meant to modify the earlier number. The remaining question I have is about what maximum RPM has to be handled. (Surely not its maximum rate.) What will you be actually requiring? And will you have all of the motors running at once? Mar 10 at 0:14
• If the opposite motors are not mechanically connected expect them to run at different speeds. Mar 10 at 2:51
• you are going to need more I/O pins. Mar 10 at 3:03
• @jsotola do you get notifications when my post is edited? my reasoning for commenting was to let people know that I had seen and replied to their questions Mar 10 at 17:20
• @LilMamiChula I got notification from your comment ... notifications are also sent to anyone that Follows the post ... there is a button for that ... you can comment to only one person at a time ... delete the comments later, just to keep the comment clutter to a minimum ... this site is not a forum, so it is best if comments are at minimum ... i do not know if people are alerted if you post a comment and then delete it ... you can test it after you read this Mar 10 at 18:14