Arduino Motor Shield Tutorial

by:INDUSTRIAL-MAN     2019-09-13
Arduino Motor Shield allows you to easily control the direction and speed of the motor using Arduino.
By allowing you to simply address the Arduino pins, it becomes very simple to integrate the motor into the project.
It also allows you to power the motor using a separate power supply up to 12 v.
Most importantly, the shield is easy to find.
For all of these reasons, Arduino motor shielding is a bit cool in your arsenal of rapid prototyping and general experiments.
The pins of the official Arduino Motor Shield are only aligned with the Arduino Uno Rev3.
In order for it to work with the older version of Arduino, you need to trim several pins from the motor shield.
However, these 1. 1 points are not recommended either.
Plug the motor shield pin into the socket of the Arduino Uno.
There are two channels for motor shielding, which can control two DC motors, or one stepping motor.
It also has 6 titles for connecting Tinkerkit input, output, and communication lines.
The use of these pins is somewhat limited, so it is not described in this tutorial.
With an external power supply, the motor shield can safely supply up to 12 V and 2A for each motor Channel (
Or 4A to mono).
Pins on Arduino are always blocked for use.
By addressing these pins, you can select the motor channel to start, specifying the motor direction (polarity)
Set the motor speed (PWM)
, Stop and start the motor and monitor the current absorption of each channel.
Pin breakdown is as follows: For more information on technical specifications, please check the official page of motor shield on the Arduino website.
Plug the Arduino into the USB port of the computer and open the Arduino development environment.
In order for the motherboard to do anything, you need to initialize the motor channel by switching three parameters: the motor will not open if you have not completed all three parameters.
The following steps are some common examples of common motor settings.
To use Arduino Motor Shield to control the motor, the positive (red)
Insert the wire into the terminal of the channel on the motor shield and the grounding of the motor (black)
Access Channel-
Terminal on shield
The external power supply is not always necessary, but it greatly improves the performance of the motor.
It is recommended that you always use one.
To connect the external power supply, connect the positive pole (red)
Wires from the power supply to the \"Vin\" terminals and the ground (black)
Connect to the \"GND\" terminal.
Finally, upload the code that controls the motor shield to the Arduino.
The interface with the two motors is almost the same as the interface of one motor.
Just plug the motor into channel B.
Only different code
It is wise that you need to connect the second channel to control the second motor.
There are many different types of stepping motors, but in this tutorial we will be talking specifically about bipolar stepping motors.
The bipolar stepping motor usually has 4 pins, corresponding to two coils.
To use a stepping motor, the two coils need to be powered with alternating polarity.
To find out which two pins make up a coil, insert the LED into any two pins on its socket and rotate the motor shaft.
If the LED light is on, you will find a coil.
The other two pins should make up another coil.
Make the bipolar motor rotate: to reverse the direction of the bipolar stepping motor, just reverse the polarity of the second coil.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...