# Haunted Air Blaster

## Overview

https://youtu.be/T5hmbRACTho

![](https://cdn-learn.adafruit.com/assets/assets/000/133/182/medium800thumb/hacks_haunt.jpg?1729049816)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/057/medium800/hacks_airb-1938.jpg?1728507763)

Danger: DO NOT use the Air Blaster to fire air or projectiles at people or pets, always aim it at a wall or other solid surface to create a loud sound, or at a haunt prop, such as Dracula's toupee to make it flap around menacingly, or to fire confetti up in the air.

## Parts
Featured
### Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier

[Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier](https://www.adafruit.com/product/5768)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. By picking a feather and stacking on a FeatherWing you can create advanced projects quickly. One popular combo is our [Feather M4](https://www.adafruit.com/product/3857)...

In Stock
[Buy Now](https://www.adafruit.com/product/5768)
[Related Guides to the Product](https://learn.adafruit.com/products/5768/guides)
![Video of a white hand pressing a button to briefly turn an LED strip into white lights. Also wired up to the microcontroller are a servo motor and a speaker.](https://cdn-shop.adafruit.com/product-videos/640x480/5768-09.jpg)

Featured
### Adafruit Power Relay FeatherWing

[Adafruit Power Relay FeatherWing](https://www.adafruit.com/product/3191)
A Feather board without ambition is a Feather board without FeatherWings! This is the **Power Relay FeatherWing**. It gives you power to control, and control over power. Put simply, you can now turn on and off lamps, fans, solenoids, and other small appliances that run on up to...

In Stock
[Buy Now](https://www.adafruit.com/product/3191)
[Related Guides to the Product](https://learn.adafruit.com/products/3191/guides)
![Angled shot of a Adafruit Power Relay FeatherWing. ](https://cdn-shop.adafruit.com/640x480/3191-04.jpg)

Featured
### FeatherWing Doubler - Prototyping Add-on For All Feather Boards

[FeatherWing Doubler - Prototyping Add-on For All Feather Boards](https://www.adafruit.com/product/2890)
This is the **FeatherWing Doubler** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are two! The magic of the Doubler comes when stacking a Feather and another...

In Stock
[Buy Now](https://www.adafruit.com/product/2890)
[Related Guides to the Product](https://learn.adafruit.com/products/2890/guides)
![Double prototyping feather wing PCB with socket headers installed](https://cdn-shop.adafruit.com/640x480/2890-01.jpg)

Featured
### Brass Liquid Solenoid Valve - 12V - 1/2 Inch G / BSP Thread

[Brass Liquid Solenoid Valve - 12V - 1/2 Inch G / BSP Thread](https://www.adafruit.com/product/996)
Control the flow of fluid using the flow of electrons! This liquid valve would make a great addition to your robotic gardening, aquarium, or pool project. There are two 1/2" (British Standard Pipe / German Thread) outlets. Normally, the valve is closed. When 12VDC is applied to the two...

In Stock
[Buy Now](https://www.adafruit.com/product/996)
[Related Guides to the Product](https://learn.adafruit.com/products/996/guides)
![Brass Solenoid Valve with two threaded inlets and huge solenoid and two wires](https://cdn-shop.adafruit.com/640x480/996-07.jpg)

Featured
### 12V 5A switching power supply

[12V 5A switching power supply](https://www.adafruit.com/product/352)
This is a beefy switching supply, for when you need a lot of power! It can supply 12V DC up to 5 Amps, running from 110V or 220V power (the plug it comes with is for US/Canada/Japan but you can use any plug adapter for your country, or just replace the cable with a standard 'figure-8'...

In Stock
[Buy Now](https://www.adafruit.com/product/352)
[Related Guides to the Product](https://learn.adafruit.com/products/352/guides)
![Power brick with coiled cables.](https://cdn-shop.adafruit.com/640x480/352-07.jpg)

Featured
### Female DC Power adapter - 2.1mm jack to screw terminal block

[Female DC Power adapter - 2.1mm jack to screw terminal block](https://www.adafruit.com/product/368)
If you need to connect a DC power wall wart to a board that doesn't have a DC jack - this adapter will come in very handy! There is a 2.1mm DC jack on one end, and a screw terminal block on the other. The terminals are labeled with positive/negative assuming a positive-tip configuration...

Out of Stock
[Buy Now](https://www.adafruit.com/product/368)
[Related Guides to the Product](https://learn.adafruit.com/products/368/guides)
![Angle shot Female DC Power adapter - 2.1mm jack to screw terminal block](https://cdn-shop.adafruit.com/640x480/368-03.jpg)

Featured
### Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm

[Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm](https://www.adafruit.com/product/3967)
The&nbsp; **Adafruit VL53L1X Time of Flight Distance Sensor** (also known as VL53L1CX) is a&nbsp;_Time of Flight_&nbsp;distance sensor that has a massive 4 meter range and LIDAR-like precision. The sensor contains a very tiny invisible laser source and a matching sensor....

In Stock
[Buy Now](https://www.adafruit.com/product/3967)
[Related Guides to the Product](https://learn.adafruit.com/products/3967/guides)
![Top view of Adafruit VL53L1X Time of Flight Distance Sensor hooked up to an OLED display. A white manicured hand waves at the sensor, and the OLED displays the distance.](https://cdn-shop.adafruit.com/product-videos/640x480/3967-05.jpg)

### STEMMA QT / Qwiic JST SH 4-Pin Cable - 400mm long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 400mm long](https://www.adafruit.com/product/5385)
This 4-wire cable is a little over 400mm / 15.7" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5385)
[Related Guides to the Product](https://learn.adafruit.com/products/5385/guides)
![Angled shot of 400mm long STEMMA QT cable.](https://cdn-shop.adafruit.com/640x480/5385-01.jpg)

Featured
### Snap-action 3-Wire Block Connector (12-24 AWG) - Pack of 3

[Snap-action 3-Wire Block Connector (12-24 AWG) - Pack of 3](https://www.adafruit.com/product/866)
These are like the fancy electronics equivalent of the wire nuts electricians use to bind wires together. They are a lot easier to use as well! Each block connector has a metal block inside and three levers that snap open and close to bind stranded/solid-core wire. No screwdrivers required!...

In Stock
[Buy Now](https://www.adafruit.com/product/866)
[Related Guides to the Product](https://learn.adafruit.com/products/866/guides)
![Snap-action 3-Wire Block Connector with two wires installed](https://cdn-shop.adafruit.com/640x480/866-08.jpg)

Featured
### Flanged Weatherproof Enclosure With PG-7 Cable Glands

[Flanged Weatherproof Enclosure With PG-7 Cable Glands](https://www.adafruit.com/product/3931)
Whether you're raiding tombs or traversing nuclear fallout wastelands, this is the most heavy-duty enclosure for your project! Weatherproof? Check. Tough&nbsp;polycarbonate cover? Check. Built-in gasket seal? Oh yeah, check.

Store your project safe and sound in this **Flanged...**

In Stock
[Buy Now](https://www.adafruit.com/product/3931)
[Related Guides to the Product](https://learn.adafruit.com/products/3931/guides)
![Angled shot of off-white, rectangle-shaped, flanged enclosure.](https://cdn-shop.adafruit.com/640x480/3931-00.jpg)

### Hook-up Wire Spool Set - 22AWG Stranded-Core - 6 x 25ft

[Hook-up Wire Spool Set - 22AWG Stranded-Core - 6 x 25ft](https://www.adafruit.com/product/3111)
This is a box of **six** &nbsp;25ft **&nbsp;** spools of **stranded-core** wire. These&nbsp;spools&nbsp;of stranded-core wires are&nbsp;easily soldered to and are&nbsp;rated 80C and 300V (UL AWM style 1007). Best used for wiring jigs where there's...

In Stock
[Buy Now](https://www.adafruit.com/product/3111)
[Related Guides to the Product](https://learn.adafruit.com/products/3111/guides)
![Hook-up Wire Spool Set in box with 6 colorful wires coming out](https://cdn-shop.adafruit.com/640x480/3111-02.jpg)

### Part: Electrolytic Capacitor
quantity: 1
470µF 50V
[Electrolytic Capacitor](https://www.digikey.com/en/products/detail/panasonic-electronic-components/ECA-1HM471/245044)

## Air Tank

A 5 gallon (or bigger!) air tank to store your compressed air. This needs to have a 1/2" threaded port on it -- the tank attached to your typical shop air compressor will likely not work due to having a smaller 1/4" outlet.

You'll also need thread seal tape.

![hacks_airb-1762.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/981/medium640/hacks_airb-1762.jpg?1728496025)

![hacks_airb-1812.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/983/medium640/hacks_airb-1812.jpg?1728498956)

### Part: 5 Gallon Portable Air Tank
quantity: 1
Carry tank with 1/2" threaded opening
[5 Gallon Portable Air Tank](https://www.harborfreight.com/air-tools-compressors/air-compressors-tanks/portable-air-tanks/5-gallon-portable-air-tank-65594.html)

### Part: PTFE Thread Seal Tape
quantity: 1
HFT 21-2/3 ft. x 1/2 in 
[PTFE Thread Seal Tape](https://www.harborfreight.com/21-23-ft-x-12-in-thread-seal-tape-63944.html)

## 1/4" Pipe Fittings

You'll build the air blaster from a set of pipe fittings (galvanized or black pipe is fine), adapters, couplers, regulators, and cut-off valves.

- [**1/4" male brass industrial plug**](https://www.harborfreight.com/air-tools-compressors/air-compressor-accessories/air-plugs-couplers/industrial-couplers/14-in-male-brass-industrial-plug-63564.html) for connecting your compressor for filling the tank
- [**1/4" FIP ball valve**](https://www.homedepot.com/p/1-4-in-FIP-Lead-Free-Brass-Ball-Valve-with-Stainless-Steel-Ball-and-Stem-94ALF10101TMG/329107742) to shut off the air flow on the inlet side
- [**1/4" x 1-1/2" threaded pipe nipple**](https://www.homedepot.com/p/Southland-1-2-in-x-1-1-2-in-Galvanized-Steel-MPT-Nipple-563-015HN/100212821)
- [**1/4" x 4" threaded pipe nipple** &nbsp;](https://www.homedepot.com/p/Southland-1-4-in-x-4-in-Galvanized-Steel-MPT-Nipple-561-040HN/100133639) (optional)
- [**1/4" tee fitting**](https://www.homedepot.com/p/Southland-1-4-in-Galvanized-Malleable-Iron-Tee-Fitting-510-601HN/100131625)
- [**125 PSI 1/4" NPT pressure relief valve&nbsp;**](https://www.amazon.com/gp/product/B0081TJISW/ref=ppx_yo_dt_b_asin_title_o00_s00)
- [**1/4" x 1-1/2" threaded pipe nipple**](https://www.homedepot.com/p/Southland-1-2-in-x-1-1-2-in-Galvanized-Steel-MPT-Nipple-563-015HN/100212821)
- [**150 PSI air compressor regulator with dial gauge**](https://www.harborfreight.com/150-psi-air-compressor-regulator-kit-with-gauge-68223.html) 1/4" female threaded to check the filling pressure
- [**1/4" x 3" threaded pipe nipple**](https://www.homedepot.com/p/STZ-1-4-in-x-3-in-Galvanized-Steel-Pipe-Nipple-309-14X3/100539233)
- [**1/2" MIP x 1/4" FIP bushing**](https://www.homedepot.com/p/Everbilt-1-2-in-MIP-x-1-4-in-FIP-Brass-Bushing-Fitting-802639/207176802) this adapts us up to 1/2" for the rest of the parts

![hacks_IMG_2086.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/224/medium640/hacks_IMG_2086.jpg?1729208927)

![hacks_airb-1764.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/984/medium640/hacks_airb-1764.jpg?1728499216)

![hacks_airb-1765.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/986/medium640/hacks_airb-1765.jpg?1728499428)

![hacks_airb-1785.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/991/medium640/hacks_airb-1785.jpg?1728501233)

![hacks_airb-1766.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/993/medium640/hacks_airb-1766.jpg?1728501272)

![hacks_airb-1767.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/994/medium640/hacks_airb-1767.jpg?1728501289)

![hacks_airb-1768.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/995/medium640/hacks_airb-1768.jpg?1728501425)

![hacks_Screenshot_2024-10-15_at_5.18.16 PM.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/180/medium640/hacks_Screenshot_2024-10-15_at_5.18.16%E2%80%AFPM.jpg?1729038013)

![hacks_airb-2040.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/181/medium640/hacks_airb-2040.jpg?1729040736)

## 1/2" Pipe Fittings

This section takes us into the air tank and then out through the solenoid valve, all at 1/2".

- [**1/2" tee fitting**](https://www.homedepot.com/p/Southland-1-2-in-Galvanized-Malleable-Iron-Tee-Fitting-510-603HN/100129668)&nbsp;
- [**1/2" x 3-1/2" pipe nipple**](https://www.homedepot.com/p/STZ-1-2-in-x-3-1-2-in-Galvanized-Steel-Nipple-PDG-N12X312/316930324) this connects to the air tank
- [**1/2" x 2" pipe nipple**](https://www.homedepot.com/p/Southland-1-2-in-x-2-in-Galvanized-Steel-Nipple-563-020HN/100127620) to connect the outlet of the tee fitting to the ball valve
- [**1/2" FIP full port ball valve**](https://www.homedepot.com/p/Everbilt-1-2-in-Brass-FPT-Full-Port-Threaded-Ball-Valve-107-403EB/205822369) to shut off airflow on the outlet side
- [**1/2" x 2" pipe nipple**](https://www.homedepot.com/p/Southland-1-2-in-x-2-in-Galvanized-Steel-Nipple-563-020HN/100127620) to connect the outlet of the ball valve to the solenoid valve (this is the second of two of this size needed)
- [**1/2" x 12" pipe nipple**](https://www.homedepot.com/p/STZ-1-2-in-x-12-in-Galvanized-Steel-Nipple-PDG-N12X12/316930301) to act as the barrel of the blaster

&nbsp;

![hacks_airb-1769.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/996/medium640/hacks_airb-1769.jpg?1728501541)

![hacks_airb-1770.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/997/medium640/hacks_airb-1770.jpg?1728501718)

![hacks_airb-1771.jpg](https://cdn-learn.adafruit.com/assets/assets/000/132/999/medium640/hacks_airb-1771.jpg?1728502225)

![hacks_airb-2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/000/medium640/hacks_airb-2.jpg?1728502237)

![hacks_airb-1773.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/001/medium640/hacks_airb-1773.jpg?1728502250)

## Tools

You'll need an adjustable wrench and a pipe wrench to fasten the fittings tightly enough to be pressurized without leaking. I happened to have a couple of sets of adjustable wrenches and pipe wrenches so I set one for 1/4" and the other for 1/2" to make life easier.

![](https://cdn-learn.adafruit.com/assets/assets/000/132/980/medium800/hacks_airb-1804.jpg?1728495860)

You'll also need a soldering iron to solder the header pins on the Feather, FeatherWing, and FeatherWing Doubler, as well as wire strippers and a small screwdriver.

### Adafruit Pocket Screwdriver - Black

[Adafruit Pocket Screwdriver - Black](https://www.adafruit.com/product/3284)
Have you ever been in a situation where you desperately&nbsp;needed a screwdriver _right away_? Now you can have one at-the-ready all the time —&nbsp;enter the **Adafruit Pocket Screwdriver**!

OK, it's a little tough to write exciting copy for a pocket...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3284)
[Related Guides to the Product](https://learn.adafruit.com/products/3284/guides)
![Double-sided Pocket Screwdriver with Black body, flathead tip](https://cdn-shop.adafruit.com/640x480/3284-04.jpg)

### USB Type A to Type C Cable - approx 1 meter / 3 ft long

[USB Type A to Type C Cable - approx 1 meter / 3 ft long](https://www.adafruit.com/product/4474)
As technology changes and adapts, so does Adafruit. This&nbsp;&nbsp; **USB Type A to Type C** cable will help you with the transition to USB C, even if you're still totin' around a USB Type A hub, computer or laptop.

USB C is the latest industry-standard connector for...

In Stock
[Buy Now](https://www.adafruit.com/product/4474)
[Related Guides to the Product](https://learn.adafruit.com/products/4474/guides)
![Angled shot of a coiled black, USB-C to USB-A cable.](https://cdn-shop.adafruit.com/640x480/4474-02.jpg)

# Haunted Air Blaster

## Build the Air Blaster

## Tank Prep

The air tank probably came with some fittings in place. They have too small of an outlet diameter to do anything fun and air blaster-y -- Grab your wrench and remove those!

![hacks_airb-1775.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/011/medium640/hacks_airb-1775.jpg?1728504167)

![hacks_airb-1777.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/012/medium640/hacks_airb-1777.jpg?1728504175)

## Fitting Prep

Lay out all of the fittings so you have an idea of the assembly order and can double-check you've got all of the parts needed.

- industrial plug (for filling with your compressor line)
- shut-off valve
- pipe nipple
- regulator

![](https://cdn-learn.adafruit.com/assets/assets/000/133/014/medium800/hacks_airb-1805.jpg?1728504394)

Warning: SAFETY UPDATE: I added a 125 PSI pressure relief valve and a 1/4" tee to the build to be extra safe. You can do the same by omitting the 1/4" x 4" nipple and running the inlet to the tee as shown with two 1/4" x 1-1/2" nipples to connect.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/222/medium800/hacks_tee_relief.jpg?1729208738)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/221/medium800/hacks_relief_valve.jpg?1729208551)

- pipe nipple
- tee fitting
- pressure regulator
- pipe nipple
- bushing
- tee fitting

![](https://cdn-learn.adafruit.com/assets/assets/000/133/007/medium800/hacks_airb-1806.jpg?1728504011)

- vertical pipe nipple to tank
- pipe nipple
- shut-off valve

![](https://cdn-learn.adafruit.com/assets/assets/000/133/008/medium800/hacks_airb-1807.jpg?1728504019)

- pipe nipple
- solenoid valve

![](https://cdn-learn.adafruit.com/assets/assets/000/133/009/medium800/hacks_airb-1808.jpg?1728504030)

- long pipe nipple (barrel)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/010/medium800/hacks_airb-1811.jpg?1728504047)

## Dry Fit

Before you tape the threads and crank everything on with a pair of wrenches, it's a good idea to dry fit the whole assembly. Thread everything together by hand, just keep it finger-tight.

Here is a dry fit test I did before I had the solenoid valve in place.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/016/medium800/hacks_airb-1788.jpg?1728505248)

## Assembly

It's time to do the final assembly. Grab your tape and wrenches!

## Taping

For the final assembly you'll need to seal all of the threads with sealing tape. Wrap it starting at the bottom of the threads going counter-clockwise and overlapping by at least half of the tape width with each turn. Pull to stretch and break the thread from the roll.

![hacks_airb-1812.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/017/medium640/hacks_airb-1812.jpg?1728505403)

![hacks_airb-1813.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/018/medium640/hacks_airb-1813.jpg?1728505410)

![hacks_airb-1814.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/019/medium640/hacks_airb-1814.jpg?1728505418)

![hacks_airb-1815.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/020/medium640/hacks_airb-1815.jpg?1728505430)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/022/medium800/hacks_airb-1822.jpg?1728505613)

## Threading

Thread each part together using two wrenches (adjustable and/or pipe as needed) to crank them down hard, otherwise there will be leaks!

![hacks_airb-1816.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/021/medium640/hacks_airb-1816.jpg?1728505578)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/030/medium800/hacks_airb-1820.jpg?1728505644)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/039/medium800/hacks_airb-1823.jpg?1728505673)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/045/medium800/hacks_airb-1824.jpg?1728505684)

Here's the full assembly, minus the tank.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/053/medium800/hacks_airb-1825.jpg?1728507614)

Screw the assembly onto the tank -- it's best to use a pipe wrench on the pipe nipple closest to the tank flange, rather than pulling on the barrel, as tempting as that is, just to avoid bending any fittings.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/050/medium800/hacks_airb-1937.jpg?1728507584)

# Haunted Air Blaster

## CircuitPython

[CircuitPython](https://github.com/adafruit/circuitpython) is a derivative of [MicroPython](https://micropython.org) designed to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the **CIRCUITPY** drive to iterate.

## CircuitPython Quickstart

Follow this step-by-step to quickly get CircuitPython running on your board.

[Download the latest version of CircuitPython for this board via circuitpython.org](https://circuitpython.org/board/adafruit_feather_rp2040_prop_maker/)
 **Click the link above to download the latest CircuitPython UF2 file.**

Save it wherever is convenient for you.

![install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/655/medium640/install_circuitpython_on_rp2040_RP2040_UF2_downloaded.jpg?1618943202)

![](https://cdn-learn.adafruit.com/assets/assets/000/121/865/medium800/adafruit_products_boot_reset.jpg?1686710555)

To enter the bootloader, hold down the **BOOT/**** BOOTSEL button**(highlighted in red above), and while continuing to hold it (don't let go!), press and release the**reset button**(highlighted in red or blue above).&nbsp;**Continue to hold the BOOT/BOOTSEL button until the RPI-RP2 drive appears!**

If the drive does not appear, release all the buttons, and then repeat the process above.

You can also start with your board unplugged from USB, press and hold the BOOTSEL button (highlighted in red above), continue to hold it while plugging it into USB, and wait for the drive to appear before releasing the button.

A lot of people end up using charge-only USB cables and it is very frustrating! **Make sure you have a USB cable you know is good for data sync.**

You will see a new disk drive appear called **RPI-RP2**.

&nbsp;

Drag the **adafruit\_circuitpython\_etc.uf2** file to **RPI-RP2.**

![install_circuitpython_on_rp2040_RP2040_bootloader_drive.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/656/medium640/install_circuitpython_on_rp2040_RP2040_bootloader_drive.jpg?1618943666)

![install_circuitpython_on_rp2040_RP2040_drag_UF2.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/657/medium640/install_circuitpython_on_rp2040_RP2040_drag_UF2.jpg?1618943674)

The **RPI-RP2** drive will disappear and a new disk drive called **CIRCUITPY** will appear.

That's it, you're done! :)

![install_circuitpython_on_rp2040_RP2040_CIRCUITPY.jpg](https://cdn-learn.adafruit.com/assets/assets/000/101/658/medium640/install_circuitpython_on_rp2040_RP2040_CIRCUITPY.jpg?1618943864)

## Safe Mode

You want to edit your **code.py** or modify the files on your **CIRCUITPY** drive, but find that you can't. Perhaps your board has gotten into a state where **CIRCUITPY** is read-only. You may have turned off the **CIRCUITPY** drive altogether. Whatever the reason, safe mode can help.

Safe mode in CircuitPython does not run any user code on startup, and disables auto-reload. This means a few things. First, safe mode _bypasses any code in_ **boot.py** (where you can set **CIRCUITPY** read-only or turn it off completely). Second, _it does not run the code in_ **code.py**. And finally, _it does not automatically soft-reload when data is written to the_ **CIRCUITPY** _drive_.

Therefore, whatever you may have done to put your board in a non-interactive state, safe mode gives you the opportunity to correct it without losing all of the data on the **CIRCUITPY** drive.

### Entering Safe Mode
To enter safe mode when using CircuitPython, plug in your board or hit reset (highlighted in red above). Immediately after the board starts up or resets, it waits 1000ms. On some boards, the onboard status LED (highlighted in green above) will blink yellow during that time. If you press reset during that 1000ms, the board will start up in safe mode. It can be difficult to react to the yellow LED, so you may want to think of it simply as a slow double click of the reset button. (Remember, a fast double click of reset enters the bootloader.)

### In Safe Mode

If you successfully enter safe mode on CircuitPython, the LED will intermittently blink yellow three times.

If you connect to the serial console, you'll find the following message.

```terminal
Auto-reload is off.
Running in safe mode! Not running saved code.

CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.

Press any key to enter the REPL. Use CTRL-D to reload.
```

You can now edit the contents of the **CIRCUITPY** drive. Remember, _your code will not run until you press the reset button, or unplug and plug in your board, to get out of safe mode._

## Flash Resetting UF2

If your board ever gets into a really _weird_ state and CIRCUITPY doesn't show up as a disk drive after installing CircuitPython, try loading this 'nuke' UF2 to RPI-RP2. which will do a 'deep clean' on your Flash Memory. **You will lose all the files on the board** , but at least you'll be able to revive it! After loading this UF2, follow the steps above to re-install CircuitPython.

[Download flash erasing "nuke" UF2](https://cdn-learn.adafruit.com/assets/assets/000/145/511/original/nuke_universal.uf2?1786537992)
# Haunted Air Blaster

## Code the Air Blaster

## Text Editor

Adafruit recommends using the&nbsp; **Mu** &nbsp;editor for editing your CircuitPython code. You can get more info in&nbsp;[this guide](https://learn.adafruit.com/welcome-to-circuitpython/installing-mu-editor).

Alternatively, you can use any text editor that saves simple text files.

## Download the Project Bundle

Your project will use a specific set of CircuitPython libraries and the&nbsp; **code.py** &nbsp;file. To get everything you need, click on the&nbsp; **Download Project Bundle** &nbsp;link below, and uncompress the .zip file.

Drag the contents of the uncompressed bundle directory onto your board's&nbsp; **CIRCUITPY** &nbsp;drive, replacing any existing files or directories with the same names, and adding any new ones that are necessary.

![Haunt_Air_Blaster.png](https://adafruit.github.io/Adafruit_Learning_System_Guides/Haunt_Air_Blaster.png )

https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/main/Haunt_Air_Blaster/code.py

## How It Works

The distance sensor continuously measures how far objects are from it. When something moves within 50 cm of the sensor, it triggers the air blaster to fire a few quick blasts. You can control the number of blasts, how long they last, and the rate at which they happen in the code.

### Libraries

We start by importing the necessary libraries. `board` gives us access to the Feather’s pins, `digitalio` helps us control the relay pin, and `adafruit_vl53l1x` is the library for the distance sensor.

```auto
import time
import board
import digitalio
import adafruit_vl53l1x
```

### Variables

- `TRIGGER_DISTANCE` is set to `50` cm, meaning that when something is closer than this distance, it will activate the air blaster.
- The `triggered` variable keeps track of whether the air blaster has already been activated, preventing it from firing repeatedly when the object stays close.

```auto
TRIGGER_DISTANCE = 50.0
triggered = False
```

### Setup

- We initialize the I2C bus for communication with the VL53L1X sensor and set it to **long-distance mode** (`distance_mode = 2`), perfect for larger detection ranges.
- The **timing budget** is set to 100 ms, which controls how quickly the sensor takes measurements. Lower values mean faster readings but slightly reduced accuracy.
- We set up the relay pin (connected to pin D10) that will control the air blaster. By default, the relay is off (`False`).

```auto
i2c = board.STEMMA_I2C()
vl53 = adafruit_vl53l1x.VL53L1X(i2c)
vl53.distance_mode = 2
vl53.timing_budget = 100

relay_pin = digitalio.DigitalInOut(board.D10)
relay_pin.direction = digitalio.Direction.OUTPUT
relay_pin.value = False
```

### `blast` Function

This function controls how many times the air blaster will fire, how long each blast lasts, and the delay between blasts. You can adjust `repeat`, `duration`, and `rate` to create different blast patterns.

```auto
def blast(repeat, duration, rate):
    for _ in range(repeat):
        relay_pin.value = True  # Turn on the relay (blasts air)
        print("bang")
        time.sleep(duration)    # Wait for the duration of the blast
        relay_pin.value = False  # Turn off the relay
        time.sleep(rate)         # Wait for the interval before the next blast
```

### Main Loop

In the main loop, the sensor checks if it’s ready to send a distance reading. If it is, it prints the distance in centimeters and then clears the sensor’s interrupt (which tells it to get ready for the next reading).

```auto
while True:
    if vl53.data_ready:
        distance = vl53.distance
        print("Distance: {} cm".format(vl53.distance))
        vl53.clear_interrupt()
        time.sleep(0.1)
```

### Triggering the Air Blaster

- When the distance is less than or equal to `50` cm, and the air blaster hasn’t already been triggered (`triggered == False`), the `blast` function fires the air cannon.
- In this example, it blasts three quick shots, pauses for `0.4` seconds, and then blasts two more.
- The `triggered` variable is set to `True` to ensure that the blaster doesn’t keep firing while the object remains close.
- If the object moves farther than `50` cm, the system resets for another trigger.

```auto
if distance <= TRIGGER_DISTANCE:
    if not triggered:
        blast(3, 0.01, 0.1)
        time.sleep(0.4)
        blast(2, 0.01, 0.2)
        triggered = True
else:
    triggered = False
```

# Haunted Air Blaster

## Air Blaster Circuit

The Air Blaster circuit consists of a Feather RP2040 Prop-Maker that reads a VL53L1X time-of-flight distance sensor over I2C to determine when to fire. The Power Relay FeatherWing connects to the Feather over pin 10 to control the external 12V DC power to the solenoid valve. The solenoid valve is has a capacitor connected across its leads to preven EMF backcharge from resetting the board.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/133/080/medium800/hacks_air_cannon_Sketch_02.jpg?1728571592)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/082/medium800/hacks_air_cannon_Schem_02.jpg?1728572187)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/110/medium800/hacks_airb-1894.jpg?1728847587)

## Headers

First, solder male header pins under the Feather and FeatherWing and female header sockets to the top of the FeatherWing Doubler. [This guide](https://learn.adafruit.com/adafruit-feather-rp2040-pico/assembly#soldering-in-plain-headers-2295747) has more info on soldering headers.

## Relay Jumper

Not an exciting new track and field event, but instead, an invitation to solder one of the pads on the underside of the Power Relay FeatherWing.

I've chosen to solder the pin 10 jumper here.

![hacks_airb-1893.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/105/medium640/hacks_airb-1893.jpg?1728847367)

![hacks_feather_jumpers.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/106/medium640/hacks_feather_jumpers.jpg?1728847516)

## Connect Feather/FeatherWing to Doubler

Press the Feather and FeatherWing into the Doubler as shown here.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/113/medium800/hacks_airb-1895.jpg?1728847865)

## Power Connection

Connect a 4" length of 24 ga. stranded hook-up wire, red and black respectively, to the **+&nbsp;** and&nbsp; **-&nbsp;** of the DC power jack.

Open the levers on the snap-action block and insert the legs of the capacitor as shown, then snap the levers shut.

Connect the red wire from the DC power jack to the center common screw terminal on the relay FeatherWing.

Then, insert the black wire from the DC power jack into one of the blocks of the snap-action connector that is already connected to the negative leg of the capacitor.

Run an 8" length of red wire from the normally-open (NO) terminal of the relay to a block on the positive wire connector.

![hacks_airb-1899.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/140/medium640/hacks_airb-1899.jpg?1729027317)

![hacks_airb-1902.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/141/medium640/hacks_airb-1902.jpg?1729027419)

![hacks_airb-1904.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/142/medium640/hacks_airb-1904.jpg?1729027720)

![hacks_airb-1905.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/143/medium640/hacks_airb-1905.jpg?1729027872)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/148/medium800/hacks_airb-1907.jpg?1729027960)

## Solenoid Connection

Connect one wire from the solenoid valve to the positive side of the snap-action connector block and the other solenoid wire to the negative side. Polarity usually doesn't matter for the solenoid, it should function properly regardless of polarity.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/133/149/medium800/hacks_airb-1911.jpg?1729028190)

## Test Run

Without pressurizing the air tank you can test if the solenoid triggers properly.

Connect the distance sensor to the Feather with the STEMMA QT cable.

Plug in the 12VDC power supply to AC wall power, then plug the barrel jack into the 2.1mm adapter.

Give the Feather power over USB (or battery as shown here for convenience).

Trip the distance sensor and the solenoid should open and close!

![](https://cdn-learn.adafruit.com/assets/assets/000/133/150/medium800/hacks_airb-1913.jpg?1729028427)

## Enclosure

You can neaten up the build by placing the circuit in an enclosure.

Disconnect the solenoid from the wire blocks, feed them through a cable gland, and then reconnect as shown.

I sadly lost one cable gland, but if you haven't, use the second one for the STEMMA QT cable, USB C cable, and 12V DC power!

![hacks_airb-1914.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/151/medium640/hacks_airb-1914.jpg?1729029414)

![hacks_airb-1915.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/152/medium640/hacks_airb-1915.jpg?1729029428)

![hacks_airb-1916.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/153/medium640/hacks_airb-1916.jpg?1729029443)

![hacks_airb-1919.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/154/medium640/hacks_airb-1919.jpg?1729029588)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/163/medium800/hacks_airb-1920.jpg?1729032569)

## Connect Enclosure

Use zip ties or other fasteners to connect the enclosure to the handle of the air tank.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/167/medium800/hacks_airb-1922.jpg?1729032675)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/171/medium800/hacks_airb-1927.jpg?1729032683)

You can position the distance sensor wherever it makes the most sense for your haunt use. Some Blu-Tack will work fine, or make it a little more secure with double-stick foam tape -- or mount it to a structure with the mounting holes.

![](https://cdn-learn.adafruit.com/assets/assets/000/133/177/medium800/hacks_airb-1938.jpg?1729032694)

# Haunted Air Blaster

## Use the Air Blaster

https://youtu.be/T5hmbRACTho

![](https://cdn-learn.adafruit.com/assets/assets/000/133/183/medium800thumb/hacks_haunt.jpg?1729049859)

## Fill the Tank

Connect your compressor hose to the air blaster's inlet and open the valve.

Turn on the compressor an fill the tank to around 80 PSI.

Close the inlet valve and turn off the compressor.

You can remove the hose or leave it connected for quick refilling later.

![hacks_airb-2053.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/190/medium640/hacks_airb-2053.jpg?1729094009)

![hacks_airb-2054.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/191/medium640/hacks_airb-2054.jpg?1729094019)

![hacks_airb-2057.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/192/medium640/hacks_airb-2057.jpg?1729094037)

![hacks_airb-2060.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/193/medium640/hacks_airb-2060.jpg?1729094044)

## Prep the Air Blaster

Close the output valve to prevent discharge during setup.

Plug in the USB C power and 12V power plugs.

Place the distance sensor so it will be tripped by your victims, er... guests!

Test tripping the sensor -- you should hear the solenoid valve click open and closed.

Time to arm it -- make sure the barrel is not facing anyone, then open the output valve. It's now armed and ready.

![hacks_airb-2062.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/194/medium640/hacks_airb-2062.jpg?1729094087)

![hacks_airb-2063.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/195/medium640/hacks_airb-2063.jpg?1729094094)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/202/medium800/hacks_airb-2064.jpg?1729094134)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/187/medium800/hacks_airb-2048.jpg?1729050906)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/185/medium800/hacks_airb-2049.jpg?1729049961)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/188/medium800/hacks_airb-2043.jpg?1729050918)


## Guide Products

### Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier

[Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier](https://www.adafruit.com/product/5768)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. By picking a feather and stacking on a FeatherWing you can create advanced projects quickly. One popular combo is our [Feather M4](https://www.adafruit.com/product/3857)...

In Stock
[Buy Now](https://www.adafruit.com/product/5768)
[Related Guides to the Product](https://learn.adafruit.com/products/5768/guides)
### Adafruit Power Relay FeatherWing

[Adafruit Power Relay FeatherWing](https://www.adafruit.com/product/3191)
A Feather board without ambition is a Feather board without FeatherWings! This is the **Power Relay FeatherWing**. It gives you power to control, and control over power. Put simply, you can now turn on and off lamps, fans, solenoids, and other small appliances that run on up to...

In Stock
[Buy Now](https://www.adafruit.com/product/3191)
[Related Guides to the Product](https://learn.adafruit.com/products/3191/guides)
### FeatherWing Doubler - Prototyping Add-on For All Feather Boards

[FeatherWing Doubler - Prototyping Add-on For All Feather Boards](https://www.adafruit.com/product/2890)
This is the **FeatherWing Doubler** - a prototyping add-on and more for all Feather boards. This is similar to our [FeatherWing Proto](https://www.adafruit.com/products/2884) except there are two! The magic of the Doubler comes when stacking a Feather and another...

In Stock
[Buy Now](https://www.adafruit.com/product/2890)
[Related Guides to the Product](https://learn.adafruit.com/products/2890/guides)
### Brass Liquid Solenoid Valve - 12V - 1/2 Inch G / BSP Thread

[Brass Liquid Solenoid Valve - 12V - 1/2 Inch G / BSP Thread](https://www.adafruit.com/product/996)
Control the flow of fluid using the flow of electrons! This liquid valve would make a great addition to your robotic gardening, aquarium, or pool project. There are two 1/2" (British Standard Pipe / German Thread) outlets. Normally, the valve is closed. When 12VDC is applied to the two...

In Stock
[Buy Now](https://www.adafruit.com/product/996)
[Related Guides to the Product](https://learn.adafruit.com/products/996/guides)
### 12V 5A switching power supply

[12V 5A switching power supply](https://www.adafruit.com/product/352)
This is a beefy switching supply, for when you need a lot of power! It can supply 12V DC up to 5 Amps, running from 110V or 220V power (the plug it comes with is for US/Canada/Japan but you can use any plug adapter for your country, or just replace the cable with a standard 'figure-8'...

In Stock
[Buy Now](https://www.adafruit.com/product/352)
[Related Guides to the Product](https://learn.adafruit.com/products/352/guides)
### Female DC Power adapter - 2.1mm jack to screw terminal block

[Female DC Power adapter - 2.1mm jack to screw terminal block](https://www.adafruit.com/product/368)
If you need to connect a DC power wall wart to a board that doesn't have a DC jack - this adapter will come in very handy! There is a 2.1mm DC jack on one end, and a screw terminal block on the other. The terminals are labeled with positive/negative assuming a positive-tip configuration...

Out of Stock
[Buy Now](https://www.adafruit.com/product/368)
[Related Guides to the Product](https://learn.adafruit.com/products/368/guides)
### Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm

[Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm](https://www.adafruit.com/product/3967)
The&nbsp; **Adafruit VL53L1X Time of Flight Distance Sensor** (also known as VL53L1CX) is a&nbsp;_Time of Flight_&nbsp;distance sensor that has a massive 4 meter range and LIDAR-like precision. The sensor contains a very tiny invisible laser source and a matching sensor....

In Stock
[Buy Now](https://www.adafruit.com/product/3967)
[Related Guides to the Product](https://learn.adafruit.com/products/3967/guides)
### STEMMA QT / Qwiic JST SH 4-Pin Cable - 400mm long

[STEMMA QT / Qwiic JST SH 4-Pin Cable - 400mm long](https://www.adafruit.com/product/5385)
This 4-wire cable is a little over 400mm / 15.7" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/5385)
[Related Guides to the Product](https://learn.adafruit.com/products/5385/guides)

## Related Guides

- [Adafruit VL53L1X Time of Flight Distance Sensor](https://learn.adafruit.com/adafruit-vl53l1x.md)
- [Adafruit RP2040 Prop-Maker Feather](https://learn.adafruit.com/adafruit-rp2040-prop-maker-feather.md)
- [Computer Space Mini Arcade](https://learn.adafruit.com/computer-space-mini-arcade.md)
- [Easy No-Soldering Bluetooth Controlled Room Lights](https://learn.adafruit.com/easy-no-solder-bluetooth-controlled-room-lights.md)
- [Sensor-Locked Secrets with CircuitPython](https://learn.adafruit.com/sensor-locked-secrets-with-circuitpython.md)
- [Mystery Box: Remote Chess Board Puzzle Lock](https://learn.adafruit.com/mystery-box-remote-chess-board-puzzle-lock.md)
- [PyPortal Titano Weather Station](https://learn.adafruit.com/pyportal-titano-weather-station.md)
- [Adding a Bubble Level to the MEMENTO](https://learn.adafruit.com/adding-a-bubble-level-to-the-memento.md)
- [Memento Photo Capture with itsaSNAP](https://learn.adafruit.com/memento-photo-capture-with-itsasnap.md)
- [Blinking an LED with the Zephyr RTOS](https://learn.adafruit.com/blinking-led-with-zephyr-rtos.md)
- [Solderless Robot Toy Xylophone](https://learn.adafruit.com/solderless-robot-toy-xylophone.md)
- [NeXT Computer Keyboard to USB HID with CircuitPython](https://learn.adafruit.com/next-computer-keyboard-to-usb-hid-with-circuitpython.md)
- [Adafruit MagTag Kitchen Timer](https://learn.adafruit.com/adafruit-magtag-kitchen-timer.md)
- [WiFi Jellyfish Lantern with WLED](https://learn.adafruit.com/wifi-jellyfish-lantern-with-wled.md)
- [Cartoon Character Clock](https://learn.adafruit.com/cartoon-character-clock.md)
- [Microsoft Azure Cost Monitor](https://learn.adafruit.com/azure-cost-monitor.md)
- [MIDI Breath Controller](https://learn.adafruit.com/midi-breath-controller.md)
