Project tutorial
Avenger Assembled: Iron Man Helmet & Arc Reactor

Avenger Assembled: Iron Man Helmet & Arc Reactor © GPL3+

A 3D Printed Iron Man Helmet & Arc Reactor, controlled with a embedded Arduino Uno!

  • 6,565 views
  • 6 comments
  • 25 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)
We used a Lulzbot Mini which has worked perfectly for over 1 year(except for our flexystruder head which has never worked :( )

Apps and online services

About this project

Avenger Assembled: 3D Printed & Arduino Controlled Iron Man Helmet and Arc Reactor.

Introduction and Motivation:

My motivation behind making this helmet started with my very first helmet, I ever made. It was a cardboard Antman helmet from a few videos that I found online. It was really cool (being a huge marvel fan), so I decided I really wanted to make an Iron Man helmet. I had just been to the National Maker Faire in Washington D.C. and everybody loved the Antman helmet. This motivated me even more to make the Iron Man one. I went through several prototypes, starting with another card board helmet. That helmet was too small so I designed my own helmet, this time when I put it together it looked more like a ball on my head than the one from the movie. Finally, I went to a paper model. This paper model turned out looking fantastic, but I ran into one more issue. The paper model was too flimsy. I tried to fix it but it just wouldn't work, so I made a decision to 3D print the helmet. I finally made one that was stable enough and also big enough to fit my head and a motor.

  • Making the Helmet & Arc Reactor:

The 3D Print:

1) Splitting it into pieces - software

The first step to creating this helmet was finding the file online, and then printing it. The file I found was a motorized Iron Man helmet. The file that I downloaded from thingiverse came in three pieces: the main part, the chin, and the face plate. Since all three of the pieces were too big for my printer's build plate, I had to find software that could cut my helmet into parts. While looking online, I found free software online called netfabb basic. I downloaded the tool and uploaded my file to it. Netfabb basic was very easy to use and I was able to cut the parts of the helmet up. Then I printed the part to the main helmet, chin piece, and face plate. While going through the prints, I would duct tape the pieces together and check to see if the size was good. When all the pieces were finished printing and 1 ½ rolls of filament were used up, I had the 24 piece helmet.

2) Selecting the proper adhesive

The next challenge was to find the right adhesive to glue the parts together. For the glue to work, it would have to meet three requirements:

  • It had to hold the pieces together with a strong bond,
  • have a quick cure time
  • easy to sand.

We tested 4 different kinds of glue, E6000, JB Weld KwikWeld, JB Weld Plastic Bonder, and Loctite Plastic Bonder epoxy. Ultimately, we ended up using KwikWeld because it met all three requirements. To attach the pieces, the first steps would be to rougher the sides that were going to be glued. I used a file to roughen the smooth sides until the piece had rough sides with little grooves and pockets. This would help the piece stick together. We then mixed the JB KwikWeld together with equal parts of the hardener and the steel and spread it evenly on both filed sides and press them together. If you have a clamp then slide it into the clamp and wipe away the excess glue. It takes about 10 minutes to dry but it helps to leave it longer then that.

  • 3) Designing the servo mechanism

The next challenge in making the Iron Man helmet was designing the servo mechanism. Since I was struggling to figure out how to attach the servo to the helmet with the pictures on thingiverse page, I decided to make my own. First, I planned out where the servo was going to be and measured a straight line from the servo to the attachment place. Then I guesstimated the angle that the servo was going to be. The first design was a little bit off with too sharp of an angle. The next one I fixed and it was just about right. Then I screwed the arm into the servo and the attachment place to see if it fit. It did! Finally, I designed a clamp to fit around the servo and printed it out. I assembled everything and we did the very first test. It was unstable and the face plate didn’t go all the way up in a smooth and equal way. To fix this problem I bent a metal coat hanger into a rectangular shape and put it into the slots where the 3D printed part was supposed to go. Then I designed clips to go under the coat hanger to keep it from falling. I cut slots in the top of the helmet with a hacksaw and then put everything back together. We tried it for the second time and it worked great!

4)Assembly & Painting

Finally, it was ready to paint. I took everything apart and did the first primer coat of white. Once the primer was done I masked off part of the chin piece with painters tape and I painted the helmet red. For the face plate, I painted it all gold. Since the gold dries fast, it was soon done but the red paint dries very slow so I left it out to dry. After all the parts were dry, I took the tape off the chin piece and masked off everything near the piece that was still white. Then, I used tin foil and put it around the rest of the helmet. Then I painted the white part gold and waited for that to dry. Then I reassembled the helmet again and put it all together. Then I did the final test and it worked!

5) The Arc Reactor:

Making the arc reactor was next. I first measured the size of the neo-pixel ring and designed a case to hold it. Then, for the lid, I used a design from someone on thingiverse and modified it to fit my needs. You can find the original model at here: http://www.thingiverse.com/thing:33021 The new design had almost the exact same features although some parts of it are a bit out of proportion. I printed the case and the top out and they fit pretty well. The only problem was, was that the Neopixel was too small for the case. it turns out I had done my calculations wrong so I went back and changed that. This time it fit. Next, I added two holes for the wires to go through and a bar on the top for the string to go in so I could wear it around my neck. Finally, I added a defuser made from translucent abs filament that fit snug in the case. The printing part was finally done!

The Electronics:

Once the 3D print was done, we knew we had a great platform to embed some electronics. For this project, we would like to control 1 servo motor which is attached to the face plate of the helmet. We would also like to control a Neopixel ring in the Arc Reactor. We used an Arduino Uno as the foundation of the control system for this project. However, there are numerous other types of boards which could be used as well and we have kept the software and hardware generic for this reason. As a matter of fact, we have used both an Uno and an Arduino101 interchangeably in this project. This will also allow for future expansion and the potential of making a connected helmet with the 101's onboard BLE!

Iron Man will need to actuate the servo motor of the helmet and the neopixel ring of the arc reactor. We used the MPR121 ADAFRUIT 12-KEY CAPACITIVE TOUCH SENSOR BREAKOUT to provide a touch based interface. This breakout board allows for 12 different inputs and communicates with the Uno using I2C. The 12 contacts leave plenty of room for future expansion and I2C is a part of the standard IDE packages for the Arduino family giving us the ability to interchange boards without reprogramming. It is well documented and the software examples provided make it easy to understand how to use it in our sketch.

We attached wires with bare ends to act was our capacitive touch switches. While we do not see traditional “switch bounce” like that observed with mechanical switches, a single touch will generate multiple hits as the loop() in the arduino sketch polls the board. To avoid the servo “chattering” in response to these hits, we implemented a 1/4 second software delay mechanism when reading touches. After testing the Uno and MPR121, we added the servo motor and power supplies.

Taking into consideration the use of a servo motor under load and the desire to “field deploy” this project at the 2016 NYC Maker Faire, one of the most important considerations of this project is the power supply. We have been told that power supply design is one of the more important, but least glamorous areas, of electrical engineering. Neither of us is an electrical engineer, so the solution we came up with is a combination of what we read would work, what we understood, what we had available and what we got to work. So we don’t claim that this is best solution and look forward to any suggestions for improvements.

Because of the load placed on the servo, the potential for back emf and the recommendations from https://www.arduino.cc/en/Reference/Servo, we chose to power the servo separately from the Uno. The servo motor power and ground were connected to the power and ground of a 4XAA battery pack. Very importantly the ground of the Uno, the servo and the battery pack must all be connected to complete the circuit. We do this connecting the ground rail of the Perma-Proto board, the 4XAA battery pack and a wire from the Uno's ground pin all together as can be seen in the Fritzing schematic below.

Originally we also had the Neopixel ring also being powered from the 4XAA battery pack. We changed this as there seemed to be some “chattering” of the servo when the Neopixel ring was being turned on and off. This, however, may have been due to low batteries at the time we were testing. Unfortunately we noticed this the night before the Maker Faire and we were already on the Perma-Proto. We decided to directly wire the Neopixel Ring to the Uno and change to fresh batteries at the same time. This fixed the problem, but did not answer the question. Maybe as we work to improve the project in the future we will pursue this.

The entire circuit was prototyped on a breadboard and then simply moved to an Adafruit ¼ Perma-Proto board. With a secure enclosure, this is the one of the simplest ways to rapidly create a deployable package for your project. We designed and printed a custom enclosure in blue HIPS filament, seen below. The whole unit with batteries was packed into a camera case for the Maker Faire!

The Software:

There are currently 2 versions of the sketch, IronMan02.ino and IronMan04.ino. Both will work with the hardware setup as described in this article.

The first, IronMan02.ino is the “get-it-done” version which follows in the spirit of, “Perfection is the enemy of completion.” We had a deadline to meet and this version, while not elegant, got the job done. In this version you will see that we created objects to represent the Helmet and Arc Reactor. This was done in anticipation of implementing multi-tasking on the arduino in future versions, so it wasn't a complete rush job. We can highly recommend reading the series of three articles on arduino multitasking by Bill Earl from Adafruit. Our code is based, especially IronMan04.ino, is based on the examples, ideas and recommendations from this set of 3 tutorials. These articles will take you beyond the basics of arduino programming and enable your projects to really take-off!

One issue we faced was that the faceplate opened and closed too rapidly. We solved this by using the delay() function to slow down and smooth out the motion of the face plate. Yes, if Dr. Reallyevilbadguy is about to blast Iron Man in the face with his super death laser, you want the helmet to close fast, but for demonstration purposes the slower, smoother motion looks much better.

// move helmet up, 1/4 second time block to avoid chatter/bounce on touch cap. switch  
 void up()  
 { 
   if((millis() - lastSwitched) > 250 )  
   { 
     lastSwitched = millis(); 
     if (!helmetUp
       int currPos = 0; 
       while( currPos < upAngle ) { 
         helmetServo.write(currPos); 
         currPos = currPos + 2; 
         delay(20); // delay(20) blocks all processor activity for 20 milliseconds! 
       } 
       helmetUp = true;  
     } 
     else {/* do nothing, helmet already up*/} 
   } 
 } 

The problem with using the delay() function is that the microcontroller can’t do anything else during the delay(). We solved this problem using the guidance in the adafruit tutorials above in the second version, IronMan04.ino.

The second version, IronMan04.ino, includes 2 major elements we wanted to implement, but ran out of time trying to accomplish prior to the Maker Faire:

  • One button/touch face plate control
  • Multi-tasking

When we talked to people about our initial project, everyone;s reaction was, you should only have one button/touch sensor to move the helmet up and down. We couldn't have agreed more and decided to implement this when we had time. Our solution involves using several state variables:

  • flip - to maintain the state of the face plate
  • flipping - to indicate if the face plate is currently transitioning position
  • directionality - to indicate moving the face plate up or down

In setup(), we always start the helmet in the open or up configuration. This is not absolutely essential. Regardless of the initial state, toggling the face plate switch will get you to the correct state by the second press. We have, however, written the code to take into account that the initial state of the face plate is up, and therefore there is no wasted button press in the beginning. Is this the best way? We're not sure, but since some of the greatest scientific minds spent many years working on control theory, I think we did ok with this project!

Since we poll for touches from the MPR121 in the loop, one user perceived touch will generate many touch signals. This is similar to traditional switch bounce and we handle it by means of software. We want fast response to the touch sensor and we do want to implement multi-tasking, so instead of blocking multiple touches in the switch/case of the loop() function, we place a timing block using the millis() function in the Helmet and ArcReactor objects, as seen in this code fragment from the Helmet object:

void flipFaceplate() 
 {
   // timing block to protect against chatter/bounce
   if ((millis()-lastFlipped) > 500 )
   {
     . . .

Again, by not using the delay() function we preserve multitasking in our project. It might be wiser to use a variable for the delay interval of 500 milliseconds to allow for changes and testing, but we got it right with our second guess of 500 and just were a bit sloppy here.

In order to smoothly sweep the servo through its angle of rotation, we needed to increment the servos rotation slowly. By placing a time block on the angle step of the servo motor by checking the current time with the millis() function:

void Update()
 {
   if ( flipping & (millis()-lastMoved) >= 15 )
   {
     lastMoved = millis();
     if ( directionality == UP ) 
     {
       currentPos = currentPos + 3;
     }
     else 
     {
      currentPos = currentPos - 3;
     }
      Serial.print("current position: ");Serial.print(currentPos);
      helmetServo.write(currentPos);
   }
   if ((currentPos >= upAngle) || (currentPos <= downAngle)) { flipping= false; }
 }
};

Yet again we implemented this without the delay() function. If you build this project, and watch carefully, you will notice that with IronMan04.ino running on the Uno, you can flip the faceplate and turn the Neopixel on and off at the same time. With the IronMan02.ino, the delay() causes the to be blocked until the servo is done moving. Thanks Bill Earl!

This last line of the update function checks to ensure we don't exceed the upper or lower position of the faceplate, as the loop() function calls Update() it will continually check this after the last movement of the helmet and then set the flipping variable to false to indicate that the face plate is done moving up or down. On the next cycle through, with flipping false, the entire function is essentially skipped.

  if ((currentPos >= upAngle) || (currentPos <= downAngle)) { flipping= false; }

Future Directions:

There are so many things we could do with this project not sure exactly where to begin! Glowing eyes is one. Perhaps adding BLE connectivity with the arduino101? A voice interface? Jarvis is definitely calling for this one!

Code

Iron Man Helmet and Arc Reactor Project!

Schematics

Iron Man Fritzing Schematic
Ironmancircuit

Comments

Similar projects you might like

Exploring Encoders - Step Trackers for Motors

Project tutorial by SciJoy

  • 2,970 views
  • 3 comments
  • 9 respects

Guitar Speed Pick and Stomp Pedal!

Project tutorial by marc_uberstein

  • 5,088 views
  • 8 comments
  • 30 respects

RFID Based Automatic Door System

Project showcase by Robodia Technology

  • 35,760 views
  • 20 comments
  • 97 respects

Calibrating My Servos

Project tutorial by Jeremy Lindsay

  • 18,532 views
  • 10 comments
  • 81 respects

Voronoi101: Light Your Lamp!

Project tutorial by Gregory O. Voronin

  • 8,509 views
  • 2 comments
  • 25 respects

BLElectric Light 101

Project tutorial by Gregory O. Voronin

  • 3,753 views
  • 3 comments
  • 15 respects
Add projectSign up / Login