You are on page 1of 3

handson.dmt.fh-joanneum.

at

ARDUINO
Workpackage: Description: Arduino UNO Motor Shield This workpackage deals with the Motor shield for Arduino. The motor shield is designed for controlling inductive loads, like magnets, motors and relays. As a result you should be able to connect a 4-wire bipolar stepper motor to the Arduino motor shield and create a waving-machine. advanced - Introduction o DC Motor o Stepper Motor - Instructions o Build a waving machine o Write the program o Flash the program - Troubleshooting - Useful Resource Hardware: - Arduino UNO - Motor Shield - 4 wire bipolar stepper motor Software: - Arduino Studio

Difficulty (1-10): Overview:

Requirements:

Carelse, Pauger, Pilz

Instructions

handson.dmt.fh-joanneum.at

INTRODUCTION
This work package deals with connecting a motor to the Arduino Uno. For powering inductive loads a special design is necessary. Furthermore, most motors need more power than the Arduino can provide. The motor shield is capable of powering two DC at the same time or one bipolar stepper motor. The maximum voltage is 12 V, the maximum current is 2A or 4A when externally supplied.

DC Motor
A direct current, or DC motor, is commonly used motor, powered by a battery or external direct current power supply. It is a popular and strong motor with high rotations per minute. But you just can adjust the speed and the direction, it is not possible to drive the motor to exact positions.

Stepper Motor
A stepper motor is also powered by direct current, but its design is completely different. Instead of having one pair of coils it is driven by numerous coils, all of them are powered separately. This enables exact positioning. If you are not familiar, you should read the introduction about all the different motors and available.

Instructions
Attach the motor shield on top of the Arduino.

Build a waving machine


You can see several connectors on top of the motor shield. For connecting the stepper motor we use the blue screw terminal. You will notice that the stepper motor comes with 4 wires in different colors. These 4 wires represent 2 coil pairs, therefor from this 4 wires, you have to find the two pairs. This can be done very easily. Take a voltmeter and switch it to continuity test. Pick one wire and connect it to the black wire of the voltmeter. Than test all the remaining wires. If the voltmeter starts beeping, you found the second wire. Connect this wires to the blue screw terminal A and connect the other two wires to terminal B. Now print the provided picture of the hand and use some duct tape to attach it to the drive shaft of the motor.

Write the program


The first thing you have to do is to import the specific library. The Arduino needs some extra code to work properly with the motor shield. The library we need is called Stepper. Please notice that the code is not described in this work package. A detailed description can be found in the provided source code.
Carelse, Pauger, Pilz 2

Troubleshooting

handson.dmt.fh-joanneum.at

Flash the program


To flash the program on the Arduino UNO just plug it in and flash it the usual way.

Troubleshooting
- In case the motor does not move, please check the connectivity. - In case the motor still does not move, make sure that the motor is not too big. Note that the Arduino just can drive smaller motors without an external power supply. If you connect, for instance, a motor which is rated for 12 V, your motor will probably not move because the voltage supplied by the Arduino is way to low. Try to connect a 12 VDC source to the remaining two blue screw terminals. Make sure to connect the plus wire to VIN and Ground to GND. OTHERWISE YOU WILL DESTROY THE MOTOR SHIELD AND PROBABLY THE ARDUINO! This worksheet was entirely tested and performed on an Arduino Uno with a 12V bipolar Stepper motor from adafuit.

Useful Resource
A detailed explanation of various direct current motors
http://www.electronics-tutorials.ws/io/io_7.html

Carelse, Pauger, Pilz

You might also like