Enchanted Thor Hammer

"Whosoever balances this hammer, if they be worthy, shall possess the power of Thor..."

Similar projects worth following
Mjölnir with an additional enchantment using a touch of accelerometer, a sprinkle of actuator and a few 3D printed parts.

I believe that the thought of building a self-balancing robot crosses every maker's mind at some point. And who can blame them. Its fun to watch and appears simple enough to at least attempt once. I was also bitten by the bug but wanted to give the self balancing robot a fresh look. So, decided to build its chassis to resemble the Thor's hammer, Mjölnir.

Now, to be honest, I am probably the least qualified person to talk about Thor or his hammer. I haven't even watched the movie yet :) But I had heard of it and imagined it to be a good candidate since it is top-heavy with high moment of inertia. So, decided to give it a shot.

I got the STEP file from grabcad and altered it in Fusion 360 to suit my requirements. The body consists of a hammer head at the top. It is connected to the grip through a handle. The grip and the head were split in two halves, top and bottom. The head was hollowed out from inside to make space for the electronics. The hammer uses the inverted pendulum concept to balance itself on the two wheels. The wheels are powered by a DC motor situated inside the top half of the hammer grip. The bottom half of the grip is just for aesthetics and gives a nice finishing touch to the grip.

Below is the list of parts to be 3D printed and the required electronic components:

  • the hammer head to house all the electronics. Other than the DC motor, all the electronics are housed in the hammer head. The bottom portion of the hammer head acts as a lid to close the hammer head and also connects it to the handle.
  • an accelerometer to measure the deviation angle used as an input for the control algorithm. MPU6050 is a good choice with its low cost and reasonable accuracy. Digital Motion Processor (DMP) was used since it minimizes the errors inherent in its gyroscope and accelerometer sensors.
  • a bluetooth (HC-05) module slave to control its motion remotely. It can also be used to get the stats for PID tuning.
  • A microcontroller to process the information from the sensor, perform computations and generate output for the motor. Arduino nano was used due to its small footprint.
  • an L298N motor driver which provides speed control through Pulse Width Modulation (PWM) and direction control through its H-bridge configuration.
  • a battery holder with 6 AA batteries to provide juice to this whole contraption.
  • a switch to give this thing a break.
  • The DC motor is nicely concealed in the grip with the power to it carried through the handle.

All parts were printed in PLA with 0.28 mm layer height and a 0.4 mm nozzle on an Ender 3. The STL files can be found on Thingiverse and the source code can be found on github.

Design notes

  • Adding more mass to the hammer head results in higher moment of inertia. With the given gravitational torque, it means less angular acceleration which means it will take longer for the hammer to fall over and therefore gives a better chance for the control algorithm to calculate and apply corrections timely.
  • Designed a shaft coupler to extend the DC motor shaft length and a sleeve for the axle to reduce wobble from the DC motor.
  • The control algorithm used is a simple PID loop with the 'setpoint' as the angle deviation from vertical. It tries to minimize this error by adjusting the 'output' mapped to the motor speed. The tuning was done by adjusting the value of Kp first followed by Kd and Ki.Forward or backward motion can be achieved by changing the setpoint for the hammer to gradually incline and then get back to upright position. I was unable to test the last part due to limited motor torque.
  • Used a soft serial port for interfacing the Bluetooth module. Arduino nano has just 1 hardware serial port and I wanted to avoid multiplexing it between firmware upload and BT.
  • The MPU6050 breakout board I used was marked as GY-521. It has an onboard 3.3V voltage regulator (4A2D). So, it should be fine to hook it up directly to a 5V supply.


  • Since there is only one motor, the hammer...
Read more »


Circuit Diagram

fzz - 119.67 kB - 02/04/2021 at 17:21


View all 6 components

  • 1
    Assemble the grip
    • Start by inserting the 1/2" PVC conduit into the top portion of the grip, through the handle and in to the bottom portion of the hammer head. There are 2 distinct benefits of using a PVC pipe. It adds a lot of strength on the slender portion of the assembly and reduces the 3D printing time.
    • Insert the DC motor into the top portion of the grip. Use a pair of wire long enough to extend from the motor all the way to the hammer head.
    • Secure the DC motor to the grip using 30 mm long M3 screws.
    • Insert shaft extension into the motor axle on both sides.
    • Securely attach the wheels to the shaft extension.
    • Use the small 3d printed tabs to attach the top and bottom portion of the grip.
  • 2
    Assemble the head
    • Mount the L298N motor driver on the 4 standoffs in the electronics mounting platform using M3 screws.
    • Attach the MPU6050 accelerometer/gyroscope sensor using the 2 holes in the center. This minimizes any offset when the hammer is in the vertical position.
    • The microcontroller (Arduino Nano) and the Bluetooth module (HC-05) go on the other side of the MPU6050 ensuring a relatively uniform weight distribution. Ensure that the micro USB port of Nano lines up with the opening on the side of the upper portion of the hammer head.
    • Secure the battery holder to the battery mounting platform using the 2 standoffs.
    • Insert the switch through the designated opening in the lower portion of the hammer head.
    • Complete the connection as per the circuit diagram below.
    • The upper portion of the hammer head has slots for 4 M3 nuts. Line up the slots and join the upper and lower portion of the hammer head using 4 M3 screws.
  • 3
    Power on
    • Place the hammer on a flat surface in the vertical position.
    • Turn the switch on and enjoy!

View all 3 instructions

Enjoy this project?



Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates