Thursday, September 4, 2014

Arduino-Controlled Chemical Foam Spewing Pumpkin [Full Tutorial]




If the thought of dozens of tricker-or-treaters in gross-out costumes knocking down your door makes you want to spew, have we got the pumpkin for you! Every time the Arduino-Controlled Chemical Foam Spewing Pumpkin encounters a trick-or-treater at your doorstep, it spews burning chemical foam all over your front lawn. Now you can convey how much trick-or-treaters make you want to vomit, without doing any real vomiting yourself. So grab some antacid to settle your stomach, and dive deep into these helpful instructions to build your own.

Step 1: Materials

You will need:

(x1) Large round pumpkin
(x1) Square Nalgene 1000 ml bottle
(x2) Square Nalgene 250 ml bottles
(x1) 5' of 3/8" rubber tubing
(x1) 100g potassium iodide mixed in a 2M solution
(x2) 500 ml 35% hydrogen peroxide solution
(x1) dish soap (economy style, not natural stuff)
(x1) food coloring
(x2) 5/8" rubber grommets
(x2) brass check valves for liquid
(x2) 3/8" barbs
(5') rubber 3/8" hose
(x1) Teflon tape
(x4) small diameter hose clamps
(x2) self-priming pumps
(x1) PCB
(x2) 5V SPST relays
(x1) 10K resistor
(x1) Arduino
(x1) M-type connector
(x1) 9V battery clip
(x1) 9V battery
(x1) 22AWG red and black solid-core wire
(x1) 9V / 2.5A wall wart
(x1) 3' floor switch material
(x1) Halloween Door Mat
(x1) Assorted alligator clips
(x1) Assorted zip ties

How to make Chemical Foam

The chemical foam is made from mixing a few simple ingredients:
  • Hydrogen Peroxide (the stuff you put on scrapes and cuts is 3%, the one we're using is 35%)
  • Potassium Iodide (mixed in a 2M solution)
  • Dish Soap (not the eco-friendly kind - get regular stuff like Palmolive)
  • Food Coloring
When you mix the ingredients above in the correct proportions, you get foam, potentially lots of it.  Be safe when working with these chemicals and use common sense.  35% Hydrogen Peroxide is a powerful oxidizer and should be handled with rubber gloves, goggles, and long sleeves.  Always use best chemical practices when making chemical foam.

Step 2: Drill holes in mixing chamber

Drill two 5/8" holes into the 1000ml square nalgene container that will serve as the mixing chamber.

The check flow valves are attached directly to the mixing chamber and thread themsleves in as they are twisted into position with a wrench.

This part is a little tricky, as a safety precaution we capped the ends of the MIP threaded check valve with a compression fitting - a brass nut of sorts that was just small enough to fit through the mouth of the bottle and screwed into place.  We used a piece of metal tapped onto the nut to hold the compression fitting in place as the check valve was screwed in so that it threaded itself on.

Wrap the check valves with teflon tape and screw on the brass barbs.

Step 3: Insert grommets in chemical reservoirs

Drill a 3/4'" hole in the top of the cap for each 250ml bottle.

Insert a 5/8" rubber grommet into each of these holes.

Put the caps back on the bottle.

Step 4: Insert

Insert a 2' section of tubing through the grommet into each of the bottles.

If the fit gets very tight, you should use a little WD-40 to ease it through. You might also consider drilling a small hole in the cap to prevent a vacuum from happening when the pump turns on.

Repeat for the second bottle.

Step 5: Attach

Attach the other end of the hose in the bottle to the inlet on the pump and secure it in place with a hose clamp.

Repeat for the second bottle and pump.

Secure the pump to the bottle if necessary to keep the system stable.

Step 6: More tubing

Attach a two foot section of tubing to the outlet on the pump, and secure it with a hose clamp.

Plug your threaded barb into the other end, and fasten this as well.

Repeat this for the seconds pump.

Step 7: Attach hose to brass barb and check valve

Squeeze the rubber hose over the brass barb and secure with hose clamp.

Repeat for the second pump assembly.

Step 8: Drill hole in cap and mount nozzle

Drill a 1" hole in the cap of the mixing chamber and thread in a male male garden hose union fitting.  This fitting just happened to fit inside the neck of the bottle well and was available at Home Depot, so we used it.  It of course can be substituted with something else that is better suited taking multiple sized spouts so you can have the most flexibility for foam spewing.

Epoxy the fitting in place in the top of the cap. 

Step 9: Relays

Attach the relays to the PCB such that they can be controlled by two separate Arduino pins.

See the schematic for more details.

Step 10: Check flow rate of pump

With everything ready for testing, run the pumps by hooking them up to a 9V DC power supply and calculate the flow rate of the pump.

Step 11: Program Arduino

After some preliminary testing we calculated that the pumps had a flow rate of 50ml of fluid at 2 seconds. To pump 400ml, we needed to run it for 8 seconds. To pump 40ml, it had to run for 1.6 seconds.

Download the attached code and upload it to the Arduino:


Step 12: Prep Potassium Iodide

Mix a few hundred ml's of a 2M solution of KI...that means 3.3 grams of KI for every 10ml of solution that you'd like to make.

Mix the solution with a gentle swirl.

Step 13: Prep Hydrogen Peroxide

Measure out 250ml of 35% hydrogen peroxide and mix it with a generous squirt of dish soap.

Step 14: Build door mat switch

The floor mat switch is a commercial product I came upon years ago and no longer know exactly where to purchase it from.

Basically, it is a series of long switches wired in parallel. Attach wires to each end of the switch, cut it so that it fits under the door mat, and then place it underneath your door mat.

Step 15: Carve a pumpkin

Cut the lid off the top of the pumpkin and then hollow out all of the gunk.

Now is time to carve your jack-o-lantern. It helps to tape a paper stencil to the front of the pumpkin, position how you like it, and then trace it.

Once you have drawn the face onto the pumpkin, cut it up.

Step 16: Wire it up

Wire the motors and the floor switch to the Arduino board as follows:


Step 17: Fill pumpkin with reservoirs, pumps and reaction chamber

Put all of the components inside the pumpkin. Secure them firmly in place, and make sure none of the hoses have kinks or bends in them.

Plug in the power and battery.

Step 18: Activate door matt switch and spew foam

As soon as you step on the floor switch, it's going to start mixing the fluids. There is typically a slight delay for each pump to run, the chemicals to mix, and spewing to start.

It's good to avoid being spewed upon. The foam is mostly-harmless, but can be quite hot.

0 comments:

Post a Comment