I just started using Nema 17 stepper motors and still have a lot to learn about them. I bought one rated for 12v, 1.5amps Amazon.com. I have learned that it's more the current (amps) for these motors than volts.
I set this motor up with Uno and L298N driver. From what I've read they aren't the best motor drivers.
When I set up this project I used the "stepper one revolution" sketch to run it. I used a 12v, 2amp wall wart. The thing is the motor turned only one half revolution in each direction instead of a full revolution. I messed around with the wires and just about everything else to see if it was hooked up wrong. Then I changed the delay time from 500ms to 750ms and it turn 3/4 revolution. Then I changed it to 900ms and I got a complete revolution in each direction.
This is the part I can't figure out why. Why would changing the delay time change how far it would turn?
I have since switched to a 5v, 1amp power supply and the motor does a complete revolution in both directions. I tried another stepper motor rated at 3v, 1.5amps, Amazon.com, with the same 5v power supply and it runs fine at 500ms delay.
You cannot run this motor with that type of driver. The motor needs a current driver ( like DRV8825), which limits the current through the coils independent of the supply voltage ( within the limits of course ).
With a L298N and 12V you risk to damage the motor.
You would be hard pressed to find a worse stepper driver. Do as @MicroBahner says and get a proper driver (DRV8825). When you do get that driver, it is imperative that you set the coil current limit properly. The Pololu page that I linked will show how to set the coil current properly. The DRV8825 driver requires at least 8.2V power supply.
The Stepper library is not an appropriate library for step/dir type stepper motors. I have been using the MobaTools stepper library by @MicroBahner. It works very well for step/dir drivers, features acceleration (which is required for higher stepper speeds), allows microstepping (necessary to mitigate resonance effects)* and is easier to learn than, say, the AccelStepper library. The MobaTools documentation. The MobaTools library is available through the IDE library manager.
//* EDIT to clarify: The library does not enable microsgtepping. That is the job of the driver. The L293/L298 drivers do not do microstepping.
The motor driver and the Stepper library were the two things I figured would be mentioned that need to be changed. I am looking at other drivers but didn't know what a good library is. The search is half the fun.
Speaking of DRV8825 (and others like it), I see them on the internet with separate heat sinks. Do they come with a sticky surface on the bottom to apply them to the module? I was wondering if I need to order some heat sink paste.
The heat sinks that came with the DRV8825 drivers that I bought from Ebay and Amazon came with adhesive, though it is sticky it is not real strong. I have a CNC shield V3 that I use for development. It gets moved around and the heat sinks came loose so I finally cemented them. If your driver is in a case and won't be disturbed they should be OK with the factory adhesive.
Note that the heat sinks, by themselves, are not as effective as one would wish. They really should be coupled with forced air cooling (fan).
If using a genuine DRV8825 and it is set to less than 1.5A coil current you should not need a heat sink. Of course keeping the driver cooler will extend its lifetime.
And also, you do not have to set the coil current to the motor max either. Run them a current that gives reliable operation that does not miss steps. The less current, the less heat, the longer the life.