
Photo by Hep Svadja

This project is excerpted from Make: Action by Simon Monk, available at the Maker Shed and fine bookstores.
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.
1. Wire the circuit
Figure A illustrates the wiring diagram for the project, and Figure B shows a close-up of the Arduino and H-bridge module.

Fig. A

Fig. B. Photo by Simon Monk
The L293 module has jumper pins that by default keep its H-bridge circuits enabled, and so only the two Arduino outputs connected to IN1 and IN2 are needed.
Conveniently, the H-bridge module includes a voltage regulator that provides a 5V output that you can connect directly to the 5V pin of the Arduino to supply it with power.
2. Build the crusher
The basic structure of the crusher is a length of 2×4 wood. At one end, the actuator is anchored using the fixtures supplied with it. The actuator’s shaft is then fixed to a block of wood that crushes cans against an end stop. Two plywood sides help prevent the can escaping while it’s being crushed.
I haven’t used exact dimensions, because your actuator is likely to be a little different in size than mine. The best way to get it right is to place the actuator on the 2×4 and then calculate the spacings. Remember to leave a bit of a gap between the fully extended crushing surface and the end stop; otherwise, the machine might push itself apart.
3. Program the Arduino
Click here to download the project code file can_crusher.ino. Here’s how it looks:
const int in1Pin = 10;
const int in2Pin = 9;
const long crushTime = 30000; //
void setup() { //
pinMode(in1Pin, OUTPUT);
pinMode(in2Pin, OUTPUT);
crush();
stop();
delay(1000);
reverse();
stop();
}
void loop() {
}
void crush() {
digitalWrite(in1Pin, LOW);
digitalWrite(in2Pin, HIGH);
delay(crushTime);
}
void reverse() {
digitalWrite(in1Pin, HIGH);
digitalWrite(in2Pin, LOW);
delay(crushTime);
}
void stop() {
digitalWrite(in1Pin, LOW);
digitalWrite(in2Pin, LOW);
}
Although the actuator will automatically stop when it gets to the end of its travel, this crushTime period (30 seconds for my motor) sets how long the motor should be on, before reversing.
The setup function controls the whole operation of the project. After setting both control pins to be outputs, it immediately starts the crushing action using the crush function.
Be Nice to Your Motors
Imagine a car driving along and then suddenly being thrown into reverse gear — that’s pretty much what you’re doing if you suddenly reverse the direction of a motor. For small motors without a great deal of mass attached to them, this isn’t normally much of a problem. But you may find that if you’re using a Raspberry Pi or Arduino board that’s powered from the same power source as the motors, then the Pi may crash or the Arduino may reset. This happens as a result of the large current that flows when you suddenly switch directions, causing the board’s power supply voltage to dip.
For larger motors that are driving something with a lot of inertia, sudden changes in speed or direction can cause big problems. The resultant large currents may damage the H-bridge, and there’s also the mechanical shock to the bearings of the motor.
This is something to bear in mind when designing control software for larger motors. One way to be nicer to your motors is to precede any change in direction by setting the control lines to let the motor stop, pausing for enough time for it to actually stop before setting it running again in the opposite direction.
In Arduino, setting up this kind of delay function might look something like this:
forward(255);
delay(200);
reverse(255);In our can crusher code, you can see we’ve set full stops and also a delay of 1 second (1000 milliseconds) between crushing and reversing.
4. Smash cans!
Push the Reset button on the Arduino to trigger the crushing action (Figure C). Whenever the Arduino resets, it automatically starts to move the linear actuator. Smoosh!

Fig. C
Going Further
H-bridges can be used to control other types of motors, including stepper motors. They can also be used to switch power to other devices, such as Peltier heating and cooling elements. You’ll learn all this and a lot more in my book, Make: Action.
if you’re going to use an arduino to control it why not throw in a sensor to tell when a can has been placed in the crusher to start it.
You seriously used a freaking arduino to do the job of a single switch?
I make in the range of $6,000-$8,000 /a month from working online at home. For those of you who are prepared to work easy computer-based work for 2-5 hrs each day from your house and make good payment in the same time… This is a work for you… http://self40.com
It’s obvious to me (from the temporary nature of the woodwork) that this was mainly an experiment in linear motor control, not in replacing a single switch with an Arduino. And it worked. Using the duino allows you to protect the motor from over-run without limit switches. Well done. I like the idea of a can sensor too.
Don’t have time to build a device? Can’t afford a linear actuator? The secret to crushing cans by hand is the squeeze and twist:
1. Hold the can in a vertical position with one hand on each end and the fingers and thumb on opposite sides.
2. Rotate one hand around the can so the fingers are 90 degrees offset from the fingers of the other hand.
3. Squeeze the sides of the can toward the middle and push slightly from the top.
4. As the can begins to compress move the fingers of the bottom hand to the lower rim while increasing pressure from the palms of both hands.
5. Twist with the top hand and the can will collapse into a puck.
**Go slow and steady until you feel comfortable, as the can crushes strain hardening can cause points (and even sharp tears in badly manufactured or previously stressed cans) to form, and nobody wants to get poked (or sliced). Also, you don’t have to push very hard: once the cylindrical structure is compromised you’re only pushing against 4-5mil aluminum sheet, not much thicker than heavy duty foil.
TIL; That clearly explaining a simple movement that takes less than half a second to perform, without pictures, can require a lot of language.
The Arduino could lift my hatchback on my Honda Civic CRX, better than the nonfunctional pistons supplied or purchased to replace both of them.
Is that a 750 N linear actuator or did you use a different one?
ConfigureACCEPT
Privacy Overview
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.