Iron man motorised faceplate electronics tutorial!!!

Discussion in 'Marvel Costumes and Props' started by 7sinzz, Dec 16, 2012.

  1. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    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 * 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: Nov 9, 2018
    Nismo, Rikimaru80, katinski and 7 others like this.
  2. Murdoch

    Murdoch Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    2,286
    Could only skim through. But looking foward to reading this one. Thanx man...GM
     
  3. sq10e

    sq10e Active Member

    Trophy Points:
    331
    That's some pretty intense knowledge sharing there. You sir, are an asset to the community
     
  4. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    Cheers guys, look forward to hearing from more people that have managed to get this up and running.
     
  5. omarbou1

    omarbou1 Well-Known Member

    Trophy Points:
    866
    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 !
     
  6. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    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.
     
  7. omarbou1

    omarbou1 Well-Known Member

    Trophy Points:
    866
    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 !
     
  8. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    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: Dec 16, 2012
  9. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    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?
     
  10. Murdoch

    Murdoch Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    2,286
    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
     
  11. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    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: Dec 16, 2012
  12. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    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)
     
  13. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    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!
     
  14. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    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.
     
  15. Corey

    Corey New Member

    Trophy Points:
    2
    Ive been looking for this for a long time. Thanks!!!
     
  16. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    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) :)
     
  17. J Scorn

    J Scorn Sr Member

    Trophy Points:
    1,307
    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.


    .
     
  18. omarbou1

    omarbou1 Well-Known Member

    Trophy Points:
    866
    do you recommend any hinge system with the jaw cuz flakhood used 4 servo but people told me i dont need it !
     
  19. bobafettsslave1

    bobafettsslave1 Active Member

    Trophy Points:
    331
    Thank you for doing this. I have just bought all the kit and was searching for ideas.
     
  20. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    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.
     
  21. thetrentandpaul

    thetrentandpaul New Member

    Trophy Points:
    2
    Very impressive! And I must say thank your for sharing. I plan on implementing this into my next few helmets now.

    Also just to be sure, if say, we were using something else for the LED's in the eyes, we just need to skip the appropriate steps which you mentioned in first post?

    Also for anyone looking for an arduino "kit" I found this starter kit on Amazon
    Amazon.com: Starter Kit for Newsite Uno R3 - Bundle of 6 Items: Newsite Uno R3, Breadboard, Holder, Jumper Wires, USB Cable and 9V Battery Connector: Computers & Accessories

    ^^(assuming that this is appropriate)^^
     
  22. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    Yes just skip the steps I mentioned.

    That kit is right but please note that it doesn't come with LED resistors or switch.
     
  23. Tony Stark III

    Tony Stark III Well-Known Member

    Trophy Points:
    566
    I just want someone to sell me theres, to avoid all this madness.

    lol
     
  24. thetrentandpaul

    thetrentandpaul New Member

    Trophy Points:
    2
    Right, and as for the motors (or servos? are they interchangeable?) any one in particular? I noticed yours said micro servo and I found this with a quick google search Dagu Micro Servo Motor - RobotShop

    And they don't require any sort of external power source just the source being provided to the arduino?

    Sorry I know a bit about electronics but am a total noob when it comes to this servo stuff.
     
  25. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    most servos -can- be powered by the Arduino directly.. (temporarily, under no load.. not for final project)

    most motors can -not-.....

    (usually need alot more current than any Arduino pin can provide..)

    there is also protection circuit recommended when using a motor you trigger the motor on/off as it spikes.. and could damage the Arduino directly..


    I can probably help with the Arduino code a well.. just not sure all what you want done..etc
     
    Last edited: Jul 23, 2015
  26. guitarakizta

    guitarakizta Member

    Trophy Points:
    191
  27. guitarakizta

    guitarakizta Member

    Trophy Points:
    191
    sir if you need help.i want to help :D
     
  28. IronLeoMan

    IronLeoMan Active Member

    Trophy Points:
    332
    soon everyone will be able to have a motorized helmet... so people get looking into getting those suits made people
     
  29. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    Dude are you able to write the eye flicker into the code?

    Don't forget everyone, this can also be used for flight stabilisers.
     
  30. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    eye flicker?

    lol.... Im not sure I guess..

    Im not 'up' on all the IronMan canon stuff as most of you guys are here..


    I dont know if I have an extra servo laying around anymore or not to test with.. (I broke my last one trying to mod for 360 degree rotation and 'faster' gear ratio speed)..

    but I dont think it'll be that hard to be honest..


    lets get a list of 'effects' of things you want to happen.. and we'll start there.. :)
     
  31. DirtyBrit

    DirtyBrit New Member

    Trophy Points:
    17
    Fantastic! One question... which may have already been answered and missed by me:
    Where on the board would the eyes plug into?
     
  32. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    you would have/make a separate PCB (with leds) for each eye.. then connect them to your 'main' board for controlling..
     
  33. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    The flicker effect I'm suggesting is to mimic powering up. Flicker twice then solid light.

    Dirtybrit, The eye location on the breadboard is described in first post. It's represented by the green LED in my photos. Without looking I'm sure it's steps 3,4,5,17.
     
  34. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    just a wuick two flicker before fully on is needed..


    also.. question:

    how are you doing your servo stopping? by time? position? limit switch?
     
  35. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    Position AND time. The servos are programmed to move 180 degrees and are given a time limit of 15ms to get there. I think that's a nice speed and rotational degree. If anybody needs less distance or wants it to open and close faster or slower, I will explain how to change the code at a later date.
     
  36. PurdueMadLou

    PurdueMadLou Member

    Trophy Points:
    180
    7sinzz & Ironleoman - Thank you for going through the trouble of learning this and then for starting this thread to share that knowledge. I have been scared s***less by this aurduino stuff, but now, with this, I can't wait to play around with it. Thanks also to those of you that have or will post here with tips/tricks/code/etc.

    Subscribed!
     
  37. Drack

    Drack Well-Known Member

    Trophy Points:
    866
    Thank you so much man! I have read countless threads and micro controller tutorials on how to learn to do this but it seems to be the one thing I just can't teach my self. Now you have given a solid starting point I will ditch my portable battery powered hand drill disection idea and go back to using servos in my lid.
    A daft bonus for me is that it was a fellow Brit that brought this to light for us all :)

    Tom.
     
  38. IronLeoMan

    IronLeoMan Active Member

    Trophy Points:
    332
    no problem we both felt it needed to be done that everyone should have the chance to make there suits more realistic
     
  39. Isildur

    Isildur New Member

    Trophy Points:
    16
    Will the code work if i add more LEDs? If not may i change it.
     
  40. ShackMan

    ShackMan Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    1,041
    You can add all the LEDs you want by having the Arduino output trigger a transistor instead of the LEDs directly. That keeps the chip from having to source/sink much current, and won't require a change to the code.
     
  41. guitarakizta

    guitarakizta Member

    Trophy Points:
    191
    do you want the light blink 2 times then on.? or blink 2 times then fading ON..?
     
  42. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    Try blink twice then fade on
     
  43. guitarakizta

    guitarakizta Member

    Trophy Points:
    191
    try this sir. its working just replace the LED ON program of the servo.

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

    i hope it will help you :) just adjust the delay on fading and the fadevalue if you want it fast :love
     
  44. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    You are an absolute diamond. Ill try it when I get home and post video.
     
  45. guitarakizta

    guitarakizta Member

    Trophy Points:
    191
    thanks :D i like your helmet hinges, i always watch it when im making my motorize helmet :thumbsup
     
  46. 7sinzz

    7sinzz Well-Known Member

    Trophy Points:
    566
    That's not mine dude. That's the method I intend on using.
     
  47. Murdoch

    Murdoch Sr Member RPF PREMIUM MEMBER

    Trophy Points:
    2,286
    I just wanted to take a moment to say thanx to the folks who have taken the time to contribute to this thread. For me, i who have no experience in electronics what so ever, have been trying to figure out how am i going to learn this strange langauge of electronics. You folks have paved the way, actually laid a solid foundation for guys like me to pickup and understand something that has until now, been alien to me. Thank-you all... GM
     
  48. DirtyBrit

    DirtyBrit New Member

    Trophy Points:
    17
    Am i understanding correctly that i can hook multiple leds to the board using the 2 jumper points listed in the original steps? Do these have have a transistor included as someone else posted... any chance of an dummies guide to this or a diagram?sorry to sound like an idiot... just dont wanna do anything that will damage the arduino!
     
  49. xl97

    xl97 Sr Member

    Trophy Points:
    1,506
    you might be able to hook up '2' per pin.. and always use the correct resistor calculated for this.

    but each Arduino pin can only give up to max 40mA I believe.. ..

    if you use a transistor.. you can group more together.. and toggle the group together.. however you would only be using the Arduino to 'toggle' to logic gate.. not really be powering them from the Arduino as you would hook the power source to the transistor


    also.. how many leds do you think each 'eye' will need.. and what kind? (need a datasheet for the leds you want to use.. so we can get a vF.....etc for it)
     
  50. xevanx

    xevanx Active Member

    Trophy Points:
    341
    Coming from a guy that knows nothing about electronics, thanks for the tutorial.
     

Share This Page