This Instructable shows you how to control a pneumatic piston with an Arduino to animate a Halloween lunger prop. The project consists of an Arduino Uno board, pneumatic cylinder, solenoid and Halloween prop. A pneumatic cylinder can deliver a lot of power quickly and are great for popups and lungers. With a double acting piston you can push and pull the cylinder for better control
The parts for pneumatic cylinder and solenoid came from http://www.frightprops.com/ who sell pneumatic kits with great tutorials to make creating pneumatic props much easier. Solenoids require more power than can be delivered by the Arduino Uno board which is limited to 5V so we use a 12V DC external power supply.
Code is included to control the cylinder. There are three things that effect the speed of the cylinder movement 1) compressor psi 2) duration solenoid valve is open as determined by software 3) adjustment of the speed control muffler. WARNING: I drive the piston at around 20 psi, higher psi will rock the prop too severely and damage or injuries may result. One end of the piston will be attached to a base and the other to the prop. You will need to secure the base to stabilize it.
To make things simpler for beginners like myself, I included all of the breadboard connections so you can just follow a recipe.
Step 1: Step 1: Arduino Circuit Parts
- Arduino Uno R3 board
- USB cable for programming and powering the Arduino
- 5V DC or USB connection to power Arduino
- Jumper wires
- 2.2K Ω resistor
- 330 Ω resistor
- TIP120 Darlington Transistor (Radio Shack 276-2068)
- 1N4004 diode
- Push button
Step 2: Step 2: Arduino Circuit
330 Ω resistor inner (-) to a1
Button - from Digital 2 (INPUT) to b1
LED 1c,2c (+ or anode)
2.2KΩ resistor from Digital 13 (OUTPUT) to 18a – sends signal to transistor
Push button - 6g, 4e. Starts program.
18c Transistor base receives HIGH signal from pin 12 and opens switch.
19c transistor collector (or in) to solenoid (positive solenoid wire connects to outer positive)
20c emitter (or out) connects to outer ground – wire runs from 20d to outer ground (solenoid ground)
Diode – allows current to travel in one direction only 19e to outer positive. When you stop powering a solenoid, a reverse voltage, up to several hundred volts, briefly spikes back. Make sure solenoid is in the correct direction to prevent frying the transistor.
12V DC power input to outer (+) and (-) of bread board. Powers solenoid.
Output to solenoid: 19d (solenoid black wire), solenoid red wire on outer bread board (+)
Step 3: Step 3: Pneumatic Controller Parts
- 1 x 4-Way Solenoid 12V DC (#1)
- 12V DC Power Supply (barrel plugs that have center positive 5.5mm)
- Female 5.5 mm barrel power jack
- 2 X Speed Control Muffler 1/8 (#3,#4)
- 2 x Male Connector Push-On Fitting 1/8 (#5,#6)
- 2 x Male Connector Push-On Elbow 1/8NPT Threads (connects to cylinder)
- 10+ feet of 1/4" Polyethylene Tubing (#10)
- 2 inches of 1/4 inch pipe (#7)
- 1/8” to 1/4” adapter (#8)
- 1/4” quick connect (#9)
- 2 gallon air compressor (a smaller one can do the job)
Note: all threads are NPT, not metric
Step 4: Step 4: Pneumatic Cylinder and Mounting Hardware
- 3/4 Inch Bore Double-Acting Universal Mount Cylinder 8 inch Stroke (#5)
- Clevis Mounting Bracket: .25" HOLE x .11" THICKNESS (#1)
- Rod Clevis 1/4-28 (M24S) (#2)
- Rear Pivot Mount - Two Piece with Pin: .25" HOLE x .11" THICKNESS (#6)
- 3 foot diameter wood round
- Door hinge
Step 5: Step 5: Base and Prop
The base is cobbled together from parts I found in my garage...
- 1/2 inch PVC pipe (#3)
- 1/2 inch PCV pipe tee (#2)
- 1/2 metal conduit (#1)
- Cable ties
- Halloween prop
Step 6: Step 6: Arduino Code
The application starts and runs the loop which waits for the button press. Once the button is pressed, the animate method is run. This method calls the method lunge, shake and rest. The lunge method triggers the solenoid to open one of the two ports on the manifold longer so the cylinder rod extends all the way out. The rest method closes the open port so the cylinder rod retracts. The shake method toggles between the lunge and rest methods so the cylinder rod moves back and forth. At the end of the animate method, the rest method is run so the cylinder can retract and the lunger is ready to go!