Warhammer 40K Chainsword
For about 8 years now I have been interested in the 40k universe and when the school project came where I had to make something with an Arduino I had the brilliant idea to make a real life sized chainsword (Human sized, not Astartes)
In this Instructable I will show you my process on how I made this beast of a project. You will notice in some pictures that there are time skips or I am further that other images, this is because I have made this instructable in the order I would do it if I had to redo this project again and not the order in which I did it originally.
I hope you enjoy and for the Emperor.
Supplies
Essential:
- Arduino Uno
- L298N motor driver module
- Servo motor x4
- Wheels x4
- Gears x4
- Bike chain x2
- 12v battery (I had 8x 1.5v batteries)
- Button
- Wires (to connect everything)
- Wood (to build everything)
Useful:
- Tape
- scissors
- Bike chain punch (to shorten the chain)
- Screwdriver
Arduino Connections
Arduino to motor driver connection
First connect the motor driver to the Arduino, do this by connecting the 4 pins next to the 3 blue ports that read in1 to in4, I connected them to pin 9 to pin 6 (as shown in the code and pictures).
Servo's to motor driver connection
Then connect the 2 servo's to the motor driver module by connecting the wires from the servo's into the 2 blue ports on the side of the motor driver.
You should test out the servo's to check if they are both spinning in the right direction, otherwise they will push/pull against each other. If that is the case just simply switch one of the servo's connection.
Power supply to Arduino and motor driver connection
And at last connect the power supply to the motor driver module and Arduino. I connected the 2 6v battery housing together with one end each, leaving one red wire from one and one black wire from the other housing.
Connect the black wire in the ground port on the motor driver together with the pin in the ground from the Arduino.
Then connect the red wire in the 12v port on the motor driver with the Arduino wire going into the Vin port next to the ground (not the 5v port!)
Code
Setup function
First link all the pins (servo motors and button) by assigning them and calling them in the void setup function, then create the variables to make the toggle code work and the delay.
also create a serial begin line if you want to use the troubleshooting code to look at the serial monitor.
Loop function
Next you will have to create 2 if statements where one is to have the servo's turn on and one to turn them off.
The button variables will be updated when the button is pressed which in turn will update the state variable and switch from if statement to turn the servo's on or off. The input is put in the buttonNew variable as well as assigned to the buttonOld variable. when both are the same the servo's turn off, but when they are different they turn on. The state variable also gets updated in the if statements,
If you want to use the troubleshooting code you will also have to write the serial print line to se it in the serial monitor.
Troubleshooting Extra's
An extra is to also activate the built in led on the Arduino to check at all time if the button is working when the servo's are not responding. I have also included a line of code that prints out the state number for extra troubleshooting, just in case. Both these things are not necessary for the final product.
//button and led int button = 12; int led = LED_BUILTIN; // motor A //int ENA = 10; int in1 = 9; int in2 = 8; // motor B //int ENB = 5; int in4 = 6; int in3 = 7; //variables int buttonNew; int buttonOld = 1; int state = 0; int dt = 100; void setup() { Serial.begin(9600); //setup for button and led pinMode(button, INPUT); pinMode(led, OUTPUT); // set all the motor control pins to outputs pinMode(in1, OUTPUT); pinMode(in2, OUTPUT); pinMode(in3, OUTPUT); pinMode(in4, OUTPUT); } void loop() { buttonNew = digitalRead(button); if(buttonOld == 0 && buttonNew == 1){ if(state == 0){ //Everything on digitalWrite(led, HIGH); digitalWrite(in1, HIGH); digitalWrite(in2, LOW); digitalWrite(in3, HIGH); digitalWrite(in4, LOW); state = 1; } else{ //Everythin off digitalWrite(led, LOW); digitalWrite(in1, LOW); digitalWrite(in2, LOW); digitalWrite(in3, LOW); digitalWrite(in4, LOW); state = 0; } } buttonOld = buttonNew; delay(dt); Serial.print(state); }
Wood Structure
Main frame
create a long box with one side open
Cut out 3 long planks that are 80 cm in length, 2 of the 3 planks are the sides and will be 10 cm in width. The remaining plank is about ?? cm in width.
I made a mistake here and made it a little to small which led to the wheels not fitting which in turn led to the holes being made, this eventually led to the cool details I could add which are visible in the design and paint section of this instructable. I made the holes the size of the wheels + 2 cm (which is about ??cm), I did this with a drill that had a special attachment.
Padding
When looking at pictures of chainswords I noticed the 'engine block' on the bottom end of the frame, for this I made 2 different 3 sided boxes. One box was 10 cm tall and half (5cm) the width of the main frame, the thickness was the same as the main frame. The other box was 20 cm tall and the same width as the smaller box, the thickness was twice that of the main frame/smaller box.
I also notice the exhaust cutouts on the engine block so I used a special tool with a rounded sandpaper thing that made the round cutouts in the taller padding. I made 3 "holes" that were ??cm in width and the same depth as the thickness, I stopped sanding when I could see the wood from the main frame.
Handel
To create a sturdy handle I took a block of wood and used a tool that would spin the block around, I then uses a chipper to slowly chip away the wood to make the block round. I left an untouched bit at one end to then glue to the inside of the main frame, I left about 10 cm of it so it would sit firm on the inside because I would be obviously carrying it by the handle.
Bike Chain
Bike inner tube
The first iteration of the 'spinning part' was to cut a inner tube of a bike to size and let that spin around.
It worked at first but then slowly started to move to one side and start scrub on the side of the wood which made it slow down and eventually sop moving at all. I did everything I could to make it stop doing that but I eventually had to give up and think of a new plan.
Bike chains
What is more metal that having the 'spinning parts' actually be chains. I had this idea after the first one did not work, because the inner tube was moving around to much I had the idea to use chains because the cogs make sure that the chain does not go anywhere.
I glued one cog on each wheel (which to my surprise fit perfectly) on the side that was closest to the servo. I then got a bike chain and shortened it to the right length so that it would fit perfectly and not hang limply.
Electronic Layout
Battery Packs
Because the battery packs were so bulky I had to place them on the outside of the design on the side of the small padding, in my opinion it did add a lot to the overall design in the end.
Arduino and motor driver
The Arduino and motor driver were a little easier to hide as I had left out extra room when making the structure at the bottom. they both stacked nicely on top of each other and slid right into the 'compartment' onto of the handle block.
Button
Same with the extra room for the Arduino I left a gap above the handle to hide the button, as you can see the button does not take up much space. I would have liked to increase the size of the button but I did not have the material to do that, the upside is that it is well hidden.
Details and Paint
After all the basic things were complete I decided to decorate my chainsword a little more, I decided to theme it in the direction of an inquisitor chainsword.
Laser cutter designs
Using the laser cutter my school had I made some really cool designs to stick on my chainsword.
Taking the simple design from the net I put the Adeptus Mechanicus cog wheel on a circle and engraved it on a see through plastic, in the final build you will be able to see through the design and see the wheel spinning, which I though was pretty cool.
The aquila, banner and rosette was also a simple image from google. I converted them to DXF files and was able to laser cut them all within a day.
As you can see in the images I had to print a lot of teeth, about 150 to be exact. Gluing them to the bike chain was a slow and time consuming process, but it was definitely worth it for the final look.
3D prints
I mostly used the laser cutter for my designs because they were usually flat I only had to 3D print the purity seals, from which the design I took from the internet. They took 3 hours each to print, so I was happy that was the only thing I had to 3D print because the laser cutter is a whole lot faster.
Paint style
The main bulk of the chainsword I painted black, this was mainly had the other decoration with more color to pop. Following the examples on the internet I Painted the engine block chrome. The handle I painted bronze, but that was mostly because I had bronze paint laying around, otherwise I would have painted it chrome as well.
The rosette on the front I painted with the help of images online. the Aquila had to be painted gold, as so often depicted. The same was true for the banner which I painted using bone color making it look like paper, the letters on the banner where painted white to make them also better visible. As see on the internet purity seals are also bright red, so I painted them accordingly.
As you may have noticed the Arduino wheels are bright yellow and did not really fit with the whole theme I was going with, so I decided to paint them chrome. Fortunately I only had to paint the top 2 wheels because the bottom 2 are not visible from the outside.