Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Problem with DC Motor and L298N driver

Status
Not open for further replies.

alexsoad

New Member
Hello,

For my project i am using a L298N motor driver to command 2 DC Motors (200 mA, 6-9V).
For beginning, let me post the part of the schematic where the problem occurs:


I made a test board , but i cannot make the motors to start. I set IN1 to 5 volts, IN2 to 0 volts, and EN A to 5 volts (always enable). This must rotate the motor in one way. I used a multimeter to measure the voltage from OUT1 to OUT2, and all looks fine: 6-9 volts, depending on what voltage i select. But when i connect the 2 outputs to a motor, nothing happends.
I have connected two wires to the motor, directly from DC Source, and it does starts, so the problem must be from the driver.
The only thing that does not follows the L298N's data sheet is C7 capacitor. I used a 47uF instead of 470uF, but i do not think this is the problem.

Here is the datasheet of the motor driver:
https://www.electro-tech-online.com/custompdfs/2011/04/36721.pdf

I am waiting for any advises .
 

moffy

Member
What you describe should work. Try the same thing for OUT3-4, just to see if there is a problem with the OUT1-2 channel. What happens to the voltage across the motor? If you could reference both sides to ground that might help.
 

audioguru

Well-Known Member
Most Helpful Member
You say that your motors use 200mA but do not say with what load. Your problem occurs with starting a stalled motor so you must find out the stalled or starting current which might be 2A with a motor that runs at only 200mA.

I don't know if you have a little 9V "transistor" battery that cannot supply 2A for more an a few seconds.
But I do know that the datasheet for the L298 spec's a max saturation voltage loss of a total of 4.9V when the load is 2A. Then the motor gets only 4.1V if the 9V battery is brand new.
 

Boncuk

New Member
Enable pins should be either high or low to activate the outputs.

The PWM-signals should go to the input pins (IN1 through IN4).

See the function table below.

Boncuk
 

Attachments

  • L298-LOGIC.gif
    L298-LOGIC.gif
    19 KB · Views: 1,066

alexsoad

New Member
@ Boncuck:
I red somewhere that PWM signals can be applied also to Enable pins, but i am not sure yet. For now i just test with 1 logic or 0 logic.

.update to my problem.
I have removed the 1k Resistor, and i connected the sense pin to ground.
New improvments:
I measure the voltage between OUT1 and OUT2, and it is all ok. (6-7V)
I connect the wires to the motor, and for a short period of time (0.2 sec) the motor starts, but after that it stops.
I measure again the voltage between OUT1 and OUT2, and it isn't ok. (0.2V)
I reset the board=> the voltage between OUT1 and OUT2 is again 6-7 V.

So the L298N stops the motor, and i can't figure out why.....
 

audioguru

Well-Known Member
Most Helpful Member
When the motor stops running, measure the voltage of your dead battery.
 

alexsoad

New Member
problem solved :)

the resistance from the sensing pin is clearly too big and this is the main reason for having no power to supply the motors.
i let for one terminal block the sensing resistance connected, and the motor doesn't starts, and for the second terminal block i removed the sensing resistance, and the motor does work. so this is the problem.

the second thing is that the voltage meassured by me is different with the voltage shown on my variable traf. When i select the traf to output 6 volts, on the board i do have 9 volts. I can't explain why.
The problem was that i was selecting the traf at 4,5 volts to have on the board 6-7 volts. This was not enough for the motors.
I raised the voltage from the traf up to 6 volts, and on the board i had 9 volts. The result: motors are working !

thank you very much for help, and i will come back here with other problems as well, because i just started to test practically my project.
 

MrAl

Well-Known Member
Most Helpful Member
Hi,

Sounds good now. Those resistors are typically in the low ohms range and they are used to protect the transistors during an over current for one thing. They shape the output wave too but that's more required for steppers or to make the motors have a faster response to control signals.
 

alexsoad

New Member
update:
I made some tests and i cannot explain some results, so i need some help again.
At 12 V, both motors are working fine, but if i lower the voltage down to 9 V, sometimes the motors just don't start.
I don't get it... why? At 9 V sometimes the motors start, but other times they start for only 0,2 sec, and then they stop. After some resets and other retries, the motors start, and i cannot explain this.
I do not understand the cause of this malfunction. Maybe the Shottcky diodes do this stop? Or maybe the L298N?

The second problem is with my IR sensors.
I used a IR emitter, a Photo Diode and some resistances and i created my own sensors. This is the circuit




When i use a white paper for the reflection i get on the output ~ 0,3V. When i use black paper for the reflection, i get on the output ~0,05V.
The problem is if i will be able to to differentiate these two voltages. If i will use ADC from uc it will be ok?
 
Last edited:

audioguru

Well-Known Member
Most Helpful Member
How can you get an output at ground?
A photo-transistor has much more output than a photo-diode. A photo-diode usually needs a preamplifier.
 

ronv

Well-Known Member
Most Helpful Member
We are all thinking you are using a 9 volt battery. If you are it may not be powerful enough for your motors.

Try taking your output from the detector from the point between the resistor and the diode.
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top