Feather M4 & PropMaker

Build a Time Baton inspired prop from the Disney+ series Loki. Use a Feather M4 and PropMaker FeatherWing with CircuitPython to make a motion activated prop with lights and sounds!

Different sounds are triggered depending on threshold and the LED changes brightness and color!

Accessible USB

Hidden inside the handle are the electronics. The Feather and PropMaker are fitted in a holder that can easily pull out for easy USB access.

3D Printed Prop

The diffuser is removable much like a lightbulb, you can unscrew it from the assembly.

Parts are designed for support-free 3D printing and fit on beds of most 3D printers!

Time Stick

Capable of altering the flow of time, this weapon is wielded by the Time Variance Authority. This SciFi inspired baton has the power to prune individuals by incapacitating variants. It features seven light tubes arranged in a circular group. 

Parts

Angled shot of a Adafruit Feather M4 Express.
It's what you've been waiting for, the Feather M4 Express featuring ATSAMD51. This Feather is fast like a swift, smart like an owl, strong like a ox-bird (it's half ox,...
Out of Stock
Angled shot of a Adafruit Prop-Maker FeatherWing.
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. Perfect for fitting into your next prop build! This FeatherWing will...
$9.95
In Stock
Very bright LED bathing robot figuring in rainbow light
Better grab your sunglasses, your sunscreen, and a bucket hat because this 3W RGB LED is so bright it's like like taking a beach...
$2.95
In Stock
Mini Oval Speaker with pico blade connector
Hear the good news! This wee speaker is a great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like...
$1.95
In Stock
Lithium Ion Cylindrical Battery - 3.7v 2200mAh with JST PH connector
Need a big battery for your project? This lithium-ion battery contains a 2200mAh and a protection circuit that provides over-voltage, under-voltage, and over-current protection. Yet,...
$9.95
In Stock
Breadboard-friendly SPDT Slide Switch
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch...
Out of Stock
Angled shot of a Header Kit for Feather - 12-pin and 16-pin Female Header Set.
These two Female Headers alone are, well, lonely. But pair them with any of our 
$0.95
In Stock
1 x 2-pin JST plug
Female Connector 100mm
1 x 2-pin JST socket
Male Header 200mm
1 x 2-pin JST Molex Pair
40cm long - Molex PicoBlade Compatible
1 x 4-pin JST plug
STEMMA Cable - 200mm
1 x 4-pin JST socket
Color Coded Cable - 200mm

The diagram below provides a visual reference for wiring of the components. This diagram was created using the software package Fritzing.

Adafruit Library for Fritzing

Use Adafruit's Fritzing parts library to create circuit diagrams for your projects. Download the library or just grab individual parts. Get the library and parts from GitHub - Adafruit Fritzing Parts.

Wired Connections

The Prop-Maker FeatherWing is fitted on top of Adafruit Feather M4 Express via female/male headers. The speaker is connected via a molex pico blade connector.

Powering

The Adafruit Feather M4 Express can be powered via USB or JST using a 3.7v lipo battery. In this project, a 2200mAh lipo battery is used. The lipo battery is rechargeable via the USB port on the Adafruit Feather. The slide switch is wired to the enable and ground pins on the Prop-Maker FeatherWing. 

3W RGB LED

  • red pin (R-) to red pin on Prop-Maker FeatherWing
  • green pin (G-) to green pin on Prop-Maker FeatherWing
  • blue pin (B-) to blue pin on Prop-Maker FeatherWing
  • voltage pin (V+) to V+ pin on Prop-Maker FeatherWing

Speaker

  • Voltage and ground to Prop-Maker speaker port

Slide Switch

  • Middle pin to enable pin on Prop-Maker
  • Far left or right pin to ground on Prop-Maker
Note the RGB LED can get H-O-T HOT! Be careful to not touch it or allow flammable materials around it if it is very hot. This is how these parts are designed, to be so bright, and it is not a part design issue.

Fusion 360 Tutorial

In this tutorial I chat about my design for housing the PropMaker FeatherWing and Feather M4 Express in this prop inspired by the TVA Time stick from the Disney+ show Loki. I really like using threads to make this type of assemblies easy to take apart and put back together. By making the pommel removable from the handle, the USB port from the microcontroller becomes easily accessible. I managed to design the PCB holder so it doesn’t require any supports when 3D printing.

CAD Parts List

STL files for 3D printing are oriented to print "as-is" on FDM style machines. Parts are designed to 3D print without any support material. Original design source may be downloaded using the links below:

  • 3W LED Holder
  • Cage-Bottom-Cover
  • Cage-Clip
  • Cage-Top-Cover
  • Cage
  • Collar
  • 7x Diffuser
  • Feather Holder
  • Guard
  • Handle
  • Pole Lower
  • Pole Upper
  • Pommel
  • Speaker Holder

Technical Drawing

Download a PDF of the designs technical drawing. The guard thread-size can be used to design an adapter for making custom diffusers and light fixtures.

Build Volume

The parts require a 3D printer with a minimum build volume.

  • 150mm (X) x 150mm (Y) x 140mm (Z)

Slicing Parts

No supports are required. Slice with setting for PLA material. 

The parts were sliced using CURA using the slice settings below.

  • PLA filament 220c extruder
  • 0.2 layer height
  • 10% gyroid infill
  • 60mm/s print speed
  • 60c heated bed

Printing Diffusers

The 7x diffuser tubes are printed using clear translucent PLA filament. Use 0% infill to make the model hollow. Using a brim can help with good bed adhesion. Printing a single diffuser at a time is suggested for best print quality.

Design Source Files

The project assembly was designed in Fusion 360. This can be downloaded in different formats like STEP, STL and more. Electronic components like Adafruit's board, displays, connectors and more can be downloaded from the Adafruit CAD parts GitHub Repo.

CircuitPython is a derivative of MicroPython 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.

The following instructions will show you how to install CircuitPython. If you've already installed CircuitPython but are looking to update it or reinstall it, the same steps work for that as well!

Set up CircuitPython Quick Start!

Follow this quick step-by-step for super-fast Python power :)

Click the link above and download the latest UF2 file.

Download and save it to your desktop (or wherever is handy).

Plug your Feather M4 into your computer using a known-good USB cable.

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

Double-click the Reset button next to the USB connector on your board, and you will see the NeoPixel RGB LED turn green. If it turns red, check the USB cable, try another USB port, etc. Note: The little red LED next to the USB connector will pulse red. That's ok!

If double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!

You will see a new disk drive appear called FEATHERBOOT.

 

 

 

Drag the adafruit_circuitpython_etc.uf2 file to FEATHERBOOT.

The LED will flash. Then, the FEATHERBOOT drive will disappear and a new disk drive called CIRCUITPY will appear.

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

Further Information

For more detailed info on installing CircuitPython, check out Installing CircuitPython.

Once you've finished setting up your Feather M4 Express with CircuitPython, you can access the code, audio files and necessary libraries by downloading the Project Bundle.

To do this, click on the Download Project Bundle button in the window below. It will download as a zipped folder.

# SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
Prop-Maker based Light Up Prop.
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open source hardware by purchasing
products from Adafruit!
Written by Kattni Rembor for Adafruit Industries
Copyright (c) 2019 Adafruit Industries
Licensed under the MIT license.
All text above must be included in any redistribution.
"""
import time
import random
import digitalio
import audioio
import audiocore
import busio
import board
import adafruit_rgbled
import adafruit_lis3dh

# CUSTOMISE COLORS HERE:
MAIN_COLOR = (20, 10, 0)  # Default is red
HIT_COLOR = (255, 100, 0)  # Default is white

# CUSTOMISE SENSITIVITY HERE: smaller numbers = more sensitive to motion
HIT_THRESHOLD = 650
SWING_THRESHOLD = 125

# Set to the length in seconds of the "on.wav" file
POWER_ON_SOUND_DURATION = 1.5

POWER_PIN = board.D10

enable = digitalio.DigitalInOut(POWER_PIN)
enable.direction = digitalio.Direction.OUTPUT
enable.value = False

# Pin the Red LED is connected to
RED_LED = board.D11

# Pin the Green LED is connected to
GREEN_LED = board.D12

# Pin the Blue LED is connected to
BLUE_LED = board.D13

# Create the RGB LED object
led = adafruit_rgbled.RGBLED(RED_LED, GREEN_LED, BLUE_LED)

audio = audioio.AudioOut(board.A0)  # Speaker

# Set up accelerometer on I2C bus, 4G range:
i2c = busio.I2C(board.SCL, board.SDA)
accel = adafruit_lis3dh.LIS3DH_I2C(i2c)
accel.range = adafruit_lis3dh.RANGE_4_G

COLOR_HIT = HIT_COLOR  # "hit" color is HIT_COLOR set above
COLOR_SWING = MAIN_COLOR  # "swing" color is MAIN_COLOR set above


def play_wav(name, loop=False):
    """
    Play a WAV file in the 'sounds' directory.
    :param name: partial file name string, complete name will be built around
                 this, e.g. passing 'foo' will play file 'sounds/foo.wav'.
    :param loop: if True, sound will repeat indefinitely (until interrupted
                 by another sound).
    """
    print("playing", name)
    try:
        wave_file = open('sounds/' + name + '.wav', 'rb')
        wave = audiocore.WaveFile(wave_file)
        audio.play(wave, loop=loop)
    except:  # pylint: disable=bare-except
        return


# List of swing wav files without the .wav in the name for use with play_wav()
swing_sounds = [
    'swing1',
    'swing2',
    'swing3',
    'swing4',
    'swing5',
    'swing6'
]

# List of hit wav files without the .wav in the name for use with play_wav()
hit_sounds = [
    'hit1',
    'hit2',
    'hit3',
    'hit4',
    'hit5',
    'hit6'
]

mode = 0  # Initial mode = OFF

# Main loop
while True:
    if mode == 0:  # If currently off...
        enable.value = True
        play_wav('on')  # Power up!
        led.color = MAIN_COLOR
        time.sleep(POWER_ON_SOUND_DURATION)
        play_wav('idle', loop=True)  # Play idle sound now
        mode = 1  # Idle mode

    elif mode >= 1:  # If not OFF mode...
        x, y, z = accel.acceleration  # Read accelerometer
        accel_total = x * x + z * z
        # (Y axis isn't needed, due to the orientation that the Prop-Maker
        # Wing is mounted.  Also, square root isn't needed, since we're
        # comparing thresholds...use squared values instead.)
        if accel_total > HIT_THRESHOLD:  # Large acceleration = HIT
            play_wav(random.choice(hit_sounds))  # Start playing 'hit' sound
            COLOR_ACTIVE = COLOR_HIT  # Set color to fade from
            mode = 3  # HIT mode
        elif mode == 1 and accel_total > SWING_THRESHOLD:  # Mild = SWING
            play_wav(random.choice(swing_sounds))  # Randomly choose from available swing sounds
            led.color = MAIN_COLOR  # Set color to main color
            mode = 2  # SWING mode
        elif mode == 1:
            # Idle color
            led.color = MAIN_COLOR
        elif mode > 1:  # If in SWING or HIT mode...
            if audio.playing:  # And sound currently playing...
                if mode == 2:  # If SWING,
                    led.color = MAIN_COLOR
                else:
                    led.color = HIT_COLOR  # Set color to hit color
            else:  # No sound now, but still SWING or HIT modes
                play_wav('idle', loop=True)  # Resume idle sound
                mode = 1  # Return to idle mode

Upload the Code, Sounds and Libraries to the Feather M4 Express

After downloading the Project Bundle, plug your Feather M4 Express into the computer USB port. You should see a new flash drive appear in the computer's File Explorer or Finder (depending on your operating system) called CIRCUITPY. Unzip the folder and copy the following items to the Feather M4's CIRCUITPY drive. 

  • lib folder
  • sounds folder
  • code.py

Your Feather M4 CIRCUITPY drive should look like this after copying the lib folder, sounds folder and code.py file.

Audio Files

The sounds used in this project are from the Motion Pulse BlackBox pack from VideoCopilot. The pack contains various sounds that are already in the supported audio format.

Adafruit CircuitPython supports 16-bit, Mono, 22.050kHz .wav audio format. See this guide to help format any audio files you might want to use in this project besides the files provided.

In the main loop, the swing and hit modes randomly choose from a list of sounds. For example, swing1.wav, swing2.wav, swing3, etc. This makes the motion effects feel much more varied and sounds less repetitive.

  • Power on – on.wav
  • Idle looping noise – idle.wav
  • Swing whoosh – swing.wav
  • Crash strike – hit.wav

Headers for PropMaker FeatherWing

Use a 12-pin and 16-pin male header pins for the PropMaker FeatherWing.

The strips of header are installed from the bottom of the PCB.

Breadboard for Headers

Using a breadboard can help keep the headers straight while soldering. Apply solder to all of the pins.

Headers for Feather M4

Use a 12-pin and 16-pin female headers for the Feather M4. The headers are installed on the top of the PCB.

Installing Feather Headers

Use the male headers from the PropMaker FeatherWing to help install the headers for the Feather M4.

Install the 12-pin and 16-pin female headers over the PropMaker's male header pins.

Place the Feather M4 over the pins on the female headers.

Solder Headers to Feather M4

Use a PCB vise to keep the PCB sturdy while soldering. Apply solder to all of the pins on the Feather M4.

Installed Headers

Pull apart the Feather M4 and PropMaker FeatherWing. These will be kept separated until the end of the assembly.

3W RGB LED

The 3W RGB LED uses a 4-wire ribbon cable and a 4-pin JST connector. Wire up the 3W LED using the following cable lengths.

4-pin JST plug cable: 20in (51cm)

4-pin JST socket cable: 4.5in (11.5cm)

 

Speaker

The stock cable on the mini over speaker will need to extended in order to reach the PropMaker FeatherWing. Use the following wire length.

2-pin Molex plug cable: 8in (21cm)

Battery Extension Cable

The stock battery cable will need an extension cable in order to reach the Feather M4. Use the following wire length to create a custom 2-pin JST cable.

2-pin JST extension: 6in (5cm)

Slide Switch

Use a 2-wire ribbon cable and 2-pin molex plug cable to connect the slide switch to the PropMaker FeatherWing.

2-pin Molex Socket & Plug cables: 3.5in (9cm)

3W LED Holder

The 3W LED uses the following hardware to secure to the LED holder.

  • 2x M3 x 10mm button head screws
  • 4x M3 hex nuts 

3W LED Assembly

Use the available mounting holes on the 3W LED and secure the two M3 x 10mm screws using hex nuts. Reference the photo for correct orientation

Insert the 4-pin JST cable from the 3W LED through the hole in the LED holder.

Secured 3W LED

Pull the cable from the 3W LED all the way through and fit the threads of the screws through the two mounting holes.

Use hex nuts to secure the 3W LED holder.

3W LED Holder Assembled

Double check the 3W LED is assembled correctly. The LED should be mounted facing up with the PCB fitted inside the holder.

Install 3W LED Cable to Guard

Insert the cable from the 3W LED through the hole in the guard. 

Assembled 3W LED Guard

Pull the cable all the way through and fit the LED holder into the guard. It should have a loose fitting so it can freely rotate when screwing the assembly together.

Pole Assembly

The pole is made from two pieces that are screwed together. Orient the two parts so the threads are properly lined. Fasten them together so they're tightly secured together.

Install 3W LED Cable to Pole

Get the pole and guard ready to assemble together. Insert the cable from the 3W LED from the the top of the pole. Reference the photo to see the correct end of the pole.

Install Guard to Pole

Pull the LED cable all the way through the pole so it sticks out the bottom. Fasten the guard to the top of the pole. Tightly fasten the two parts to secure them together.

Installing Battery to Pole

Get the 2200mAh battery ready to install into the Pole assembly. Fit the battery into the bottom of the pole with the cable facing out the bottom. Make sure not to kink the cable from the 3W LED while installing the battery.

Optionally use a piece of cardboard wedge in between the battery to make a tighter fitting – Otherwise the battery could rattle around inside the pole.

Install Battery Extension

Connect the 2-pin JST extension cable to the battery.

Speaker Holder

The mini oval speaker is press fitted into the cavity on the speaker holder. The speaker cable is fitted through the built-in slot away in the holder. 

Optionally peel away the protection covering and stick it to the holder – This will make it nicely secured. Otherwise, the tolerance should have a tight fitting.

Install Speaker Cable to Collar

The speaker holder is fitted inside the collar. Insert the cable from the speaker into the top of the collar.

Install Speaker Holder to Collar

Pull the cable from the speaker through the collar. Do not fit the speaker holder all the way into the collar just yet.

Get the speaker holder and collar ready to install into the pole assembly.

Install Cables to Speaker Holder

Insert the two cables (battery extension and 3W LED) through the hole inside the speaker holder. 

Installing Cables to Collar

Insert the three cables (speaker, battery extension and 3W LED) through the collar.

Installed Cables in Collar

Pull the cables through the collar. Reference the image for correct installation.

Begin to fit the speaker holder into the collar.

Installing Collar to Pole

With the speaker holder now fitted inside the collar, begin to fasten the pole into the collar. Tightly fasten the parts to secure them together.

Slide Switch for Handle

The slide switch is press fitted into the built-in holder inside the handle. Get the switch and handle ready.

Install Switch to Handle

Use a pair of tweezers to handle the switch. Carefully insert the slide into the build-in holder inside the handle. Push the body of the switch all the way into the holder. The actuator should protrude through the hole on the handle.

Installing Handle to Collar

Get the handle ready to install into the collar.

Install Cables to Handle

Insert the three cables (speaker, battery extension and 3W LED) through the top of the handle.

Install Handle to Collar

Pull all of the cables through the handle. Fasten the handle onto the collar. Tightly fasten the handle and collar to secure them together.

Feather Hardware for PCB Mount

Use the following hardware to secure the Feather M4 to the PCB mount.

  • 4x M2.5 x 10mm button head screws
  • 8x M2.5 hex nuts 

Use 4x M2.5 hex nuts to secure the screws to the Feather M4 PCB.

Secure Feather to PCB mount

Place the Feather M4 over the PCB mount with the USB port facing the large pull tab.

Use 4x M2.5 hex nuts to secure the Feather M4 to the PCB mount.

Installing Feather to Handle

The PropMaker FeatherWing and Feather M4 will snap together once all of the wired connections are made. 

Connect 3W LED

Start by connecting the cable from the 3W LED to the accompanying connector soldered to the PropMaker FeatherWing.

Connect Battery

Plug in the 2200mAh battery to the battery port on the Feather M4.

Connect Slide Switch

Plug in the cable from the slide switch to the accompanying connector soldered to the PropMaker FeatherWing.

Connect Speaker

Plug in the cable from the speaker to the audio port on the PropMaker FeatherWing.

Installing PropMaker FeatherWing

With all of the components now connected, get the PropMaker FeatherWing ready to install onto the Feather M4.

Installing Feather Mount

Keep the battery and slide switch cables fitted inside the Feather. Carefully fit the PropMaker FeatherWing onto the Feather M4.

Orient the PCB mount so the bottom is lined up with the slide switch holder.

The PCB mount is inserted into the handle with the side groves fitting through rail inside the handle. 

 

Installed PCB mount

The PCB mount is fulled inserted into the handle. The pull tab allows you to take it out for maintenance and easy disassembly.

Install Pommel

The pommel is fastened onto the bottom of the handle. Tightly fasten the two parts to secure them together.

Install Bottom Cover to Cage

Gather up the parts for the diffuser cage assembly. Start by fitting the bottom cover onto the cage.

Slightly bend the pillars apart to fit the bottom cover. Push it all the way down so it sits flush.

Install Diffusers to Cage

Begin to insert all seven diffuser tubes into the bottom cover. The tolerances should be loose so you'll need to hold the diffuser tubes in place while installing.

Install Clip to Cage

Place and insert the clip over the pillars in the cage. Orient the clip so the posts are lined up with the pillars. Reference the image for correct placement.

Install Top Cover to Cage

Get the top cover ready to install over the cage. Orient the top cover so the slots are lined up with the tips of the pillars.

Slightly bend the pillars apart to fit them into the slots inside the top cover. The top cover will snap fit into place.

Snap Fit Clip

Begin to slide the clip up and into the top cover. Insert the posts from the clip into the slots on the top cover. This will need the top cover secured to the pillars in the cage.

Assembled Diffuser

Double check the diffuser has been correctly assembled.

Optionally use glue to secure the top cover to the cage.

Install Diffuser to Guard

Get the diffuser assembly ready to install onto the guard.

Fasten the diffuser assembly onto the guard. Tightly fasten the parts to secure them together.

Final Build

Use the slide switch to power on the Feather M4 and PropMaker FeatherWing.

Swing and hits will trigger the various sound effects.

Hits will make the 3W LED brighter.

Congratulations! Your TVA Time Baton replica is ready for use. Be careful not to prune yourself!

This guide was first published on Oct 27, 2021. It was last updated on Oct 27, 2021.