Articles, Blog

SAMCO Arduino Powered IR Light Gun – Build Guide


hi guys so this is going to be hopefully
a fairly comprehensive build guide for the SAMCO Arduino powered infared
light gun so first thing i’m just going to run you through the parts that you’ll
need for the project then I’ll show you a quick schematic then the actual build
guide and then how to upload your code so let’s get into it
firstly you will need a DFRobot IR positioning camera a microcontroller
with built-in HID support I’m using an Adafruit ItsyBitsy M0 2 infrared LEDs 2 100 ohm resistors an old USB cable I’ve just used an old charging cable and cut the
end off and a fairly long USB micro cable you also need a few tools so
you’ll need some wire cutters a phillips screwdriver some solder I recommend
60/40 and a soldering iron so that’s the absolute basics but if you want to make
your life a little bit easier you can get yourself one of these this is a
little PCB board that I’ve created to just fit everything in nicely and just
replace the insides of the namco light gun with as little fuss as possible I’ve
got a frits and guides up of this on my github and also have a few of these on
my eBay if you want to purchase them and so if you use the PCB you also just need
a couple of extra things a little bit of extra wire a thumbtack this push button
which you can get from Adafruit a drill and a 3.5 millimeter drill bit alright
so let’s get into the schematic so here we have our schematic as you can see
it’s a fairly simple design we just have the DFRobot IR positioning camera
running off I2C I’ve powered mine pin five but you can just as easily
power it off three volts then the rest of it’s basically just a whole lot of
switches so I have lift mouse button calibration pin right mouse button
middle mouse button and then I’ve also broken out another pin just in case you
want to add an LED or something like that but I don’t actually use that in my
code also just a quick note if you do want to use an eighteen Atmega 32U4 board you’ll just have to change these two pins because they are shared
by the i2c but if you’re using the m0 then you don’t have to worry about it
and then we also just have to improve LEDs running off USB so that’s about
that let’s get into the build guide okay so firstly obviously we’ll have to open
up our NAMCO light gun with just these few screws here once we have it opened we
can see what’s going on inside so we just need to trim these to read and
white there and then there’s two little black ones up at the top that you’ll
have to trim as well once you’ve done that we can just lift out all the old
circuitry we don’t actually need any of this anymore so you can dispose of that
and then we just want to take out little buttons here so we just pull out that
one and then pull it out this other one and that’ll just make it easier when
we’re soldering everything together okay so just before we solder everything
together we just want to make a little hole for our calibration button right
here so how we do that is we grab the little calibration part of our PCB and
as you can see it’s got a little hole in between those for soldering points there
so we just have to flip that over and we push that into the corner here and
then we use it a thumbtack just to mark the center of that button which is what
we’ll use to as a point for drilling the hole for a calibration button so once
this much simply grab your drill and just drill a little calibration button
hole all right so now we have to just solder
everything together so it made this little guide here which will hopefully
help it’s fairly self-explanatory just one thing you have to be a little bit
careful with is what side you solder on so if you can see in the diagram there’s
some dotted lines which mean insert your wires from the unprinted side of the
board and then the solid lines mean into it your wires to the printed side of the
board which you hopefully see here so here we have it it’s all soldered
together once you’ve got something looking pretty similar to this all we
have to do is populate it back into our gun like so just be a little bit careful
I noticed when I filming this my IR positioning camera moved around a bit
just make sure the little bit that says top in the little white circle is facing
the top of the gun not like mine does there so if you’ve got that all right
then all we need to do now is upload our code okay so just a couple of things
we’ll need to upload our code firstly you will need the do we know IDE
software if you haven’t have already got that installed I’ll leave a link below
to where to get this from once its installed you’ll also need to install
the libraries from Adafruit for your super team zero board so once again I’ll
leave a link to that it’s fairly self-explanatory so I went going to that
too much and then the last thing you’ll need is the actual code which you can
get from here this is my github page so simply go into I like gun download the
file once that’s downloaded all we need to do is unzip it so just go into
downloads unzip that and then grab this folder
here then we just simply need to drop that
into a do we know libraries which on a Mac is under Arduino libraries and
documents once that’s all done we can open up our code and the arduino ide so
here it is here is the code it’s almost ready to go you only have to do one
small tweak which is scroll down to here and just change this to the resolution
of your screen or the screen that you want to use your gun on mine’s already
set up so I’ve got my gun plugged in and my two LEDs stuck to the top of my
screen so now all I have to do is make sure that I’m using the correct borden
the itsy-bitsy m0 make sure that I’m on the right port and then simply click
upload so this will compile the sketch make sure there’s no errors as you can
see down the bottom there and then it will start to upload sure only take a
couple of seconds oh yeah if you’re on a Mac you’ll probably get this little
notice come up here don’t worry about that you can just close that all right
so now what we have to do is open a serial monitor just be aware if you’re
doing this on windows your mouse may have been taken over by the light gun
but you can still open your serial monitor by pressing control shift M so
once you’ve got that open you just want to move back from your screen a bit
until you start seeing the raw numbers changing as you can see here and now we
can give it a test so if we press the calibration button I’m up into the top
left to pull the trigger aim to the bottom right and pull the trigger
a mouse should be working you can check there the mouse buttons are working move
it around you should be able to tilt it a little bit should be able
pause it by pressing the calibration button I push the calibration button
again and then pull the trigger you should be able to recalibrate and if
that’s all working congratulations you have your very own SAMCO Arduino powered
infrared light gun I do plan to make a few more videos kind of setup guides to
show you how to get these working on your favorite emulators so if you don’t
want to miss out on that please subscribe if you enjoyed this video
please give us a like if you have any questions I just put them in the
comments below and I’ll try and get back to you once again thanks for watching
and I’ll see you next time thanks a lot bye

9 thoughts on “SAMCO Arduino Powered IR Light Gun – Build Guide

  1. Does it have to be a DF Robot IR camera? The only IR cameras I can get are the E18-D80NK and E18-D50NK (they both have three wires instead of four)

  2. Really cool project – funnily enough I've done basically exactly the same thing using the same camera, however I tried to use a series of 4 LEDs flashed in series like the original arcade machines use.

  3. Great project Sam. Does your gun work similarly to a Wii Remote and Dolphin bar? Does the Samco have better compatibility? I want to get into some old lightgun games but trying to figure out if I should risk trying to put this together seeing I'm terrible at soldering.

Leave a Reply

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