Motor Control Boards
Mini Project Controlling Direction
Find the following components in your kit:
- Arduino Uno
- Arduino Software
- USB A-to-B cable
- Computer with USB port
- 22 AWG wire
- Motor with two leads
- Header Pins
- Header Pins Housings
- Header Pin Wire Crimper
- 9 Volt Rechargable Battery
- 9V Rechargable Battery Charger
- 9 Volt Battery Connector
- Small phillips screwdriver screwdriver
- Motor Control Board
Take the 22 AWG 5 pin wire and separate the wires so that you have red, black, green, and blue wires.
Attach Male Header Pins to one side of each of the four wires.
Attach Female Header Pins to the other side of the blue and green wires.
To do this, perform the following steps:
To begin attaching and crimping spade connectors, you will need the following:
- 22 AWG Wire
- Wire Cutter/Stripper
- Header Pin Crimper
- Male or Female Header Crimps
- Header pin housings or shells
- Needle nose pliers or Wire Cutter / Stripper
You may want to have extra crimps and wires. These crimps are small, require a special crimping tool, precise techniques and practice to create a proper crimp.
Header pin crimps are made up of three distinct portions: The mating pin zone is the portion of the crimp that interfaces with the component that you are connecting to. The other two portions interface with the wire. There is the conductor crimp zone which is the portion of the cimp that forms around the conductor and makes the electrical connection. The final part is the insulation crimp zone, where this part of the crimp forms around the wire’s insulation. This further securies the wire and creates a strain release. Both male and female header pins are crimped using the same process.
Cut a piece of the wire to the needed length and separate the number of wire you need from the .
Strip the ends of the wire so that 0.10 in or 2.5 mm of wire is exposed. It may be easier to strip the wires longer and trim the exposed wires to 0.10 in or 2.5 mm.
Cut off the male or female pin off of their connector strips. Keep the metal tab connected to the crimp, it will be used to align the crimp into the header pin crimper.
Place the wire into the crimp. Make sure the exposed wire is not in the mating pin zone.
To give your crimp a better chance to be successful use your wire cutters or needle nose pliers to start to fold over the tabs on the insulation crimp zone.
The recommended crimper has 2 different crimping areas the larger anvil crimps the insulation zone while the smaller anvil crimps the conductor zone. Make sure to line up the zones correctly or the crimp will not crimp properly.
Use the crimping tool to crimp the conductor crimp zone and the insulation crimp zone. Make sure the Mating pin zone is extended completely out of the crimping tool. If you crimp this part it will deform and will not function
After crimping, if you inspect the connection and see that the crimped parts are not fully compressed onto the wire you may want to crimp the connection a second time.
Once the crimp is successfully attached to the wire you can remove the metal carrier strip by bending or cutting it off. After removing that, the crimp is ready to be placed into the plastic housing.
The plastic housing, or shields as they are sometimes called, add structure and support to make the crimp more durable. The plastic housings come in various sizes that can hold multiple connections in one block. Some projects will have all the connections next to each other which make the multi-connection block very convenient to use. Using single pin housing is easier to learn on and creates wires that have more flexibility in how they can be connected.
Both the male and female header pins have a small square or rectangle of metal in the pin mating zone. This metal “tab” will lock itself into the square opening or “slot” in the housing. Make sure the tab and the slot are facing the same direction and push the crimp into the larger opening in the housing. If done successfully the crimp will lock itself in the housing.
Perform a pull test to confirm that the crimp will not slip out of the housing. If the housing does not easly slip off you have successfully made a crimp!
First attach the 9V battery connector to the battery. Then attach the battery connector to the Motor Control Board. Using a small screwdriver connect the Black wire to the GND or ground port. It is the middle of the 3 port terminal block. The Red wire connects to the +12V ternimal.
This label may be confusing but it is for connecting to external power. The +12V label exists because some changes to the board must be made if using a power source greater then 12 volts.
The motor wires connect to the left output of the motor control board. Using a small screwdriver conect the red wire to "Out 1" or output 1, and the black wire to "Out 2".
Connect the black wire’s header pin to the GND port, the red wire’s header pin to the 5V port, the green wire’s header pin to Port 13, and the blue wire to Port 12.
Using a small screwdriver, connect the other end of the black wire to the GND port of the motor control board. This wire will share the port with the black wire from the battery connector.
Connect the red wire to the +5V port. When using this board with a external power supply, this 5V port can be used to power the arduino.
Connect the green wire to the "IN 1" port, and the other end of the blue wire to the "IN 2"port. These are the input connections for this board.
Take a look at the circuit below to check your circuit!
Connect the Arduino to your computer using the USB A-to-B cable.
Download the following program: MotorControl.ino
Open the Arduino software and open the “MotorControl” program.
Click on the Upload button to upload the “MotorControl” program to the Arduino Uno. The program should immediately run after it is done uploading.
With the arduino connected to the +5V you can disconnect your arduino from the computer after the upload completes.
What happens?
The motor should move forward and backward every second!
Explanation
The Motor Control Board is created in a way that allows different signals to give the motor a direction. It does this by using a circuit design called an H-Bridge.
H-Bridges are called that because of the way the circuits are shaped that allow the circuits to control the direction of electricity flow.
Inside the Motor Control Board, the wiring inside the board is done in such a way that Port 12 enables one pathway for the electricity to flow, and likewise, Port 13 enabled the pathway that causes electricity to flow in the opposite direction.
Looking at the program that you used, there are two commands that set the ports to either be on or off.
You can see that the ports are reversed the second set so that one port is on, while the other is off. This results in the motor moving in one direction for one second, and the opposite direction for one second.