if any object resists my dc motor how can i stop it ?

please help me i have a dc motor but i want to stop this motor if any object making any resistance of movement can you help me thanks a lot

You can monitor the current with a current sensor. Run the motor to get a baseline reading then add more resistance (slow it down with your finger) and watch the value from the sensor increase. When it gets to a certain point that you think is too much, you tell the code to stop the motor.

thanks a lot

Google for things like anti-stall for electric windows.
I know there used to be app notes on the Microchip site

HazardsMind: You can monitor the current with a current sensor.

Is that what the current sensors built into an L298 are for? I imagine so- are they easy to use?

Edit.... that rang a bell and I uncovered this thread which describes the use of the 298's current sensors.

How big is the motor?

What kind of obstacle is to stop the motor? How much is "resistance"? (i.e.: a 10% -more or less- of whatever you measure, a 20%, . . .?

Is that what the current sensors built into an L298 are for?

Good catch, I forgot they had sensors in them. The board i'm using (here)doesn't have any breakout pins to the sensors, unless you trace and measure from the resistors.

Whoever makes those boards should include pins from the sensors.

HazardsMind:

Is that what the current sensors built into an L298 are for?

Good catch, I forgot they had sensors in them. The board i'm using (here)doesn't have any breakout pins to the sensors, unless you trace and measure from the resistors.

Whoever makes those boards should include pins from the sensors.

I've just started a thread about sensing current on a MotoMama, which also uses a 298 and doesn't bring the pins out. But it does seem the pins go to resistors, although I doubt if they are the current sense resistors which need to be in the whole Watt range.

Well the people who design these types of boards tend to use cheap components, so I doubt it too. But let me know what you find. Could I have the link to your thread or is it the one you posted above?

HazardsMind: Could I have the link to your thread or is it the one you posted above?

No, a new one

Thank you.

JimboZA:
Is that what the current sensors built into an L298 are for?

No they are :-

  1. Not built into the chip they have to be external.
  2. They are designed so you can make a chopping regulator with the addition of a L297

I supposed you could use it for this purpose but if you treated the voltage correctly but remember if you just wire it so the current stops then it immediately starts again once it has stopped. This leads to an oscillation called hiccuping.

My final year degree project ( back in the 70s ) involved a current detector to turn off a motor when it had rotated a sample through 90 degrees.

Grumpy_Mike:

JimboZA: Is that what the current sensors built into an L298 are for?

No they are :- 1) Not built into the chip they have to be external.

Fair comment but I meant the presence of the pin for that purpose, not the external resistor.

Grumpy_Mike: I supposed you could use it for this purpose but if you treated the voltage correctly but remember if you just wire it so the current stops then it immediately starts again once it has stopped. This leads to an oscillation called hiccuping.

Perhaps one could handle that in code, so it pauses (perhaps even reverses for a moment), tries again say once, and then stops totally. Then an external momentary push switch could do a reset when the user checks that there's not obstruction.

Yes or you could handle it in hardware, the over current causes a flip flop to be cleared and removes the power. Then just set the flip flop to set it going again.

but I meant the presence of the pin for that purpose

Yes but you would need that pin as an ground return for the coils anyway. If you don't want to sense current you just ground these pins.

hi you may put gear box to this motor it make it stop but motor should be with high amber after that

firasalfares: hi you may put gear box to this motor it make it stop but motor should be with high amber after that

I think not? You could fit a friction clutch but not a gear box. What is high amber? It is not a recognised engineering term.