Iron man motorised faceplate electronics tutorial!!!

keep that in mind for whatever your led requirements are.. what your using in your project..etc :)

wow, thank you for the fast answer.. :)

I was actually looking for a solution expanding from the original quest for the ''holy grail'', meaning keeping all the other aspect of it:

1) - use switch
2) - face plate close, eyes flickers, then light

3) - use switch
4) - eyes goes dark, face plate opens

the only difference being that instead of 4 white leds per eyes, I'd like to use 4 RGB leds. (or would it be really simpler to have both 4 white leds AND 4 red leds installed in each eyes, and to figure a way to ''trigger'' one or the other?)

I've looked at a couple of tutorials on youtube on arduino wiring for RGB and those were really, really simple..
For what I have in mind, I fear I'm far from being able to figure this out on my own.. the only real knowledge of electronics I have, I have acquired reading this thread for the last 10 hours.. I can't say I've understood it all yet, but I've taken lots of notes..

also I already ordered the battery pack that you suggested a couple of times earlier, so I'm pretty sure I'll be good on that end..
but my gut feeling tells me that the wiring of the leds themselves (and the coding) is going to be somewhat .. complicated, and I wouldn't know where to begin..

With my non-existing knowledge of electronics, I'm not sure if it would be feasible to, lets say, have two separate switches..
one to control the 4 steps above (holy grail), and the other to change the color of the leds (if its white, go red / if its red, go white)

I'd very much like to ''work'' on this, but at this point I'm pretty much only capable of asking for help

Is my ''project'' something that can interested others too, maybe?
 
Like xl97 said...

The process is real simple, you gonna need to use different pwm channels on the arduino for each individual collor pin on the led.

for exemple: If you wanna fade from blue to red, and lets supose you are using the pins 9 (pwm) and 10 (pwm) to control those 2 individual colors on the led. You are going to need a code that says to the pin 9 starts to fade down wile the pin 10 starts to fade up

since you are using a RGB led you can create other colors as well... i gave the easiest example using just 2 fix colors that the rgb leds have.

use transistors to make sure you will not punish too hard on the arduino itself
 
Ok, so, I've tried to put on "paper" the wiring diagram for 5 RGB leds for each eyes.
I want to do the exact same thing as what was described by the OP originally (button press, leds go dark, mask open, button press, mask close, leds flicker, leds go on) Only difference is, when the eyes are lit, I want to be able to control what color the eyes are.

I know not to power those leds directly by the arduino, but I'm not exactly sure how a transistor works..
actually, in this case, I'm not sure how the arduino can ''command'' a rgb led to display a certain color..
the only tutorials I've found demonstrate this by powering the led directly from the arduino, so I cant tanslate what that means for my scenario

Like xl97 said...
The process is real simple, you gonna need to use different pwm channels on the arduino for each individual collor pin on the led.

Right, so I use 3 PWM pins to be able to control the 3 colors output of the R-G-B led.. I just don't know where/how to wire a transistor in the circuit

the problem you face (like all led projects & Arduino).. is how to power it? and what leds you wanna use.

If it's possible, I would like to power the kit by the 7.4v battery pack that you mentionned a couple of time in this thread.

The Leds I'd like to use for this are 5mm RGB LEDs:

Forward Voltage (V) IF=20mA
Red = Min 1.9 Typ 2.2
Green = Min 3.2 Typ 3.4
Blue = Min 3.2 Typ 3.4

I actually have a question concerning that, should I buy common anode or common cathode?
I understand their difference, I'm just not sure which one would be simpler to wire?
(commond anode needs to be connected to the 5v of the arduino board, instead of having a common ground)

Can anybody tell me if my thinking of wiring would work?

wip-rgb.jpg
 
ok.. so if you are using low power RGB leds.. you can power it off an Arduino pin..

however, if you are going to be using several of them in a group like setting (like in the image).... then you would still need to power them from an external source.. and use the Arduino to 'trigger/toggle' the transistor gate... (make sense?

Think of a transistor as a 'door' (for lack of a better term)..

battery on one side of the door... leds on the other side of the door..

the Arduino.. connects to this 'door'.. and through the Arduino you can open/close this door.. letting the battery/juice flow through.. onto the leds.

The arduino can even *(using a PWM pin),... crack this door open a little.. or alot...

which is how you would attempt color mixing...

RED door is cracked up a little bit..
Blue door is cracked open a little bit..

you'll get a 'shade' of purple...

open either one of those 'doors' up a little more.. and you will change the shade/color..


Here are some old diagrams (general).. I made for connecting transistor and RGB leds..

The type of transistor you pick depends on the type of LED you use. (common cathode vs common anode)

RGB_transistor_commonCathode_diagram2.jpg

RGB_transistor_commonAnode_diagram2.jpg


*note: do not follow the pin of the transistors in the diagram.. use the datasheet supplied for your transistor choice.. it will have the correct order of the pinout... as not all are the same..



That diagram looks alot like mine?... (the internal pull-up note).. but you state you want to follow the OP first post? You will have to use my code (as a start/base) if you want to follow my diagram... to ensure pins are set-up correctly, and any switches work correctly.
 
ok, perfect, thank you for that.. it's getting clearer (no pun intended ;)) by the minute

what I meant when mentionning the OP was the functions of the circuit in general, and yes, it is indeed your diagram I modified in MS-Paint to try and visualize what I'm trying to do..

I see now that I had it backwards.. I'd put the transistor to the ground of each cluster of leds..
I'll modify it again. Thank you so much to take the time to answer all those questions.. I'm hoping to find all of this easier in the future, after some practice!
 
ok, perfect, thank you for that.. it's getting clearer (no pun intended ;)) by the minute

what I meant when mentionning the OP was the functions of the circuit in general, and yes, it is indeed your diagram I modified in MS-Paint to try and visualize what I'm trying to do..

I see now that I had it backwards.. I'd put the transistor to the ground of each cluster of leds..
I'll modify it again. Thank you so much to take the time to answer all those questions.. I'm hoping to find all of this easier in the future, after some practice!

Take a look at these: WS2812B 5050 RGB LED with Integrated Driver Chip - 10 Pack ID: 1655 - $4.50 : Adafruit Industries, Unique & fun DIY electronics and kits Do all the stuff you need and they have a library for the ardunio that makes them super easy to use. Yes they are SMD but they can be wired together with some thin wire. Its what I will be doing but with just plain white LEDs.

Infact use one or two of these: http://www.adafruit.com/products/1378 one for each eye and can give you something cool and interesting. The ones above could give you some chases that go eye to eye and may look amazing!
 
Jiggles: thank you for that info.. I will surely look into it in the future.

At this point though, I really really want to understand how to do it the "hard way" (maybe the dumb way?), by controling regular RGB leds color via the arduino.

So anyway, I downloaded Fritzing to give another go at my wiring diagram.

While drawing it, I wondered what were the pros and cons of driving my 10 RGB leds with 3 PWM pins (lets say 9-10-11) versus 5 RGB leds on PWM pins 9-10-11 and the other 5 on PWM pins 3-5-6 ?? The only thing I can think of is, if driving all 10 with the same pins, the two eyes wouldn't be able to display different color? (which I don't want anyway).. I don't know enough to be sure about this: maybe the current draw would be different since I'm looking at 10 leds in series vs 2-groups-in-parallel of 5-in-series? any insights here would be very appreciated..

and if somebody can have a look at my rev2 diagram, I would appreciate it very much
I only drew 2 leds in series, just to know if I'm on the right track, but I'm aiming for all 10 in a row in series (unless somebody tells me its a bad idea)

Here goes, RGB leds (common cathode).
NovaDom rev2.jpg

The push button drawing in Fritzing seems to have 4 possibles inputs on it, not sure how to wire it.

Once the wiring is sound, I'll have to look at modifying XL97's code to get it to work..
 
Hi guys, first of all i would like to thank you guys for creating these pages. i followed the instruction on the first page and it work fine but the problem is that my servo cannot left my faceplate, so i would like to get some advise from you guys what i have to change in order to left it up? if i would like to use a bigger servo to replace those 2 what i need to change? as i replaced the bigger servo but it start to move by itself back and forth after i press the switch. Please help me to solve this problem :cry
 
do you mean that the first servo couldn't lift the faceplate because it was too heavy? (was the servo 'trying' to lift the faceplate?)

the thing is, when you say that after switching to a bigger servo that servo was acting weird, I think a bad code might be your culprit..

who wrote the code that you're using?
 
Thank youuuuuuu for the reply
yes, i used 2 towerpro 9g and it could not lift the faceplate up,so i wanted to change it to 1 towerpro mg995 which has more lifting power. i used the code on the first page so what code i should change to?
 
i used this code of guitarkizta


#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
}
}
 
Maybe others, more familiar with coding could chip in, here..

another thing to think about that somebody else experienced in this thread (with two different models of servos):
if one of your servo move the way it's supposed to, then you switch servo and this one behave erratically, maybe your second servo isn't able to rotate the way the code is asking it to ( IE some servo can't rotate more than 90 degree for example)
 
Maybe others, more familiar with coding could chip in, here..

another thing to think about that somebody else experienced in this thread (with two different models of servos):
if one of your servo move the way it's supposed to, then you switch servo and this one behave erratically, maybe your second servo isn't able to rotate the way the code is asking it to ( IE some servo can't rotate more than 90 degree for example)

Thank you for your advise, i think the problem might be the angle as u said. i will try to change it. really really thank you for ur advise
 
I haven't done my mechanics yet for my face plate, i have all the Ardino parts and mechanisms, I'm just now about to finish peping the entire suit, and about to start the resign process...

My question is this, I want to have the 4 flaps, open and close ( Mark 7 suit) is any one down for writing code, for servos to open and close and what not, I'm good at fabricating and wiring, but as far as Ardino code, I stink...I was wondering if anyone would be down for writing code for me for this, I'm willing to pay for your services...

Thanks...
 
Finally found time to come back to my helmet, I've been playing around with some new code. I've been trying to come up with a solution to simplify things as much as possible and go back to the roots. Over the course of 50+ pages, this thread has plunged into levels of unfathomable complication. My new plan is to lose all LED's and literally just have open and close. As mentioned in the first post, this thread was always aimed at beginners, that includes myself... I've spent hours tweaking a new code to simplify things as much as possible. The first post will soon be updated with this new code. This post originally asked for help on it, but I've sourced hop elsewhere and am now quite comfortable with the code. Minimal components, minimal cost, minimal time, minimal effort. The first post will be edited soon to hide all the complicated stuff in a spoiler and create a new post with the bare essentials.
 
Last edited:
There's just so much info that It's hard to sif through so I was wondering if I can get some basic questions answered.

Where are people placing their servos?
-Are people placing there servos at the top of their helmet and letting the servo arms directly connected to the hinge arms to do the lifting or are people doing a pulley system where their servos pull on cables to pull the hinges up?

-Also what is the general consensus on servo options that are both slim and powerful in an affordable range to a higher price range?
Can you get by with two MG90s? My faceplate has been cast in Black Onyx resin so its not as light as a fiberglass resin pep faceplate is.
I've looked at Hitec HS-125MG metal gear as an option for a single servo but am not sure if it is powerful enough alone, ive seen it used by therealtonystark in his hinge system for sale.
 
hey guys i need your help.
i use a hs-125mg servo (only one!) so i want to remove all stuff which are for a second servo.. also i have a other servo mechanism. so the led is fading when faceplate is open? how can i change 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 = 0;
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(90);
myservo1.write(90);
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) {
servostatus = 1;

digitalWrite(ledPin, LOW);
delay(15);
digitalWrite(ledPin2, LOW);

myservo.write(40); // servo helmet
myservo1.write(180); // servo faceplate

} else {
servostatus = 0;

myservo.write(90);
myservo1.write(90);
delay(1000);
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(100);
digitalWrite(ledPin, HIGH);
delay(200);
digitalWrite(ledPin, LOW);
delay(100);


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


}

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

I'm looking to use something like this in a project I'm working on, with a sliding up / down mechanism, but in a much tighter space than would be available in an Iron Man Helmet. Rather that using a blocky servo, do you think a small electric motor like the one below could be use to wind the front piece up and down?

Here's the motor I'm thinking of using; http://modelshop.co.uk/Shop/Electrical/Motors/Item/Motor-1-5-3-volts/ITM1265

Thanks

Gav
 
Hi all,

I'm looking to use something like this in a project I'm working on, with a sliding up / down mechanism, but in a much tighter space than would be available in an Iron Man Helmet. Rather that using a blocky servo, do you think a small electric motor like the one below could be use to wind the front piece up and down?

Here's the motor I'm thinking of using; http://modelshop.co.uk/Shop/Electrical/Motors/Item/Motor-1-5-3-volts/ITM1265

Thanks

Gav

I don't know if that kind of motor would have enough torque. It all depends on the weight and friction of what you are trying to slide. you also have to think about the return mechanism. You'd have to have a push as well as a pull. I'd suggest looking in to a small stepper motor (for better control over the movement), which drives some sort of spool that has some wound up high-tensile material (like strong fishing line). The fishing line would come off in two strands (the top end and the bottom end), then you could route that line through a couple of pieces of tubing, one for the push and the other for the pull.

Another option would be to look at small solenoids or other types of linear actuators.

Sorry I don't have specific parts or whatnot, but some quick googling should give you examples of solenoids, stepper motors, etc. I'm sure something will pop up that will work.
 
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