Loading
ByteSlinger

Servo Hinge for Iron Man Helmet

by ByteSlinger Jan 11, 2017
Download All Files

Thing Apps Enabled

Please Login to Comment

Is it fitted tight to your head? Or more universal to all adult head?

Why are the codes having issues and is there any schematic diagram for reference.

The fact that after a year and a half there's no arduino code make me wonder if the OP made it himself as he claims it or if he's unwilling to share the code...

It's basically a copy/paste of the arduino code... I mean, I made a code for a 2 servos + 2 LEDs strips for my helmet and I can share it:

include

//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 = 5;
int pos1 = 165;
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(5);
myservo1.write(165);
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(5);
myservo1.write(165);
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(165);
myservo1.write(5);

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

Hey man!

I think your code is great and I want to use it myself to power my servos. I'm planning on a similar setup, but I'm not sure how this works wiring wise!

Do you have schematics or advice or pictures of your wiring setup for two servos? I cannot figure out how this should work. The Arduino can't provide enough power draw for the servo, so I think it needs external power for the LED's as well as the servos.

I just was curious how you did yours as there really isn't any clear instruction on how the wiring goes.

Thanks!

Actually DevilFlash, I've been out of the country working for most of the last year. When I have been in the country, I've been working hard and have had little free time.

With regards to the code, unfortunately, I had a hard drive failure when I came back from a shoot and lost the file (which I stupidly had no backup of).

It is however the most simple of scripts.
I did find a version of the script a couple of months back, but I'm not sure if this is the latest version of the script (after I got it working), and haven't had time to test it out before posting. But sure, of you want a version of the code that I can't guarantee is bug free, please help yourself. I apologise that I haven't had time to offer support for the thing I designed and uploaded for people for free.

include

int MaskButton = 3;
bool servostate;
int EyesButton = 5;
bool eyestate;
int pos = 70;
int eyes = 6;
Servo myservo;
int MaskButtonState = digitalRead(MaskButton);
int EyesButtonState = digitalRead(EyesButton);

void setup() {
pinMode(eyes, OUTPUT);
digitalWrite(eyes, HIGH);
eyestate = true;
pinMode(MaskButton, INPUT);
myservo.attach(10);
myservo.write(pos);
delay(500);
servostate = false;
Serial.begin(9600);
}

void loop() {

MaskButtonState = digitalRead(MaskButton);
EyesButtonState = digitalRead(EyesButton);

if(servostate == false){
if(MaskButtonState == HIGH){
Serial.println("Mask Up");
if(eyestate == true){
digitalWrite(eyes,LOW);
eyestate = false;
delay(200);
}
for (pos = 70; pos <= 150; pos += 1){
delay(10);
myservo.write(pos);
}
servostate = true;

}

}
if(servostate == true){
if(MaskButtonState == LOW){
Serial.println("Mask DOWN");
for (pos = 150; pos >= 70; pos -= 1){
delay(10);
myservo.write(pos);
}
servostate = false;
if(EyesButtonState == HIGH){
delay(500);
digitalWrite(eyes,HIGH);
delay(200);
digitalWrite(eyes,LOW);
delay(200);
digitalWrite(eyes,HIGH);
delay(30);
digitalWrite(eyes,LOW);
delay(30);
digitalWrite(eyes,HIGH);
delay(30);
digitalWrite(eyes,LOW);
delay(30);
digitalWrite(eyes,HIGH);

    eyestate = true;
  }
}

}

EyesButtonState = digitalRead(EyesButton);

if(EyesButtonState == LOW){
if(eyestate == true){
digitalWrite(eyes, LOW);
Serial.println("Eyes Off");
eyestate = false;
}
}else if((EyesButtonState == HIGH) && (servostate == false)){
if(eyestate == false){
digitalWrite(eyes, HIGH);
Serial.println("Eyes On");
eyestate = true;
}
}

delay(1);
}

Is there a diagram for assembly that I'm not seeing?

Do you think this would work on the Iron Patriot helmet? ;)

can you put de sketch for arduino???

thanks and regards

Hi Byte Slinger,
I have printed the mask. Now I also have the arduino nano but I know nothing bout electronics. Is there a very simple drawing or diagram on where the power, wires for the servo and wires for the switch to go..? I managed to load the script into the board...after figuring it out with the help of the internet...but thats it. Stuck.
Would really appreciate it if you could give me a simple drawing on the connections.

Thanks a lot

Hi there, I'm currently in the middle of moving house so I don't actually have anything to hand to do this with.
However, I am planning on doing a full build tutorial eventually on my YouTube channel: www.youtube.com/c/3Drevolution
Once I'm moved in however I'll try and get something posted back here when I can.

Do you think this would work well for the Mark 42 Helmet? Thanks for designing and sharing this! :)

Hey there, parts of this may work. But with sections like the servo mount, it's designed specifically to fit the inside roof of the MK3 helmet and won't fit any others. In around 6 months I may be printing a MK42 myself to go with the suit I'm building and if I do, I'll design and upload one for it.

For now, the concept should definitely work for you, the main thing you need to adjust is how the servo fits to the helmet.

Understandable. Luckily I have a Mk3 helmet already printed out to try this setup on.
Do you have a video tutorial on how to do it? I'm a better viewer learner.

Thanks!

Unfortunately I don't right now. But I am planning on re-fitting mine as I'm swapping over my face plate so I may do one.
I do have a 3D Printing channel though which you can check out at: www.youtube.com/c/3Drevolution

What values do I need for the open and close servo?

Did you print the helmet normal size or larger?

I printed at stock size so nothing was scaled for me. Good question and thanks for asking

do u know where i can get my hands on 7/14 M4 Washers? i cant find that measurement anywhere.

Ah sorry if it wasn't clear. So that is either 7 or 14 M4 size washers, depending on personal preference. You can get away with using just 7 washers, but I'd recommend 14.

can i get the code for the servos please?

would this work on mark 46 helmet?

I'm afraid I haven't tried. I'd imagine the concept would but the top plate part would need re-designing and the arms would probably need to be a different length

have you use any program code? if it is true caould you send me that code file?

Could I get the code used for this? And the circuit maybe?

Hi ! Have you got the code and circuit or still trying to find a solution ?

Hey, yep it's fully functional, although I am looking to make additional improvements at some point. You can see it working here: http://www.youtube.com/watch?v=9C7PNllLDsQ

I'm afraid I'm currently out of the country but when I'm back I'll try and remember to post details here

Nice work! it can be worn, are you still able to see?

In a well lit room or outside, yes, but if the room is still dark, I can make out shapes but not really any detail. I'm working on a design to fit screens inside the eyes which will relay a feed from an external camera at the moment. Not really because it needs it, more just because I can :p

Thanks. Absolutely, this is designed for use when the helmet is being worn. Yeah I can see out with the lights on unless it's very dark room. If I switch the eye lights off I can see fine regardless.

These hinges are awesome! I'm in the process of wiring and setting everything up. Would you care to share the Arduino code you used? It'd be much appreciated. Thanks!

Just FYI, the Flat Top is just ever so slightly tilted upwards and not flat. Just enough to cause a floating bit when printing.