Bipolar Stepper Motor w/L298N Problems!

Okay I have a L298N hooked up with my arduino and the small $15 4-wire bipolar stepper motor from Sparkfun. My power source is 12v 750ma for the stepper then the 5v from the arduino I have tried to follow the this schematic as best as I could, I think I have everything hooked up right (I know the IN1 says pins 5&11 it should be 5&12). The diodes are 1N4934.I tried running the code from this tutorial but when I do it just does 2 stepper every ~5 sec with ~1/4sec in between each step. I hooked up the easy driver to this motor before and it worked just fine. But I wanna get some beefier motors so i figured I need a beefier motor driver. But I want to get this to work first so i know exactly what components to get. Please help. I already lost to many hours of my life to this thing.

Great to provide photos, but I don't think I can really follow that nest of wires(!) I'd double check - also what's the rating of the stepper motor - you don't mention this.

Sorry about the photos I know they are messy. I have checked my wiring a few times, it seems correct. I’ll try to clean it up. The motor is from here
Step Angle (degrees) :1.8
2 Phase
Rated Voltage : 12V
Rated Current : 0.33A

Here are two more pictures

All the wires are the same colour, that's impossible to follow! I think that's probably where the error comes from, best to have a full set of colours if you can.

Have you followed the voltages by multimeter or oscilloscope to see what's actually happening?

Okay so I have finally gotten around to rewiring my L298N. I am still running the same motor from sparkfun. (see above for link) I don’t have any blue hook up wire so the wire coming of the motor is black instead of blue. but the coils on the motor are (A = Red, C = Green, B = Yellow, D = Black/Blue) A/C are one coil and B/D are the other coil. I am using 1N4934 Schottky diodes, with 2 ceramic 104m caps and 2 1000mF 16v caps. So the schematic above for wiring diagram. So what is happening is the the motor is kind of stepping but not really is kinda just vibrates and goes both directions and stuff (See the video). Also when I hold it down it seems like it just stops moving I think some of my wires are crossed somewhere most likely the output pins? Here are pics, videos, and code. Thanks again for all the help. Same power supply as listed above.




#include <Stepper.h>

#define STEPS 200 //the number of steps for one rotation (this is motor dependant) 
                  //if unsure 200 is a good starting point and the value can be determined

Stepper stepper(STEPS, 2, 3, 4, 5);  //declares a stepper motor with coil A connected to out 1 and out 2 (arduino pin 2 and 3)
                                     //and coil B connected to out 3 and out 4 (arduino pin 4 and 5)

const int enable12 = 9;   //bridge 1 and 2 enable (pin 1 on the 16 pin IC) 
const int enable34 = 10;  //bridge 3 and 4 enable (pin 9 on the 16 pin IC)

void setup()
  pinMode(enable12, OUTPUT);    //Set the enable12 pin to Output
  pinMode(enable34, OUTPUT);    //Set the enable34 pin to Output  
  digitalWrite(enable12, HIGH); //Set the enable12 pin HIGH to turn the bridges on
  digitalWrite(enable34, HIGH); //Set the enable34 pin HIGH to turn the bridges on  
  stepper.setSpeed(50);           // set the speed of the motor to 50 RPMs

void loop()
  stepper.step(STEPS);  //Rotate the motor forward one rotation
  delay(1000);          //wait one second
  stepper.step(-STEPS); //Rotate the motor backward one rotation
  delay(1000);          //wait one second

I will not attempt to check your wiring from the pictures. I think it is hard enough to that even if I had the breadboard in my hands. ;)

It makes a difference for (some) steppers if you reverse the polarity of connecting your coils.

The last code you posted is simple enough. So, the inevitable conclusion arises: There is still a wiring error. I have been down that path. Checked, rechecked, convinced it was correct, and then after faultfinding for the uumpteenth time find the miswiring anyhow.

There may be a fault in you wiring as you may be using the wrong schematic. (My first L298N was fried as I had read the pinout mirrored - :roll_eyes: ) Have you used an Ohm meter to verify that the motor wire/colors are as expected?

Hang on in there! Sleep, give it another shot.