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
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Pi power question driving a stepper motor
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 665 subscribers
  • Views 842 views
  • Users 0 members are here
  • voltage/current
  • raspberry_pi
  • raspberrypi
  • power
Related

Pi power question driving a stepper motor

knight_rider1977
knight_rider1977 over 11 years ago

I'm working on getting a python script to drive a stepper motor (28BJY-48).  When I hook it up to the 5v power on the Pi it basically freezes up.  I added a header on a circuit board to allow me to hook up a 9v power source (9v battery since I don't have any plugs for power supplies yet).  After rebooting I hooked up to the external power source and that resolved the issue and the motor started turning.  I've tested several other things running off just the Pi power and not had this issue, LED lights, 16x2 Backlit LCD screen.  Is there something I need to check with the Pi or is the Motor just a bit too much for the Pi to supply the needed power to the stepper motor?  I also have a external powered USB hub attached to the Pi.  I'm trying to learn more about how electronics work.  My main background is in Computers but I've always had a interest in electronics so anything, including theory, will help me greatly.  I'm just hoping I didn't do something and fried my Pi image

  • Sign in to reply
  • Cancel
  • penguintutor
    0 penguintutor over 11 years ago

    The Raspberry Pi GPIO ports are not able to supply the amount of current needed for a stepper motor.

     

    You will need an external power supply and external components to control the stepper motor. You could either look at using a stepper motor driver IC or just manually controlling FETs connected to each of the stepper motor coils.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • knight_rider1977
    0 knight_rider1977 over 11 years ago in reply to penguintutor

    Thanks.  Each of the stepper motors I have came with a controller card (ULN2003AN IC).  I also have a couple of L293D IC to play with at a later date.

     

    So I need to determine the power requirements and create a board I can connect the power up to each of the boards. I have an old switching (slectable) power adapator I use with my Atari Lynx (had that for 19 years and it still works).  It can go from 3 to 12 volts DC with a max of 800mA.  I printed the datasheet for the motor  but I'm not 100% sure on the power requirement.  I'm still trying to comprehend Ohm's Law.  The motor is rated at 5VDC and has a DC resistance of 50Ω±7%(25%) so to figure out the current needed I take 5V / 50Ω = I = .1  Now the .1 means 100mA correct?  So in theory I would need 10V and 200mA minimum to drive 2 of the 28bjy-48 stepper motors.  Is that Correct?  Since the adaptor I have can supply 12V and 800mA it would have no trouble providing the necessary power for 2 motors??  Could the same adaptor power 3 of those motors or would I need more voltage?

     

    Thanks image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • penguintutor
    0 penguintutor over 11 years ago

    The ULN2003AN should be fine for driving the motors. They use TTL inputs so will work with the 3.5v from the Raspberry Pi GPIO.

     

    For a basic resistance level then your calculations look good, but motors are inductive loads so don't behave as pure resistors. It is probably sufficient to use those calculations, but if you have a datasheet it should give you maximum actual current depending upon whether a load is connected. It's also important to note whether that is for an individual coil or if there are multiple coils that may be switched on simultaneously (eg. a 4 coil stepper motor may have two coils energised at the same time).

     

    Note that it is the current rating of the power supply that is relevant here and not the voltage. So if you find that the peak current through all your motors exceeds that of the power supply then you need to look for a power supply with a higher current rating, not voltage rating.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • knight_rider1977
    0 knight_rider1977 over 11 years ago in reply to penguintutor

    K that makes sense.  I'm looking at the datasheet and not having much luck finding information on google to get the light to fully come on (the light in my head is getting brighter though image ). Some of the data makes sense but I'm not seeing a max current.  Is one of the below from the datasheet what I'm looking for or do I need to track down a different datasheet?

     

    Rated voltage: 5VDC

    Number of Phase: 4

    Speed Variation Ratio: 1/64

    DC resistance: 50Ω±7%(25°C)

    Insulated resistance >10MΩ(500V)

    Insulated electricity power 600VAC/1mA/1s

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to knight_rider1977

    Have just glanced at your message. 10v at 200mA is incorrect. 5v at 200mA  is correct.

    Motor is rated for 5v, do not overdrve at 10v.

    Your arithmetic reasoning is phoney. (5 X 0.1) multiplied by one (X1)  for 1 motor

                                                          (5 x 0.1) multiplied by two  (x2) for 2 motors

    Since motor is rated at 5v                 (5 x 0.1) x 2  = 5 x 0.2  ie a supply of 5v at 200mA

     

    Best regards

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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