You need to consider the mechanical arrangement, what the expected load is and how you control the motor.
Imagine you start the motor by applying full voltage via a relay.
The motor is initially stationary so you will see the stall current. You need to allow the back emf to build up as the motor turns.
Similarly you may need to account for the behaviour of the load on the motor.
You can monitor the current as described in some detail here
So your "detector" will need to make those corrections in software.
The bulk of what I have seen in motor protection is thermal based protection. This works because a motor can survive being overloaded for a period of time. A fuse will protect it from a major fault. This should help explain it:
IF you are still going ahead with this project, then you need to include "time" in your calculations. An overcurrent detection must also include the amount of time that is taking place. An over current just a bit over your limit might cause a fault in 1/2 a second. But a 2X overcurrent should be limited to, perhaps, 1/10 of a second.
Got some ACS712 20A boards for testing and can read the current in both directions of the motor. The motor running is 3-4 amps, when the motor jams it goes up to 15 amps. The turn on current of the motor is never higher than 7 amps.
I have 2 relays to power the motor so what would be the best way to shutdown the relays if the current reading is 10 amps.
void setup() {
Serial.begin(9600); //Start Serial Monitor to display current read value on Serial monitor
}
void loop() {
unsigned int x = 0;
float AcsValue = 0.0, Samples = 0.0, AvgAcs = 0.0, AcsValueF = 0.0;
for (int x = 0; x < 150; x++) { //Get 150 samples
AcsValue = analogRead(A0); //Read current sensor values
Samples = Samples + AcsValue; //Add samples together
delay(3); // let ADC settle before next sample 3ms
}
AvgAcs = Samples / 150.0; //Taking Average of Samples
//((AvgAcs * (5.0 / 1024.0)) is converitng the read voltage in 0-5 volts
//2.5 is offset(I assumed that arduino is working on 5v so the viout at no current comes
//out to be 2.5 which is out offset. If your arduino is working on different voltage than
//you must change the offset according to the input voltage)
//0.100v(100mV) is rise in output voltage when 1A current flows at input
AcsValueF = (2.5 - (AvgAcs * (5.0 / 1024.0))) / 0.100;
Serial.print(AcsValueF); //Print the read current on Serial monitordelay(50);
}
As pointed out, you are not measuring the current fast enough. You need to read out the current at 1kHz or greater rate, and you can't do that and print out the values at this ridiculously low serial Baud rate. Use 250000 or 500000 instead.
Serial.begin(9600);
The startup current is very close to the stall current during the first few milliseconds.