I'm trying to use a linear actuator (sample electric cylinder) for a soil penetration device. Originally, I thought of using a pressure sensor to know when/if I hit a rock. However, I am not seeing many linear actuators with integrated pressure sensors but they do come with potentiometers. So I am thinking, would it be possible to use the potentiometer as a rough way to know if I hit something?
Basically, my program would check if its position does not change for a small time interval. If the position has not changed before it extends the maximum length, then the actuator must have hit something it cannot penetrate well.
Yes, you'll see the position become fairly stable when you've hit a rock (assuming that your bot is heavy enough to stall your actuator).
Measuring current will also tell you if you've stalled/are stalling. I have used a Pololu controller which apparently has current feedback over USB but I have not used that feature. I suggest that you use something like this rather than building your own H-bridge and current sensor. It will make it easy to experiment with different approaches.
Proximity: Alternatively, You can use sensors such as capacitive or inductive proximity sensors. It is used quite frequently in the industry to detect touch and contact or measure temparature or distance. For example:
Using a pot, or a linear encoder, could let you know when the actuator is no longer moving. But I would not call that a pressure sensor. If you want to know the actual pressure for a dirt-penetrating device, you could use a piezo crystal, or another tip device that responds to pressures (see haptic sensors). Alternately, you could sense the current into the actuator to determine the impedance of the environment.