element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino + Driver Board & Stepper motor
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 13 replies
  • Subscribers 398 subscribers
  • Views 943 views
  • Users 0 members are here
Related

Arduino + Driver Board & Stepper motor

Former Member
Former Member over 12 years ago

Hi everyone,

 

I wonder if anyone can help me, I'm trying to build a 'Barn Door tracker mount' (see - http://500px.com/eliperelman/stories/60797 )

 

I'm totally confussed, as I was told that you need a Driver Board to be wired into the Arduino... but the guy in that link above seems to have wired the motor directly into the Arduino, also, Im not sure how he's powering it? (Would it be a 9v battery?)

 

I have an Arduino and a driver board + stepper motor... all the gear and no idea! lol

 

Any help would really be appreciated.

 

Thank you.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 12 years ago

    Just a little update.

    The 9v battery connectors arrived last night and I hooked it all up and loaded on an sketch from the example folder and it runs!

     

    Really pleased to see it working off the batteries.

    I'm not sure if the little motor will be upto the job (of turning a drive bolt) but I do have a chunky motor at hand if needed.

     

    The motor isn't turning smoothly with the example code I used (I think it's doing a 1/4 turn then stops then a 1/4 turn ect.)

     

    Here is the Code -

     

     

    /*

    Stepper Motor Control - one revolution

     

    This program drives a unipolar or bipolar stepper motor.

    The motor is attached to digital pins 8 - 11 of the Arduino.

     

    The motor should revolve one revolution in one direction, then

    one revolution in the other direction. 

     

     

    Created 11 Mar. 2007

    Modified 30 Nov. 2009

    by Tom Igoe

     

    */

     

    #include <Stepper.h>

     

    const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution

                                         // for your motor

     

    // initialize the stepper library on pins 8 through 11:

    Stepper myStepper(stepsPerRevolution, 8,9,10,11);           

     

    void setup() {

      // set the speed at 60 rpm:

      myStepper.setSpeed(60);

      // initialize the serial port:

      Serial.begin(9600);

    }

     

    void loop() {

      // step one revolution  in one direction:

       Serial.println("clockwise");

      myStepper.step(stepsPerRevolution);

      delay(500);

     

       // step one revolution in the other direction:

      Serial.println("counterclockwise");

      myStepper.step(-stepsPerRevolution);

      delay(500);

    }

     

     

     

     

    I need to work out how to get it to turn at 1rpm.

     

    Here's a snap shot of it all connected up -

     

     

    http://i1012.photobucket.com/albums/af244/967stuart/20130924_155048_zps1c80ec14.jpg

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • Former Member
    Former Member over 12 years ago

    Just a little update.

    The 9v battery connectors arrived last night and I hooked it all up and loaded on an sketch from the example folder and it runs!

     

    Really pleased to see it working off the batteries.

    I'm not sure if the little motor will be upto the job (of turning a drive bolt) but I do have a chunky motor at hand if needed.

     

    The motor isn't turning smoothly with the example code I used (I think it's doing a 1/4 turn then stops then a 1/4 turn ect.)

     

    Here is the Code -

     

     

    /*

    Stepper Motor Control - one revolution

     

    This program drives a unipolar or bipolar stepper motor.

    The motor is attached to digital pins 8 - 11 of the Arduino.

     

    The motor should revolve one revolution in one direction, then

    one revolution in the other direction. 

     

     

    Created 11 Mar. 2007

    Modified 30 Nov. 2009

    by Tom Igoe

     

    */

     

    #include <Stepper.h>

     

    const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution

                                         // for your motor

     

    // initialize the stepper library on pins 8 through 11:

    Stepper myStepper(stepsPerRevolution, 8,9,10,11);           

     

    void setup() {

      // set the speed at 60 rpm:

      myStepper.setSpeed(60);

      // initialize the serial port:

      Serial.begin(9600);

    }

     

    void loop() {

      // step one revolution  in one direction:

       Serial.println("clockwise");

      myStepper.step(stepsPerRevolution);

      delay(500);

     

       // step one revolution in the other direction:

      Serial.println("counterclockwise");

      myStepper.step(-stepsPerRevolution);

      delay(500);

    }

     

     

     

     

    I need to work out how to get it to turn at 1rpm.

     

    Here's a snap shot of it all connected up -

     

     

    http://i1012.photobucket.com/albums/af244/967stuart/20130924_155048_zps1c80ec14.jpg

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • mcb1
    mcb1 over 12 years ago in reply to Former Member

    Stuart

    this line here gives you the answer I think you're looking for

     

    myStepper.setSpeed(60);

     

    it even says so above it.

      // set the speed at 60 rpm:

     

    Have you tried it?

     

    Does this motor take 200 pulses to do a full revolution.?

    From the limited information this supplier gave (despite suggesting they had a forum)

    Step angle: 5.625 x 1/64
        Reduction ratio: 1/64

     

    Comparing it with the others from the same factory that are a little clearer, the stepper motor is 5.625 deg and a 64:1 reduction.

     

    360 deg divided by 5.625 deg = 64.

    It also has a 64:1 ratio reduction, so therefore 64 x 64 = 4096 steps for a full revolution.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to mcb1

    Hi Mark, yeah it was set to 60.

     

    To be honest, I think I've got in a complete muddle lol

     

    I was hoping to pinch the example sketch and just tweak it, but I can't seem to get it to work.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mcb1
    mcb1 over 12 years ago in reply to Former Member

    Stuart.

     

    You need to check to see what is happening, before you can rectify the problem.

     

    As you know delay(1000) adds a one second delay before moving to the next instruction.

     

    I would change this

    const int stepsPerRevolution = 200

    to

    const int stepsPerRevolution = 4096

     

    and this

    myStepper.setSpeed(60);

    to

    myStepper.setSpeed(1);

     

    Uload it and try again.

    It should do one whole revolution, wait 0.5 secs, then reverse (using the code ** with edits** in your post).

     

    The 9 volts is because some motor drivers won't work below 7v, its just the way they are.

    I'm keen to see the end result because I've been asked to do a similar thing ... (except I don't have the scope).

    I was thinking of using the same motor.

     

    mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube