user82557: I'm using an arduino UNO with a L2989N motor controller with a nema 17 hanpose 17h3401 stepper motor. I'm using two 9 volt batteries in series to power it. I'm sure I connected them properly but it just doesn't work. I tried using the example stepper motor sketch stepper_oneRevolution but it didn't work. I just cant pinpoint what's wrong.
PS. I'm very new to this

user20245: It is highly likely your power source supplies insufficient current to power both the stepping motor and the Arduino reliably.
This is very similar to one of my past stackexchange question / answer.
Where I say ...

Consider using a power source which can supply more current.  For
instance, D size cell batteries can supply much more current than
a small 9 volt battery.

... all that said, stepping motors are high current devices.  It may not be feasible to run stepping motors off batteries.

82557: <p>I'm using an arduino UNO with a L2989N motor controller with a nema 17 hanpose 17h3401 stepper motor. I'm using two 9 volt batteries in series to power it. I'm sure I connected them properly but it just doesn't work. I tried using the example stepper motor sketch stepper_oneRevolution but it didn't work. I just cant pinpoint what's wrong.
PS. I'm very new to this</p>
 20245: <p>It is highly likely your power source supplies insufficient current to power both the stepping motor and the Arduino reliably.</p>
<p>This is very similar to one of my <a href="https://arduino.stackexchange.com/questions/85856/mixed-sharp-ir-sensor-readings/85859#85859">past stackexchange question / answer</a>.</p>
<p>Where I say ...</p>
<blockquote>
<p>Consider using a power source which can supply more current.  For
instance, <a href="https://en.wikipedia.org/wiki/D_battery" rel="nofollow noreferrer">D size cell</a> batteries can supply much more current than
a <a href="https://en.wikipedia.org/wiki/Nine-volt_battery" rel="nofollow noreferrer">small 9 volt battery</a>.</p>
</blockquote>
<p>... all that said, stepping motors are high current devices.  It may not be feasible to run stepping motors off batteries.</p>
