It’s fair to say I stalled a bit with this project. When I last wrote about it (in October!) I was waiting for parts- they duly arrived, and when I started figuring out how to put it all together I realised I’d made a bit of a mistake with the design. It threw me a bit, but I got there in the end.
Just to recap, I’m making a prop gun for my friend Thomas (aka @braiba) who is cosplaying as Fiona from ‘Tales from the Borderlands’. It’s a great game and you should play it.
In the game the gun has three barrels that each have a different elemental effect; the player directs Fiona to rotate the barrel, to choose the desired effect before taking her shot. My plan here was to incorporate three little reed switches into the barrel, so the Arduino would know which way the barrel was rotated, and which effect to ‘fire’.
Reed switches are tiny flexible metal plates (the reeds), set in an little glass tube. When you bring them near a magnet, the reeds bend, touch each other, and complete the circuit.
In my head, this was going to be so simple; three reed switches in the barrel (you can see in purple where i was going to nestle them in) and one magnet in the space below in the body of the gun (purple again):
Great. Job done. Can you spot my mistake? It took me a while.
This would only ever have worked if the barrel was upside down! When the barrel was the right way up, the switches would have been nowhere near.
It took me a long time to figure this one out. The only place on the body where I could have fitted a magnet would have been where the battery was designed to go, which would have involved a large redesign.
In the end, I happened on the idea of having a solid structure inside the barrel that stayed fixed to the main body, that the barrel could rotate around:
You can see here that the new bit (I started calling it a spindle in my head) sits within the barrel, but it is joined to the interior of the post that holds the bearing; the spindle stays still so the magnet stays at the top, and the barrel revolves around it.
I said before the plan was to 3D print the metallic parts with a metal filament; plastic filament that contains a certain amount of metal particles. Depending on the ratio of metal to plastic you can either have filament that’s easy to work with, or looks really metallic, or at least that’s the theory. I bought a fairly low metal content filament but to be honest I think this was the worst of all worlds: It was brittle, slow to print, kept clogging up my printer and the results didn’t really look much better than regular PLA filament that had been painted. For some of the smaller pieces, we ended up keeping the metallic filament but for body of the gun I just ended up using regular PLA (The see-through bits are still PLA, which can be produced to be transparent)
The body of the gun was printed in two halves, and each took a couple of hours each. Once they’d been printed, I gave them a coat of epoxy resin to strengthen them a bit and smooth out some of the layering you always get with 3D printing:
Next job was to start wiring up the barrel. Each of the three chambers had four LEDs (3 for the stripe down the side, and one for the aperture at the end of the barrel) and a reed switch, all fixed inside the transparent bit inside the barrel. It was about at this point I figured I realised I was working at a smaller scale than I was used to! Here it is before I added the three aperture LEDs:
And here it is with the extra three LEDs, all wired up just to check everything is working:
Great! Now just to glue and clamp everything together. At this point, both the spindle and a slip ring (to allow the wires to rotate around and not get tangled up) are entombed within the barrel:
I forgot to take photos of the bearing which joined the barrel to the main body, but you can see here how it all fit together:
The bearing slipped over the peg on the body, and the barrel fit on the outside of the bearing. These bearings are really super cheap at the moment, because they’re the same as the ones used in fidget spinners! The wires from the barrel pass through the hole in the centre of the bearing, through the peg and into the body of the gun.
Now, more wiring. This was super fiddly work:
This is a little bit of strip board (works like a breadboard, but everything gets soldered in) to connect all the other components together. The red and purple coil goes off to the ‘trigger’ button, the red and black coil goes to the power supply, and the seven single wires go to the Arduino (three inputs from the reed switches, one input from the trigger, one output for the LED data and two to power the Arduino). You can also see some ‘pull down’ resistors (in a nutshell: when the reed switches or the buttons are pressed that provides a positive signal. You need the pull down resistors to provide a negative signal. Without them, you get an indeterminate ‘floating’ signal). You can also see the 6 little connectors at the back to connect the wires from the barrel.
And here is everything crammed inside the gun, without the battery or the barrel. You can see the tiny bit of stripboard and the six connectors, with the Arduino on top of it (I’m using an Ardiuno Nano, which has similar pins to an Uno but is a lot smaller). You can also see the trigger button, and a few of the small hexagonal nuts glued in that you use to bolt the two halves together. The little green board about the Arduino is a ‘boost regulator’ which takes the 1.5V supplied by the battery and converts it to 5V. The overall wattage supplied remains the same, so the trade off is you get less amps; about 500mA in this case, but that is plenty for powering 12 LEDs and the Arduino.
Once I’d put the battery in and hooked up the barrel, Thomas and I took it for its first test ride:
It looked pretty good to me! My initial program for the Arduino meant you could ‘fire’ one chamber, which would then fade to black. You’d then have to rotate to another chamber to fire it again, until all three were spend, at which point you could reload. Unfortunately, I neglected to get any video of this 😦 I did get video of the important stuff though:
(this was an just a base coat of paint, Thomas neatened it up nicely later on)
I’ve also uploaded the .STL files to Thingiverse here
The only thing I think I’d have done differently with this project is changing the way the two halves joined together. In theory having the three bolts worked, but in practice you couldn’t tighten them up enough without the nuts popping out of their sockets. That being said, I think two of the three lasted until the end of the convention. On that subject, here is the actual cosplay (at the most excellent Nine Worlds Con, August 2017)