RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    SAMCO Arduino Powered IR Light Gun

    Scheduled Pinned Locked Moved Ideas and Development
    light gunmamediyarduino
    52 Posts 9 Posters 13.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cyperghostC
      cyperghost @samco
      last edited by

      @samco I've everything in place so I might rebuild your project ;)
      But don't expect something in the next few weeks.
      Thank you for sharing

      samcoS 1 Reply Last reply Reply Quote 0
      • samcoS
        samco @cyperghost
        last edited by

        @cyperghost Nice! let me know how ya go :)

        1 Reply Last reply Reply Quote 0
        • samcoS
          samco
          last edited by

          Hi Guys, this is just a quick update to let you know I've added a new sketch to the GitHub for anyone who wants to add a foot pedal to their Samco. It's really simple just grab any momentary foot switch (I used one that was for a tattoo gun there's heap of these on eBay) and solder it to the broken out Alt pins on the PCB (I knew I broken out an extra pin for a reason :) ). Basically all it does is gives you an extra right mouse button but it's great for dual gun mode in Time Crisis II on PCSX2 and it's just cool to have a foot switch. Attached an image so you can see how it all fits.

          Also updated the old code slightly so it releases the mouse in pause mode so you can use your normal mouse again when your Samco's paused.

          Cheers.

          IMG_8209.JPG

          1 Reply Last reply Reply Quote 0
          • samcoS
            samco
            last edited by

            IMG_1398.JPG

            1 Reply Last reply Reply Quote 0
            • M
              mrbee
              last edited by

              nice!! i have been looking in to making a lightgun mod.

              my idea was basically one of these https://s.click.aliexpress.com/e/mdDVIbq0

              then rewire it so that the charging port is at the base of the gun and the buttons then are wired to the guns switches and buttons.

              in the model 2 emulator i have a trackball keyboard and wireless airmouse and they seem to auto assign and be controlled independently so you can have two players use 2 mice!

              but the issue i have is that the pointer wont leave the screen and so if you point the gun back at the monitor after pointing away from the monitor the calibration is off. its just a case of moving the pointer centre on the opposite side. so its only good providing that you stay pointed at the screen for heated gun slingin sessions.

              i just ordered one of the samco boards so am looking forward to getting one and working.

              i wonder if can work in the gcon 2 also?
              or the sega saturn gun (this is the main gun id like to mod).

              my main question is when you point away from the screen is the tracking all ok or do you have to recalibrate like an air mouse?

              also. do you need sensors around the monitor?

              thanks

              1 Reply Last reply Reply Quote 0
              • samcoS
                samco
                last edited by

                Thanks man, yeah I had a bit of a play around with those wireless pointers but the one I had the calibration would constantly go out was pretty much unplayable. In my build the tracking is done by the leds so once you're calibrated you continue to get accurate tracking where ever you point it.

                I am looking at making a GunCon2 version hopefully it's not too far off. I haven't looked into Sega Saturn yet but definitely will now.

                As far as sensors go it's just the 2 leds on top of the screen or you can use aftermarket dolphin bar like this one https://www.aliexpress.com/item/32963414424.html?spm=a2g0s.9042311.0.0.7a8e4c4daLPEoQ.

                Have fun building your light gun would love to know how ya go :)

                1 Reply Last reply Reply Quote 1
                • M
                  mrbee
                  last edited by

                  Thanks for the reply. I bought two samco boards just incase I mess one up.
                  The ultimarc ones are very expensive for what they are so this is a nice alternative.

                  I wonder if its possible just to have the samco just fit inside of the sega saturn gun So you don't have to change anything? (the ultimarc ones are modelled after the saturn gun, and its the same gun sega used for virtua cop etc).

                  I will eventually build an arcade for myself in a year or two (i build them for my shop and for customers but at home this is a totally different story lol).
                  Ive always disliked visible sensor bars and perhaps it is possible when having an arcade machine the monitor has a glass panel infront of it that usually is black around the edges (the bezel).

                  But it could be possible i think to cover the glass with a privacy screen (that you use to darken car windows). Perhaps then the leds could sit behind the glass and still be seen by the sensor.
                  I will have to try this out. It would mean that you could have an arcade without little sensors visible. I think it would work as most remotes etc have a darkened transparent plastic infront of them (much like a wii remote or sensor bar has)

                  1 Reply Last reply Reply Quote 0
                  • samcoS
                    samco
                    last edited by

                    No worries man, I searched a few videos on YouTube so I could see the insides of a VirtuaGun and it looks like the PCB's are quite similar so would be interested to know if a SAMCO does fit in one. Let me know how ya go.

                    Yeah, a hidden sensor bar would be great even if you took an aliexpress sensor bar and kind of inset it in your cabinet so it's not so obvious would be cool :)

                    M 1 Reply Last reply Reply Quote 1
                    • M
                      mrbee @samco
                      last edited by

                      @samco Ok i finally managed to order the stuff i need (got it all from the pi hut as am in the UK)

                      Here are the UK links for the parts.

                      IR CAMERA
                      https://thepihut.com/products/ir-positioning-camera-for-arduino?variant=27741017617

                      RESISTORS
                      https://thepihut.com/products/adafruit-through-hole-resistors-100k-ohm-5-1-4w-pack-of-25

                      IR LED
                      https://thepihut.com/products/adafruit-super-bright-5mm-ir-led-940nm

                      (OR THE ALIEXPRESS USB SENSOR)
                      https://www.aliexpress.com/item/32873063325.html?spm=a2g0s.9042311.0.0.78f74c4drfqie7

                      ITSYBITSY
                      https://thepihut.com/products/adafruit-itsybitsy-m0-express-for-circuitpython-arduino-ide-ada3727

                      If I manage to get some time during christmas I will look forward to building it!

                      I have seen a lightgun on kickstarter called the Sinden Lightgun but I always have my doubts with kickstarter (Shenmue 3 been a big let-down for PC for me, still haven't received anything and all I have so far is an Epic store code through email!) so I wonder if that lightgun would fail to deliver in the end and would be any better than this.

                      Because this has the advantage of costing less, is a nice hobby build to do also.
                      I bought 2 sets from you because I am looking to do a gcon and also a virtua gun one so I will post here my progress with them!

                      1 Reply Last reply Reply Quote 0
                      • samcoS
                        samco
                        last edited by

                        @mrbee That's awesome dude! You might need to get some other resistors thou I just had a look at your link it looks like your've bought 100K ohm instead of 100 ohm?

                        Yeah, I'm super curious to see how the Sinden goes as well. But I'll never get over trying to build stuff like this myself :)

                        Sorry for the late replay, I actually only saw this post because I've just put a new video and was about to post it here. It's a test sketch for the light gun so you can test your setup before uploading the final code.

                        M 1 Reply Last reply Reply Quote 0
                        • M
                          mrbee
                          last edited by

                          thanks for the heads up! just ordered 100 ohm resistors! i would have gone off my head not realising this error!

                          i watched the new video and will follow this when calibrating etc! loving the updates and responses here. am looking to build this on sunday!
                          will send some pics here hopefully of it going in the virtua gun also!

                          1 Reply Last reply Reply Quote 0
                          • M
                            mrbee @samco
                            last edited by mrbee

                            @samco Ok, I built it am just getting the hang of trying to load the software into it now.

                            1 Reply Last reply Reply Quote 0
                            • M
                              mrbee
                              last edited by

                              I downloaded the arduino ide software, i couldnt find the board so i went on the website to get the adafruit itsybitsy m0 board in the board manager..

                              I selected it, i select COM 8 as the only showing port for it.
                              I click upload (also tried verify) and i get this -

                              Arduino: 1.8.10 (Windows 10), Board: "Adafruit ItsyBitsy M0, Arduino, Off"

                              exec: "/bin/arm-none-eabi-g++": file does not exist
                              Error compiling for board Adafruit ItsyBitsy M0.

                              What have I done wrong?

                              1 Reply Last reply Reply Quote 0
                              • samcoS
                                samco
                                last edited by

                                @mrbee hi mate, it sounds like you need to install SAMD support (it's at the top top this page here but easy to miss https://learn.adafruit.com/introducing-itsy-bitsy-m0/using-with-arduino-ide) try going back into your board manager and search for Arduino SAMD and install the first one you see (not the beta) and try upload again. Hopefully that'll fix it :)

                                M 1 Reply Last reply Reply Quote 1
                                • M
                                  mrbee @samco
                                  last edited by mrbee

                                  @samco You were correct! I had to delete the userdata folder of the arduino for it to work, doing this it got to the step where windows says to install the driver. It didnt do this before!

                                  I've now got it running!!!
                                  You are simply amazing for getting this all made and coded its perfect!!

                                  1 Reply Last reply Reply Quote 0
                                  • M
                                    mrbee
                                    last edited by mrbee

                                    Virtua Gun Opened Picture

                                    This is the Virtua Gun opened. The board is about 1cm bigger than the gcon.
                                    The plastic of mine split at the screw holes and the trigger cover had shattered off so i had to glue repair it!
                                    So be careful opening the virtua guns. Plastic seems to be far more brittle than the g con.

                                    I think i should be able to put your boards inside if but just fixing it inside with a gluegun.

                                    If you ever made boards for these you could call it the Samcop lol (Virtua Cop being the most popular use of this gun).

                                    Your samco boards are millimeter perfect and i messed up the soldering a few times (wires soldered on the underside instead of the top etc) so i had to desolder a few times and each of the contacts on the board are perfect and no worry of them accidentally prying off of the board so perfect for people who are going to give this a go without too much soldering experience.

                                    I like also that it uses the existing buttons etc as much as possible.
                                    Excellent am super happy with the boards and also fast replies helping me.
                                    cheers man

                                    1 Reply Last reply Reply Quote 0
                                    • samcoS
                                      samco
                                      last edited by

                                      @mrbee that's awesome dude!! Glad you like it :)

                                      M 1 Reply Last reply Reply Quote 0
                                      • M
                                        mrbee @samco
                                        last edited by

                                        @samco oh no im actually having some trouble with it.

                                        Ok so in work where i tested it on the desktop on a 4:3 19" monitor it works ok, although the mouse pointer is a bit jumpy.

                                        But getting home all of my displays are widescreen. The resolution is set on the script same as my monitors (1920x1080) but when using the gun... the mouse pointer will only work along the left side of the screen and end up having as the middle of the screen being like the right side of the screen to the gun if you get me.

                                        I tried all sorts, of distance from the monitor and now the axis seems to be reversed where if you move the gun up the mouse pointer goes down and same for left and right is reversed.
                                        It goes back to normal then but this makes it only work on one side of the screen!

                                        So not sure what to do to fix this.

                                        samcoS 1 Reply Last reply Reply Quote 0
                                        • samcoS
                                          samco @mrbee
                                          last edited by

                                          @mrbee the only thing I can think that would be causing this is some sort IR interference. The camera will pick up any IR Light including sunlight so if you have window behind your monitor or even something that can reflex it, it might be picking it up a messing with the code. You can test this by running through my trouble shooting vid which will show all the light points the camera is picking up. Let us know how ya go.

                                          M 1 Reply Last reply Reply Quote 0
                                          • M
                                            mrbee
                                            last edited by mrbee

                                            I cant seem to delete my posts here so having to edit them, had some trouble with processing3 crashing but its all ok now!

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.