0

I'm trying to control a DC motor with the L298N motor driver and it worked for a brief moment. I've used the setup mentioned in this video tutorial, but someone in the comments said that with this wiring, you might damage the L298N - which I think has happend now.

How can I protect the L298N against damage?

EDIT:
This is the schematic: enter image description here

It is wired after the above tutorial, where he lists the wiring like this (sorry for low quality):

enter image description here

curly_brackets
  • 111
  • 1
  • 3
  • If you made this using Fritzing, please post the real circuit diagram. This is almost impossible to follow for EEs. It should be available from one of the tabs. (Oh, I see now that the image is actually tagged Fritzing). – AndrejaKo Apr 02 '14 at 20:50
  • 2
    This is an electrical/electronic engineering site and basic standards should include a circuit diagram. – Andy aka Apr 02 '14 at 20:54
  • Hi guys. I've uploaded the diagram. Hope this helps... :-) – curly_brackets Apr 02 '14 at 21:10
  • If you really powered the whole thing with a 9V battery the chance that you damaged the l298 is low. – Wouter van Ooijen Apr 02 '14 at 21:10
  • It's connected to USB to my computer, and attached a 9V battery as external power to control the DC motor. – curly_brackets Apr 02 '14 at 21:11
  • I posted [a question and answer pair](http://electronics.stackexchange.com/q/105136/2028) to help explain the differences between schematics and wiring diagrams, and how Fritzing fits in. – JYelton Apr 02 '14 at 22:16
  • Your "schematic" doesn't make sense - it shows one input of the 298 connected to +5, and another to ground. Two outputs are shown connected to what I think are outputs of the Adruino, and +9 volts connected to an output of the 298. No clue as to where (if at all) the motor is connected. – Peter Bennett Apr 02 '14 at 22:55
  • Sorry guys, I'm brand new at this stuff... :-) I've updated the schematic. I hope that this helps understanding. – curly_brackets Apr 03 '14 at 06:57

2 Answers2

1

Questions, which, with any luck, might turn into an answer.

You appear to be using the 298 just as a simple transistor switch, rather than as the full-bridge driver it's intended to be. That's OK, though it would be less confusing if you just used a transistor. (But perhaps you're going to use it in more elaborate fashion later?)

Anyhow... test procedure:

Step 1. Test the motor: Separate from the circuit you showed: Connect the motor to the 9V battery -- does it run? If so, it can be used to test the next step. If not, address either the battery or the motor. To be honest, a slot car motor is going to drain one of those common small rectangular 9V batteries quite quickly, so beware of that during testing.

In the following, attach and detach the motor only with power off or disconnected.

Step 2. Test the 298's basic function: With power off: -- Reattach the motor to the 298 as shown in your diagram. -- Disconnect the Arduino from the 298 entirely. -- Check that ground and 5V wires are connected to the 298 as shown. -- Jumper In1 and EnA to ground.

-- Power up the 5V supply, and attach the 9V supply. Motor should not be running.

-- Disconnect In1 and EnA from ground and connect them instead to +5V. Motor should run.

If this test doesn't work, then something is amiss in the wiring, or, relatively unlikely, with the 298 itself. So recheck the wiring.

You can also try repeating test 2, but connecting the motor to Out3, and using In3 and EnB for the tests.

Step 3. If test 2 DOES work, then the problem is in your Arduino code. Devise a way to inspect the outputs D10 and D11, for example hook up a couple of LEDs (with series resistors of 200 to 1000 ohms). Run your code and see whether the LEDs do what you expect.

In the process of doing this exercise you are almost certain to stumble upon some error or omission.


As for protection of the L298, the main strategy is to use diodes to minimize "back EMF". When the motor is suddenly switched off, energy remaining in the motor turns into a current with no where to go, which results in a high voltage that can damage the switching device, here the L298. So the diodes provide a path to ground or + supply to dissipate this energy safely. That is discussed here: http://www.raspberrypi.org/forums/viewtopic.php?f=37&t=57872 , and a representative schematic is here: http://www.4tronix.co.uk/arduino/pictures/HBridge_02.jpg. Note D1 and D9 connected to Out1, for example. One diode connects to ground, the other to the V+ of the motor supply, in your case +9V. Note polarity of the diodes.

Hope this helps.

gwideman
  • 2,679
  • 13
  • 19
  • Hi, thank you for your answer. It's an L298N for sure, but Fritzing only had this when I made the sketch... The driver itself is a L298N. I will try to test it out. Thanks. – curly_brackets Apr 08 '14 at 14:52
-1

Am I the only one who noticed that pin3 of the L298 should be the one connected to the motor instead of ground?