Star-Wars X-Wing 2




Introduction: Star-Wars X-Wing 2

About: An aspiring artist. Visit me at
I've always liked star wars, recently I was watching a star wars movie on you tube and when I say the “X-wing fighter”, I liked it so much, that I decided that I had to make one for myself, it took me about a week to get the materials and the almost about 3 and a half weeks to get the project together. I wanted it to look a bit different and I wanted to add an enemy detection system, so I decided to make the
“X-wing fighter 2”. Its pretty similar to the “Original X-wing” but it has an enemy detection system(a servo and a blue LED on top of the servo)(I just added a picture with the LED turned on, you can see the blue LED which kinda looks weird in the first few pictures(Don't know why)and the servo is under the LED)) and it has a bit different looks.

Please vote for this instructable in the LED contest if you liked it --->>>(Thanks in advance) HERE

Here is a video of the finished model, in this video you can see the cool lighting effects!
I know that the video is a bit dark, but I wanted you to see how cool the lighting effects look when its in darkness, so hope you liked the light effects, I didn't show you the servo and the LED on top of it(Scanning device), because I forgot about it while shooting the video, and now my camera does not work, so I will add a video of that as soon as my camera starts working.

In this video I rotate the X-Wing in clockwise direction so that you can get a view of the X-Wing from all directions.

And here is the video of the Star-Wars X-Wing I made out of Paris metro tickets as I had a lot of them after my visit to Paris, so I made an army of 15 of these X-Wings(May the force be with you)

So what on earth is an arduino??
It cannot be described in words, the arduino is a cheap, innovative and creative open source micro-controller which anyone can buy, and hacking this micro-controller is as easy as it could be, so this is one way anyone can start leaning about electronics.
For more info go to :

If you are new to LEDs etc then go to these links to learn about them

If you need more help on LEDs then just type in "LED guide" in instructables, and you will get a lot of help.

An LED has two leads one is the cathode and the other is the anode ( cathode is + anode is -)
Cathode is the longer end and anode is the shorter end.
Keep this in mind that different LEDs need different amounts of power supply and different types of resistors. The most common types of LEDs are 20 mA (20 milli amperes).
The color bands on resistors indicate what resistance they have.(For my project I used 1 K ohm resistors).If you want to learn more about this then just go on Google and type resistor codes and you can learn from the websites listed, but if you want it to be calculated for you go to this link :

Some LEDs work even without resistors, but to be on the safe side I added resistors even tough for me they were not required.

This is the simplest project that you can make because there are no ICs used in this project at all, only an arduino(Which has an Atmega on it)So some basic skills that you will learn as you go through this instructable will help you make this project in no time

The fighter has a total of 26 LEDs(As I added 1 more LED in each shooter to increase the brightness) 5 in each of the shooters so 16 in total and 4 for the boosters and 1 for the detection unit and one for the headlight, and it had 1 Servo with the detection unit LED on top of it.(It was a blue LED).I recently added a distance sensor on top of the servo and the LED was attached on top of the distance sensor, and it the distance sensor detects something coming close then the LED will scan the area and another LED right beside the scanner LED will blink(shoot).You can also add an infrared transmitter on top of the distance sensor and as soon as it senses an infrared receiver as there will be an LED right beside the infrared receiver, as soon as the light sensor detects the LED the infrared transmitter transmitted data to the infrared receiver and the opponent loses.(You can also play this gave with your friend if you have 2 ships).
Ok basically a whole lot of electronics are wired up to act as a targeting device to target the infrared transmitter of the other ship and send data to it, to win the game.(Basically like shooting it with the infrared transmitter,
(Its a self targeting device in simple language.)

The making of this isn't really hard if you are making a second model or you are experienced at these kind of stuff. My first one was “kind of” bad, but my second one was a success, I took it to my school for a talent show and I won a certificate for the most creative electrical/craft creation. I was really happy that day and then when I come home I see that there is an LED contest so I quickly decide that I will post this instructable in the contest.

I started off making the base with a deodorant can for the center base and 4 PVC pipes for the shooters and some bigger PVC pipes for the boosters and some cardboard for the wings, it was a really hard job cutting the PVC into size because all I had was a candle and a knife so I had to heat the knife and cut it because I had no drill press or anything.

And then I gave it the first coat of spray paint, and waited it to dry and then gave it another layer of spray paint. I then added details like the shooters top parts(near the LEDs) and some white spray painted cardboard for more detail on the wings.

Then I carved a block of styrofome in to shape with a lot of effort for the front part of the spaceship and it looked quite nice, but then when I spray painted it the pressure of the spray paint was too high so it made dents all over the thing somewhat similar to asteroids hitting the moon and making all sorts of dents, or somewhat like a shower spray on a handful of shampoo, so I advice you never to spray paint on styrofome.

So then I had to re-sand the styrofome into shape and covered it with some cardboard and then spray painted the cardboard. And by doing this I was finished doing the craft part of this model..

The next step was to insert the electronics inside the model, and I faced another problem at this point as the LEDs would not fit in some areas etc, and the wires were too short for some and the breadboard would not fit into the compartment, so I had to do some more cutting and pasting of cardboard and plastic and then I was able to fit the electrics in.So I strongly recommend that you make all the correct measurements and glue the LEDs in the tube before covering up the tubes etc.

The next step was to program the entire thing.
I used putty on windows as the terminal program(a program that runs the arduino like the arduino's serial monitor)I used it because you do not have to click enter after inputting each and every command.
This was the code I used :

#include <Servo.h>

int LedPin1 = 12;
int LedPin2 = 10;
int LedPin3 = 9;
int LedPin4 = 13;
Servo myservo;

void setup()
pinMode(LedPin1, OUTPUT);
pinMode(LedPin2, OUTPUT);
pinMode(LedPin3, OUTPUT);
pinMode(LedPin4, OUTPUT);

void loop()
while (Serial.available() == 0);
int val = - '0';

if (val == 5)
digitalWrite(LedPin1, HIGH);
digitalWrite(LedPin1, LOW);

if (val == 6)
Serial.println("Boosters On");
digitalWrite(LedPin2, HIGH);
if (val == 4)
Serial.println("Boosters Off");
digitalWrite(LedPin2, LOW);

if (val == 7)
digitalWrite(LedPin3, HIGH);

if (val == 1)
digitalWrite(LedPin3, LOW);
if (val == 3)
Serial.println("Scannign for enemies");
digitalWrite(LedPin4, HIGH);
for (int i =0; i <=180; i =i+20)
delay (100);
for (int i =180; i <=0; i =i-20)
delay (100);
digitalWrite(LedPin4, LOW);

Now I am going to explain what the code does in brief
The first part is adding the servo library to control the servo easily, then it tells which LEDs are connected to which pins on the arduino, then it sets the pins as outputs and in the void loop it basically checks with the computer to see if any key on the keyboard has been pressed, if it has then it checks if the key that was pressed was defined in the code eg : if (val == 9) then it checks if 9 has been pressed, if yes then it performs the action under that part of the code, if not then it just skips that part.
So this is how I control my 22 LEDs and 1 servo.

Just today, I found a laser for 10zl at my local store(3$), and I plopped it open and used the laser instead of the blue LED on top of the servo, and in the dark, it looks really cool.

The electrical parts I used are
  • An arduino
  • A breadboard
  • Some jumper cables
  • 2 NPN transistors
  • A couple of resistors
  • 22 LEDs
  • A 9 V battery
  • A servo
  • Lots of wire
  • Wire glue (because I do not have a soldering gun)
  • Heat Shrink tubing
  • An Arduino to USB communication cable ( You can use a blue-tooth transceiver to make it wireless, but I couldn't because I did not have enough space and due to some power problems.

If you want to post tweets on twitter do it by using this code in processing(Its a program just like the arduino IDE but for the computer)
When you use that code anything that is written like serial.println in the code will be posted onto twitter.
The Code for Processing :

* based on:

import processing.serial.*;

Serial myPort; // The serial port
PFont myFont; // The display font
String inString; // Input string from serial port
int lf = 10; // ASCII linefeed

Twitter twitter; // Twitter

//Going to get oAuth working instead of this, but this will do for now
String username = "YOUR-TWITTER-USERNAME"; // you Twitter Username Here
String password = "YOUR-TWITTER-PASSWORD"; // your Twitter Password Here

void setup() {
twitter = new Twitter(username,password);
myFont = loadFont("AppleGothic-48.vlw");
textFont(myFont, 18);
myPort = new Serial(this, Serial.list()[0], 9600);
myPort.bufferUntil(lf); //wiat for line feed to specify end of serial buffer

void draw() {
text("color selected: " + inString, 10,50);

void serialEvent(Serial p) {
inString = p.readString();//read serial string
//For some reason this only wanted to work in a try catch
Status status1 = twitter.updateStatus("Arduino's favorite color is "+inString);//update twitter status
catch( TwitterException e) {

Change username and password with your twitter username and password, I tried it and it works perfectly.
If you want to post updates to an application on twitter go to my other instructable :

I had so ships, the first one which was OK and the second one that you see in the pictures,my friend asked me if I could add some infrared transmitters and receivers and I said yes and after adding 4 receivers to each and 1 transmitter, we went into our garden maze and had a star wars infrared light battle, my friend won because he was better than me at playing these sorta games :(  then We decided that we wanted to make something even better, so we removed the infrared receivers and senders and added a tilt sensor to each of the ships and then I also hooked up a tilt sensor in the other direction, and I made a game with java which is basically a game between two computers, and I used these sensors as input values.So one sensor is for turning and the other is for shooting, and we had lots of fun, and in this game I won :) .

If you want to use the ultrasonic range finder, then use this code and swap the pins and make some adjustments in the code to use it however you want, this is not the code I used, but its an example code from the seller, I did not give you the original code, because I would like you to take on a challenge and write the code for yourself.

int blinkLed=13; // Where the led will blink
int sensorPin=0; // Analog Pin In
int sum=0; // Variable to calculate SUM
int avgrange=50; // Quantity of values to average
int sensorValue; // Value for te average
int i,media,d; // Variables
float cm,inch; // Converted to cm

void setup()
Serial.begin(9600); // To check what is being read on the Serial Port

void loop() {

d=analogRead(sensorPin); // Read the analog value
digitalWrite(blinkLed,HIGH); // Turn on LED
delay(d); // Delay changes with the analogread
digitalWrite(13,LOW); // Turn off LED
delay(d); // Another delay

cm = (d / 2) * 2.4; // Convert the value to centimeters
inch = d/2; // Value in inches

Serial.println(cm); //Print average of all measured values

// This is the code if you want to make an average of the read values


for(i = 0; i < avgrange ; i++) {

media = sum/avgrange;
Serial.println(media); //Print average of all measured values




And of course you can expand upon these ideas and make something even more awesome, if you do post a picture or a video in the comments section of this project.

The last few pictures show my mini X-Wing model I made, as I went to Paris a month ago and I had so many metro tickets that I decided to make the X-Wing with Paris metro tickets and here it is, I just gave the base and the ship(Both made of Paris metro tickets) a coat of white spray paint for the base and a coat of silver spray paint for the X-Wing.
If you want an instructable on the mini X-Wing made from Paris metro tickets then please comment and I might make an instructable.

There weren't many materials used in the craft part of the project,
Only some mechanical screws, bolts etc, Some cardboard, some spray paint, some cardboard and PVC tubes(PVC tubes were really hard to cut) and some duct tape, as you see some white colored cardboard and white colored duct tape, eg in the head of the x-wing the white decoration is made from duct tape.

This is a perfect project for anyone who likes star-wars and it does not matter if you are new to DIY as you can definitely make this project to start your DIY career.

Learning reference :

Where to buy :

LEDs :

Micro controller :

Servo :

Transistors and Resistors :

Breadboard :

Voltage Regulator :

When I bought these items, I got them from different sellers on ebay for way cheaper, but if you search on ebay, I'm pretty sure that you could get stuff for cheaper, and I also had some stuff lying around in my house, so that is why my project was completed in only 30 dollars, even tough I bought myself another arduino uno.

If you have any questions regarding the making of this project or the code or if you want the schematic on how I connected everything, you can just comment and I will try and help you as quickly as possible.

I thank everyone who helped me with this project and the forums of as I received all my electronic help from there.I got my inspiration from the star- wars movie and from this instructable :

The schematics for everything are in the last few pictures, I drew the schematics on a program called "Eagle", and they show you how to connect the whole thing, and then how to connect the wireless blue-tooth transceiver and how to connect the ultrasonic range finder for the scanning unit, I added all these to my project and its great now.

Any ideas will be appreciated, as I would like to improve this a lot!

The files ending with .sch(last 3 pictures) can be opened with Eagle(A program which is used to make schematics) and there are images of those schematics in the second last 3 pictures.

Please comment, rate, vote and subscribe.


Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

LED Contest

Participated in the
LED Contest

Adafruit Make It Tweet Challenge

Participated in the
Adafruit Make It Tweet Challenge

Be the First to Share


    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest

    44 Discussions


    8 years ago on Introduction

    This is great, I just voted for it right now!!!


    8 years ago on Introduction

    very cool!! me being a starwars fan myself its awsome specialy with the LEDs make it look realy cool!!


    Reply 8 years ago on Introduction

    Glad you liked it and maybe you would like to vote for this instructable when the voting period for the LED contest starts!


    8 years ago on Introduction

    Yup this is definitely going to win, I mean there is nothing better than this ible entered for this contest(LED contest)


    8 years ago on Introduction

    If anyone asks why the battery was outside, it was because I did not want to dig in every time the battery runs out and so that I can easily replace the battery


    Reply 8 years ago on Introduction

    And if you liked it please vote when the voting period starts,
    I liked yours so I will vote for it!!!


    8 years ago on Introduction

    Looks nice!! I'll be voting for it!


    Reply 8 years ago on Introduction

    Thanks ,and if you liked it please vote when the contests voting period starts