Picture of Whac-a-Veggie
Whac a Veggie game.JPG
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.
Remove these adsRemove these ads by Signing Up

Step 1: Design and Operation

Picture of 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 ( 
Tube male elbow fittings 1/4” #E1/4-N02 ( 
Union straight speed controller #USC1/4 (Qty-6) (
Triple branch union #TUBU1/4(Qty-2) (
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, 
diydonut4 months ago

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.

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!
tekkguy4 years ago
What was the total cost of the parts?
kooth4 years ago
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?

mark-mark (author)  kooth4 years ago
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 ( of all the items I needed and they sent back a price quote for all my items.
The other items fittings, tubing, and branch unions I purchased from Power Aire. ( Power Aire will send you 10pcs connector fittings free of charge but you have to pay for the shipping cost.
Both companies offer excellent parts and service.
kooth mark-mark4 years ago
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!
mark-mark (author)  kooth4 years ago
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.
kooth mark-mark4 years ago
Thanks, that really cleared up my understanding of how this works!
Honus4 years ago
Wow- very impressive!
Wow! Really impressive!!
much fun!
jeff-o4 years ago
Very nice result. Does the code have provisions for people cheating? That is, covering all the holes so a "hit" is registered when the veggie pops up?
Very cool. Do you have any footage of it in action with veggies getting whacked?
TSC4 years ago
This is pretty good!!