Thursday, February 20, 2014

Stepper Motors

Stepper motors are unlike ordinary motors.  A simple motor will spin when current is applied to the coils.  Reverse the polarity of the current, and the motor spins in the opposite direction.  Stepper motors, however, contain multiple coils which can be energized individually to provide precise "stepping" of the motor.

This precise control makes them perfect for a variety of applications.  They are commonly used in floppy drives, hard drives and CD/DVD drives to precisely control the speed that the disc turns as well as where the read/write heads are positioned.  They are also used in scanners to position the scanning optics and in ink jet printers to move the paper and position the print head.  Any application that requires precise positioning is likely to use stepper motors.

For more details on the many varieties of stepper motors, see the following pages:

Quick Start for Beginners -

Stepper Motor Basics -

There are two basic methods for controlling a stepper motor.  One is to use an IC specifically designed as a stepper motor controller.  The other option is to use a microprocessor (the Raspberry Pi, in this case) to directly control the individual coils of the stepper motor.  This is the method that I demonstrate in the following video.

The code for the program used in this demo follows.

Wednesday, February 19, 2014

Stupid Simple Tip #3

The ribbon cable connector used for floppy disk drives on PCs can be used as a GPIO connector.

They are larger than than the Pi GPIO connector (34 vs 26 pins) so they overlap some.  These are cheap (free if you have old PCs to scavenge from.)  One problem - they won't fit in a case made for the Pi, but I have used them in cases that I built that held the Pi as well as other hardware.  If you do use this cheapskate trick, I recommend trimming the unused lines from the ribbon cable to prevent confusion.  It is also a good idea to plug the unused holes on the connector so that you don't accidentally plug it in wrong.

Monday, February 17, 2014

Stupid Simple Tip #2

The body of an old ball point pen can be easily made into a standoff of any size.  And it's hard to beat the price.

Stupid Simple Tip #1

A rubber band and a pair of pliers make an quick and easy clamp for holding components while soldering.