Changing direction of DC motor using LN298N driver.

Hello, I had bought new DC LN298N motor driver in form of PCB board. It have 4 input pins and 2 enable pins. I can connect max 2 engines. http://sklep.celiko.net.pl/image.php?main=images/mikro/moduly/modul_sterowania_silnikow.JPG&watermark=watermark.png -> link to image of driver.

Question is simple how to change direction of engines using this driver. How to connect? Where i should connect GND? What is Vms?

To drive one motor, you make say ENA high, then put a high and a low on the associated IN pins, ie IN1 and IN2. Then to reverse, you swop the high / low on the IN pins to be low / high.

According to the pic, the GND is one of the blue pins at the top.

EDIT.... but you really should check the documentation. There is documentation?

Thank you for response.

Yeah, i know that i should look for documentation. But there is documentation for LN298N chip not for PCB. Nor i can't find it.

Returning to topic, but what if i wanna connect external power? How to send signals, i must have signal (output pin) from Arduino connected to GND, right?

Yes, connect the board's ground to the Arduino ground, else the Arduino signals will have no reference and thus no meaning.

I can't see the pin labels on the pic, but there will likely be two power inputs to the board: one will be to power the 298 logic (~5V), the other will be for the motors. If my memory serves, the 298 handles a motor voltage of almost 50V.

Don't even think of powering the motors from the Arduino 8)

And allow for a minimum 2V drop of the motor voltage through the chip, up to about 5V loss at high current. check the 298 datasheet for exact values....

I'm not even thinking about powering motors trought Arduino. But, can I power logic of driver trought 5V pin?

overkiller: I'm not even thinking about powering motors trought Arduino. But, can I power logic of driver trought 5V pin?

Yes, i think it will work.. I've tried before and it work well..

Yes, you can drive this module direct from your Arduino. The shop that sold you the unit has this poor excuse for a "datasheet" available. It tells you you can do this, but not how you can. The unit has a jumper for every pin it has. You need to set those in the correct position, it's impossible to tell what that position would be with the available data.

This is how these units work in general, assumed the jumpers are set correct: Set IN1 HIGH, IN2 LOW, then set ENA HIGH. The motor wil start running at maximum speed in one direction. Set ENA LOW, the motor will stop running. Set IN1 LOW, IN2 HIGH, then set ENA HIGH. The motor will start running at maximum speed in the other direction. Set ENA LOW, the motor will stop running.

There are advanced ways to use this unit. You can use PWM at the ENA (or ENB or both) pin. That will give you control over the motor speed.

You can also set both IN1 and IN2 LOW and set ENA HIGH. This will short the motor and act as a brake.

And by adding some hardware you can incorporate some protection that might prevent the motor from damage by incorrect control or overload.

So if we are talking about protection, what should i use?

I was thinking about high wattage resistors for overload protection.(correct me if i'm wrong) But i do not know how to secure them from incorrect control?

That is what i was thinking about too. If you do control them in an inappropriate way, there will also be too much current and the same protection mechanism should kick in. Those resistors i was thinking about, aren't meant to limit current themselves. They are meant to measure current. That means you will measure the voltage drop over these resistors, and if this voltage becomes too large, you'll have the PWM kick in to limit current. So resistors aren't the only additional hardware, you also need extra analog inputs and probably an amplifier (perhaps galvanic isolated) to do your measurements in the correct range. Of course things depend on how much you need to do this protection.

I'd start by trying to control the motors without the protection.

I really need protection beacuse if i burn any of motor i will have to dismantle my robot to replace it.

How big (Ohms) resistors should i buy? 0.5 Ohm will be right? We are talking about OP amps, right? I have CA3193E amp (datasheet: http://pdf1.alldatasheet.com/datasheet-pdf/view/66340/INTERSIL/CA3193E.html) and MC14538BCP (datasheet: http://html.alldatasheet.pl/html-pdf/11988/ONSEMI/MC14538BCP/184/1/MC14538BCP.html) Can I use any of them?

The lower the resistance, the lower the resistor's influence. But i can't tell anything without knowing what current we're talking about.

Also, remember that you will have positive and negative voltage drop over the resistor, as you are going to reverse direction.

OPAmps are amplifiers indeed. It depends on the way they are used, if they are to be called opamps or an other name. I don't know what type would be best and how well the types you've got available will do (that's going to take a bit time to study, and i don't have that time available right now).

Okay. Thank you for help :)

Thread can be closed.

Threads don't get closed unless they need to be. I'd like to have feedback on your progress in this thread. Your questions and their solutions can help others. So if you make any progress or find any error in answers you got, and / or find other, perhaps better solutions, please let us know. I can learn from you as well as you might learn from my input.

Ok.

I'll add some pictures of progress. I have almost done my vechicle. But it is normal that, my IR receiver is hot after while?

But it is normal that, my IR receiver is hot after while?

No.

Info on a almost-the-same Motor Driver here: http://arduino-info.wikispaces.com/MotorDrivers