The reviews on this site are the text versions of the videos on my YouTube channel. The text based reviews use (if at all) very little pictures. Please follow the link to the corresponding video in order to see in game graphics.
In episode 215 I showed the best currently available virtual reality guns. In the end I quickly explained how to build a cheap yet capable VR gun yourself. Today I am proofing the feasibility by building a nice VR gun for just about 20 USD. Along the way occasionally I will take the opportunity to refer to better but more costly part alternatives.
As a template I used a Glock G18 foam dart gun for which I paid 4 USD. The particular gun I have been using is fed via a removable magazine with plastic cartridges, which contain foam projectiles. When cocking the gun, empty casings are being ejected. I got rid off most of the internals, just leaving the trigger and the magazine eject button.
For the trigger I glued in a miniature micro switch, which has just enough return force, so that I won't have to use a counter spring. I obtained three of these for 1.2 USD. You might want considering to invest into a quality switch instead, that will last you for years. My favorite micro switch manufacturers are Cherry, which is now ZF Friedrichshafen and Honeywell who owns the original micro switch trademark.
The force feedback in my gun is realized via a 12 V linear solenoid with a pull force between 2 and 4 kg. I paid 6.6 USD for it. Before using it, I tested how much current it draws in order to scale the rest of the internals. Generally rotary solenoids are stronger than linear ones, but those require a more sophisticated actuator and are harder to come by. Namco uses linear solenoids made by TDS and rotary solenoids made by Takano for their arcade guns. Suddenly providing to and removing power from a coil will result in voltage spikes. To manage them people use so-called flyback diodes or resistors. I use a 3 A, 50 V rectifier diode. I purchased 50 units for 1.3 USD. The negative side of the diode has to be connected to the input of the solenoid and the positive side to the solenoid output.
To make room for the solenoid I cut the gun shell with an axial grinder, filed it down and sanded it. I wanted to avoid removing too much material and therefore I went step by step. I tried to spot potential weak points and strengthen them. To do so I used glue, scrap metal gained from a jar lid and chip wood. You can add material by applying two compounds putty and epoxy paste. One example is the casing eject hole. I laid out a general shape with tape into which I poured epoxy. After curing I removed the tape and sanded it down to shape. Because I left a residual gap, I made corrections with Milliput, which is a slowly curing two compounds putty. I wanted the controller to be as user serviceable as possible and therefore I decided to have the solenoid being removable, yet firmly held to account for its high actuation force. I formed a bed out of two compounds putty and made a back plate from chip wood. To increase structural integrity even more, I filled up some hollow spaces with additional Milliput.
To attach the vive tracker I purchased a simple 1/4 inch camera thumb screw for 4 USD. Because it's made of plastic it was easy for me to sand it down to make it fit into the gun. I cut a groove into its top, so that I can turn it with a flat head screwdriver. To electronically connect the pogo pins of the Vive tracker I bought 3.5 mm pitch contact pans. I was able to purchase 20 units for 14.5 USD of which I glued two on a wooden ice cream stick. I trimmed down the stick and glued it to one side of the shell halves. That way the contacts are held firmly enough, but the gun can still be opened. I painted the finished assembly with black Tamiya model paint, which I had left over from another project.
I wired the created pogo pin socket to PCB through-hole rubber dome buttons, which I accompanied with plastic caps. 20 buttons coasted me 2.4 USD and 60 caps 1 USD. For one button I reused the original magazine eject button assembly, which I had to slightly file down. Personally I like to place buttons at the thumb rest and grip, which enables me to operate the gun one handedly. For two handed operation I like heel buttons very much. The quality of rubber dome buttons varies greatly, if they are bought for the lowest cost possible. To people who want to build something very good I would recommend the ones made by Alps, which still can be purchased new old stock (model number SKEYAHA010).
Fitting in the solenoid at a good position relative to the slide mechanism was more challenging than I have hoped. If the resting position is too far in the front, the solenoid won't reliably pick up the plunger or struggle to take it while pointing the gun down. If the resting position is too far back, travel is wasted. If the solenoid is rotated at an ill suited angle, the plunger will bind at the solenoid cavity wall and cause friction. Especially on cheaper solenoids the plunger stop socket might be inserted crooked by the factory. I was able to beat mine straight with a metal rod and a hammer.
As I removed the original slide stop mechanism I was required to add a replacement. To do so I cut a piece from the retaining ring from the solenoid plunger, drilled a hole in it and screwed it into a thread which I glued onto the bottom rail of the Glock.
For the force feedback control I went with an Atmel ATtiny85 based Digispark clone board which I was able to acquire for 2.4 USD a piece. I severely detest clone boards and I urge you to just go for original hardware, but for the low cost theme of this video I made the sacrifice. If space and cost are not a concern I strongly recommend the Italian made Arduino micro or nano boards, which are ATmega32U4 based. For this project I ported my existing force feedback code of episode 214 to the Digispark board, which required a rewrite of the timing portion. I kept the single shot and auto fire selector portion in the code intact and mapped it to pin 2, but for this build I chose to permanently set the gun to auto fire. For the case a user wants to use a bi-stable rotary solenoid, the whole pole swapping portion of the code was preserved in the port. As always I made the code available on my website.
The Digispark board can take up to 35 V at its power input pin and thus can be supplied directly by the same source as the solenoid. If you fear the voltage spikes, which are introduced due to switching the coil, you can solder a 7 V step down power regulator between the power supply and the micro controller. I just had a 5 V unit laying around, for which I paid 80 cents. It still had a princely voltage of 5.13 V at its output and thus I refused to directly connect it to the 5 V pad of the Digispark. It is out of specification to connect a 5 V regulator to the voltage input pad of the Digispark, but I ran with it, because I had no spares for the micro controller in case something went wrong.
As the switching component I went with a decoupled D4184 MOSFET board, which I bought for 50 cents. My personal favorite for such applications are solid state relays, but these are considerably more expensive. Another comparably low cost alternative to SSRs are Reed relays, but these are hard to come by when rated for high currents. The MOSFET boards are connected differently than the SSRs I am usually using. The output line of the load is switched and not the input. Electronically both, the Vive trigger button and the Digispark trigger input pin have to connect to the trigger switch. Those two lines would disturb each other if connected directly and therefore I led the Digispark trigger line over a small signal diode, before soldering it to the trigger switch. Also disabling reverse current to the Tracker by a second diode would be cleaner, but is not strictly necessary in this built. I used a single 1N4001, but to save money one would use the same item as purchased for the rectifier diode when inserting the solenoid.
I glued the Digispark board into the magazine channel onto a wall so that the USB micro B socket is close to the heel, which facilitates reprogramming to me, in case there should ever be a need for it. I attached the other boards solely with double sided tape, as those won't endure much strain at all. Even with all components set, theoretically there would be sufficient space to house a single 18650 cell. Such cells typically have a capacity of 2200 to 2500 mAh. In a steady state the 12 V solenoid draws 2.55 A. The capacity would enable a runtime of 18 minutes of continuous use. As I set up recoil with 100 ms pulses this would suffice for approximately 10'000 shots. Personally I decided against an internal battery and went the wired route. In order to mitigate wire strain I attached a DC barrel socket, of which I acquired 10 pieces for 85 cents, pretty far down the magazine cavity. I soldered a compatible DC barrel plug to a power supply which I have found in the electronics trash. I won't put a figure for the power supply onto the total bill, as I would encourage you to buy a solenoid which is rated for a voltage compatible with a power supply from your existing stock. Of course you can regulate the available voltage to the desired value. Here is an example: Notebook power supplies usually deliver 19.5 V. Using an 80 cents step down or step up regulator will bring you exactly to the desired voltage without breaking the bank. I Velcro strapped the power lead along the HMD tether to a DC barrel socket which I can quickly plug and unplug to a wire which I attach to my arm via rubber bands.
I am very pleased about how this controller turned out. Without compromising the pistol form factor or the weight of the gun, I was able to add a very hefty force feedback. I hope the fact that I was able to build it myself for less than 20 USD will inspire people to build fabulous VR guns themselves. This in turn could pressure the current VR gun vendors to step down from their high horses and lower their insane margins.
This is the schematic diagram of my circuit. It uses an Atmel ATtiny85 based Digispark board which switches a decoupled D4184 MOSFET board to control the 12 V solenoid of a VR gun controller.
(respect the copyrigth)
Parts: D1: 1N5400 flyback diode; D2 - D3: 1N5401 small signal diode; S1: trigger switch (e.g. ZF Friedrichshafen AG DB2C-A1RC); S2: SPDT switch; S3 - S5: momentary rubber dome button switches (e.g. Alps AlpineSKEYAHA010)