Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I'm trying to use an L298N and an Arduino UNO R3 to drive a bipolar stepper motor.

To simplify things, I'm just trying to get a 12v output from either output-1 or output-2 of the l298 (then I can write up the 2nd h-bridge in the l298 the same way and be able to drive both motor coils).

I'm only getting ~130mv from output-1 and 140mv from output-2 (measured between the power supply ground wire and output-1/output-2). The motor is a 12v motor, but I've been able to drive it with an l293 which provides only 6v.

I am getting 5v on the logic supply voltage pin and ~4v on the enable pin (using analogWrite(3, 200) - tried with the enable pin connected to either the analog pin 3 or the digital pin 3 (labeled pwm)).

I have measured supply voltage to be 11.85v (12v power supply). I have followed the wiring/code from here and here (using same arduino code, but they got it to work, and I can't).

I have tried connecting the Current Sensing A pin to the power supply ground as suggested on the 2nd web page.

I have double checked that I have wired it up the same way. I've tried everything on both web pages and the few other pages I can find about building a circuit with an l298n and an arduino and I'm out of ideas about what to try next.

Is there anything I can do?

Here's a picture of what I built: Picture

share|improve this question
2  
Photo is better than some but could be sharper and brighter. As the problem MAY be how you connect a pin that you think is OK but isn't then a crisp clear photo may be what makes the difference. MUCH more light will help your camera greatly. If using a phone camera be sure it is in focus before capturing. Detail around the IC with where each wire goes being clear would be helpful. – Russell McMahon Aug 17 '12 at 1:07
2  
Drawing your COMPLETE circuit diagram as You think that YOU have made it will also be of use. As the two diagrams you provided are not identical and your notes suggest you have "tried" an idea from one on the other, it is not certain what you think you have actually done. The circuit is actually very simple despite it appearing slightly confusing and a dead IC or dead drive port or wrong connections are the most likely problem. – Russell McMahon Aug 17 '12 at 1:19
@Russell - Thanks for pointing the package thing out. Rather silly of me not to check the datasheet really... – Oli Glaser Aug 17 '12 at 12:01
@OliGlaser - easily done and datasheet does not make it overly clear. I've met these packagess before in this sort of context. What I want is a CLEAR photo so we can be SURE of what wire goes where. – Russell McMahon Aug 17 '12 at 14:51
Matt - Are you grounding pins 1 & 15 if a current sense resistor is not used? If pin 1 is not grounded it will; not function. – Russell McMahon Aug 17 '12 at 14:52
show 3 more comments

1 Answer

You must use a separated power supply for the bridge, and this must be attached to the arduino ground

share|improve this answer
1  
This is incorrect. It is possible to run a low-current stepper off the same supply the Arduino regulators are run from without any trouble. Depending on the motor, you might have noise issues, but that can be dealt with when/if it becomes a problem. – Connor Wolf Aug 30 '12 at 7:51

protected by Community Feb 16 at 2:31

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.