Stepper motor on arduino

Hi guys.

Im building a 3d printer with a hp photo printer. I need to sync a stepper motor to an encoder on the hp printers board. Ive done a lot of research and found that a lot of people control the steps on the motor directly with an arduino board.

Whats the use of a motor drive shield then?

I know some programming from what ive done in Pascal, visual basic and C from a few years back, so im a bit rusty :slight_smile: Ive taken a look at the code available on this site, and im happy to say i can understand most of it.

Also, i have built some basic electronics before but never anything major or with microcontrollers, so please keep this info in mind when you reply plz :slight_smile:

Basically assume i dont know much :slight_smile:
Oh and btw there are 2 arduinos on there way from sparkfun to me here in south africa (yay!)

Thanx in advance for your help!

Whats the use of a motor drive shield then?

Because the Arduino can only supply at most 40mA per output pin, and that won’t be enough to move a stepper.

how does the arduino code at the bottom of this page work?

http://www.tigoe.net/pcomp/code/category/code/arduinowiring/51

It uses one of the Arduino libraries (Stepper), this lib. does all the nitty gritty work of doing the stepping sequences.

Hey Wynand what part of the country are you in, I am in Cape Town.

To control a stepper from any microcontroller you can drive the coils through transistors and manually control motor. Check out this article from Microchip to get started http://ww1.microchip.com/downloads/en/AppNotes/00907a.pdf

While that application note is for the PIC microcontroller the same concepts apply to the Atmega microcontroller used by the Arduino.

If you don’t want to use transistors you can use H-Bridge IC’s which contain all the transistors wired up for you. The shields use driver IC’s such as the L293 and wire it up for you to save you having to do all the work yourself. If you can’t wait for a shield you can build your own circuitry using transistors or driver IC’s