Linear actuators convert the fast rotation of a DC motor into slow linear movement, and they can provide quite a strong pushing or pulling force.
You can easily control these actuators using a simple H-bridge circuit — put it together with an Arduino and a bit of woodwork, and you can make yourself an automatic crusher for beverage cans — no soldering required!
H-Bridges
An H-bridge is a simple circuit that uses 4 switches to change the direction of a DC motor (forward or reverse) by simply reversing the polarity of the motor’s connections.
With all 4 switches open, no current can flow through the motor. However, if switches S1 and S4 are closed, but S2 and S3 are open (as shown here), current will flow from the positive supply to terminal A of the motor, through the motor and S4 to the negative supply, and the motor will turn in one direction.
If S1 and S4 are now opened and S3 and S2 closed, the positive supply will be applied to terminal B instead and flow out through the motor and S2 to reverse the direction of the motor. Interestingly, you can brake the motor by closing S1 and S3 simultaneously (or S2 and S4). Just don’t close S1 and S2 at the same time (or S3 and S4) or you’ll cause a short circuit!
The L298 chip in your H-bridge module contains 2 miniature H-bridge circuits that work in exactly this way.
CAUTION: Linear actuators are strong. This project is about crushing beverage cans, but the actuator will quite happily crush a hand or anything else that you put into the crushing area. So be careful, especially while you’re getting it to work, when there is a temptation to adjust and intervene.