Sunteți pe pagina 1din 11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

Gmail Para Tu Negocio

Ahora puedes verte ms profesional con un e-mail personalizado.

Comienza Ahora

ControllingaStepperMotorwithanArduinoAll

Gmail Para Tu Negocio

Ahora puedes verte ms profesional con un e-mail personalizado.

Comienza Ahora

ShowAllItems
This tutorial will show you how to operate a stepper motor that was salvaged from an old printer with an Arduino.

Step 1: What is a Stepper Motor?

ShowAllItems
A stepper motor consists of two main parts, a rotor and a stator. The rotor is the part of the motor that actually spins and
provides work. The stator is the stationary part of the motor that houses the rotor. In a stepper motor, the rotor is a permanent
magnet. The stator consists of multiple coils that act as electromagnets when an electrical current is passed through them. The
electromagnetic coil will cause the rotor to align with it when charged. The rotor is propelled by alternating which coil has a
current running through it.
Stepper motors have a number of bene ts. They are cheap and easy to use. When there is no current send to the motor, the
steppers rmly hold their position. Stepper motors can also rotate without limits and change direction based on the polarity
provided.

Step 2: Parts List


http://instructables-pdf.abuouday.com/download.php

1/11

4/13/2016

http://instructables-pdf.abuouday.com/download.php

Download Controlling a Stepper Motor with an Arduino - All as pdf

2/11

4/13/2016

http://instructables-pdf.abuouday.com/download.php

Download Controlling a Stepper Motor with an Arduino - All as pdf

3/11

4/13/2016

http://instructables-pdf.abuouday.com/download.php

Download Controlling a Stepper Motor with an Arduino - All as pdf

4/11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

T o o l s

http://instructables-pdf.abuouday.com/download.php

5/11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

ShowAllItems
Needed Parts

StepperMotor(Thismotorwassalvagedfromanoldprinter)
Arduino
InsulatedCopperWire
WireCutters/Strippers
CurrentRegulator
Transistor
HBridge(Whatwillbeusedinthistutorial)
MotorShield
Optional Parts

SolderingIron
Solder
SolderingFan
3rdHandTool
SafetyGlasses

Step 3: Attach the Wires

http://instructables-pdf.abuouday.com/download.php

6/11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

ShowAllItems
Most stepper motors have four leads so you will need to cut four pieces of copper wire (note the color does not correlate to
anything speci c. Di erent colors were only used to make it easier to see). These leads will be used to control which coil is
currently active in the motor. This motor was salvaged from an old printer so soldering the wires on was the easiest option for
this project. Anyway you can safely make a connection (solder, plug, clips) will work though.

Step 4: Arduino Sketch

http://instructables-pdf.abuouday.com/download.php

7/11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

ShowAllItems
Arduino already has a built in library for stepper motors. Simply go to File > Examples > Stepper > stepper_oneRevolution. Next
you are going to want to change the stepsPerRevolution variable to t your speci c motor. After looking up the motors part
number on the internet, this particular motor was designed for 48 steps to complete one revolution. What the Stepper library is
actually doing is just alternating HIGH and LOW signals to each coil as shown in the GIF.

Step 5: What is an H-Bridge?

http://instructables-pdf.abuouday.com/download.php

8/11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

ShowAllItems
An H-Bridge is a circuit comprised of 4 switches that can safely drive a DC motor or stepper motor. These switches can be relays
or (most commonly) transistors. The transistor is a solid state switch that can be closed by sending a small current (signal) to
one of its pins. Unlike a single transistor which only allow you to control the speed of a motor, H-bridges allow you to also
control the direction in which the motor spins. It does this by opening di erent switches (the transistors) to allow the current to
ow in di erent directions and thus changing the polarity on the motor. WARNING: Switches 1 and 2 or 3 and 4 should
never be closed together. This will cause a short circuit and possible damage to the device.
H-Bridges can help prevent your Arduino from being fried by the motors you are using it drive. Motors are inductors, meaning
that they store electrical energy in magnet elds. When current is no longer being sent to the motors, the magnetic energy
turns back into electrical energy and can damage components. The H-Bridge helps isolate your Arduino better. You should
never plug a motor directly into an Arduino.
Though H-Bridges can be fairly easily built, many opt to buy an H-Bridge (such as a L293NE/SN754410 chip) due to
convenience. This is the chip that we will be using in this tutorial. The physical pin numbers and their purpose are listed below.

Pin1(1,2EN)>Motor1Enable/Disable(HIGH/LOW)
Pin2(1A)>Motor1LogicPin1
Pin3(1Y)>Motor1Terminal1
Pin4>Ground
Pin5>Ground
Pin6(2Y)>Motor1Terminal2
Pin7(2A)>Motor1LogicPin2
Pin8(VCC2)>PowerSupplyforMotors
Pin9>Motor2Enable/Disable(HIGH/LOW)
Pin10>Motor2LogicPin1
Pin11>Motor2Terminal1
Pin12>Ground
Pin13>Ground
Pin14>Motor2Terminal2
Pin15>Motor2LogicPin2
Pin16(VCC1)>PowerSupplyforHBridge(5V)

Step 6: Connect the Wires

http://instructables-pdf.abuouday.com/download.php

9/11

4/13/2016

http://instructables-pdf.abuouday.com/download.php

Download Controlling a Stepper Motor with an Arduino - All as pdf

10/11

4/13/2016

Download Controlling a Stepper Motor with an Arduino - All as pdf

ShowAllItems
For a stepper motor, the 4 terminal pins on the H-Bridge should connect to the 4 leads of the motor. The 4 logic pins will then
connect to the Arduino (8, 9, 10, and 11 in this tutorial). As shown in the Fritzing diagram, an external power source can be
connected to power the motors. The chip can handle an external power source from 4.5V to 36V (I just chose a 9V battery
because I'm still new to Fritzing).

Step 7: Upload Code and Test


Upload your code onto your Arduino. If you run your code and everything works as expected then that is awesome! If the wires
are put into the wrong pins then the motor will just vibrate instead of fully rotating. Play around with the speed and direction of
the motor as you see t.
You should now have a working stepper motor with your Arduino. What you do next with it is up to you.

Step 8: Referneces & Thanks


The full data sheet for the H-Bridge can be found here.
When I initially posted this I didn't think it would gain the attention that it did. For that reason, I just made a quick instructable
that I was planning on editing once all my parts had arrived. I didn't mean to cause so much concern with my previous, sloppy
methods. Thanks for all your comments and I have updated my instructable to re ect the more appropriate method of
connecting stepper motors.

Downloaded using:
instructables-pdf.abuouday.com Privacy Policy

http://instructables-pdf.abuouday.com/download.php

11/11

S-ar putea să vă placă și