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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • 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
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • 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
Blog Raspberry PIO Stepper Library: Trying it out with a Pi Pico and two Stepper Motors!
  • 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
GPIO Pinout
Raspberry Pi Wishlist
Comparison Chart
Quiz
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: shabaz
  • Date Created: 23 Apr 2025 7:13 PM Date Created
  • Views 4947 views
  • Likes 9 likes
  • Comments 14 comments
Related
Recommended
  • raspberry
  • pico
  • PIO
  • stepper-motor
  • c++

Raspberry PIO Stepper Library: Trying it out with a Pi Pico and two Stepper Motors!

shabaz
shabaz
23 Apr 2025

Stepper motors are super-useful for precision movements.

I made a little stepper motor board a while back, but never got around to testing it at the time.

Jan Jan Cumps has created a stepper motor control library (click here to learn about it:  Raspberry PIO stepper library documentation - 1: intro, set up project and simple example )  that uses special hardware inside the Pi Pico chip, called PIO. The PIO hardware allows for precise control of inputs and outputs. 

The PIO is used to pulse an output that goes to a Toshiba chip which translates that to higher-current outputs in a sequence to drive the coils of the motor.

The video shows a quick first test of the board, using Jan's stepper motor library.

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Here's another short video; showing interaction from a terminal/console connection. This will be useful when trying out new stepper motors and mechanisms, to experiment and discover what speeds and steps are needed:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

The stepper motors/leadscrew/linear rails combo were purchased from AliExpress quite a while ago. The particular AliExpress seller no longer has more to sell, but I have seen that other AliExpress sellers have very similar-looking options.

I need to experiment a bit more, but it's great to see the board operational with the stepper motor code.

The circuit diagram is below (this is a more recent revision 1.1, compared to the revision 1.0 board which I used. The rev 1.1 board is directly compatible with Jan's stepper motor library, whereas the older rev 1.0 board needs a few resistor changes). The PDF circuit diagram is downloadable here.

image

If you wish to build the board, see the pico-dual-stepper GitHub repo for the Gerber files.

Top layer:

image

3D render:

image

The underside doesn't have any components:

image

The PDF Parts List is available here.

 

  • Sign in to reply
  • dougw
    dougw over 1 year ago

    Nice looking PCB shabaz .

    Were you expecting Jan Cumps  to develop his library when you designed it? ... Relaxed

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 1 year ago in reply to shabaz

    Another way of "homing" is to step the complete length with lowest possible torque. It will then slip when at the home base.

    Also happy to see the library in action with 2 motors. I only have one, and wasn't able to prove that it works in practice.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 1 year ago in reply to genebren

    I was going to build a coil winder originally, but the need went away. Not sure what to do with them!

    I might try to 3D-design a limit switch for them, so that it's easier to reset their position.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 1 year ago

    Looks great.  It is nice that you got back to trying this.  I hope you have some interesting plans for the linear actuators.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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 © 2026 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.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube