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 14.2k 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.
    • G
      grant2258 Banned
      last edited by

      Well I got a few Arduinos and parts lying about might be able to rustle something up unless i need the guns electronics for something. Will check it out for sure when more details are available.

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

        Hi Guys, just a quick update. Build Guide is now available...

        cyperghostC J 3 Replies Last reply Reply Quote 4
        • cyperghostC
          cyperghost @samco
          last edited by cyperghost

          @samco The costs are little imho
          20$ the gun
          25$ the IR camera
          10$ the itsybitsy
          2.5$ for some hardware

          1 Reply Last reply Reply Quote 0
          • H
            hhromic
            last edited by

            @samco congratulations on your project!
            This is indeed very well executed, spot-on and seems to give a very professional result. I think everyone will appreciate the simplicity and openness of your design.

            Kudos!

            1 Reply Last reply Reply Quote 0
            • J
              janderclander14 @samco
              last edited by

              @samco Thanks! That's certainly professional and straigtforward.
              I have several questions, if you don't mind.
              I assume any small arduino, like the nano or the micro, would work, don't they?
              Also, do you think it would be possible to use a Namco Guncon 2 instead of 1? It already uses a usb cable and has extra buttons and a directional pad at the back. This would avoid the need for building the calibration button. I assume that the arduino code can be extended to add support for additional buttons (since the arduino has several input pins available) but I'm unsure whether a Guncon2 (which is smaller as has more internals for the extra hardware) would fit the arduino and the camera.
              The IR camera you use can detect up to 4 IR lights. Do you think tracking could be improved by using additional leds around the screen? Or even avoiding the need for recalibration?
              And, finally, I understant that the arduino is detected in Retropie as a standard mouse, so that it can work as is in all emulations that use mouse input as lightgun, is this the case?

              cyperghostC samcoS 2 Replies Last reply Reply Quote 0
              • cyperghostC
                cyperghost @janderclander14
                last edited by cyperghost

                @janderclander14 said in SAMCO Arduino Powered IR Light Gun:

                I assume any small arduino, like the nano or the micro, would work, don't they?

                The micro yes ... then nano no.
                You need a HID compatible device.
                If I'm wrong then please correct me.

                And, finally, I understant that the arduino is detected in Retropie as a standard mouse, so that it can work as is in all emulations that use mouse input as lightgun, is this the case?

                yes

                If you consider the costs ... you are equal to a DolphinBar (and if you already have a wiimote you are cheaper)

                10-15$ the Dolphin bar
                25$ the Wiimote
                20$ a gun "case"

                About the namco guns.... they are very cheap in Japan nowadays.
                Take a look here

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

                  @janderclander14

                  @janderclander14 said in SAMCO Arduino Powered IR Light Gun:

                  @samco Thanks! That's certainly professional and straigtforward.

                  Thanks!

                  I assume any small arduino, like the nano or the micro, would work, don't they?

                  Yeah Like @cyperghost said any HID compatable board will work.

                  Also, do you think it would be possible to use a Namco Guncon 2 instead of 1? It already uses a usb cable and has extra buttons and a directional pad at the back. This would avoid the need for building the calibration button. I assume that the arduino code can be extended to add support for additional buttons (since the arduino has several input pins available) but I'm unsure whether a Guncon2 (which is smaller as has more internals for the extra hardware) would fit the arduino and the camera.

                  Yeah, I've already looked into this (most likely going to be my next project). You could have the mouse and keyboard libraries loaded on, so some buttons could be keyboard strokes and some some mouse buttons. A little more tricky due to how the buttons are configured but I'm hoping to work away around this. And yes the camera fits.

                  The IR camera you use can detect up to 4 IR lights. Do you think tracking could be improved by using additional leds around the screen? Or even avoiding the need for recalibration?

                  I have seen other projects that use 4 leds, but haven't looked into it to much yet. Also something I'm considering.

                  And, finally, I understant that the arduino is detected in Retropie as a standard mouse, so that it can work as is in all emulations that use mouse input as lightgun, is this the case?

                  Yes, but only a few do at this stage. No PSX yet. But I keep hearing rumours that this isn't too far off.

                  Cheers Sam

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

                    @samco Do you think you can rewrite this to circuit-python?
                    Then you will make full use of the M0 board. You know it has a python interpreter on board ;)

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

                      @cyperghost I don't actually know python yet :) but from the little research I've done C++ actually runs faster than circuit-python (can anyone confirm this?). I am interested in circuit-python thou, definitely on my "to learn" list.

                      1 Reply Last reply Reply Quote 0
                      • G
                        grant2258 Banned
                        last edited by

                        c++ will be faster depending on what your doing speed might no matter that much in the big picture.

                        1 Reply Last reply Reply Quote 0
                        • cyperghostC
                          cyperghost
                          last edited by cyperghost

                          @samco @grant2258 I think you're both on the wrong track. The Adafruit M0 controller has a file system enabled. So you just plug it in to any computer and it will show as a storage device. This device holds a file main.py where you immedialty can alter program code. So in fact you don't need an IDE ... just copy and paste code to that storage device and you are fine.
                          Speed does not matter in this case (imho) the camera does most of the work and the calculations done by C code or python is not really difficult.
                          Maybe I'm wrong .... but with the M0 you can even play wave-files ;) I think it is a feature that isn't usefull on a light-gun system (ironic!)

                          1 Reply Last reply Reply Quote 0
                          • J
                            janderclander14 @samco
                            last edited by

                            @samco I was told from another site that the author of this related project:

                            https://retropie.org.uk/forum/topic/22531/xwiigun-a-line-of-sight-accurate-wii-remote-lightgun-hack

                            may be willing to offer his automatic calibration code to be integrated into your project. I've personaly tested it and self-calibration and tracking is excellent, but support for mouse emulation in Retroarch emulators is quite limited. He should have posted into your git's issues.

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

                              @janderclander14 Yeah, he messaged me in GitHub. Thanks for linking us up!

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

                                Hey Guys, not exactly RetroPie related (unless PSX Beetle & Beetle Saturn works with the new RPI 4 fingers crossed) but if your interested I have a setup guide for the SAMCO working on PSX Beetle & Beetle Saturn on RetroArch in Windows.

                                By the way, if any does know if PSX/Saturn Beetle works on the new RPI 4, I'd love to know?

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

                                  Hi Guys,

                                  Just another quick vid showing the SAMCO Light Gun in action...

                                  cyperghostC 1 Reply Last reply Reply Quote 3
                                  • 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
                                            • 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.