Electronic – arduino – Debugging the bipolar stepper motor design

arduinodebuggingstepper motor

I'm trying to connect a NEMA 17 Bipolar Stepper Motor to an Arduino Uno using an L298N Stepper Motor Controller Module and control its speed using a 10K potentiometer.

I haven't found any examples online on how to do this explicitly (using the L298N controller module), so I've resorted to trying to design the circuit myself. This is, literally, my very first attempt at designing a circuit myself. I have no background in electronics or electrical engineering. I've gathered as much info as I can from the arduino website and the manufacturers of the motor itself. This much I'm certain of:

  1. The motor should be powered independently from the arduino, using 2.55 volts and 1.7 amps.

  2. The motor and its power source must be connected to an H-bridge before connecting to the arduino inputs.

  3. Pairs of wires on the stepper motor are connected and can be determined easily by hooking an LED light to a pair of wires and rotating the motor manually. Connected wires will cause the LED to light up.

  4. All grounds should be connected together.

In addition to this, I'm also making a few (hopefully true) assumptions:

  1. The L298N Controller module should provide the necessary H-bridge.

  2. The H-bridge inputs should be connected to a contiguously indexed array of digital pins on the arduino.

  3. Despite the specs indicated the need for 2.55 volts, a 2.5 volt source should be sufficient for this motor.

  4. Since a 2.5 volt source is not readily available, I can create one with a voltage divider.

  5. Reversing the polarity of the stepper wires to the Controller Module (h-bridge) does not matter. That is, if a pair of connected stepper motor wires Wire1 and Wire2 are wired to Out1 and Out2 on the L298N Controller Module (respectively), then hooking up Wire1 to Out2 and Wire2 to Out1 would produce the same effect as the original wiring.

Based upon the above facts/assumptions, I created a schematic of how I think everything should be hooked up:

My stepper motor schematic

Note that the two instances labeled 2.5V are connected to each other. Additionally, all grounds are also connected together.

I would like some feedback from the community on my proposed stepper motor design. In particular, I would like to know if my assumptions above are correct and whether I can obtain the necessary current for my stepper motor using my voltage divider as displayed in the picture above. Any suggestions to improve / ensure functionality would be greatly appreciated!

If anything is unclear about my schematic or assumptions, please let me know and I will clarify as best I can.

Best Answer

Okay, you have a couple of issues:

  1. Your voltage divider will present ~2.55V at it's centre, but only unloaded - due to Ohm's law as soon as you present a low resistance load the voltage will drop severely. For instance, if your stepper coil has a resistance of around 3 Ohms, then the voltage will drop to ~9mV!. See the various wiki pages on maximum power transfer and voltage dividers.

  2. Rather than making sure you have exactly the right voltage, you would be better off with a stepper motor driver that will ensure no more power than the motor can handle will be used. They do this by "chopping" the voltage into pulses, and there are many to choose from. The L298 is pretty old now, uses bipolar transistors and after the source/sink saturation voltages you will have almost nothing left to drive the motor. I would read this wiki page on Stepper Driving (and related pages) plus ask people who have already used these setups - the reprap folks are probably a good source of info.

On dropping small amounts of voltage, a series diode can come in handy to drop between 0.3 and 0.8V or so per diode. But for efficient power regulation, depending on the difference between input and output, linear or switching regulators are the norm, (almost) never voltage dividers for supplying power.