Mjölnir 2.0: IoT Smart Thor Hammer
by alemanja in Circuits > Sensors
819 Views, 2 Favorites, 0 Comments
Mjölnir 2.0: IoT Smart Thor Hammer

Ever wondered if you're worthy to lift Thor’s hammer? In this project, I recreated Mjölnir using modern electronics: a Raspberry Pi Pico W, capacitive touch sensors, a hidden electromagnet, and motion-triggered sound effects. Connected to the cloud via Adafruit IO, this hammer judges your worthiness and even roars with thunder when you swing it!
Supplies
Electronics:
- Raspberry Pi Pico W
- MPR121 Capacitive Touch Sensor (STEMMA QT)
- ADXL345 Accelerometer
- MicroSD Card Reader
- Electromagnet
- P2N2222A NPN Transistor
- Speaker (small, powered by PWM)
- 1kΩ Resistor
- Micro USB cable
- USB battery pack
- MicroSD Card
Materials:
- 3D printed Thor hammer case (PLA)
- Metal plate or metal stand (for hammer to magnetically lock onto)
- Soldering tools and wires
- Breadboard and jumper wires
- Hot & epoxy glue (optional for securing internals)
3D Print the Hammer
)


I 3D printed a Thor hammer shell using PLA, designed to be hollow with room for a breadboard and wiring inside. The head holds the speaker, SD card, and control electronics. The handle is hollow to route the capacitive touch sensor wires. Time to print was about 20 hours.
🔌
Assemble Electronics on Breadboard

I connected the Raspberry Pi Pico W to a breadboard, wiring in the SD card (SPI), MPR121 (I2C), ADXL345 (I2C), audio output pin (GP15), and an NPN transistor to control an external electromagnet. A 1kΩ resistor connects the base of the transistor to GP7. The electromagnet is powered from a 5V USB pack and shares GND with the Pico.
Mount Components Inside Hammer


The MPR121 touch sensor detects when someone grips the handle. If triggered, the Pico runs a random worthiness check and either unlocks the magnet (if worthy) or leaves it engaged. This lets the hammer feel "stuck to the ground" unless you're chosen!
Program the Pico W
First, I flashed CircuitPython onto the Raspberry Pi Pico W using the official UF2 file from circuitpython.org.
Then, I installed the following CircuitPython libraries into the /lib/ folder on the Pico:
- adafruit_minimqtt
- adafruit_mpr121
- adafruit_adxl34x
- sdcardio
- storage
- audiocore
- audiopwmio
After that, I uploaded my code.py file directly to the Pico's main directory.
Setup Adafruit IO
I created a free Adafruit IO account and set up a new feed called worthy_feed.
Then I added that feed to a simple dashboard so I could see real-time updates every time the hammer judged someone "worthy" or "not worthy."
You can customize the display with icons or text blocks for dramatic effect during your demo!
Add Sound Files
I created a folder on the MicroSD card called /thor/ and added all of the following .wav sound files to it:
- worthy.wav
- notworthy.wav
- thundergod.wav
- hammer.wav
- odin.wav
These sounds are triggered based on either the touch interaction (worthiness test) or swing motion (motion detection via accelerometer).
Final Assembly & Testing

I carefully routed all wires and sensors inside the hammer body, secured them with hot glue, and ensured the capacitive touch pads were in the handle.
I then ran tests:
- Touch detection: triggers worthiness logic and MQTT update
- Swing motion: triggers thunder/hammer/Odin sounds
- Magnet lock/unlock: releases hammer when worthy, holds it when not
Everything runs from a USB battery hidden inside. The hammer can be picked up only when the user is deemed worthy.