Summary of Arduino-Controlled Chemical Foam Spewing Pumpkin
This article describes building an Arduino-controlled Halloween pumpkin that sprays chemical foam at trick-or-treaters using 35% hydrogen peroxide, potassium iodide solution, dish soap, and pumps/valves controlled by an Arduino. It details materials, foam chemistry, safety precautions, and drilling and fitting check valves into a Nalgene mixing chamber.
Parts used in the Arduino-Controlled Chemical Foam Spewing Pumpkin:
- Large round pumpkin
- Square Nalgene 1000 ml bottle (mixing chamber)
- Square Nalgene 250 ml bottles (x2)
- 3/8 inch rubber tubing (5 feet)
- Potassium iodide (100 g, mixed in a 2M solution)
- 35% hydrogen peroxide solution (500 ml x2)
- Dish soap (regular, economy style)
- Food coloring
- 5/8 inch rubber grommets (x2)
- Brass check valves for liquid (x2)
- 3/8 inch barbs (x2)
- Rubber 3/8 inch hose (5 feet)
- Teflon tape
- Small diameter hose clamps (x4)
- Self-priming pumps (x2)
- PCB
- 5V SPST relays (x2)
- 10K resistor
- Arduino
- M-type connector
- 9V battery clip
- 9V battery
- 22AWG red and black solid-core wire
- 9V / 2.5A wall wart
- Floor switch material (3 feet)
- Halloween door mat
- Assorted alligator clips
- Assorted zip ties
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
(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.
For more detail: Arduino-Controlled Chemical Foam Spewing Pumpkin
- What chemicals make the foam?
The foam is made from 35% hydrogen peroxide, potassium iodide in a 2M solution, dish soap, and food coloring. - What concentration of hydrogen peroxide is used?
The project uses 35% hydrogen peroxide solution. - How much potassium iodide is used?
The materials list includes 100 g of potassium iodide mixed in a 2M solution. - What container is used as the mixing chamber?
A square Nalgene 1000 ml bottle is used as the mixing chamber. - How are the check valves installed in the mixing chamber?
Drill two 5/8 inch holes in the 1000 ml Nalgene, thread in the check flow valves, wrap with Teflon tape, and screw on brass barbs; a compression fitting cap was used as a safety precaution during installation. - What safety precautions are recommended for handling 35% hydrogen peroxide?
Use rubber gloves, goggles, and long sleeves and follow best chemical safety practices. - What type of dish soap should be used?
Use regular economy dish soap, not eco-friendly varieties. - How are the check valves secured during threading?
A brass compression fitting cap small enough to fit through the bottle mouth was used and held with a piece of metal while the check valve was threaded in.

