Help with ACS712 DC Current sensor.

Hello. I am completely new to Arduino, but do have some experience with electronic controls, steppers, etc.
I want create a device which will monitor current draw of a 12V geared DC motor, and reverse polarity when a certain threshold is crossed. It seems like the simplest thing would be to use a mechanical DPDT relay which is controlled by the Arduino board. In one state, the board would keep the relay closed, until the current measured by the ACS712 reaches a threshold of around 1 Amp, and the board would stop power to the relay, reversing the motor. The state would be reversed on the other end of the cycle by a mechanical limit switch. I have read a few tutorials on the ACS712, but none have gone into using it as a current sensing A/B switch.
Advice?

You are thinking of hooking them together. Don't.

What you want to do is a project, not an application. Manufacturers only cover applications not projects. The arduino combines applications into projects. The Arduino will be in charge of reading the current and controlling the motor.

The control of the motor will require two relays, one for power and one DPDT setup to control/reverse direction.

Connect the the ACS712 to the analog input. Use the analogRead to get the current, then use an if statement of the current reading to detect the current limit and stop and/or switch directions. If you do not stop the motor before reversing direction, you are going to see huge current readings as the magnetic field collapses and the motor reverses direction.

I don't quite understand your first two sentences, but yes. This is a project. No warranty expected.
Otherwise, yes. There would need to be a delay programmed in. Not only to prevent motor damage from an instant polarity reversal, but to keep the device from unwanted switching when the motor starts up in reverse. Thanks. Now I see why you suggest two relays. Maybe 1 second of power off before reversing polarity, and another 3 seconds to prevent the startup spike from triggering the switch.
Thanks!

Robobass:
I have read a few tutorials on the ACS712, but none have gone into using it as a current sensing A/B switch.

Put another way. You would never (very very unlikely to) find a tutorial on how to do this project. Many folks confuse applications with projects. Unless you are reading a walk-through of a project (such as you might find in a magazine), the tutorials are based on how to use (apply) an item in the field. Such as how to use an ACS712 to measure current or how to wire a DPDT relay to control the direction of a DC motor. Now you take the two applications and make a project. Use the ACS712 to read current and then to control the direction of a motor.

OK. Please be patient with me. I want to present the idea, and make sure it is feasible, before I invest more time in this approach. I see uses of the ACS712 to read current, but no mentions of making a threshold based switch with the Arduino board. I don't expect anyone to do the work for me. Hopefully a few hints though.

Robobass:
OK. Please be patient with me. I want to present the idea, and make sure it is feasible, before I invest more time in this approach. I see uses of the ACS712 to read current, but no mentions of making a threshold based switch with the Arduino board. I don’t expect anyone to do the work for me. Hopefully a few hints though.

Hi,
ACS712 sensor converts current to volts (taht is the only magnitude that arduino can read and convert to digital information). It enters the arduino as a value between 0 (no amps) and 1023 (full range).
Once into the arduino, you can choose to convert it to true amperes (by multiplying it by the proper factor; it is recommended -converting the value, I mean) or not. Any case, if you want to know if it has reached a threshold, just compare the value with the number you want (normally something like “if (current > threshold) then …”)
Regards

Good. That's what I wanted to know. I think I can make things happen from here, but will definitely need more help fine tuning the code.
Thanks!

Hi,
Thanks.
Another advice: do things one by one. Try first to make sure you're reading the sensor (by sending the value to the serial monitor; one of the "examples" in the IDE is almost that). Then you can make the comparation and chech if it works ... and so on.
Regards