Iron man motorised faceplate electronics tutorial!!!

I got my Helmet DONE AND FUNCTIONAL ON BATTERY POWER!!! Going to mount the bits in the suit (The brains and batteries will have to be in the right arm) and shorten some of the wires so there isn't any extra length of wire. I am not sure if it is completely electrically sound but it seems to work well and not get hot or anything. Mine is powered off of 8 AA batteries and the eyes (cool stick on LED arrays for car interiors) are powered by a 9 volt (not the best batteries, but really I wont be wearing the suit all that much). I have also transferred the breadboard stuff onto a simple pert board.

I will post pics of all of the parts that I made. The hinge arms that raise the mask that I designed for my helmet are pretty simple, but effective. I will post pictures of what I made soon!!!
 
when i push the button for the servos to turn up and for the lights to go off, that happens, and then after about 2 seconds the servos turn back down but the lights do not come on. it is basically resetting itself because i have to press the button again for the lights to come on...does anyone know what is going on and how i can fix it?

When something like that happened with my set up I think the problem was that the Servos were drawing to much power for the external batteries that I had, and that made the board reset. I think. anyway when I switched to smaller servos it worked. Maybe that is the issue that you are having?
 
When something like that happened with my set up I think the problem was that the Servos were drawing to much power for the external batteries that I had, and that made the board reset. I think. anyway when I switched to smaller servos it worked. Maybe that is the issue that you are having?
thank you but it was my battery. it was almost dead i just needed to change it, although i think the servos ARE eating up a lot of the power because one of the batteries only lasted about 2 hours when i left the thing on
 
I think it was posted on page #3 maybe?

(mine at least)


the code you use.. depends on the who's wiring diagram you used.
 
Hi Guys, I dont know if this has been answered or not but can someone help me with this...I am looking to change the value so that the servo only travels half the distance. I dont know anything about code and have been mucking around with the values in the code but cant seem to get it to work. so can someone tell me where in the code i need to change so as to fine tune the movment of the servo. Is when the servo moves the faceplate up, I just want it to travel half the distance as this code. can someone please help. Im using this code as posted in page one
#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
}
}
 
I feel generous today:

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 = 10;  //<---change this next time to modify the servo arm position
int pos1 = 90; //<---change this next time to modify the servo arm position


int servostatus = 0;
int switchPin =2; // Switch connected to digital pin 2
int ledPin = 5;
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(10); //<---change this next time to modify the servo arm position
myservo1.write(90); //<---change this next time to modify the servo arm position



}

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(10); //<---change this next time to modify the servo arm position
myservo1.write(90); //<---change this next time to modify the servo arm position



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);




myservo.write(90); //<---change this next time to modify the servo arm position
myservo1.write(10); //<---change this next time to modify the servo arm position






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




***** I did not checked to see if it works, i just grabbed what you have posted, removed what was not in use and changed the values to half what they were, btw it indeed compiled without any errors.
 
Okay, I finally read through this entire thread and I want to start collecting the items I need, but I have a few questions I'm hoping somebody can help me out with.

My issues mostly come from the power aspect. I've wired up fans to battery packs, and this year I wired up a bunch of LEDs throughout a costume, so I get the basics of wiring, soldering, calculating resistors, parallel/series, and so on. But I've never dealt with multiple connected items with differing power requirements before, so keeping that in mind here is what I think I want to do.

My intent is to prototype on an Uno, and migrate it to a Nano. I assume I should use the 5V version and not the 3.3V version because that's what everyone has been saying... I'm not 100% sure I understand the reasons why but I'll trust everyone on this.

Assuming I get standard servos operating in the 5V range, I want to use these 3 LED strips for the eyes.
2 X 3LED STRIPS, 3 SMD LEDs per PCS
Input volts: DC 12V (resistors are pre-soldered into each unit)
2 x Motorcycle Car 3 LED 5050 Cool White SMD 5 cm LED Strip IP65 Waterproof | eBay

Yep, they are the same sort of dreaded 'odd led string' as one of the other posters is using but I have different plans for power than he did.

This is my plan, but I'm not sure if I'm correct here. I'm using xl97's schematic as a jumping off point.

IronMan_circuitLayout_drgmod1.jpg

Under this proposed setup I have a few questions...

1. Would 12V rated LED strips still work with a slightly lesser power source, like say this 11.1v Lithium-Ion battery pack (All-Battery.com: Tenergy Li-Ion 18650 11.1V 2200mAh Rechargeable Battery Pack w/ PCB Protection) - basically the same as the 7.4v packs xl97 has been suggesting but with one more 3.7v cell?

2. Can the Arduinos handle 11.1V?

3. Can the LM7805 regulator and those capacitors handle 11.1V or would I need different values for those?

4. Any need for capacitors on the LED part of the circuit, and are the NPN transistors still good there? Heck, I don't even really understand what the capacitors are here for, even though I've read several articles on them.

Would any of this work? Is it even feasible? Or am I way off-base here?

As a secondary option I am also considering just adding a separate 12V power source for the eyes and running the Arduino and servos off a 7.4V battery, but I'm unsure how this effects the wiring of the internal pull-up button in xl97's diagram, since that seems to rely on everything running off the same power source.
 
Hi GUys just a quick one again, I know this was brought up before but cant find if it has been answered. About the servos turning the same direction... Can someone point out what I have to change in the code so that the the servos rotate in opposite direction as they will be back to back thanks. Im using the original code below
#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
}
}
 
Edit: scratching this idea. I got these in and the circuitry is encased in a clear rubbery material. Back to Plan A (see a few posts above).
 

Attachments

  • 3LED-5050Y-TOP.jpg
    3LED-5050Y-TOP.jpg
    194.2 KB · Views: 177
Last edited:
Guys,

i have a problem. between building the rest of my suit, i ordered new stronger micro servos (bluebird BMS 380) and hinges for my helmet.
Now when i connect those servos to my breadboard, they dont work. Its like the dont even get any power. My supplier helpdesk wrote me it was because of Puls Code Modulation. But i dont understand?? It should work. The require the same current.
My towerpro mg90s work perfect on my setup.

Please help me.
 
So I've been trying to figure this out for the last hour and can't. I copied the code and did the setup and everything works .. except for the button. It doesn't do a thing when I push the button but if I take the one wire (28f) and touch it to the positive rail then it reacts the way it's supposed to when the button is pushed. I've tested the button and it works no problem. So I am at a complete loss as to what might be wrong. Is it maybe the type of button?? It makes no sense at all that it would work but ignore the button completely. Any ideas?
 
hi guys,

i got a problem with my servo, i did everything according to the guide but when i plug in the usb to power the arduino, the servo start to move without me pressing the button(moving in the same direction). i don't kn if the servo is broken or what, please help me with this problem TT^TT
 
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