Picking and wiring motors, encoders and drivers to an Arduino Uno

Hi,
I’m designing a vacuum cleaner robot focused on efficiency and affordability. The few DIY project online uses obsolete (or not appropriate) devices most of the time so I want to pick the right components.

At the moment the robot (prototype not optimised) weights ~0.9Kg.
The robot is powered by a 12V 1.3Ah 25C LIPO battery, but in the future I’ll go with a 18650 battery pack.
The core is an Arduino Uno.

So, here is my picks:

  • (2x) 298:1 Micro Metal Gearmotor HPCB 12V with Extended Motor Shaft
  • (1x) Magnetic Encoder Pair Kit for Micro Metal Gearmotors, 12 CPR, 2.7-18V (HPCB compatible)
  • (1x) A4990 Dual Motor Driver Carrier OR A4990 Dual Motor Driver Shield for Arduino

Which is better between 12V and 6V for my needs?
The 298:1 ratio will be god or I need the 380:1 one?
Which is the best option between driver and the Arduino shield? Consider that I need free digital pins as much as possible on my Arduino to manage all sensors.

And then, how I wire all the components together? There’s a schematic? I didn’t find enough documentation about all of these 3 devices together.

I wrote a schematic down on a paper using the A4990 Dual Motor Driver Carrier , is It right?

Thank you.

Hello,

It will not matter which of those motor drivers you use since they will need the same numbers of pins to run two motors. Since you are using a 12V power supply, I suggest using 12V motors to simplify things. Which motor and gear ratio you use will depend on the combination of speed and torque you want for your application, and deciding those specifications is up to you. To give you some idea of scale, our Zumo robots use micro metal gearmotors and is intended for robots of about 500g.

Your diagram looks fine. While you can use the A4990 shield as a standalone driver, in this case it seems easier to use it as a shield and use the default pin assignments to simplify using our Arduino library for it. You can find the A4990 library under the “Resources” tab of the A4990 shield product page.

Also, I see you are only using one channel from each encoder which will only give you half the resolution and you will not be able to tell which direction the motor is turning. If you need direction information, you should use both encoders channels and you can use one of the libraries on the Arduino rotary encoder page to read the sensors.

-Derrill

Hello Derrill,

thank you so much. I confirmed the 12V motors as well as 298:1 gear ratio, good balance between speed and torque when needed. I was looking at the motor’s specs tab and I found the Performance at maximum efficiency. In real scenario, what’s the meaning of 0.73 kg·cm ?

If I use the A4990 standalone driver, can I use the Arduino library by changing the PIN declaration from A4990MotorShield.cpp ?
I really like the Arduino shield but my robot is really tight, I’m afraid that there isn’t enough space.

I’m using one channel from each encoder because of Arduino Uno limitations, there are only 2 interrupt pins. Is there a way to get the full resolution by using only these two pins?

“Performance at maximum efficiency” means that is the torque you can expect the motor to output when running under its most efficient conditions, which is indicated by the green dot and text in the graphs in the datasheet.

Our dual A4990 shield adds logic gates to reduce the number of PWM outputs required to control the drivers (see its product page for more information), so to use a standalone driver, you would either have to add the logic gates yourself to use our library or write your own code to control it with four PWM signals.

You can use pin change interrupts with the Arduino to handle additional pins; some of the examples and libraries on the rotary encoder page I linked to utilize those interrupts.

-Derrill

Unfortunately, I found out that the Italian Pololu distributors don’t sell 12V micro gear motors.
So now I’ve to buy the 6V version #3079.

I’ve decided to buy 2x DRV8838 driver #2990 to get the most out of my motors which run at higher current.

1 Like