Build a Tony Stark Iron Man Gauntlet in a weekend
This Halloween I wanted to challenge myself a little bit for my costume so once I finally settled on Tony Stark I just had to put a gauntlet together. This video is of me with the final product. Not perfect but I’m happy with what I was able to get done even though it was in a very short time frame. I am so thankful for the people that put together the Arduino platform and the vibrant community surrounding it. Keep being awesome. Full video demonstration at the end of the post.
The List
Build Time (including Dev time prototyping the electronics)
20 hours
Re-using code ~10 hours
Build Cost – 65$
Consumables – 25$
Electronics – 40$ (if bought new, high estimate).
Required Tools
Soldering Iron
Wire Strippers
Solder
Hot glue gun
Drill and drill bit (matches screws chosen)
Required Electronics
Accelerometer (MMA8452Q breakout board from Sparkfun)
Microprocessor (Arduino / AVR based)
Breadboard
Small perfboard / protoboard
Small Speaker
2 LEDs
2 220 Ohm Resistors
Required Hardware
1 Ethernet Cable
1 2 fore arm length peices of 1/4 inch plastic tubing/pipe.
1 RCA Cable
1 Cable TV cable
1 Antennae Cable (Wi-Fi)
A few more random cables
1 pipe clamp that fits your wrist
1 pipe clamp that fits your forearm
2 pieces of metal strip the length of your fore arm
4 Screws and nuts
A few zip ties
1 roll of electrical tape
1 ping pong ball
1 glove
1 plastic mouth wash bottle
1 can silver spray paint
1 can gold spray paint 1 4′ cable organization strip (Got mine at Ikea)
Nice to haves
Heat Gun
Heat Shrink tube
Multimeter
Epoxy Resin
Super Glue
There are three main phases to build this project. First, prototype your electronics and make sure they are all working. Second, get all the physical hardware assembled and ready to put the electronics on. Third, move the electronics from the breadboard onto perfboard and wire up your gauntlet.
Electronics – Part 1
All the code for the Arduino as well as a Fritzing schematic are located in my github repository for this project.
Step One
First your going to want to wire up the LEDs, Resistors, Accelerometer and speaker before you upload any code from your computer to the Arduino. I used a speaker harvested from a singing card someone sent me a while back as well as some donor LEDs from other reclaimed electronics. You can use any color you want but I wanted the blend of Blue and White to try and mimic how the gauntlet looks in the films. I used the MMA8452Q breakout board from Sparkfun as I had one on hand for a different project I’m working on and was familiar with the library I was going to need to use to communicate with it.
The large Arduino could be replaced with a much simpler board and smaller footprint. I ran out of time trying to move it over to an Arduino Pro mini I had on hand so I ended up with a much bulkier device. The program that powers the effect is rather large because it stores all three sounds (power on, power down, fire) in program memory so the total compiled size is about 29K. This would never fit on a smaller chip, like an ATTiny85 which only has about 6K of program memory left after the bootloader is accounted for. The code for just the LED effect was much much smaller so that should easily fit on a smaller chip. Another factor in the program’s size is simply that there are large libraries being used as well, IC2 (to communicate with the Accelerometer), PCM (to be able to play the audio using PWM). The design could be simplified and use other chips to store the sound files, play audio, and maybe even replace the accelerometer with single axis one or a tilt switch. The electronics are really over kill but they were on hand and quick to assemble into the project.
Step Two
Once everything is wired up you’re going to need to get access to the code to put on the Arduino. The latest version is going to be on github in the Iron Man Gauntlet repository located here https://github.com/hendricksonrw/iron_man_gauntlet. In case you can’t use git there is a working version of the code and libraries needed from my website by downloading them from this link
Step Three
Once you have downloaded the code you’ll need to move the folders in the library folder into your Arduino library folder so that the main sketch will compile correctly. Remember you have to restart the Arduion development environment after you copy new libraries in otherwise they won’t show up.
Step Four
The basic outline of the program is like this
There are Four states
– Stable/Idle
– Power up
– Power down
– Fireing
During the main loop of the Arduino the program checks which state it is in and responds accordingly.
Stable – LED gentle Pulse
Power Up – LED faster pulse & Play Audio
Power Down – LED faster pulse & Play Audio
Fire – LED fastest pulse & Play Audio
In the code you can change a few things to fit your build better
Change the values from the Accelermoter that trigger a state change
int stableThreshold = 0;
int rampThreshold = 60;
int fireThreshold = 160;
Change how many seconds you want to have to hold your hand cocked back before switching to the fire state
//The amount of time in seconds that you have pass the fire threshold
float fireDelay = 1.0;
Now that you’ve customized your code to fit your gauntlet you need to compile it and load it onto your Arduino. You should now have a working prototype of the electronics, wiggle your accelerometer around on the X axis and admire the blinky-ness.
You should end up with something that looks like the below picture
Hardware
I’m going to try and keep this brief as it really boils down to how creative you want to be with the wiring. There are lots of build photos on my flickr account here.
1. Build your basic frame by drilling two holes in each pipe clamp and the corresponding metal and bolting them all together.
2. Build some Wire frameworks
3. Attache wire frameworks
4. Spray paint gold cut off RCA wire ends and hot glue them to places.
5. Cut the Ping pong ball in half
6. Add random wires going all over and you’re ready to build the Glove armor pieces.
7. Cut to length pieces of the cord guidance / organizing tube. Attach to the glove leftover metal strip to attache the LEDs to later.
8. Take each finger and slice it where your knuckles are so it will bend with your fingers and then shape the end so that it is more round. Hot glue them to the glove.
Electronics – Part Two and final assembly
Now that your basic frame is set up and your electronics are working it is time to move the electronics onto the actual glove and gauntlet. This is going to take some creativity and some soldering work. When cutting your lengths of wires to the devices make sure to measure out how far away your electronics are going to be. I ended up having to use an arm band on my bicep because my speaker and LED wiring was just a little short of where I wanted it (resting on my shoulder).
1. You’re going to need to move the LED array off the bread board on onto a perf board so they can be attached to the glove hand. You could possible just solder the LEDs, resistors, and some long wires together but that would be difficult to attach to the hand.
2. I chose to use an old 8 wire cable to hook up to my Accelerometer breakout board as well as make a small board at the other side that could just plug into the Arduino using headers and a small piece of perf board. You don’t have to do that per se but it makes re-using this cable setup easier for in the future (which I’m already planning on doing).
3. Now that you’ve got your electronics ready to mount them to the glove, do so! Shout out for my old hackerspace Solid State Depot (their stickers are in this shot)
4. Attach the final wiring, the gauntlet cover and then secure everything and try it on.
5. Cover the LED with the cut up ping pong ball.
At this point you should be able to switch it on and fine tune your state threshold numbers for your gauntlet. Here is a video of it working.
I’ve been trying to upload the Arduino file but have come up with some issues. One being how to upload the mp3 sounds to Arduino IDE and I keep getting an error when compiling.
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: “Arduino Nano, ATmega328P”
sketch\MMA8453_n0m1.cpp: In function ‘void accelISR()’:
sketch\MMA8453_n0m1.cpp:409:6: warning: ‘accelISR’ appears to be a misspelled signal handler, missing __vector prefix [-Wmisspelled-isr]
void accelISR(void){
^
gauntlet_base:39:14: error: redefinition of ‘MMA8453_n0m1 accel’
MMA8453_n0m1 accel;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:39:14: note: ‘MMA8453_n0m1 accel’ previously declared here
MMA8453_n0m1 accel;
^
gauntlet_base:40:5: error: redefinition of ‘int currentState’
int currentState = STABLE;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:40:5: note: ‘int currentState’ previously defined here
int currentState = STABLE;
^
gauntlet_base:41:5: error: redefinition of ‘int previousState’
int previousState = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:41:5: note: ‘int previousState’ previously defined here
int previousState = 0;
^
gauntlet_base:42:5: error: redefinition of ‘int whiteled’
int whiteled = 6;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:42:5: note: ‘int whiteled’ previously defined here
int whiteled = 6;
^
gauntlet_base:43:5: error: redefinition of ‘int blueled’
int blueled = 5;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:43:5: note: ‘int blueled’ previously defined here
int blueled = 5;
^
gauntlet_base:44:5: error: redefinition of ‘int smoothValue’
int smoothValue = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:44:5: note: ‘int smoothValue’ previously defined here
int smoothValue = 0;
^
gauntlet_base:47:5: error: redefinition of ‘int stableThreshold’
int stableThreshold = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:47:5: note: ‘int stableThreshold’ previously defined here
int stableThreshold = 0;
^
gauntlet_base:48:5: error: redefinition of ‘int rampThreshold’
int rampThreshold = 60;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:48:5: note: ‘int rampThreshold’ previously defined here
int rampThreshold = 60;
^
gauntlet_base:49:5: error: redefinition of ‘int fireThreshold’
int fireThreshold = 160;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:49:5: note: ‘int fireThreshold’ previously defined here
int fireThreshold = 160;
^
gauntlet_base:52:7: error: redefinition of ‘float fireDelay’
float fireDelay = 1.0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:52:7: note: ‘float fireDelay’ previously defined here
float fireDelay = 1.0;
^
gauntlet_base:53:9: error: redefinition of ‘boolean timeFire’
boolean timeFire = false;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:53:9: note: ‘boolean timeFire’ previously defined here
boolean timeFire = false;
^
gauntlet_base:54:7: error: redefinition of ‘float fireStart’
float fireStart = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:54:7: note: ‘float fireStart’ previously defined here
float fireStart = 0;
^
gauntlet_base:55:7: error: redefinition of ‘float fireEnd’
float fireEnd = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:55:7: note: ‘float fireEnd’ previously defined here
float fireEnd = 0;
^
gauntlet_base:58:5: error: redefinition of ‘int soundStart’
int soundStart = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:58:5: note: ‘int soundStart’ previously defined here
int soundStart = 0;
^
gauntlet_base:59:5: error: redefinition of ‘int soundEnd’
int soundEnd = 0;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:59:5: note: ‘int soundEnd’ previously defined here
int soundEnd = 0;
^
gauntlet_base:60:9: error: redefinition of ‘boolean playing’
boolean playing = false;
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:60:9: note: ‘boolean playing’ previously defined here
boolean playing = false;
^
In file included from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from sketch\iron_man_Rev1.ino.cpp:1:
gauntlet_base:64:31: error: redefinition of ‘const unsigned char ramp_up []’
const unsigned char ramp_up[] PROGMEM = {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:64:21: note: ‘const unsigned char ramp_up [5012]’ previously defined here
const unsigned char ramp_up[] PROGMEM = {
^
In file included from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from sketch\iron_man_Rev1.ino.cpp:1:
gauntlet_base:68:33: error: redefinition of ‘const unsigned char ramp_down []’
const unsigned char ramp_down[] PROGMEM = {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:68:21: note: ‘const unsigned char ramp_down [4894]’ previously defined here
const unsigned char ramp_down[] PROGMEM = {
^
In file included from C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.21.0_x86__mdqgnx93n4wtt\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from sketch\iron_man_Rev1.ino.cpp:1:
gauntlet_base:72:28: error: redefinition of ‘const unsigned char fire []’
const unsigned char fire[] PROGMEM = {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:72:21: note: ‘const unsigned char fire [7310]’ previously defined here
const unsigned char fire[] PROGMEM = {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘void setup()’:
gauntlet_base:76:6: error: redefinition of ‘void setup()’
void setup() {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:76:6: note: ‘void setup()’ previously defined here
void setup() {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘void loop()’:
gauntlet_base:83:6: error: redefinition of ‘void loop()’
void loop() {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:83:6: note: ‘void loop()’ previously defined here
void loop() {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘int checkState()’:
gauntlet_base:105:5: error: redefinition of ‘int checkState()’
int checkState() {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:105:5: note: ‘int checkState()’ previously defined here
int checkState() {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘void pulseLED(int, int, int, int)’:
gauntlet_base:166:6: error: redefinition of ‘void pulseLED(int, int, int, int)’
void pulseLED(int ledOne, int ledTwo, int fadeRate, int state) {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:166:6: note: ‘void pulseLED(int, int, int, int)’ previously defined here
void pulseLED(int ledOne, int ledTwo, int fadeRate, int state) {
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘void stableState()’:
gauntlet_base:209:6: error: redefinition of ‘void stableState()’
void stableState(){
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:209:6: note: ‘void stableState()’ previously defined here
void stableState(){
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘void rampState()’:
gauntlet_base:224:6: error: redefinition of ‘void rampState()’
void rampState(){
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:224:6: note: ‘void rampState()’ previously defined here
void rampState(){
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\gauntlet_base.ino: In function ‘void fireState()’:
gauntlet_base:260:6: error: redefinition of ‘void fireState()’
void fireState(){
^
C:\Users\micha\Downloads\iron_man_gauntlet-master\iron_man_Rev1\iron_man_Rev1.ino:260:6: note: ‘void fireState()’ previously defined here
void fireState(){
^
exit status 1
redefinition of ‘MMA8453_n0m1 accel’
This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.