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.
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.
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 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.