Hi, my name is Hunter and I am having trouble programming my robot for my graduation project. I dont know how to program the arduino to where the motors work with my motomama v2 motor controller. I dont even know if I need another battery or the motors are connected in the wrong place. The motor controller and arduino are connected and have power. The motors are connected to 5v and GND pins in the Break Out Zone. I do not know how to code this at all after spending hours looking up information that might help me.
Hi Hunter,
Please confirm the following: you are using an Arduino Uno R3 and the following motor controller? If so, you can also find more details about the motor controller here and here (from the product page, under “Useful Links”).
Can you give us more details (voltage, no load curent, peak current, etc.) about the motors you are using?
What about the battery pack (type/technology, voltage, capacity (mAh, etc.) you are using?
It would be very helpful if you could provide one or more pictures of your setup clearly showing all connections. This way we can direct you on how to properly connect the different parts.
Sincerely,
I am using an Arduino R3 and that motor controller.
I am usingthis battery
And the motors are 2 DC Reversible 3-12v motors with a no load current of 95mA @12v
This is the current connection I have with the motors to the motor controller, the black and red female jumper cables are connected to the breakout zone gyazo.com/abaacf425925be6b1b9e5fc8a27b1a70, here is what it looks like on my robot. The white is not connected to anything else on the white, red, and black female cable. gyazo.com/ac46f148b1a489605114680d5d53c36d
Hi Hunter,
Your picture of your setup does not clearly show where any wire is going. We recommend that you post another picture (or pictures) to more clearly show the setup to increases the chances of receiving help from the RobotShop community.
As for how to connect it with Arduino & program it, it should be relatively simple if you follow the manufacturer’s datasheet available here. Pages 2 (Arduino Socket definition) and 4-5 (Installation) are particularly useful.
Please check the attached diagram to understand how to connect your motors and battery to the RB-Ite-09 shield.
Some pins are predetermined for control of the shield (check the datasheet, page 2). The relevant ones for this case are:
]D8 > In1/:m]
]D9 > In2/:m]
]D10 > EnA/:m]
]D11 > EnB/:m]
]D12 > In3/:m]
]D13 > In4/:m]
The inputs In1 and In2 control the outputs names Out1 and Out2 used to drive one motor. The input EnA can enable or disable the Out1 and Out2 outputs (when disabled, it is called “free running”).
The same is true for In3 and In4 and the corresponding outputs Out3 and Out4 and their control input EnB.
You can control the direction of the motor by following this table:
[table][tr][td]EnA[/td][td]In1[/td][td]In2[/td][td]Description[/td][/tr][tr][td]0[/td][td]X[/td][td]X[/td][td]Free Running Motor Stop[/td][/tr][tr][td]1[/td][td]1[/td][td]0[/td][td]Forward[/td][/tr][tr][td]1[/td][td]0[/td][td]1[/td][td]Reverse[/td][/tr][tr][td]1[/td][td]In1=In2[/td][td]In1=In2[/td][td]Fast Motor Stop[/td][/tr][/table]
As you can see from the table above, forward & reverse require In1 and In2 to be opposite values and therefore allow current to flow through the motor. If they are both the same value then the motor breaks. Whenever EnA is low (logic 0), this motor output is disconnected from the driver and the motor enters “free running” which means it will only slow down due to mechanical resistance and friction.
You can also try the short example from the manufacturer attached to this message to see how this setup works.
Sincerely,
RB-Ite-09_DC_MotoMama_Aruino_Test.zip (537 Bytes)