Iron Man Faceplate and LED Tutorial

RocFoamArmory

Active Member
Hey everyone!

So I've been building a Mark 39 Iron Man out of foam, and I've started wiring up the electronics in the helmet. It's been difficult finding the right way to do it, and I didn't know anything about electronics before I started. Now that I'm almost finished, I thought I'd go and write up my process for everyone's benefit. Feel free to use whatever you want from it, but if you could give me credit that would be awesome! I'd like to give credit to 7sinzz and James from xrobots.co.uk for putting up great content that helped me out. Here are the links
http://www.therpf.com/showthread.php?t=170853
http://xrobots.co.uk/IM6/index_lights.html

Lets get started

Parts list:

Soldering Iron and Solder Core - http://www.walmart.com/ip/30-Watt-Soldering-Iron/16539504
-This one doesn't work great, I'd recommend getting a much better one

Electrical Tape - Any hardware store

Glue gun and glue sticks - I have a dual temp glue gun and you can get it at stores like Michaels or Walmart

9V Batteries - http://www.amazon.com/gp/product/B00MH4QM1S?psc=1&redirect=true&ref_=oh_aui_detailpage_o08_s00
9V Battery Snaps - http://www.am
azon.com/gp/product/B00NIPC9AS?psc=1&redirect=true&ref_=oh_aui_detailpage_o08_s00


Speaker Wire - http://www.amazon.com/gp/product/B00J38SGTW?psc=1&redirect=true&ref_=oh_aui_detailpage_o07_s00
Wire Stripper/Cutter - http://www.amazon.com/gp/product/B000JNLUN4?psc=1&redirect=true&ref_=oh_aui_detailpage_o05_s00
Alligator Clips - http://www.amazon.com/gp/product/B0002KRABU?psc=1&redirect=true&ref_=oh_aui_detailpage_o05_s00
Jumper Wires - http://www.amazon.com/gp/product/B005TZJ0AM?psc=1&redirect=true&ref_=oh_aui_detailpage_o01_s02

Various resistors (You never know when you'll need one, best to get them all at once) - http://www.amazon.com/gp/product/B00SD6F6FC?psc=1&redirect=true&ref_=oh_aui_detailpage_o01_s02

Arduino Starter Kit - http://www.amazon.com/gp/product/B00BT0NDB8?psc=1&redirect=true&ref_=oh_aui_detailpage_o01_s01
Micro Servos (I may be upgrading to higher torque servos) - http://www.amazon.com/gp/product/B013JKPV6A?psc=1&redirect=true&ref_=oh_aui_detailpage_o01_s01
Push Buttons - http://www.amazon.com/gp/product/B008DS1GY0?psc=1&redirect=true&ref_=oh_aui_detailpage_o01_s00

LED Strand (I got 3 incase I broke some) - http://www.amazon.com/gp/product/B004DZBYXK?psc=1&redirect=true&ref_=oh_aui_detailpage_o05_s00

2mm Craft Foam (Black and White) - I got these at Walmart, but you can find them at craft stores or online.
1 or 2 pairs of cheap reflective sunglasses - I got some Aviators from Walmart
Darice Plastic Canvas - http://www.joann.com/darice-artist-...r/1971241.html#q=cross+stitch+plastic&start=4


Faceplate:

First thing I did was to follow this tutorial. http://www.uncannydani.com/makingstuff/electronic-iron-man-helmet/. It helped me to get the basics of my code in place and the arduino circuit set up properly.

IMG_0607.JPGIMG_0605.JPGIMG_0603.JPG

Here's just a few pictures to show you the rough setup. The tutorial above is detailed enough Note: When I added more than one servo, I had to connect the 9v to the Arduino, otherwise the code wouldn't work. Also, the push button in the starter kit doesn't fit in the breadboard where the tutorial says to put it, so you need the smaller ones up above or you need to solder jumper cables to it.

IMG_0620.JPGIMG_0618.JPGIMG_0617.JPG

Now that the circuit is working, I've started soldering everything together and taking it off the breadboard. Eventually I will be transferring the code to an Arduino Pro Mini 5v to mount inside the helmet.

Arduino Pro Mini 5V - http://www.amazon.com/gp/product/B0...pro mini 5v&qid=1457208558&ref_=sr_1_1&sr=8-1
FTDI Cable - http://www.amazon.com/gp/product/B0...ue&ref_=ox_sc_act_title_1&smid=A1LHQ5G6ONPXVT
You need the cable to transfer the code to the small Arduino. I have just ordered these, I will update when I mount them inside.

Let's take a look at the code. I started with the code in the tutorial above, but then I've added my own for the leds, and changed a bit to make it more readable.

Code:
#include <Servo.h>
int button = 2; //button, connect to ground
int press = 0;
Servo servo; //left servo looking out of helmet
Servo servo1; //right servo looking out of helmet
boolean toggle = true;


int leftServoOpen = 35;
int leftServoClosed = 145;
int rightServoOpen = 115;
int rightServoClosed = 0;
int ledPin = 13;
int offTime = 55;
int onTime = 0;


void setup()
{
  pinMode(button, INPUT); //arduino monitor pin state
  servo.write(leftServoOpen);
  servo.attach(9); //pin for servo 1 on pin 9
  servo1.write(rightServoOpen);
  servo1.attach(10); //pin for servo 2 on pin 10
  digitalWrite(2, HIGH); //allows pullup for pin high
  pinMode(ledPin, OUTPUT);
}


void loop()
{
  press = digitalRead(button);
  if (press == LOW)
  {
    if(toggle)
    {
      servo.write(leftServoOpen);
      servo1.write(rightServoOpen);
      servo.detach();
      servo1.detach();
      servo.attach(9);
      servo1.attach(10);
      toggle = !toggle;
      digitalWrite(ledPin, LOW);
      onTime = 55;
      offTime = 0;
    }
    else
    {
      servo.write(leftServoClosed);
      servo1.write(rightServoClosed);
      toggle = !toggle;


      delay(1000);
      digitalWrite(ledPin, HIGH);
      delay(100);
      digitalWrite(ledPin, LOW);
      delay(100);
      digitalWrite(ledPin, HIGH);
      delay(100);
      digitalWrite(ledPin, LOW);
      delay(500);
      digitalWrite(ledPin, HIGH);
    }
  }
  delay(500); //debounce delay
}

This code will turn off the leds when the faceplate is open, and blink them on after it closes.

LEDS:

For the led eyes I mostly followed the steps laid out by James from xrobots.co.uk, except I used the plastic canvas instead of the wedding veil fabric. I did buy some fabric but I didn't like the way it looked. I will post more pictures once I get the whole system mounted, but they look just like the ones on the above website. I will explain what I did with the leds themselves.

I cut them off of the battery box, because I'm using the 9V battery to power the servos and leds. I wired up red and black wire to the appropriate ends to extend the length. Then I put the negative (black) wire into the negative rail on the breadboard and the postive(red) wire is in pin 13 on the Arduino. There is a length of wire between each LED on the strand, so I just bent it so each led sat next to each other on the lenses.

Mounting system:

I'm still working on this system and will update when I have it working. So far I'm trying to use some Lego pieces to make a hinge on the inside of the faceplate and have pieces connected to the servos. Here are some pictures of what I have.

IMG_0611.JPGIMG_0610.JPGIMG_0608.JPGIMG_0619.JPG

That's all for now guys! Hope this helps and motivates you to get building! Feel free to subscribe and respond with any questions or comments you might have!
 
Thanks for posting! I took my first steps at using Arduinos in October and have to admit that it was easier than I expected and a lot of fun.

The 9V battery is a quick & easy fix for powering up an Arduino, but they have really low capacity. If you don't need the 9V for anything specific, you're just burning up almost 50% of the energy as excess heat if you use it on a 5V Arduino.

I used Adafruit Trinkets for my project. They are Arduino compatible, relatively cheap, tiny and very low current. My first design used the 5V trinket, but the breadboard prototype actually used a 3.3V version. The specification for the servos says they work with 3.0V and higher and you can light most LEDs with a 3.3V supply. If you have the space for three AAA batteries, you'll get vastly better battery life by using a 3.3V chip & designing everything around that instead of the 9V battery. This also gives you the option of using a 3.7V LiPo cell, if you want higher energy density.

The original Trinket has somewhat limited memory and only gives you 5 I/O pins. However, it uses as little as 6mA even when running, so I'm actually using CR2032 batteries with my project and was able to last a full day at Wizard World without changing batteries (space is quite limited - a 9V battery would "bulky" in my case). There's also a much more powerful Pro trinket (but it also uses more power) in case you need more I/O pins. I used one input pin for a microswitch inside my glove and a sort of "morse code" for input. The other 4 pins were all used as outputs, controlling groups of LEDs.
 
That's awesome! I may have to check it out. I'm not worried too much about battery life. The battery is only used to raise and lower the faceplate and control the leds. The led's are off most of the time, and the faceplate is mostly raised. It should be minimal drain on the battery. I may revisit my setup in the future but I'm also trying to get my suit finished for a local con in a month and a half.
 
That's pretty cool! I've just finished mounting my wires to the Arduino Pro Mini 5v, and I've mounted everything inside the helmet. I'll add pictures later on. I still need to work on mounting the faceplate to the helmet
 
I dont really understand how to connect the ftdi cable to the arduino mini

Envoyé de mon SM-G530W en utilisant Tapatalk
 
I dont really understand how to connect the ftdi cable to the arduino mini

Envoyé de mon SM-G530W en utilisant Tapatalk

This is the cable I bought.
http://www.amazon.com/gp/product/B00DJBPIGI?keywords=ftdi cable&qid=1458314369&ref_=sr_1_2&sr=8-2

Also my Arduino Mini Pro came with these breakaway headers
https://www.sparkfun.com/products/116

From there its pretty simple to connect. I'd recommend working with an Arduino Uno first, to test your code and circuit. Then go mount everything on a Mini Pro 5v
 
Does it come with the programing driver ? ☺

You have to download it. I would look at the links I've put above for the Arduino starter kit. It's a good place to get started. Do some googling, watch some YouTube videos, and you'll figure it out. That's part of the fun! Experiment around with different things
 
Back
Top