For this year’s Trunk ‘O’ Treat game I wanted to make a something fun and exciting for kids to play so I choose a Whac- a-Mole type game called Whac-a-Veggie using the Veggie Tales characters.
The Whac-a-Veggie game is played with a foam hammer in your hand and the veggie characters randomly popping-up quickly and you have to hit them on the head before they go back in there holes to score a hit, the one with the most hits wins. The PIC microcontroller controls the game action with air cylinders that push the veggies up and down by the use of an air solenoid. A timer keeps the game time to 35 seconds long and the score board counts  the number of veggies you hit in the game.

Step 1: Design and Operation

The Whac a Veggie game has to maintain the following list of game requirements for reliability and game operation. The game starts off by clearing the score for a new game and keeping score during the game with every hit. Start a timer for a preset game time and the timer stop the game when the time is expired. The veggies need to pop-up randomly during the game. The veggies must not rotate when hit so we have to design the hardware to keep the veggies looking forward at all times. The game must me made strong enough to take the many hard hits with the hammer. The relay, air cylinders, and solenoids need to move the veggies up and down quickly to have good game to player response for game fun.

Parts List
PIC 18F4550 PIC
40 Pin PIC Development Board # DEV-00021 (Spark Fun)
ATX breaker board #BOB-09558 and ATX connector #PRT-09498 (spark fun)
Bimba Air cylinder 6” travel #BF-096-D
MettleAir pneumatic valves 5/2 way 4A210-08 12VDC (Pneumatic Products)
Brass air Silencer for exhaust air 1/8” (Pneumatic Products)
Tubes thread fittings 1/4” #S1/4-N02 (poweraire.com) 
Tube male elbow fittings 1/4” #E1/4-N02 (poweraire.com) 
Union straight speed controller #USC1/4 (Qty-6) (poweraire.com)
Triple branch union #TUBU1/4(Qty-2) (poweraire.com)
20MHZ crystal oscillator
Timer MX024 Digital Timer (Bakatronics)
Relay module board, eight channels, for PIC, songle electronics (eBay)
ATX breakout board and connector # BOB-09558 and PRT-09498.
Resistors: 1K, 100, 10K, 470 ohm,
Capacitors 4.7uf, .1uF
Counter Display #G16774 (goldmine electronics) 
ATX power supply connector 12v, 5v power for control and lights.
Blank PCB proto boards
74LS08 AND gate
74LS04 inverter 
Mechanical hardware springs, 6-32 bolts, 1/4”-20 bolts, 8-32 bolts, 
<p>I think Pneumatic Products changed their name to MettleAir, looks like they have an online store, I wanted to do this project for the halloween (with little pop up ghosts and skeletons) but work got wayyyy busy but I am aiming for next year though.</p>
<p>Hey DIYDonut,</p><p>I started building this in 2011, but I got sidetracked with a layoff and then a new job. I have most of the hardware done and most of the electronics done too. There are a few problems with his schematic (the opto-isolator circuit is drawn incorrectly) and you'll need to get creative with attaching your characters. Good luck and let us know how you do. I'm going to start back at it in a few months.</p><p>Sincerely,</p><p>Keith E. Cooper</p>
Excellent project! I'd like to build at least one for our church free public play events. Any idea how it'd hold up to maybe a game every 90 seconds for three hours three times a year? Is that too intense for this build? Got any ideas on mods to make it more robust to increase it's service cycle? Thanks!
What was the total cost of the parts?
This is awesome and I'm going to try to build one for my grandkids. I know almost nothing about pneumatics however. Does your system need an air compressor for the air cylinders or am I missing something? <br> <br>Thanks!
I purchased the air solenoids 5/2 way #4A210-08-12VDC and air silencers from Pneumatic Products via eBay. In the eBay search box type in 5 way air valve 12v or user name pnevmo. I sent then an email to (PneumaticProducts@gmail.com) of all the items I needed and they sent back a price quote for all my items. <br> The other items fittings, tubing, and branch unions I purchased from Power Aire. (poweraire.com) Power Aire will send you 10pcs connector fittings free of charge but you have to pay for the shipping cost. <br>Both companies offer excellent parts and service.<br>
A-hah! I couldn't find Pneumatic Products at first because I thought it wasn't an eBay-type company. I need to learn to read for comprehension! Thanks again!
Yes, the system needs a air compressor to make the air cylinders go up and down. I set the air pressure at 50PSI with my Porter Cable electric pancake air compressor. <br>
Thanks, that really cleared up my understanding of how this works!
Wow- very impressive!
Wow! Really impressive!!
much fun!
Very nice result. Does the code have provisions for people cheating? That is, covering all the holes so a &quot;hit&quot; is registered when the veggie pops up?
Very cool. Do you have any footage of it in action with veggies getting whacked?
This is pretty good!!

About This Instructable




More by mark-mark:Random Flickering LED Snowflake Whac-a-Veggie LED Tin Can Lantern 
Add instructable to: