Simple Coil Gun

Barrel of the coil gunThe next project that I’ve been working on (with a lab partner) for my electromagnetics course is an “EM Buffet Lab.” In other words, we get to choose what we want to build, as long as it is EM related, and then do a write-up about why and how it works. What my lab partner and I are building is a coil gun. We have actually already finished it, but we are still preparing our presentation and report for Wednesday.

Note: Be sure to also read the follow-up post to see the projectile velocity and some other goodies.

What is a coil gun?
A coil gun uses a solenoid (coils of wire wrapped closely together) to create a magnetic field. This magnetic field attracts a ferromagnetic material during a strong, brief current discharge (usually produced by a capacitor.) The projectile wants to go to and stay in the middle of the solenoid due to the induced magnetic field, but by the time the projectile gets to the middle of the coils, the capacitor is fully discharged and no magnetic field exists anymore. Therefore, the projectile does not stop, but continues traveling through the solenoid instead of stopping in the middle of it.

Parts needed to build a coil gun
Coil guns are surprisingly cheap and easy to build. Here are the minimum parts needed:

  • Disposable camera with flash.
  • Lots of magnet wire (magnet wire looks bare, but actually has a very thin insulator coating on it.)
  • Wire to connect components together.
  • Pen.
  • BB’s or steel rod (with a diameter that fits into the pen casing.)
  • a pushbutton switch (“pushbutton” = only on when you are pressing it.)

That’s all you need! If you want to get a few extra goodies, then you can also get the following (if you don’t have them already):

  • 2 washers, where the hole is barely larger than the diameter of the pen casing.
  • Nut and plastic bolt, where the threaded end of the bolt fits easily into the pen casing, and the nut is larger than the pen casing.
  • Electrical tape.
  • Hot glue gun (and glue)
  • Piece of wood.
  • Various brackets and screws to secure coil gun components to the piece of wood.
  • 2 opto-interrupters (for determining speed of projectile as it exits the coil gun.)
  • Some resistors.
  • An on-off switch.
  • Pizza (work is always more fun when you have some food nearby!)

Building the coil gun
Disposable camera flash circuit To start, disassemble the disposable camera. We need the disposable camera for the circuitry inside that controls the flash. You can get a disposable camera for around $3 at most stores like Wal-Mart (make sure you get a camera with a flash on it!) You can usually pry the camera open with a screwdriver. If you haven’t used the camera before, then the capacitor in it probably won’t have any charge on it. However, you should try to discharge it anyway to be safe. The capacitor is designed to hold about 300 V, which can be discharged at very high currents. Take something metal that has a plastic or rubber grip (like a screwdriver) so you don’t get shocked, and touch the metal part of it simultaneously to the two leads on the capacitor. If the capacitor had no charge, then nothing will happen. If the capacitor is fully charged, then you will hear an unbelievably loud BANG! as the capacitor almost instantly discharges. It is kind of fun to make it discharge when it is fully loaded, but it isn’t very safe and you will start making black marks on the capacitor leads.

It is interesting to know how the flash circuit works. What I had not realized before was that the 300 V on the capacitor is always connected to the flash. The flash does not go off, though, until its backplate (the reflecting part) has a high voltage introduced to it (greater than 4000 V.) Read all about it at Howstuffworks. The flash circuit uses a small transformer to attain the 4000 V for the back plate, but it is useless to us because the 4000 V has almost no current. We need a high current to make our coil gun work well, which is why the capacitor is so important.

Flash circuit with flash removedAt this point you should unsolder the flash from the rest of the flash circuitry. The next step will involve connecting the coil gun directly to the capacitor, with a switch in series with them. The switch will serve as the trigger for the coil gun. To do this, solder some wires where the flash was just removed. In this picture, the brown and green wires are connected where the flash was. There is a white wire in the picture, but it is not connected to anything; it is just secured to the board for convenience (you don’t need it and can ignore it.)

To make the coil, begin by disassembling the pen and keeping only the hollow pen shaft. Next, hot glue one washer in the middle of the pen shaft, and then hot glue the other washer about one inch from the first washer. The washers will keep the coil together.

Layers of coilsNow, start wrapping the magnet wire around the pen beginning at one washer and ending at the other. The wrappings should be very tight and only one layer thick. After you have completed one layer of coils, put some electrical tape over the completed wrappings and start making a second layer of coils on top of the tape that is covering the first layer (like in the picture to the right.) Continue doing this until you have around 10 layers of coils between the washers. Make sure you have left long leads at both ends of the magnet wire so that you can easily connect the solenoid to your flash circuit.

Finished coilAfter you have completed the wrappings, put some electrical tape around them so you do not scratch the magnet wire and short it out. Next, hot glue the nut to the end of the pen shaft that is closest to the coil. Make sure that the center of the nut is aligned with the hollow shaft of the pen so that the plastic bolt can be screwed into the pen shaft. The bolt will be used to adjust where the projectile is positioned and to keep the projectile’s position consistent. This picture shows what our finished coil looks like.

Next, hook up the coil to the flash circuit by connecting one wire lead to the pushbutton switch, and the other wire lead to the capacitor lead that is not connected to the switch. I recommend using a “pushbutton” switch – where the switch is engaged only while you are pressing it, and is disengaged the moment you stop pushing it. This helps ensure you don’t accidentally leave the coil gun on and drain your battery.

That’s it! You can test your coil gun by inserting the projectile into the coil gun barrel, turning on the flash circuit, waiting for the LED on the circuit to light up (which signifies that the capacitor is charged up,) and then launching the projectile by depressing the pushbutton. Here is a video of us firing our coil gun:

We also used some of the items in the “extra goodies” shopping lists above to make testing easier and to measure the projectile speed, but I will describe this in another post later (click here for the follow-up post).

33 thoughts on “Simple Coil Gun”

    1. You can’t get a disposable camera? Using a disposable camera is definitely the cheapest, fastest, and easiest way to do it. Are you doing it for a class, and they are not allowing you to use pre-made circuits?

      To answer your question: yes, you can make one yourself, without using a disposable camera. You will need to get a capacitor similar to those used in disposable cameras – one that can handle very high voltage (200 – 300 V) and that can handle discharging VERY fast.

      You will need a charge pump to step the voltage from the AAA battery up to the required 200 – 300 volts in the capacitor. You can buy charge pump integrated circuits, or you can make your own by following the same method that disposable cameras follow. View these two sites about charge pumps:

      The key is then to connect the large capacitor in series with a switch and the coil that your wrapped for the coil gun barrel, forming a complete circuit. (You might also want a large value resistor across the capacitor terminals to slowly drain the cap if it isn’t being used.) Use some diodes for the charge pump to direct the charge onto the cap from the charge pump.

      This is the basic idea. You will need to do a lot of work to tweak and get it right if you are making your own. You should reference the many websites out there that show how to make a coil gun from scratch.

    1. Qui,

      Good question. Be prepared for my long response…

      Yes, you can wire multiple caps to the circuit. However, you need to know what your end goal is in doing this. You have the choice of wiring the caps in serial, parallel, or serial+parallel configurations. When considering each of these, the end goal should be having the highest current possible through the inductor (i.e., a strong magnetic field), while at the same time making sure that the capacitors will fully discharge at around the same time that the iron projectile reaches the middle of the solenoid (e.g., not much before and definitely not after reaching the center). Let me explain this a little bit, then it will be more apparent what the effects of additional capacitors will have. The reason for fully discharged caps at the same time the iron reaches the middle is because the iron is attracted to the center of solenoid when the capacitors discharge (i.e., when driving current through the inductor the magnetic field centered around the middle of the solenoid).

      It becomes a trade-off. If the capacitors discharge too slowly then the magnetic field will still be present after the iron gets past the solenoid’s center, which will slow the iron down since it is still attracted to the solenoid’s center. If the capacitors discharge too quickly then the iron’s acceleration will end before it gets to the solenoid’s center, meaning that some of that physical distance prior to the solenoid’s center was wasted since it wasn’t used for acceleration.

      I’ll address each of these (serial, parallel, combined) individually.

      If you put 2 capacitors in serial with each other, then the equivalent series resistance (ESR) across the serial chain will be 2x higher and the stored energy will be the same as a single cap (see my comment below for correction). The result is that it takes longer for the capacitors to discharge and the current & magnetic field will be smaller than if a single capacitor was used. This means that the acceleration will be smaller, but it will last for a longer time period. The limit to the max velocity is when the force exerted by the magnetic field equals air resistance force. Once you reach that point it won’t help to lengthen the acceleration period.

      This has approximately the opposite effect of the serial configuration. With 2 capacitors in parallel, the combined ESR will be half and there will be 2x the total stored energy. The effect is that the capacitors will discharge in the same amount of time as a single capacitor would, but the total current and magnetic field will be 2x higher. This means that the acceleration will be larger, and will last the same amount of time as a single capacitor.

      This is a good idea for combining the good effects of series and parallel. The best approach here would be to find out how many caps you want to use, then figure out what top speed you want and what the air resistance of the iron will be at that speed. Then you can calculate what force is needed from the magnetic field and for how long that force must be exerted, etc. If you don’t want to do all the calculations then trial-and-error would probably work pretty well, too. Whatever makes it go faster, just keep doing more of that until it doesn’t go faster any more.

    2. Qui,

      I made some poor assumptions in my previous comment. First, my explanation for the serial configuration is only valid if you are able double the voltage at the same time as putting two caps in serial. However, you only have the output of the flash circuit, so the voltage available to you doesn’t change (unless you put two flash circuits in parallel).

      Therefore, my statement about the serial configuration, assuming the same voltage as for a single cap, should state that the energy store drops by HALF because the equivalent capacitance is HALF. This means that the time to discharge stays the SAME as for a single cap.

      If you are dealing with the same voltage regardless of you configuration, then you are more limited in how you can change the discharge time without introducing other losses (e.g., like adding a series resistor, which is a bad idea). I think the best bet is just to stick with adding parallel capacitors, and purposefully buying caps with an ESR that you want – just make sure the caps you get can handle the current and voltage you’re dealing with.

      Also take note that the inductor created with the solenoid will have some resistance, and that will also limit the current that can be achieved. Resistance of coil = wireLength * wireResistivity / wireCrossArea. The coil’s inductance value will also play a part in what you can do. However, for simplicity you can probably just worry about the capacitors (and their voltage/current ratings) to try to achieve what you want.

  1. I’m not sure you are correct about complete discharge of the capacitor as the projectile reaches the center of your coil. shows a nice pic on the right hand side of the electromagnetic forces induced when current moves through a wire. what you probably need to worry about is melting or vaporizing the insulation, or wire (see rail guns), with too much current.


    1. Janni,

      Good comment, you’re digging into more of the deeper details.

      You are right about having to worry about the wire or insulation melting. A good rule of thumb is to keep the the current through the wire less than 500 A/(cm2) (the current per cross-sectional area of the wire). In the pictures in my post, it is obvious that the wire is very tiny, probably 28 AWG or worse. As a reference, 28 AWG has a cross-section area of 0.00081 cm2, so you would want to limit the current through 28 AWG wire to less than 0.4 A. Additionally, it would be a good idea to calculate the resistance of the wire (it will be relatively high) to find out the power dissipation and temperature rise in the wire to make sure the insulation is rated for the resulting temperature.

      Regarding the magnetic field, I think that Wikipedia image that you reference actually shows quite well that strongest (i.e., most concentrated) magnetic field is in the middle of the coil. The arrows in the figure show the direction of the magnetic field, not the direction of the force exterted on the iron projectile. Iron is special because when it comes close to a magnetic field it will align its own dipoles to attract to that magnetic field, so the direction of the magnetic field doesn’t effect the direction of the force on the iron.

      That means that as long as the iron projectile is NOT in the center of the wire coil, then it will be attracted to the center of the wire coil. That also means that as long as the projectile is moving in a straight line toward the center, it will keep acclerating (neglecting air resistance) until it reaches the center – after which the projectile would oscillate back and forth across the center point if the magenetic field was still present. That is why you would want the magnetic field to go away (i.e., have the capacitors discharged or disconnected) as soon as the projectile reaches the center so that it keeps moving forward instead of of oscillating and coming to a rest in the middle of the coil.

  2. The other thing to consider is that even by adding multiple capacitors in parallel to reduce the ESR and increase the current, there is still a physical limit to how high the current will go because the length of wire used for the windings has resistance. The current will be limited, no matter what, to I = V(capacitors) / R(wire).

  3. I been working on a coil gun for a bit now was woundering is it would be posable to make a Cascade” Voltage Multiplier with the capacitors and if so i might make the power mutch higer and may make the gun a low more powerfull i have exp making Electronic Circuits and was just woundering what kind of result this would make or if it would fry the coil lol after all a 4 stage would jack the voltage from 300 to like 1200 volts or better
    the Cascade” Voltage Multiplier would be like the one on the page i link and thank you for any help

    1. phillip,

      That method might have the effect you want, but only if you do it right. It is basically what the camera flash circuit is already doing, but just in a different way. You need to consider a few things first.

      The link you included effectively puts several capacitors in series with some “switches” (i.e., diodes) to raise the voltage up. Having all those capacitors in serial might (1) decrease the current too much, and (2) make the discharge take longer than you want. If you could get that high voltage and store it across a single capacitor, then that may be closer to what you want for a coil gun.

      A high voltage is important because it will more quickly generate a high current through the solenoid. A high current in the solenoid is important because the strength of the magnetic field is proportional to the current.

      The maximum current through the solenoid (of inductance value L and assuming a constant voltage) is Imax = V * dt / L. That means that in order to have a high current (yielding high magnetic field, high projectile acceleration, and high speed) you need to have a high voltage discharging for a “long” time. You don’t want it to take too long, though, because you want the magnetic field to stop once the projectile is in the middle of the solenoid (per the comments above).

      So you basically want a high voltage, which your link tells you how to make. You want a high current, so you need a capacitor that has a low effective series resistance (ESR). Even with the low ESR, it needs to take a while to discharge so that the projectile is accelerating for a longer time period, which means you need a capacitor that can store a lot of energy (i.e., high voltage and high capacitance value).

      It may be more worthwhile to attempt a mult-stage coil gun. This would effectively be multiple coil guns in a row, where each stage fires at the moment that the projectile is past the previous stage. I think this would probably be more effective than a mult-stage charge pump.

      This may be more of a response than you were looking for, but the conclusion really is this: the design is a trade-off between voltage level, current strength, discharge time, size of solenoid, size of capacitor, and projectile-to-solenoid starting distance. There are many combinations, and each person needs to figure out what they specifically want.

  4. If I were to use a higer voltage battery, would it charge faster when adding more capacitors? Would there be any difference in velocity by adding more capacitors?

    1. Christian,

      Yes, using a higher voltage should charge it faster. However, it could be bad to use a higher voltage if the voltage-boosting transformer isn’t rated for the voltage you want to use. You have to worry about both the current density in the transformer’s wire coils and the flux density in the transformer coil:

      1. You could melt the wire insulation and have a short if you surpass the rated current density.
      2. You will have decreased transformer efficiency when you use a higher input voltage. This is because the higher voltage will increase the current through the transformer windings, which gives an increased flux density in the core and lower efficiency.

      Look at the previous comments that I have answered (above) to find your answer to your question about the effects on velocity from adding more capacitors. Basically, changing the number of capacitors used in serial or in parallel will affect the time it takes to discharge (i.e., how long the projectile will continue to accelerate), the peak current through the coil gun solenoid (i.e., the magnetic field strength), and the distance from the solenoid where you should initially place your projectile (a function of the discharge time and magnetic field strength).

      In general, higher capacitor voltages will be better, as long as they are capable of discharging a significant amount of current for a relatively long time. This means very high capacitor voltage rating and a very high capacitance value (the combination of these to qualities usually = $$$).

      My recommendation is to get several capacitors with very small effective series resistance (ESR) and put them in series. However, this assumes you are generating a much higher voltage than would be used for a single capacitor since you have to charge all of the series capacitors together. If you put the capacitors in series, then you could charge them one at a time first, and then connect them in series. You will also need to beef up the inductor to handle the increased current through it.

      It is important to get parts that are rated to handle the voltage and current to which you will be subjecting them.

  5. Hey i plan to make a coil gun with five 200v 470 uF capacitors connected in parallel, is it going to work fine or i have to do something different? please reply….

    1. That should work fine. Keep two things particularly in mind: (1) you’ll have to experiment with changing the starting at-rest position of the projectile from the solenoid to find the optimal starting point, and (2) you need to make sure that the gauge of the wire that you’ve coiled up can handle the amount of current that the capacitors are going to be discharging.

      1. I got the wire from coil from old ac transformer, i cant tell what gauge it is, it is thick as about wire from earphones i mean without the insulation.

        1. The wire used in earphone is pretty small – not much current will be able to go through wire that small without ruining the wire. However, you can always try it out and see.

  6. Can you please provide me with a circuit or a link that provides a circuit explaining how to use the capacitor to meet the need of momentary high voltage and high current also. please provide it quickly.

  7. Hello, I’ve been wanting to build a coilgun and I had a bag with a camera circuit board and magnetic wire but I’ve lost it. I got a new camera circuit board and in my various tinkerings I’ve taken apart a vacuum cleaner motor. Could I actually use the magnetic wire from the inside of that considering its the same purpose?

    1. You could use the magnet wire from the vacuum, but with three words of caution from me:

      1. By removing the magnet wire from the motor, the insulation around it may get damaged. If it gets damaged, then you could end up with shorts between the wrappings yielding a nonfunctional and dangerous coil gun.
      2. I assume that the magnet wire from the motor is a pretty thick gauge relative to what I recommend in my post. If it is very thick, then that means you won’t be able to fit as many wrappings in the same volume, meaning that any additional wrappings you add to compensate for it will be further from the core and will be less effective.
      3. You might be able to make a more powerful coil gun with the thicker wire, but this will use a higher current through the solenoid. Higher current is harder to “instantly” turn on and off due to the stresses placed on components and the amount of time it can take for the current to ramp up to the higher value through the solenoid.

      Good luck!

  8. Ahh, I found the outer portion of the motor again and I can see visible nicks where I removed the driveshaft and the wire is a lot thicker than I remembered. Thanks though! What gauge of wire would you recommend? I seem to recall the coilgun I was planning on building ages ago saying 14 or 16 gauge.

    1. I think I used 22 or 26 gauge for mine, but that is still fairly thin. I would guess that the wire in the motor you opened is probably around 14 or 16 gauge. I would recommend staying within that range of 16 – 26 gauge because it will be easier to work with (thin = good) but also won’t have too high of a resistance (thick = good).

      It really depends on how powerful of a coil gun you want to make and if you will be able to supply enough current to justify the thicker wire. You want the wire to be as thin as possible while still being able to handle the current that you’ll put through it. The thinner the wire, the more dense the windings can be, and the more dense the magnetic field will be for a given amount of current. If you can supply a higher current then by all means go to a larger wire size.

  9. Hey, Thanks to your blog and help way back in April, I’ve been able to build a rather dinky little coilgun. I’m going to start experimenting with more powerful ones and better wires. Next stop, a railgun! (half joking)

  10. hey, as a project I am working on I have to create an’electro-magnetic launcher’ which is basically the coil gun your show here. I am having a problem with the setup, firstly the flash i took from the kodak disposable camer i used had 3 wires coming off of it. The one appeared to come off the transformer and so i used the other two wires instead; could that be the issue? secondly the circuit you show in the picture has a 1 M ohm resistor connected in it, is that being used? whenever I connect the circuit up I just get a spark, is that the cap short circuiting?
    thanks a million for this post

    1. The 1 M-ohm resistor was not used for the circuit functionally. If you look closely at the circuit in the picture you will see that the short white wire is not in the same row of holes as the resistor lead. The resistor is just there as a bleeder resistor so that if we charged up the big capacitors and then ended up not firing them off then we could connect the white wire to the resistor to slowly and safely remove the charge from the capacitors.

      All the wires you see in my circuit I added myself – the circuit didn’t have any to begin with, so I’m not 100% sure what your 3 wires are. I would suspect that your three wires are two for the camera’s shutter trigger and one for the flash trigger plate (see first diagram at If this is true, then you don’t need any of those three wires. All you really need do to is to:

      • Remove the flash bulb assembly.
      • Solder wires to the leads of the capacitor.
      • On one of the new wires, connect one of the solenoid’s wires.
      • On the other new wire, connect a pushbutton switch.
      • On the other side of the pushbutton switch, connect the solenoid’s second wire.
      • Use the camera’s built-in “charge flash” button to charge up the capacitor.

      The circuit basically becomes:

                   pushbutton           flash circuit board
                     switch            _____________________
                                      |                     |
             __________/ _____________|_                    |
       ()))))_________________________|_() Big capacitor    |
      solenoid                        |                     |
                                      |                     |

      Make sense?

  11. Hey Mike,

    thanks for writing this up, but I’m wondering, would it be possible to chain the coils together?
    e.g. (for now I’m doing it the easy way and assume the speed doubles with each coil) first coil discharges the first set of capacitators, second set is in some way of delay (opto-interuptors, timed delay, etc. – that’s still being figured out), then discharges, and so forth.

    Thanks in advance!

    1. Hi Rob,

      Yes, you can do exactly what you said, and many people do. The real trick is figuring out what the delay between each coil should be. You mentioned both of the approaches that I would suggest: first, it is probably easiest to experiment and find the approximate delays by trial-and-error; second, a more advanced technique is to use opto-interruptors to trigger each subsequent coil after the projectile has passed the previous coil. In the opto-interruptor case, you would need the “interrupted” signal to get latched because the the opto-interruptor will get triggered for only a brief amount of time.

      Go look at my follow-up post ( to see how I used opto-interruptors to determine the projectile speed – you can use that to hopefully get some ideas.

  12. We have a question, because the coil gun doesn’t shoot very well. What diameter did you use? How long was the coil on the pen shaft. And the last question how long was the wire?

    Thank you in advance for your answer,

    1. Sorry for the very late response. I believe I answered one or two of these questions via email to your lab partner Madelon, but I’ll go over them again in hopes that it will help out.

      The diameter of the BB’s or the steel projectile is about 5 – 6 mm. The diameter of the tube is a standard, cheap, plastic Bic or Papermate pen casing – around 8 mm.

      The wire was wound on about 1 inch (2.5 centimeters) of the pen shaft.

      The wire is wrapped around the pen several hundred times. It is about 10 layers thick, with about 50 wrappings per layer. This would give a total length of probably around 500 inches, or 12.5 – 13 meters.

  13. Hi !
    Thanks a lot for your useful post, firstly.
    I’m an electrical engineering student. I and a couple of friends are trying to make a coil gun for a part of a robot project. There are two things very important for us; the speed of the projectile (i think we can handle it by wrapping a good and effective coil) and the charge time of the capacitor (it should be fully-charged in 5 seconds or less). We have a disposable camera circuit, as well. As far as i know the charge time is 8 seconds with a 1,5V battery in this circuit. We tried to charge it with higher voltage to make shorter the time but it didn’t work above 4V. I think the transformer in it is not available for that voltage values. I wonder if it is possible to change just the transformer without touching the rest of the circuit with a more suitable one and use a 9v battery for example, so would the capacitor be charged faster in that way ? And if we wired a parallel capacitor, would it take more time to charge both of them with the same voltage ?
    Thanks in advance

Leave a Reply

Your email address will not be published. Required fields are marked *