12v DC current sensor motor stop

I am very new to this.
I am wanting to control a 12v DC linear actuator. On the outward movement I want it to stop at a predetermined force when it hits an obstruction using a current sensor. I intend to operate it on a momentary on push button. On operating the button it activates a DPDT relay. The NC connections are wired to reverse the ram in. So the ram will return inward and stop and stay on the actuators micro switch. The outward motion is on the NO so when the button is pressed and held the ram extends and stops at the obstruction. The button is released the DPDT relay returns the ram inward.
I found this on You Tube for a similar project but it isn't working for me.

It has a current sensor ACS712 and a relay module.
I have tried the hardware and software from the above You Tube video but it doesn't work for me. I don't know what I am doing wrong. The video lists all hardware required and has the coding available to download.
I did try a module (not Arduino) that sensed the current sensor with a relay. The first part worked perfectly but after hitting the obstruction the module power supply had to be disconnected to reset it, which I don't want to do. I thought the Arduino would solve my problems but at the moment it is evading me.

This sounds exactly like a thread from last week. The linear actuator was a screw and the motor was turning the screw. There is no direct connection between the motor torque/current and the screw pressure on the nut on the screw. If your linear actuator is NOT this type, please give a link to it's technical information.

What is the motor current when the actuator is extending without load? When the required force is reached?

Motor is 4amp, no load. 5amp max. Not sure exactly how much force yet. Once I can get it to stop with my hand I can work from there.

Only 1 Amp difference between no load and full load? No load is 80% of full load? Did you measure that or read it from a spec sheet? If measured, how?

Which one of thousands? :smiley:

Spec sheet stated 4 amps. when I queried supplier they said Max 5amps. I presume that is working max.

It was this one. A cheapie off Aliexpress.
https://www.aliexpress.com/item/32842131234.html?spm=a2g0o.order_list.order_list_main.194.36ee1802DVDBmv
12v, 30mm/sec, 400Nm

So, your "trip point" will be between 4 and 5 Amps. Problem:
When a DC motor starts from standstill, it draws 5 to 10 times the full load current while accelerating up to speed. That would trip your sensor before the end effector even moved. The way around that is starting a short timer (100ms ?) at start and ignoring the sensor until the motor is up to speed, then watching for the trip current.

That is probably the maximum rated current for continuous, maximum power output operation.

The start/stall current may be greater than 20 A. Easy to detect, especially if you buy a motor driver that reports the current draw.

I have changed the software "sensor value" right down to 1 and the motor still operates and will not stop. The author of the You Tube video recommended starting at 530.

What software? Please follow the forum directions and post the code, using code tags.

What is the ADC reading when the actuator is extending with no load?

Perhaps I shouldn't say software, I think I meant code. The code is Motor_Protection

Sorry, I'm not downloading anything from that site, good luck.

The ADC is around 514.
Thanks anyway for your time. I think there is something wrong somewhere.

Is your actuator and current sensor the exact same as the video?

Yes the same except it is 5amp not 40amp. Could that be the problem?

What is "it"?
Tell you what:
Post the datasheet or brand name and exact part number for your actuator. which ADS712 (there are 3) 5 amp,20A and 30A?
Which power supply you're using (voltage and current capacity).
A drawing of how components are wired together, which Arduino or other "compatible" MCU board and the code that's running on it.
Then, maybe one of the very smart folks here can help out.