BREAKING NEWS

10 November 2015

How to Connect the stepper motor 28BYJ-48 Arduino UNO R3

The project that I propose Today is quite cheap, the module with the 'ULN2003A and stepper motor cost about 8 euros . See the photos of the project today:


We begin by motor 28BYJ-48 and its datasheet . The motor is already equipped with connector for connection. It is a unipolar stepper motor with 4096 steps for a rotation of 360 degrees. Its pivot is not rotated easily, even without power supply. So you can save energy when not feeding the windings must remain stationary. So it will heat up much less.



We see the instructions of the control module that uses the integrated ULN2003A with itsdatasheet . On my concerns about these modules and how to control the stepper motor I have already spoken here. Back to us, looking in pdf find some useful information:
  1. What are the phases of the motor and the color of the wires of the phases;
  2. How you have to activate the various phases to make it run properly.
For this module I connected the wires, from left to right, Green, Orange, Red, Blue. Power + 12Volt (Yellow) and GND (Brown). The Yellow can be connected to pin Vin Arduino UNO R3 or, if you prefer, to +5 volts. The brown must be connected to a GND pin. 
The Blue wire must be connected to pin11, pin10 to the Red, the 'Orange to Pin 9 and at Green Pin8. 
Obviously the pins can be changed but you have to edit the sketch.


After downloading the sketch is in charge 'Arduino IDE and programming Arduino UNO R3. 
Given the educational purposes only see certain parts of the sketch. In previous there are signs of such Pin output will want to use, this is the place to change them.


The function Ignition Delay   allows to have an initial delay of 5 seconds before to start the rotation of the motor. 'A good idea, before operating mechanisms, provide a brief pause to allow the operator to move away from the machine before it starts working.

If you take a look at the PDF form will discover that to rotate the stepping motor 28BYJ-48, just power phases following a precise order. Well this sequence is made by this piece of code. I chose to move the motor with eight sequences. If you prefer to do it with four sequences here's the part you have to change.

Scketch: Initialization of the Board Arduino Uno R3 - Paul Luongo
Scketch: Initialization of the Board Arduino Uno R3 - Paul Luongo
This is the usual initialization block: note the delay function on power.

Sketch: Part program princiaple control - Paul Luongo
Sketch: Part of the main control program - Paul Luongo
This is only the first part of the control program. And 'the part that deals with the rotation.The motor rotates 90 degrees, pause for half a second then rotates, pause ... to make a 360 degree rotation. Note that to rotate the engine 90 Degrees serve 1024 pulses. 

Share this:

Post a Comment

 
Back To Top
Distributed By Blogger Templates | Designed By OddThemes