unfortunately it is not working and i guess something is wrong.. i have a doubt regarding the two pins 9 and 4.. i think it has been interchanged in the circuit... because the datasheet of L298 says that pin 4 is for supply and pin 9 for logic. Also the Vc +5V is being connected to the ground in this link.. I guess this is the mistake why the circuit is not working. Could anyone please tell me whether I am correct or wrong..?? thank you

Something is wrong with your schematic and the VS connection - you show your Vc+5v connected directly to ground and a capacitor in series with the supply which will block the current to your chip.

Edit - re-reading, I see you asked about this.

It will not work as drawn. The voltage source needs to be on the other side of the capacitor - directly to pin 4.

As far as pins being mixed up - pin 9 should be the same 5V as your chip. Pin 4 should be the motor supply voltage - does the label on the drawing Vc+5v mean that it is at 5V or that it is 5V more than Vcc?

Also, you don't need the 22 ohm resistors unless you plan on measuring the current. Those pins can be connected directly to ground. Putting the 22 ohms in series with your motor supply will reduce the performance.

And, are 'Vmotor" and "Vcc+5" the same voltage source? They should be.

Pin 9 is the logic power supply. This is usually 5V. 4.5V to 7V is the allowed range for the logic supply. (The datasheet calls this Vss which can be confusing since Vss is often ground.)

Pin 4 is the motor power supply. This needs to be at least 2.5V higher than the logic power supply (so at least 7.5V if using 5V for the logic power supply). 12V seems to be a common motor power supply value. It can be as high as 46V.

There are lots of cheap L298 boards on ebay. I have a bunch from this seller.

thanx.. i made a few changes. im not using those sense resistors as your advice..well i am using arduino and i powering it with 9 V battery. my motors are 5V.. im using a voltage regulator (7806) to supply the 6v to the motors. my question is pin 4 being connected to the REGULATED voltage (6V) is correct or wrong?

Also i read in one the SOR tutorials that a capacitor being connected to the two terminals of each of the motors will increase their lifetime.. So what capacitor should I use? I guess it is an electrolytic capacitor..Please tell me the most suitable value for it..

The supply voltage needs to be 2.5V higher than your logic high values (pins 5, 7, 10, 12) If you are using 6V to supply the motors, then you would want these voltages to be down at the 3.5V range (minimum voltage on these pins is 2.3V) . If your Arduino is kicking out 5V on the digitial outputs you could put a voltage divider in the connection between the Arduino and the L298N. Also, it doesn't hurt to put 10K or so between the L298 and the Arduino so when you let the smoke out of the L298 you don't take the Arduino with it. So, to do the voltage divider from 5 volts it would be:

Check my math. And check to make sure you don't overload the Arduino I/O pin.

You can't use an electrolytic capacitor on the DC motor pins if you are going to run it in both directions because each wire will sometimes be + and sometimes - and the electrolitic cap is polarized - it only works one way. Ceramic caps would be better. Off the top of my head I woud guess about .1uF but you probably want to do some more research on that.

The 9V battery can only give about 100 mA of current before it starts to sag noticeably.

You may find that the 9V battery can't drive your motors effectively. If that happens, you could use a four-AA battery pack instead for the motor, and forego the regulator entirely.

You could also just wire 9V directly to the motor, and instead of burning it off with a regulator, just set the PWM duty cycle to something lower. If you set the PWM to 128-out-of-255, and have 9V motor power, the motors will see an effective 4.5 volts.

The EMI capacitor used on the motor terminals is typically in the range of 10 nF to 100 nF, and should be a high-voltage ceramic capacitor. For your case, a 25V ceramic with 10 nF capacitance would probably be about right.

You could also just wire 9V directly to the motor, and instead of burning it off with a regulator, just set the PWM duty cycle to something lower. If you set the PWM to 128-out-of-255, and have 9V motor power, the motors will see an effective 4.5 volts.

That solves the problem of keeping the supply voltage higher than the logic voltage as well. Forget my suggestion.

The capicitors filter out noise caused by the digital circuit switching to reduce the impact of the switching on the devices in the circuit

DC motors are, essentially, big coils of wire - inductors. When current is flowing through the coils, it builds up a magnetic field. When you shut off the current, the magnetic field collapses. However, that colapsing magnetic field is like having a wire move through a magnetic field - it generates a current. But, if you have opened up the circuit to turn off the power to the motor, where is that current going to go? With nowhere to go, it can result in high voltages that can damage componants. The diodes give that current a place to go (back to your power source) without causing damage.

In engineering, you have to choose the right part given the known requirements.The main difference between 1n4007 and 1n4001 is the rated voltage.Personally, I think the 1000V rated voltage of the 1n4007 is way overkill, and a 1n4001 would be quite good enough for the job.In fact, I think in your case (small motor,) a fast-recovery signal diode like 1n4148 might be used, and would save a little cost/board space/leakage current.

Schottkys are fine. Note that the 1N4148 I recommended actually switches FASTER than most Schottkys, and has lower capacitance (which doesn't matter here); the main benefit of Schottkys is that you can often get them in higher amp ratings than conventional fast-recovery diodes. For a bigger motor, that's a good idea. For a small motor, a small diode is good enough (me and Soren had a discussion about this a while back on this forum, if I recall correctly)