Iron man motorised faceplate electronics tutorial!!!

7sinzz

Well-Known Member
Its been two and a half years since I wrote this tutorial on how to motorise the Iron Man helmet faceplate and in that time it has been viewed hundreds of thousands of times and helped thousands of people. We've had some fantastic people jump on board and help us out and share their knowledge. This thread has become an absolute gold mine of information relating not only to motorising your Iron Man helmet, but also adding sound effects and lights and all sorts. Along with the growth of it came an element of complication. I initially embarked on this learning curve to keep things as simple as possible, I wanted to make it as easy as possible for noobs like me to get their helmet motorised. Reading back over it, I noticed my initial post was quite messy with badly formatted images and random text everywhere. With that in mind, I've decided to tidy it all up and host the tutorial on my own website. I've completely streamlined the code and the equipment to make it as easy and flawless as possible. Anybody following my new streamlined code and method should be able to have the equipment working in less than half an hour. Please follow this link:

Electronic Iron Man Helmet Tutorial


Here's a preview:


I have compressed the old post to save space without having to delete it. There is no spoiler content here, its just the messy, complicated old tutorial.
Hey guys. Well as im sure you all know, the electronics for the motorised faceplate in the iron man helmet are as rare as rocking horse ****.
Like many of you, I searched all over the internet for the code and a full tutorial, but its nowhere to be found. Certain individuals are happy to build the equipment, but not so happy to share the knowledge. Well over the past few weeks I have been taking various pieces of code and stitching them together and have finally come up with a solution I am happy with, and I'm ready to share this information with you.
This tutorial is my interpretation of the electronics and code required for a fully motorised faceplate including light up eyes. The code has a slight delay so that once the faceplate closes the eyes take a second to come on. Once open the eyes turn off again.

This tutorial only shows the breadboard stages so far but this post will be updated each time new information is provided. What i have supplied is a MASSIVE foundation for you all. This is purely designed to get all the coding and the order of components out of the way.
Moving from the breadboard into the helmet is something we can work on together.

Here's a quick video showing what i have achieved


and here's one of it in the helmet...


This is written for people that have absolutely no idea of electronics (just like me)

For this you will need:
Either: Arduino UNO + USB cable (available on ebay or many electronics suppliers) This is for prototyping only!!! To big for helmet.
OR!... Arduino Mini Pro 5v + FTDI cable (sold separately) and drivers.
Arduino software (available here)
2 servo motors
1 LED
1 push button
1 10k ohm resistor
1 breadboard
13 breadboard cables

Edit: Please note, the Arduino Uno is simply for prototyping, I advise all readers not to skip the prototyping phase, it ensures that all components are situated correctly and lends an opportunity for testing components. When it comes to installation then my preferred choice of board is the Arduino Mini Pro. Its a lot smaller and a lot lighter. If you also choose to select the mini Pro, you will need an FTDI cable + drivers in order to programme it. Once you get to the installation phase, the breadboard will also be made redundant

Observations:
First lets take a look at the Bread board. Down each side of the bread board you will notice a red line and a blue line. Next to the red line running down the board are lots of holes. These are all connected together and will act as our positive power rail.
The the holes running down next to the blue line will act as our negative ground rail. Again all the ports running in a line parallel to this blue line are connected.

Next you will notice numbers and letters on the board. Each numbered row is connected across the board instead of down this time. So 1a 1b 1c 1d 1e are all connected together. Next there is a split in the board. Anything after this split is seperate. So 1f 1g 1h 1i 1j are again connected to each other but not connected to the ports the other side of the split.

Now take a look at the Arduino UNO. Please navigate it so that the USB cable is furthest from you. On the right of the board you will notice numbers from 0 to 13. For this tutorial those are signal ports and shall be referred to as such. On the left side of the board the only things you need to be aware of for this tutorial are the 5v port and the GND port. These are for our power.


Lets begin
Ok this is pretty complicated so double check check each stage before moving on to the next.
Here is what you are aiming for (scroll down for written instructions):

arduino-2servos-a_zpsfa253911.png


ybu8yjum.jpg


1) Run a cable from the 5v port of Arduino UNO to the positive RED rail running down the side of the breadboard
2) Run a cable from the Gnd port in arduino uno to the negative blue rail of the breadboard
3) Bend the longer leg on the LED so it is the same length as the shorter leg.
4) Insert shorter leg of LED (negative) into 11a on the breadboard.
5) Insert longer leg of LED (positive) into 14a of bread board.
6) Insert one leg of resistor into 25f on breadboard.
7) Insert the other leg of resistor into 20f on breadboard
8) Please notice the switch has 2 legs on one side and 2 legs on the other. The 2 legs per side are connected together. So orientate the switch so that 2 legs face up the breadboard, and 2 legs face down.
9) Legs should be inserted into the breadboard at: 25g, 25i, 28i, 28g. If the switch does not fit in these spaces turn it 1 quarter of a turn.
10) Examine the cables on the servo. There should be a red cable, a black cable and a white cable. Red is positive, black is ground, and white is signal.
11) Run a cable from red on servo 1 to the red rail on the breadboard
12) Run a cable from black on servo 1 to the blue rail on breadboard
13) Run a cable from white on servo 1 to signal port 9 on the right of Arduino.
14) Run a cable from red on servo 2 to the red rail on the breadboard
15) Run a cable from black on servo 2 to the blue rail on the breadboard
16) Run a cable from white on servo 2 to signal port 10 on Arduino.
17) Run a cable from 14c to signal port 5 on arduino (this should be connected to the positive leg on LED, PLEASE CHECK!)
18) Run a cable from 11e to the negative rail on breadboard (this should be the negative leg on LED, PLEASE CHECK!)
19) Run a cable from 20g to negative rail on breadboard (this should be connected to 1 leg of the resistor PLEASE CHECK!)
20) Run a cable from 28f to the positive rail on the breadboard (this should be connected to switch)
21) Run a cable from 25j to signal port 2 on breadboard (this should be connected to other side of switch and resistor.
22) YOUR DONE!!! Well done, now give yourself a big pat on the back.

ave4usyq.jpg


a7a6y5ur.jpg


3y8u9a6u.jpg


Now start up the Arduino software and connect you Arduino UNO to the computer via the supplied USB cable.
Wait for your computer to install the Arduino Uno if it hasnt already.


Click show and copy this code and paste it into your arduino software:
This Code will give you eyes that just turn on 1 second after the helmet closes. As seen Here
#include <Servo.h>

Servo myservo; // create servo object to control a servo
Servo myservo1;

const int buttonPin = 2; // the pin that the pushbutton is attached to
const int ledPin = 5; // the pin that the LED is attached to

int buttonState = 0; // current state of the button
int lastButtonState = 0; // previous state of the button
int ledState = 0; // remember current led state
int pos = 0; // variable to store the servo positions
int pos1 = 180;

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
myservo1.attach(10); // attaches the servo 1 on pin 10 to the servo object
pinMode(buttonPin, INPUT); // initialize the button pin as a input
pinMode(ledPin, OUTPUT); // initialize the button pin as a output
}

void loop()
{
buttonState = digitalRead(buttonPin); // read the pushbutton input pin
if (buttonState != lastButtonState) // compare buttonState to previous state
{
if (buttonState == 1)
{
if(ledState == 1)
{
delay(30); ledState = 0;
for(pos = 0; pos <= 180; pos += 10) // goes from 0 degrees to 180 degrees
{ // in steps of 10 degrees
myservo.write(pos); // tell servo to go to position 'pos'
}
for(pos1 = 180; pos1 >= 0; pos1 -= 10) // goes from 180 degrees to 0 degrees
{ // in steps of 10 degrees
myservo1.write(pos1); // tell servo to go to position 'pos1'
}
delay(15); // waits 15ms for the servo to reach the position
}
else
{
delay(30); ledState = 1;
for(pos = 180; pos >= 0; pos -= 10) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position 'pos'
}
for(pos1 = 0; pos1 <= 180; pos1 += 10) // goes from 0 degrees to 180 degrees
{
myservo1.write(pos1); // tell servo to go to position 'pos1'
}
delay(1000);
}
}

lastButtonState = buttonState; // remember the current state of the button
}
// turns LED on if the ledState =1 or off if ledState = 0
digitalWrite(ledPin, ledState);
myservo.write(pos); // goes from 0 degrees to 180 degrees
myservo1.write(pos1); // goes from 180 degrees to 0 degrees

delay(20);
}

This different code will make the LED flicker then fade on, one second after the faceplate closes. Mimicking a powering up function. Demonstration here. Thank you to guitarkizta for this code:
#include <Servo.h>
//servo 1
Servo myservo;
Servo myservo1;
int val; // variable for reading the pin status
int val2; // variable for reading the delayed/debounced status
int buttonState;
int pos = 0;
int pos1 = 180;
int servostatus = 0;
int switchPin =2; // Switch connected to digital pin 2
int ledPin = 5;
int ledPin2 = 18;
void setup() // run once, when the sketch starts
{
//servo 1

myservo.attach(9);
myservo1.attach(10);
pinMode(switchPin, INPUT);
pinMode(ledPin, OUTPUT);
buttonState = digitalRead(switchPin);
myservo.write(0);
myservo1.write(175);
pinMode(ledPin2, OUTPUT);
}

void loop() // run over and over again

//servo 1
{
val = digitalRead(switchPin); // read input value and store it in val
delay(10); // 10 milliseconds is a good amount of time
val2 = digitalRead(switchPin); // read the input again to check for bounces
if (val == val2) { // make sure we got 2 consistant readings!
if (val != buttonState) { // the button state has changed!
if (val == LOW) { // check if the button is pressed
if (servostatus == 0) { // is the light off?
servostatus = 1; // turn light on!

myservo.write(0);
myservo1.write(180);
delay(1000);
digitalWrite(ledPin, HIGH);
delay(50);
digitalWrite(ledPin, LOW);
delay(00);
digitalWrite(ledPin, HIGH);
delay(50);
digitalWrite(ledPin, LOW);
delay(00);


// fading
for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=5) {
// sets the value (range from 0 to 255):
analogWrite(ledPin, fadeValue);
delay(30);


}

} else {
servostatus = 0; // turn light off!


digitalWrite(ledPin, LOW);
delay(15);
digitalWrite(ledPin2, LOW);
myservo.write(180);
myservo1.write(0);






}
}
}
buttonState = val; // save the new state in our variable
}
}



Click the arrow at the top of the software which will upload this code to the Arduino, then wait for it to say "done" at the bottom of the screen.

Testing:
Leave the board connected to the computer and press the switch on the breadboard.
1) First button press powers up the system and turns eye lights on (1.5 second delay), no movement will be seen.
2) Second button press rotates servos and turns off eye light, this is the faceplate opening.
3) Third button press rotates servos in opposite direction, then 1 second delay and light turns on. This is the faceplate closing and eye lights turning on.
You may notice a vibrating noise once the servos have reached their resting positions. I have been informed this is normal but Im not sure how reliable that information is. If anybody has a fix, please let me know.

Id like to give a massive thank you to ironleoman for his continued help throughout putting this together. He's been giving me the much needed kick up the arse to get this done so we can share it with you guys.

IDEAS
Some ideas for you to think of: Id like the eyes to flicker before coming on to mimic powering up... Could anyone modify the code to make this happen? Is anyone able to shut off power to the servos when they are in their resting positions to stop the buzzing noise? Feel free to modify this code and post your own findings. From this point on we're working together.

Circuit without eyes:
If you dont wish to have the eye lights in your circuit, please skip steps 3,4,5 and 17

First button press powers up the system, no movement will be seen. Second button press and every botton press thereafter will move the servos.

Flight Stabilisers:
This code can also be used for the flight stabilisers on the back of the Iron Man armour. If you would like me to write 2 more servos into the code for all 4 flight stabilisers, please comment in the thread.

Quick glance at installation
This is the same installation method I intend on using, minus the jaw:
Faceplate
Close up
Servo Mounting Location

Sound Effects
Please also find some awesome sound effects in these links provided by TryChick for those of you considering adding sound to your suits. I shall update on this at a later date:
Sound effects set 1 Here
and
Sound effects set 2 Here

EDIT10/12/2013
OK this thread has come a hell of a long way since it first started almost exactly a year ago. Its 0340 in the morning in England and I've been having a quick scan through to see how I can update this first thread. Many members have added a considerably higher amount of knowledge than I could have ever posted here. So I think its time I updated this first thread to make things easier. The information i provided above was just a foundation and a learning curve for me. Yes the code works but members with more extensive knowledge than me have provided tighter code to achieve the goals we're aiming for more efficiently.

So the first member that needs seriously crediting is xI97 who has constantly added endless reals of limitless knowledge. Here is the link to his code within this thread:

xI97 code, please scroll down the page to post number 65

You can find his schematic here:

xI97 schematic post number 778

The next member who has added a tonne of info is member, his schematic uses the same code as I have supplied but many more components. The schematic for his setup can be found here:

memebr's schamtic post number 740

Both of these guys deserve considerably more credit than me.

More to be added in time...

arduino-2servos-a_zpsfa253911.png


arduino-2servos-a_zpsfa253911.png


ybu8yjum.jpg


ybu8yjum.jpg


ave4usyq.jpg


ave4usyq.jpg


a7a6y5ur.jpg


a7a6y5ur.jpg


3y8u9a6u.jpg


3y8u9a6u.jpg
 
Last edited by a moderator:
ohhhh sweet lord an electronic faceplate tutorial !!!
can you tell me what step to skip for the eyes ? i will use magnets to power them !
 
There are a lot of steps to skip for the eyes and much code re arranging required. I will have a play around later but this is much more reliable than magnets. It guarantees the eyes come on exactly at the right time.

Please note to anyone that has already tried that code, there was a 3 second delay on the servo movement. I have re edited the first post to remove this delay. Was playing around with it yesterday... My bad lol.
 
yea but the magnet would also act as a link between the faceplate and the helm ! it would be appreciated if you tell how to skip those part !
 
Skip steps 3,4,5,17

First button press powers up the system, no movement will be see. Second button press and every button press thereafter will move the servos.

This is the quick way of doing it without altering the code. To alter the code would take considerably longer

I have edited the first post to include this modification. I hope your servos are powerful enough to detach the facelate from the magnet if your using it to keep it closed.
 
Last edited:
looks good!..

now you just need to 'shrinkify' the Arduino and use a minimal Arduino circuit to cut down on the overall footprint!

Also a quick look shows you are using delays()... not sure if this is by design or not.. but using delay() pauses the whole sketch..


maybe using the blink without delay example will help!? :)

also having you given any thought about how you are going to drive all your leds for the eys? (not sure how many you plan on using).. but dont think the Arduino will be able to drive all of them.. (directly)..

you can only get a max 40mA out of any pin.. and I dont think you'll have enough pins left to do them individually.. maybe a transistor or something?
 
Sir what you've done here is imoral, blasfamous long over due. Thank-you brother. Is it to late to change my list to santa...GM
 
xl97 If by "footprint" you refer to my messy prototype (which i totally agree is very messy), I don't mind having it spaced out all over the breadboard. This is spaced out just for testing and ease of access. Moving from here will be a group project hopefully. I assume (and hope) people wont be putting the breadboard into their helmets anyway.

The delay command appears to only affect the LED, this code achieves what can be seen in the provided video. As mentioned I'm a novice at electronics and this is just my interpretation of other peoples code from all over the net stitched together and highly modified to create what we need.

If you do know a more efficient way to achieve the same goal please feel free to post it here. This thread is designed to give people a foundation to work with and inspire others to come out of their shells, Your input would be very much appreciated I'm sure, as are your comments.

and everyone elses...

EDIT: With regards to the LED power, I'll cross that bridge when i get to it. This is just the basic foundations and code. Myself and ironleoman have been considering the option of external power for the LED's and servos. Power to the Arduino just to send signal.
 
Last edited:
hi-

to be clear.. Im not bashing your project in ANY WAY!! (in case it came off as such)..

I also support and am happy to see electronics projects.. people working their way through things to add functionality to a prop..lol..

and Im just a noob at electronics too! with some experience with playing with Arduino based stuff! :)

that being said.. yes I meant for the final project (not your testing/breadboard set-up).. that using a full blown Arduino UNO might be too big/overkill..

You can replicate the Arduino circuit (more or less) for about $10.00 or so..
which will save on costs in the end.. as well as space. :)



for example.. here are two small footprint (not SMD, still DIP components)
that break out every pin for you to use in your end project..etc..

1 has vRegulator on it.. one does not...

the bottom board is one I made/home etched at home..etc..

the top is a retail kit (no vReg) that sells for about $9.00 or so..

so once you have your code done..and ready to post to a final, smaller board.. these may help or offer some direction for you.

I havent looked at your code yet either.. but I can if you like..

Im all 'in' for community projects like this.

to be fair.. I am sorta working with the 'REAL TONY STARK' (Ryan) member here on some of his awesome projects too...

but I dont think this really interferes with the real time HUD..and audio stuff we're doing.. so I dont think there are any problems :)

off the wall ideas:

maybe use RBG leds for the eyes? (RGB 5050 leds).. and you can dial in any color you want.. and possibly change to red.. (or any color really) during certain situations.. battle damage.. attack mode..etc..

at least use a PWM pin for each eye.. so you can 'fade/pulse' the eyes.. instead of just on/off.. (like a fade in/off)..


have you thought about WHERE/HOW you are going to mount those servos?
I would think some smaller, worm gear/drive ones may be smaller/better?

(but the code should be more or less the same for whatever you choose)
 
hi-

saw your edit..

the servos can be driven directly by the Arduino I believe... (servos.. not motors though)

and you can probably use the same battery pack.. just tap the battery lines directly.. instead of the 5v/3.3v lines from the Arduino ....

the leds for the eyes.. Id make a PCB for them.. and possibly have its own v regulator on each one...

will be fun to see what you guys come up with!
 
Thanks for your comments, your initial post wasn't perceived as a bash, I will look into your advice when i have some more free time in the week.

I intend on using the same set up as this guy has done, but others are free to use whichever method they prefer:

Faceplate and Jaw

Faceplate and jaw close up

I probably wont include the jaw though. To lazy :)

I do like the idea of colour changing LED's though. Sounds awesome.
 
Cool!


first link is no good! :)

second link is taking forever to load (for me)..



anyways.. this is an AWESOME project!..

I'll be keeping an eye out..

if there is anything you need.. just post/ask..

if I can help.. I will..

I can help with some PCB design.. and minor electronics that are Arduino related....etc..etc



@Corey..

hey Im in Wisconsin too!...

(lower SE though.. closer to IL. boarder..... Milwaukee to be exact) :)
 
HELLO

saw this post by pure chance and my aim is the same 'to spread the wealth of knowledge' to everyone.

ive posted many vids explaining 'things' as clear as i can ........ not got round to the face plate yet.

I TOO AM BASED IN THE U.K! I RUN PROP MAKING CLASSES IN AN ART SHOP just outside london. if its any help or we are able to help eachother in anyway please do feel free to add me on face book or youtube... all my details are here!

all the best to you and any/everyone reading this.


.
 
Hey J scorn, great to see another Brit. Hopefully we can all help each other.

Great to see so many people are interested in this thread and I'm glad I can be of help to you all.

Are any of you able to alter the code to add the flicker to the eyes when the faceplate closes?

Omar I found a decent jaw mechanism that uses the same 2 servos as the faceplate. Ill try find it again when I get a few minutes.
 
This thread is more than 4 years old.

Your message may be considered spam for the following reasons:

  1. This thread hasn't been active in some time. A new post in this thread might not contribute constructively to this discussion after so long.
If you wish to reply despite these issues, check the box below before replying.
Be aware that malicious compliance may result in more severe penalties.
Back
Top