This is my implementation of the electronics for a Ghostbusters Proton Pack. It uses a Teensy microcontroller in both parts of the kit (Pack and Wand) and communicates between them over 4 wires (power + serial). For now I have kept it to a simple movie implementation with some additions - overheating and music playback. I've added two features that are a bit unusual:
- An OLED display in the rear box on the wand is used for managing volume control and track selection, in conjunctions with a rotary encoder (push/turn) in the front knob.
- A bluetooth receiver can be turned on for playback of anything not available on the SD card. The module I'm using will mix the stereo audio down to mono for a single pack, but comes as a pair for True Wireless Stereo. The other board will be in a friend's pack so we can use the packs as a complete speaker set.
It is designed to fit inside the 3D printed pack available here - the Q-Pack. It's been developed for a Mk3 pack - I will review it at some point in the future for Mk4 compatability.
The code is set up as a VS solution/project set using Visual Micro, but you can tweak this to your preferred environment. There are three core files:
- Wand.ino for the Wand sketch on the Teensy LC
- Pack.ino for the Pack sketch on the Teensy 4.0
- ProtonPackCommon.h which is used by both for some shared enums, timers, etc.
The Wand sketch does all state management, and will update the Pack sketch as necessary over serial. If you want to tweak speeds, animations, direction of switches, etc. then you should find the right data to change either above the setup() functions in each file, or within the common header.
You'll need the libraries listed in the section below.
minIni for Arduino - Config file saving/loading with the SD card
LCDGFX - Drives the OLED display
CmdMessenger - Manages serial connection between both boards with callbacks
Encoder - Converts rotary encoder inputs to movement
HT16K33 - Basic library for controlling the LED matrix backpack/bargraph.
NeoPixel - The Adafruit NeoPixel library. Considered using FastLED, but as I had GRBW LEDs in stock (and wanted them for some parts) I stuck with the Adafruit library.
TimerEvent - A library for managing timing of updates (helping to banish unnecessary delay() calls)
Switch - Primarily used for the debouncing and callback features for switches. Detects events for pressing, holding, and releasing.
Once power is on to both boards, they will start up in the state determined by the current switch positions, so you can switch straight into music mode if you want. If the pack is powered without a wand connected, it will enter bluetooth mode after 5 seconds. When both are connected, and the Activate switch is in the off position, a top light on the wand will pulse a faint blue to remind you that your battery is still connected!
Act Switch on Left Box
- This toggles the pack power-up for both movie and music mode.
Lower Switch Next to Bargraph
- In movie mode this toggles whether or not the overheat warning will kick in after a period of time and then move to venting after further warning. If off, firing will continue indefinitely.
- In music mode, this is used to toggle the Bluetooth module on, which will then stop any playback from the SD card.
Upper Switch Next to Bargraph
- This switches between movie mode (off) and music mode (on)
Int Button on Left Box
- In movie mode, this will cause the pack to fire while held.
- In music mode a single press will act as a play/pause button, while a long press will move to the next track in the list.
Tip Button
- In movie mode, this will cause the pack to fire while held. If single pressed, it will cause a venting routing to kick off.
- In music mode a single press will act as a stop button, while a long press will move to the previous track in the list.
Pack Crank Knob
- Connected to an encoder, this independently controls volume of the pack when held and turned.
Pack Ion Switch
- Currently unused.
A long press on the Wand encoder will activate the menu (to avoid accidental bumps). While active, a long press will also cancel the menu. The menu has an automatic timeout so will not stay open indefinitely. Single click to select / confirm menu items
Currently there these features for control:
- Volume: This changes the volume of the amplifier in the pack via i2c. This will update as you turn the knob.
- Track Change: This lets you select the extact track you want queued up for playback from the SD card (if enabled). Single click to confirm the selection, or long press to cancel. Selecting a new track while one is playing will cause the new track to start immediately. Note that using the next/prev track shortcuts on the INT/TIP buttons will display the new track name in the display.
- Overheat/Warning Time: For overheat mode, this will change the timings for how long until the warning starts (overheat) and how long the warning lasts before forced venting (warning).
- Load/Save Config: This will load or save the volume, track, and timing configuration to a file on the SD card. This is loaded as the default when the pack is first powered
A long press in any menu item should take you back up one level.
The light colours I've used in my code were chosen to work with the lenses and printed hats I'm using. I would recommend testing against your own installation and tweaking them accordingly. My setup is:
- Power cell is a layer of frosted acrylic + a top layer of blue acrylic (so lighting aims to send green and blue only)
- Cyclotron lenses are just frosted acrylic so I can do any colour. They are mounted over printed reflectors lined with a red chrome vinyl layer to give them a red tint when off.
- For the wand LED covers the slo blo is red, tip hat is orange, front shelf is opaque white, top front is clear, and top rear is orange.
I've removed the music tracks from this repository, but you can see which ones I had loaded in ProtonPackCommon.h. You can replace these with your own copies, or adapt the header file to manage your own. I used 16 bit 44.1khz wave files downmixed to mono as I only have a single speaker setup in the pack. I believe the audio board does support MP3 with some overhead, but there's so much space on a SD card that I didn't care. Audacity was used for file processing because it's great.
If you want to add more music tracks to the pack, bearing in mind that it might take a while to change them given the simple scrolling menu, then you can update the arrays in ProtonPackCommon.h to reference them. Make sure to update the track count as well.
- General code refactoring where I've got a few inconsistent approaches. Tidy up method signatures a bit to be consistent with ordering of arguments, remove TimerEvent as I've ended up with some custom implementations of the same principle so should be consistent.
- Some pin headers in the pack are already spare to support adding a smoke machine to the pack at a later date for venting (marked as IO2 on the PCB). This should be easy to add triggers in software at the appropriate state changes. I've seen some interesting looking i2c relay boards or i2c IO expanders out there as alternative options if I want more granular control over pump, smoke, fan for the effects.
- Alternative lighting schemes, sounds, animations, etc. can be added relatively easily. Switching would probably be done with additional menu items through the OLED controls.
- I'll play with adding more granular volume control, again through the menu, to individually tweak the volume of SFX, Music, and Bluetooth channels. This may turn out to be unnnecessary given the sounds should already be balanced and bluetooth volume should be handled by the device sending audio.
- The Ion Switch input currently doesn't do anything. I may use this as either a hard or soft toggle for any future smoke effects.
- Check compatibility with Mk4 Q-Pack and generally review the PCBs for other layout options. Now I've got my own wiring in, I might see some better positioning for connectors, consider breakout boards, etc.
- Consider either including an isolated converter in the BOM and as part of existing PCBs, or a breakout depending on power requirements for the smoke system.
- Reorient the wand board to make the USB port accessible when installed. At the moment you can't get in there for updates without pulling the Teensy or the whole board. Neither of those things are fun, and make software updates a pain.
- Consider a better menu system, and make all configurable settings switchable in software. That would reduce the need for any trial and error with USB cables attached and would allow for all tweaking of things like switch directions, cyclotron spin directions, etc. possible through the OLED menu. Could even then distribute just the binaries of the firmware for busters who don't want to go anywhere near an IDE.
- I'd like to add USB panel breakouts onto the motherboard and somewhere on the wand for access to the internal devices without needing to take my shell off. If I can somehow make the SD card accessible as mass storage when connected as well then so much the better.
Where I can remember it, I've listed the Equipment used and links to purchase below. You may find other sources are better for availability (Mouser, Digikey, etc.). As with all of these types of projects, it depends exactly how you're planning to mount your electronics, so I'd advise thinking about your layout before purchasing. I'm assuming I don't need to go into tools and wire here, that should be a given. A decent soldering iron is a must, and I have to say how much I'm loving my Pinecil, and also the best helping hands I've ever used, the Omnifixo.
Controllers
1 x Teensy LC. Would be fine using a Teensy 4.0 here as well if availability is a challenge
1 x Teensy 4.0
1 x Teensy Audio Board Rev D
1 x Teensy Stacking Header Kit. For the audio board to stack on the Teensy 4.0. This was the easiest source of 14 pin stackable headers I could find. If not using PCBs then you may just stick with non-stacking headers here.
4 x 14x1R Pins for the Teensy boards
4 x 14x1R Socket Headers for the PCBs
1 x 5x2R Socket Header for the PCB connection to the audio inputs/outputs on the board
1 x Micro SD Card for the Audio Adapter. See the Audio Adapter product page for up to date recommendations. Not much is stored on here so you can get away with a fairly small card, but if you want to load more songs on YMMV.
Premade Boards
1 x Adafruit 16x8 LED Matrix Driver Backpack - HT16K33 Breakout for driving the bargraph.
1 x DFRobot Mosfet Controller DFR0457 to switch the bluetooth board
1 x Adafruit 20W Class D Amplifier
1 x Bluetooth Audio Board. Comes as a wireless stereo pair.
Buttons and Switches
3 x 2 Position MTS102 mini toggle switches for wand
1 x Black Off/On SPST Momentary switch
1 x Red Off/On SPST Momentary switch
2 x EC11 Rotary Encoder with Switch for the pack (crank) and wand (top / front knob). Lengths will depend on your shells, and where you're placing the encoder.
Ion switches can be picked up on Etsy.
I also use some of these to switch on/off and choose charging vs electronics power for my internally mounted Talentcell battery.
LEDs
You may want to do your own LEDs. Numbers and type can be varied in the code, though I haven't allowed for cyclotron LEDs that are more than a single addressable LED in a chain. You may want to use the 7 LED jewels, though I found they were unnecessary for brightness and just ramped up power consumption for the sake of it.
1 x 144LEDs/m SK6812 RGBW Strip. 144 LEDs/m is just enough density to give you 15 LEDs in the Power Cell. You can get a minimum length if you like.
13+ x SK6812 RGBW Chips which I use in the wand, pack vent, and for the cyclotron. Worth getting some spares in case you fry one.
1 x RGBW LED jewel for the barrel light
1 x 28 Segment Bar Graph. Sourcing for this always ends up out of date, so hunt around Aliexpress or try asking on one of the FB groups. Note that there are two versions of this bargraph, a common anode and common cathode version. My code is designed for the BL28-3005SK04Y model (note the A or K in the model name differentiating them). It can be adapted for the other by simply changing the array mapping in the common header to point to the correct row/column references for your model.
Capacitors and Resistors
4 x 4.7K Ohm Resistors for pullups on the Teensy i2c lines
6 x 220 Ohm Resistors for neopixel data inputs
2 x 100 uF Capacitors for neopixel power inputs (these may not be necessary depending on the pixels you're using - I'm keeping them in as they don't harm)
Connectors (for PCB / wiring)
Source these where you like depending on how many you need / want for other projects. I tend to buy bulk lots from AliExpress. You can count up the exact number you need, but I always find I need more so I'll leave them open ended :)
- JST-XH connectors and headers for the boards and cables (2,3,4 pin)
- Screw terminal blocks (2 pin, 5mm pitch)
- Dupont connectors
- JST-SM wire to wire connectors for (handy locking wire to wire options)
- JST-PH connectors (2,3 pin) for some of the smaller connectors on the DFRobot boards and the bluetooth board
- An assortment of Wago221s because they're brilliant for patching cables together with quick release
- 2 Pairs of 4 pin aviation connectors which I use to carry the serial/power to and from the wand while allowing a quick release.
Other
2 x 74AHCT125 Level Shifters for driving the Neopixels as the Teensy uses 3.3V logic. You may get away without these, but better safe than sorry.
2 x 14 Pin IC Sockets for mounting the above into the PCBs (or you can just solder them in).
1 x 0.91-inch OLED Display SSD1306
1 x M6 Thumb Nut for the top knob on the wand. I drilled out a 2.5 mm hole in the side, tapped it for M3 and used a grub screw to attach it to an encoder. The top is capped with a cut-off and glued countersunk bolt head.
I have created a couple of PCBs to make installation neater in a Q-Pack. I've shared the production files in the PCBs folder for use with JLCPCB. I used Altium Circuitmaker to create these, so it's hard to share a useful copy of them. I plan at some point to migrate these to KiCad but that requires time to learn KiCad. It'll probably happen when I start working on a better belt gizmo :)
The folder also contains STLs to mount the boards and keep the solder joins clear of the mounting surface. For the Wand, it is just a spacer - the board is designed to fit along the handle side of the Mk3 Q-Pack, using the external M3 bolt to secure it with a nut internally. This should position the serial/power connections for the handle exit, but leave enough space for an encoder to run through the top/front knob if desired. For the pack, it's a backer designed to have M3x5x4 heat sets (standard size used in Vorons) added to the holes so the board can be attached and removed easily with M3 bolts. The backer can then be secured in place to the motherboard with VHB tape. It should be slim enough to fit underneath the booster box of the Mk3 Q-Pack.
Lastly, the current version did not take into account the 3mm inset on the box lid. I have added an alternative STL for this into the folder, but will refactor the PCBs when I redo them in the future. My STL for the lid also changes some hole sizes as I'm using M3 + heat inserts to attach to the box, and M4 for metal V-Hook/S-Hook connectors.
Revision 1.0: Initial release of boards
Revision 1.1: Pack board updated to move Audio Board output pin. I made a mis-reading of the schematic, and only the pins nearest the Teensy pins are connected to L/R out. Temporarily solder bridged on my v1.0 boards.
I've left supplying the 5V power to the boards to the individual user. You can take a feed directly from a Talentcell 5V output or use a common buck converter, but either of these may introduce some noise into the audio. Your mileage with this may vary. I got myself some isolated dc-dc converters to step down my 12V talentcell battery and avoid noise issues going to the amp. 6W is overspecced - in my testing, the setup draws at most 0.6A at its busiest time when in the overheat warning sequence. They're working well for me so far.
I'm slowly going over my library of replacement parts and jigs that I've made over the course of this build and exporting them into the STLs folder (and where appropriate I'll feed some back as PRs for the q-pack). Things like board mounts are generally reusable either with my PCBs or the off-the-shelf boards listed above. Some bits I've made are very specific to my build so probably not of interest to others. Have a play with Fusion 360 - you'll both love and hate yourself as a result, but you'll be too far down the rabbit hole of making to notice :)
If you see any others I'm using in photos and want to get hold of them, let me know.
A huge thanks to everyone over on the Arduino for Ghostbusters Props Facebook group. Special shout outs to:
- Chris Rossi for steering me towards the Teensy in the first place
- Kevin Delcourt for his excellent github documentation. Inspired me to take a different approach to fixing the top knob to the encoder!
- Quentin Machiels and Taco Belli over at 3D Printed Ghostbusters Props, without whom I would not have a pack to build this into
- Mike Simone and CountDeMonet for their implementations. Both have steered hardware and software choices.