0

members

Easy Basics: Project 034c Arduino motor shield R3, unipolar or bipolar stepper stepper motor 5V/6V

of Acoptex.com in UNO

Basics: Project 034c

Project name: Arduino motor shield R3, unipolar or bipolar stepper stepper motor 5V/6V

Tags: Arduino motor shield R3, unipolar or bipolar stepper motor, 5V/6V, Arduino Uno

Attachments: steppermotorsketch1, steppermotorsketch2

Tags: Arduino, Arduino motor shield R3, unipolar, bipolar stepper stepper motor 5V/6V

In this project, you needed these parts :

1.Aruduino Uno R3 1 pc (you can also use the other version of Arduino)

2.Arduino motor shield R3  1pc

3.Arduino IDE ( you can download it from here  )

4.Jumper cables

5. Stepper motor 5V/6V DC 1 pc

6. External motor DC power supply  1 pc

General

We will learn how to connect Arduino motor shield R3 to Arduino board and use it with unipolar or bipolar stepper motor 5V/6V. 

Understanding the stepper motor

What is a stepper motor?

A digital electric motor that moves one step at a time and each step is defined by a step angle. The stepper motor moves is distinct steps during its rotation. Each steps is defined by a step angle. In the example below you may notice that there are 4 distinct steps for the rotor to make a complete 360 degree rotation. As defines in step angle at 90 degrees. Since the stepper motor does move in discreet movement, we can say that a stepper motor is actually a digital motor. This characteristic makes it very suitable for digital interfaces integrates with a microcontroller. 

Stepper motors are not like simple DC motors and cannot be driven by providing just DC voltage. Driver circuit & a microcontroller are needed to control the speed & direction of a stepper.

With a stepper motor you can “step” exactly a given angle. Further the stepper motor has the advantage of having a holding torque.Steppers are able hold their position when they are not moving.

Stepper motors are available in two varieties: unipolar or bipolar.

Bipolar motors are the strongest type of stepper motor and usually have four leads. They have two sets of electromagnetic coils internally, and stepping is achieved by changing the direction of current within those coils.

Unipolar motors, identifiable by having 5, 6 or even 8 wires, also have two coils, but each one has a center tap. Unipolar motors can step without having to reverse the direction of current in the coils, making the electronics simpler. However, because the center tap is used to energize only half of each coil at a time they typically have less torque than bipolar.

Unipolar motors typically have two coils per phase, one for each direction of magnetic field.

Bipolar motors typically have one coil per phase, and current flows in both directions through this coil. Thus, the bipolar motor will be able to produce twice as much torque, since at any given time, the unipolar motor is only using half of its windings.

Unipolar stepper motors are generally of 6 wires, each coil phase has a center tap. If both of center tap (common) wires are connected together it becomes a 5 wire unipolar. To convert unipolar stepper motor to bipolar stepper motor (4 wires) just leave the center taps (2 wires) not connected.

You can read more about them here and here.

We will use stepper motor Nema 17 DC 6V.

1. Nema 17 unipolar stepper motor DC 6V specification

  • Manufacturer Part Number: 17HM15-0806S
  • Motor Type: Unipolar Stepper
  • Step Angle: 0.9 deg
  • Holding Torque: 26Ncm(36.8oz.in)
  • Rated Current/phase: 0.8A
  • Voltage: 6V
  • Phase Resistance: 7.5ohms
  • Inductance: 7.5mH ± 20%(1KHz)
  • Frame Size: 42 x 42mm
  • Body Length: 39mm
  • Shaft Diameter: Φ5mm
  • Shaft Length: 24mm
  • D-cut Length: 15mm
  • Number of Leads: 6
  • Lead Length: 500mm
  • Weight: 300g

See additional information here.

Understanding the Arduino motor shield R3

The Arduino Motor Shield allows your Arduino board to drive DC and stepper motors, relays and solenoids.

The Arduino Motor Shield is based on the L298, which is a dual full-bridge driver designed to drive inductive loads such as relays, solenoids, DC and stepping motors. It lets you drive two DC motors with your Arduino board, controlling the speed and direction of each one independently. You can also measure the motor current absorption of each motor, among other features. The shield is TinkerKit compatible (6 headers for the attachment of Tinkerkit inputs, outputs, and communication lines), which means you can quickly create projects by plugging TinkerKit modules to the board.

By allowing you to simply address Arduino pins, the Arduino Motor Shield makes it very simple to incorporate a motor into your project. It also allows you to be able to power a motor with a separate power supply of up to 12v. 

The Motor Shield must be powered only by an external power supply. Because the L298 IC mounted on the shield has two separate power connections, one for the logic and one for the motor supply driver. The required motor current often exceeds the maximum USB current rating. External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the Arduino's board power jack on which the motor shield is mounted or by connecting the wires that lead the power supply to the Vin and GND screw terminals, taking care to respect the polarities. To avoid possible damage to the Arduino board on which the shield is mounted, we recommend using an external power supply that provides a voltage between 7 and 12V. If your motor require more than 9V we recommend that you separate the power lines of the shield and the Arduino board on which the shield is mounted. This is possible by cutting the "Vin Connect" jumper placed on the back side of the shield. The absolute limit for the Vin at the screw terminals is 18V.

Specification

  • Operating Voltage 5V to 12V
  • Motor controller L298P, 2 channels - drives 2 DC motors or 1 stepper motor
  • Max current 2A per channel or 4A max total (with external power supply)
  • Current sensing 1.65V/A
  • Free running stop and brake function

Signals and connections of stepper motor Nema 17

1.Unipolar stepper motor (can be bipolar too). Used in project

2.Bipolar stepper motor (Same maker but different wire colors)

Signals and connections of Arduino motor shield R3

The power pins:

The shield can supply 2 amperes per channel, for a total of 4 amperes maximum.

Vin on the screw terminal block, is the input voltage to the motor connected to the shield. An external power supply connected to this pin also provide power to the Arduino board on which is mounted. By cutting the "Vin Connect" jumper you make this a dedicated power line for the motor.

GND Ground on the screw terminal block.

Input and output pins:

This shield has two separate channels, called A and B,

that each use 4 of the Arduino pins to drive or sense

the motor. In total there are 8 pins in use on this shield.

You can use each channel separately to drive two DC

motors or combine them to drive one unipolar stepper

motor.

The shield's pins, divided by channel are shown in the table below:

If you don't need the Brake and the Current Sensing and you also need more pins for your application you can disable this features by cutting the respective jumpers on the back side of the shield.

The additional sockets on the shield are described as follow:

  • Screw terminal to connect the motors and their power supply.
  • 2 TinkerKit connectors for two Analog Inputs (in white), connected to A2 and A3.
  • 2 TinkerKit connectors for two Aanlog Outputs (in orange in the middle), connected to PWM outputs on pins D5 and D6.
  • 2 TinkerKit connectors for the TWI interface (in white with 4 pins), one for input and the other one for output.

You can drive two DC motors by connecting the two wires of each one in the (+) and (-) screw terminals for each channel A and B. In this way you can control its direction by setting HIGH or LOW the Direction (DIR A and DIR B) pins, you can control the speed by varying the PWM A and PWM B duty cycle values. The Brake A and Brake B pins, if set HIGH, will effectively brake the DC motors rather than let them slow down by cutting the power. You can measure the current going through the DC motor by reading the Current Sensing (SNS0 and SNS1) pins. On each channel will be a voltage proportional to the measured current, which can be read as a normal analog input, through the function analogRead() on the analog input A0 and A1. For your convenience it is calibrated to be 3.3V when the channel is delivering its maximum possible current, that is 2A.

Wiring

The pins of the official Arduino motor shield will only align with Arduino Uno Rev. 3. In order to make it work with older versions of the Arduino, you will need to trim a few pins off the motor shield. However, this is not, at all, recommended. Insert the motor shield pins into the socket of the Arduino Uno.

The following picture shows the needed connections with the Arduino Uno:

1. Bipolar stepper motors typically have 4 pins, which correspond to two coils. To use a stepper motor, you need to power these two coils in phase with alternating polarity. To figure out which two pins make up a single coil, insert an LED into any two pins on its socket and rotate the motor shaft. If the LED lights up, you found one coil. The other two pins should make up the other coil.

2. Unipolar stepper motors are generally of 6 wires, each coil phase has a center tap. If both of center tap (common) wires are connected together it becomes a 5 wire unipolar. To convert unipolar stepper motor to bipolar stepper motor (4 wires) just leave the center taps (2 wires) not connected. To figure out which two pins make up a single coil, insert an LED into any two pins on its socket and rotate the motor shaft. If the LED lights up, you found one coil. The other two pins should make up the other coil.

Step by Step instruction

  1. Place Arduino motor shield R3 on top of the Arduino Uno board.
  2. Do wiring.
  3. Open Arduino IDE.
  4. Plug your Adruino Uno board into your PC and select the correct board and com port
  5. Open up serial monitor and set your baud to 9600 baud
  6. Verify and upload the the sketch to your Adruino Uno

Summary

We have learnt how to connect Arduino motor shield R3 to Arduino board and use it with with unipolar or bipolar stepper motor 5V/6V. 

Libraries:

  • No libraries required for this project.

Sketch:

  • See attachments on the begining of this project description.


Other projects of Acoptex.com
Easy CBASIC Lesson 9 Compiling and debugging in Visual Studio of Acoptex.com in Csharp 10-04-2019
Easy Raspberry basics: Project 00a Getting started with Raspberry Pi of Acoptex.com in Raspberry Pi 3 06-04-2019

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 02-10-2017
Viewed: 1505 times