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.
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:
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.
If you wish to build the board, see the pico-dual-stepper GitHub repo for the Gerber files.
Top layer:
3D render:
The underside doesn't have any components:
The PDF Parts List is available here.