The NEW Build Your Own Arcade Controls

Main => Lightguns => Topic started by: samco on June 17, 2019, 09:23:33 am

Title: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 17, 2019, 09:23:33 am
Hi Guys,

I'm currently working on an Arduino powered light gun for use use on Windows & RetroPie have a look at the demo here.

https://youtu.be/ygBHzShNIPg (https://youtu.be/ygBHzShNIPg)

Let us know what ya think, anyone keen to have a crack at building this? I hope to have a build guide up soon.


Cheers Sam
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on June 17, 2019, 07:59:49 pm
That's really impressive man.  We are starting to move away from ir-based systems due to the issues that usually revolve around them, but a diy gun is a really good idea.  I look forward to the guide. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: thet0ast3r on June 18, 2019, 05:28:35 am
Nice work.
I am assuming you are using the DFRobot IR positional camera, that returns positions of the 4 brightest infrared points?
One problem I saw with that approach was, that the field of view is pretty narrow ( almost as narrow as the wiimote`s field of view ).
The result of your work should be pretty comparable with the aimtrak lightguns, probably even in cost.

Don`t get me wrong, I really like it; however when I see an approach I almost have to point out what I think could be problems...
 :laugh:
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 18, 2019, 07:16:39 am
Nice work.
I am assuming you are using the DFRobot IR positional camera, that returns positions of the 4 brightest infrared points?
One problem I saw with that approach was, that the field of view is pretty narrow ( almost as narrow as the wiimote`s field of view ).
The result of your work should be pretty comparable with the aimtrak lightguns, probably even in cost.

Don`t get me wrong, I really like it; however when I see an approach I almost have to point out what I think could be problems...
 :laugh:

Thanks Man, yeah you're bang on. The project as it stands is very similar to a Aimtrak. I just wanted to make a gun that was as plug and play as possible, that people could customise as they need and hopefully improve on as I found out more. I've already found a wiiMote hack that uses 4 iIR leds as opposed to 2 which looks promising. But I think the real main reason is that I'm just nerd and wanted to have a crack at building one these myself  :lol
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: thet0ast3r on June 18, 2019, 09:10:12 am
Yeah, the problem with 4 points is: (or atleast my problem was)

I could not solve the Perspective n Point problem for 4 points on an arduino in real-time ( 60 fps) as it involves quite a lot of math.

https://en.wikipedia.org/wiki/Perspective-n-Point

I haven`t looked into it, but it  might be possible to solve it via lookup-tables? could be close to the computational limits of an arduino though.
Keep us updated if you manage to implement anything. :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 23, 2019, 08:33:51 am
Hi Guys, just a quick update. Build Guide is now available...
https://youtu.be/cwhUe22ZhzE
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: meltman on June 28, 2019, 04:33:49 pm
Fantastic work man.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Dam0 on July 06, 2019, 02:42:49 am
nice, ive ordered the bits, cant wait.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on July 28, 2019, 08:45:25 am
Hey Guys, just another quick update. PlayStation 1 & SEGA Saturn setup video is now up!

https://youtu.be/UqWgm9CAP7U
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Ginsonic on July 29, 2019, 05:35:39 am
Really nice Samco, thanks for your sharing! I have already got all parts, but still no time to test.
It only seems, that the cursor is a little bit jittery, do you think, it can be made more smooth (maybe a simple smoothing algorithm in the sketch)?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on July 29, 2019, 07:00:34 am
Thanks @Ginsonic, I'd love to know how ya go!

Yeah, I did play around with smoothing a little bit but as I use it for gaming I didn't want to add any latency, and I don't really notice the jerking that much when I'm actually playing (generally play with cross hairs off when I can). However, if you're using this for something else like a dedicated mouse cursor, then yeah, a smoothing script is probably a good idea as currently double clicking an icon is near impossible. I used this library https://github.com/MichaelThessel/arduino-analog-smooth when I was when I was mucking around with it.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Ginsonic on July 29, 2019, 08:12:06 am
I usually take a bunch of analog values in a loop (about 5-10) and then divide the total by the count of measures. Mostly simple and effective, but I will see, as soon as I have finished my MPU6050 based XInput Lightcannon project (similar to a Deadstorm Pirates control panel including a steering wheel ;) )

http://www.ifunpark.com/wap/eacp_view.php?id=81 (http://www.ifunpark.com/wap/eacp_view.php?id=81)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on August 09, 2019, 09:07:06 am
This looks great.

Have you given any more thought to using the 4 leds discussed above?

If it increased accuracy above what you typically get from guns like the Aimtrak then it would be even better.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on August 11, 2019, 04:25:16 am
Yeah, I'm still looking into a 4 LED option but I'm actually pretty happy with the accuracy now. Good timing really I've just uploaded a video which demonstrates it pretty well...

https://youtu.be/1g8y9xYrDiE

Still looking into the 4 LED version thou because as it will shorten the distance you have to be away from the screen (current version is about 2.5 screen widths) and possibly even reduce latency.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on August 11, 2019, 06:11:44 am
Hey, That looks great.

How does it cope if you move position? Thats always the shortfall with the aimtraks etc. If you shift a little way from where you calibrated the gun then the accuracy goes way off so I was just wondering how well it handles that?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on August 14, 2019, 04:31:22 am
Thanks lightgungamer!

To be honest this was something that I really hadn't checked too much before, so just had to do a quick test. The LED's I use from Adafruit don't have a particularly wide viewing angle but if I go from maximum left position (gun pointing just left of screen when straight on) and maximum right position (opposite for right position) it doesn't seem to change all that much. However if I go from sitting to standing there is a decent change, curser probably moves about 20 pixels down. Not sure how this compares to the Aimtrak?

I'm currently looking for wider angle LED's for the sensor bar, so when I find them I can do some better tests.

Cheers
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on August 17, 2019, 09:57:36 am
That sounds really good to be honest.

I havenít had a chance to do a proper test but I always noticed the drift when moving side to side more.

Iíve been trying to get my head round how it works out the position and it seems like you could account for sideways movement based on the previewed distance between the LEDs but I canít think of anything that could deal with up and down movement if the leds at on the same level.

Iíve ordered the pcb from you so Iím going to give this a go and build it.
Iíve started a write up on my site here https://lightgungamer.com/how-to-build-your-own-lightgun/

Iím going to add more to it once Iíve got it built.

One thing I was wondering though is if you think the M4 board would work for the build as the M0 seems to be out of stock.

I love what you are doing here. Apart from anything else, itís a really accessible way for people to have a go and play around with this.


Sent from my iPhone using Tapatalk
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on August 19, 2019, 08:54:41 am
Yeah, it's super hard to get your head around and then throw in tilt correction it's even tricker. I will make a sort video on how the tilt correction works eventually :)

That's so cool you got PCB, I'd love to know how you go. I'll be really interested to see how you feel the SAMCO compares to other guns you've tried. And yes did a quick check for you the ItsyBity M4 has exactly the same pinouts as the M0 and and from what I can tell doesn't share any of the pins I used with I2C (the reason why the AtMega32u4 doesn't work unfortunately) so you can use the exact same sketch.

Also thanks for the review & general interest in the project. I really appreciate it!

I really like what your doing with your page too. Lots of resources to get even more light gun games up an running :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: johnm on August 21, 2019, 06:00:05 am

Excellent work there samco, I've picked up a couple of Namco Guncon but as my intention would be for my kids to use it then the issues with height would show up as the guns are passed around so i might wait till its tweaked out or they get bigger :D

One thing I did like about your approach is the us of arduino, my limit to programming was typing basic listings printed in C&VG magazine into my ZX Spectrum back in the 80's but could that arduino be programmed to interface with different consoles much like the Kade did as a joystick encoder. With the rise in Retro CRT's becoming hard to find and expensive a Lightgun that imitates a joystick/mouse sounds like a winner
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on August 21, 2019, 09:08:55 pm
I'll answer that one...Ö  If the games in question could also be controlled via an analog stick then yes, but if it's light gun only then probably not.  Most light guns simply send two inputs to a console..... when the trigger is pressed and when the light sensor sees light.  The timing of one vs the other is used by the game to calculate position.  Since there isn't a way to fake that it won't work easily.  If the game allows joystick support then it could work.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: johnm on August 22, 2019, 04:41:17 am

Thanks Howard, yeah I was thinking more along the lines of PS1, PS2, Dreamcast and OGXbox where most, if not all games would have a joystick control option.
I think that with Sinden on the Horizon people are just waiting to see what it's like or if we can make our own, from what I'm aware it needs other software running so that makes it a no go for older sytems but this with the arduino could make it perfect for those wanting to play their old games on an LCD
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on August 22, 2019, 07:27:10 am

Thanks Howard, yeah I was thinking more along the lines of PS1, PS2, Dreamcast and OGXbox where most, if not all games would have a joystick control option.
I think that with Sinden on the Horizon people are just waiting to see what it's like or if we can make our own, from what I'm aware it needs other software running so that makes it a no go for older sytems but this with the arduino could make it perfect for those wanting to play their old games on an LCD
Andy , the creator of the Sinden Lightgun had demoed a poc bit of hardware using a pi that works with ps1 and ps2. I think he said it would theoretically work with other consoles.
I would have thought that this gun(Samco) would be able to work with the ps2 as the aim track gun that works in a similar way does, at least with some games.
You can also play pretty much all the old Lightgun games using an emulator but were you more interested in using the original hardware?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: johnm on August 22, 2019, 08:09:01 am

I was under the impression that there was extra software running on top of the emulator(the white border) so dont know how that would be replicated on other consoles.

I still have my saturn and dreamcast consoles along with guns and a CRT, digging them out to set up would be a pain though so anything I do would be on the PC/RPI. There is a market out there though for the consoles I mentioned before, people are spending quite a few pennies for usb/sd , psu and HDMI mods for the likes of Dreamcast and there's also a guy who converts dreamcast guns to work on lcd and are bluetooth. I believe there is a market there for something like this where someone just needs to flash a firmware to get it to work on another console
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on August 22, 2019, 08:26:04 am
I think the Sinden mod adds the border using an OSSC chip as well as handling the output. I could be wrong.
Hereís the video of the mod.
http://www.sindenlightgun.com/blog/playstation-1-and-2-original-console-sinden-lightgun-support/
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on August 22, 2019, 12:50:34 pm
I would also point out that most (not all) light gun games from the newer systems are ports of arcade games that are already emulated.  If anything a gun solution for older systems is what's needed... if you insist on playing on original hardware anyway. 

For me anyway I would want to setup a small dedicated light gun pc that could just be pulled out and plugged up to the tv when I want to play those games.  Every game would just be on there ready to go.  I mention this because you have to remember that most consoles have 15-20 gun games on them max..... you'll probably only want to play one or two of them.  It's really not worth it swapping around cables and ect. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on August 22, 2019, 03:45:29 pm
Yeah, getting one system setup where you can play everything seems like the best option.
The only thing is that it can be hard to get all the emulators set up perfectly so it all just works. Fiddling around with settings between games can be fun but it does take away from the arcade feel.
Iím hoping the Sinden gun makes it a lot smoother or consistent at least.

I really like this project though as it will give us complete control. Ive got all the parts ordered and Iím even hoping to get into the code once Iíve got it working.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on August 24, 2019, 04:26:01 am
Hi Guys, loving the chat :)

Yeah, Howards right my Gun simply emulates a mouse so the actual emulator is doing a lot of the work when comes to actually emulating a light gun (which works in quite a different fashion, this video explains it really well youtube.com/watch?v=DzIPGpKo3Ag) there would have to another step in the hardware that would convert the mouse position to this timing based system which is what I assume the Sinden guy is going to implement. The other problem is my gun requires a point on the screen to calibrate to which the old light guns didn't have.

So the SAMCO in it's current state is pretty much emulator only. But who knows is the future maybe it'll evolve, thats the joy of open source :)

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on September 05, 2019, 10:19:22 am
Hey Sam,
Iíve got all my components ready now so Iím going to start building it soon.

One thing I was wondering though is if it would work with a wii sensor bar? Itís just 2 clusters of ir leds.

Have you tried it?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on September 06, 2019, 05:51:30 am
Hey man, I actually just bought a cheap aftermarket Wii sensor from AliExpress which has the  /|\   /|\ kind of configuration to try out and I was surprised it worked perfectly. Also increases the angle you can use it at however when you jump from the front facing leds to the left/right pointing ones with recalibrating alignment does go out a fair bit. Have fun putting it all together :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on September 20, 2019, 10:06:57 pm
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 a couple of images 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.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on September 28, 2019, 02:34:25 am
Funny I was doing the exact same thing for my light guns  :lol
I also added a plug just outside of the gun to plug/unplug it at will  8)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: johnm on September 29, 2019, 07:22:27 am


Same here, I was also thinking that i could just reuse the original cable, solder a USB plug onto it and run a cable from that with a socket on the end for the pedal
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 02, 2019, 12:54:35 am
Hey I haven't looked at the sketch, but what programming language are you using?  I ask because I have Arduino code on this pc somewhere from my racing rig that allowed communication to/from mamehooker via virtual serial port.  If it's added mamehooker can optionally control the recoil.  Just a thought... you may not be that far along yet. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 02, 2019, 12:59:31 am
Hey I haven't looked at the sketch, but what programming language are you using?  I ask because I have Arduino code on this pc somewhere from my racing rig that allowed communication to/from mamehooker via virtual serial port.  If it's added mamehooker can optionally control the recoil.  Just a thought... you may not be that far along yet.
That's very interesting stuff, I didn't know you could interface mame like this!
SAMCO's Arduino sketch as well as mine are using the Arduino IDE and C++, and we can indeed communicate with serial through USB.

I would gladly see the sketch you made for that, that would help immensely :D
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 02, 2019, 08:47:33 am
Hi Howard,

Yeah, that would be great. JayBee from the post above has already started working on a recoil system. I haven't looked into yet to be honest but it's good to know that it's possible.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 02, 2019, 10:14:44 am
Hi Howard,

Yeah, that would be great. JayBee from the post above has already started working on a recoil system. I haven't looked into yet to be honest but it's good to know that it's possible.
Indeed, I already made a fully working recoil system with simple 24v solenoids and a small DIY control board.
The recoil activation and timing is controlled by the Arduino, so if I can make it communicate with Mamehooker, it should work great.
I will share the schematics later in my other posts, when I am sure it's working fine after few hours of use.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 03, 2019, 01:13:09 pm
Ok. 

Obviously it's going to have to be modified a little for recoil so I might try to change it a little before I post it. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 03, 2019, 01:37:42 pm
Ok. 

Obviously it's going to have to be modified a little for recoil so I might try to change it a little before I post it.
Awesome, thank you!
Looking forward to see your code, communicating with mame and other emulators is the last feature I miss in my 4 led setup ;)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 10, 2019, 10:49:12 am
Ok. 

Obviously it's going to have to be modified a little for recoil so I might try to change it a little before I post it.
Is there anything special to do in mame64 to make it work with mamehooker?
I followed your tutorial, setup the mame path and all, but when I launch a game in mame, mamehooker doesn't react, no sound, no voice, nothing. And no ini file created either.
Did I miss a step somewhere?  :dunno
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 12, 2019, 01:46:53 pm
Yes, set output to "windows" in your mame.ini and/or the command line.  There's a sticky about it over in the software forum. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 13, 2019, 11:20:52 am
Yes, set output to "windows" in your mame.ini and/or the command line.  There's a sticky about it over in the software forum.
Ah that explains it. Thanks, now it's working great ;)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 15, 2019, 07:13:00 am
Hey Guys, Got my PCSX2 setup guide up for anyone that's interested.

https://youtu.be/FDNjJug52EA
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 16, 2019, 02:06:40 am
Hey Guys, Got my PCSX2 setup guide up for anyone that's interested.

https://youtu.be/FDNjJug52EA
So you are actually getting an accurate aiming in PCSX2 by calibrating like that?
That's awesome man! Glad you made it work ;D
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 17, 2019, 02:12:39 am
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 18, 2019, 10:50:26 pm
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
I just tested pcsx2. I feel a bit dumb, last time I tested I forgot to disable the widescreen hacks, reason why it wasn't aiming properly. Without it it's working perfectly  ::)
Still looking for a way to play those games correctly in 16/9 tho, it would look great.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 20, 2019, 07:23:16 am
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
I just tested pcsx2. I feel a bit dumb, last time I tested I forgot to disable the widescreen hacks, reason why it wasn't aiming properly. Without it it's working perfectly  ::)
Still looking for a way to play those games correctly in 16/9 tho, it would look great.
Hey JayBee

What problem are you having with 16:9?
You can set the aspect ratio in the be window settings.
You can also set the window size.
I havenít found it necessary but you can also set a custom internal resolution in the video plugin settings.

Just setting the 16:9 aspect ratio works for me though.

If you are having trouble where the aim is fine in the Center but drifts off on one or more axis as you go towards the edge then you need to tweak the 4 values in the gun on profiles for the game that you are using to get the aim consistent for your screen set up.

Which game are you trying?


Sent from my iPhone using Tapatalk
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 20, 2019, 07:40:41 am
Samco - I meant to say that I got all of the parts and managed to build a copy of your gun.

Its almost working but I've obviously done something wrong as the camera doesn't seem to get consistent power. I think I haven't soldered it very well (Its the first time that I have soldered anything in years!)

It works for a few seconds but then when it temporarily loses power to the camera (the red camera light flickers) the whole thing stops working. Would that be the behavior you would expect if it was losing power to the camera?

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 20, 2019, 10:53:54 am
@JayBee Yeah, bonus of calibrating in game in guess :) It is quite annoying that mouse is slightly off in most games but as long as calibrate to the little red cross on the calibration screen you should be all good.
I just tested pcsx2. I feel a bit dumb, last time I tested I forgot to disable the widescreen hacks, reason why it wasn't aiming properly. Without it it's working perfectly  ::)
Still looking for a way to play those games correctly in 16/9 tho, it would look great.
Hey JayBee

What problem are you having with 16:9?
You can set the aspect ratio in the be window settings.
You can also set the window size.
I havenít found it necessary but you can also set a custom internal resolution in the video plugin settings.

Just setting the 16:9 aspect ratio works for me though.

If you are having trouble where the aim is fine in the Center but drifts off on one or more axis as you go towards the edge then you need to tweak the 4 values in the gun on profiles for the game that you are using to get the aim consistent for your screen set up.

Which game are you trying?


Sent from my iPhone using Tapatalk
You're right, I didn't touch the settings of the plug-in yet, I wanted to see how it was working without changing anything.
The issue I get in pcsx2 is that when I use the widescreen hacks and 16:9 ratio for timecrisis 3 (I must admit it's the only ps2 lightgun game I tested so far), even if the game is displayed well in full 16:9, the lightgun is still registered only in the 4:3 zone of the screen, as it was intended in the original game.
So the aiming is perfect, but I can't shoot on the left and right borders  ::)
Back with native 4:3 it works perfectly.
I will follow your advice and try to change the settings to see if I can make the aiming fit the 16:9 aspect.

For your camera issue, I would check the soldering first, to see if you have no short circuit or bad connection, the led of the camera should be either always on when it's working, or always off. Do you have a multimeter or a continuity tester that you can use?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 20, 2019, 06:28:54 pm
Iíve definitely had that same problem before but I canít remember how I fixed it. I might have just deleted my install and started fresh.

Iíve just tried it with and without the full screen hacks and it doesnít seem to make any difference. It works both ways for me.

I would check internal and window resolution and make sure they are both at least in a 16:9 ratio.

Re the camera - I think you are right. I donít have a multimeter but Iím planning on getting one so I can check. I think that must be it because if I press it at an angle then it seems to fix the connection. I canít see anything wrong visually though.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 20, 2019, 10:47:09 pm
Hi Lightgungamer,

Yeah, from your description (especially the part about pressing on it fixes it) it sounds like it probably is a soldering issue. Because your getting power intermittently it must be close to connection thou, maybe try reheating your soldering points. Power is supplied to the camera from pin "5" in my sketch so maybe start with that.

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 22, 2019, 02:52:49 pm
Thanks for the reply samco.

I got a multimeter and have started testing it.

Iíve been testing the connection between pin 5 and the + pin on the camera. It sits at about 1.5v normally then goes to about 2.5 when I press on it.
So it seems like the power getting through is the problem but probably not that connection?

This might be a silly question but should I have soldered every single pin on the board or just the ones that seem to be connected to something else on the pcb.

Iíve only soldered the ones with obvious connections.

Sorry if thatís obvious but Iím a total newb with electronics.

Thanks
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 22, 2019, 05:06:43 pm
I fixed it! I soldered the remaining pins and that fixed it.

Now Iím just having problems with the leds.

It works in terms of calibrating if I use the actual miracle led bar but obviously that doesnít aim consistently because it has a funny led configuration.

When I switch to the leds that I wired up, I get nothing in terms of the raw input to the serial monitor.

Iím not sure how to test the leds given I canít see if they should be lit up.

Does anyone know what voltage I should expect to get out of the usb cable?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 22, 2019, 08:06:11 pm
Many phones and digital cameras can see IR light, so that might help you out. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 23, 2019, 05:40:58 am
@lightgungamer Nice! Hopefully we're almost there. Here's a couple of things to try...

- Like Howard said (thanks by the way) some digital cameras (usually older ones) can see IR light. You should be able to see it as a purple glow through the view finder.

- LED's have a polarity so check you have soldered them the right way round, there should be a flat edge and a round edge. The flat edge should be closest to the SAMCO logo.

- It could also be that the wii sensor is working fine (my after market one from AliExpress works great, but maybe miracle bars are different) and you have either interference (like a window behind your screen or a bulb to close) messing with your signal...

- ...or you're not far enough back. You have to be a fair way back from your screen (about 2.5 screen widths) to reach all corner of the screen. You can test this by pointing at all four corner and making sure your raw values are still ticking over.

Hopefully one of these helps. If not let me know and I can send you over a new sketch to upload and run you though a program called processor that will show you exactly what you camera can see and we can work it out from there. It's a bit involved thou so hopefully one these work :)

Oh, and USB should give you 5V.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 23, 2019, 09:06:21 am
I just thought of one other thing. And that's to make sure your camera is up the right way up (apparently some of the stickers on these camera are not quite right). If your camera is installed correctly the red light on your camera should closest to the left wall of your gun when holding it in a shooting position, hopefully that makes sense. Anyway, good luck and let me know how ya go :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 23, 2019, 12:02:06 pm
Thanks samco.

I tested the power coming from the usb cable and it seems too low so I think it might be a problem with the cable I used.

Did you say that a wii bar should work?  I thought that the multiple leds in the would be an issue?
If not Iíll try that as I have one lying around.

It was the aimtrak bar that I used and it was detecting it but jumping around.
Iím wondering now though if thatís the camera rotation. I think the led power light is at the top.

I just need to wait until I get home to check.

Thanks for the tips. Iím nearly there!

Thanks @howard_casto as well for the tip. My current phone doesnít seem to detect it but I have an older one that I can try somewhere.


Sent from my iPhone using Tapatalk
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 23, 2019, 12:19:20 pm
I just thought of one other thing. And that's to make sure your camera is up the right way up (apparently some of the stickers on these camera are not quite right). If your camera is installed correctly the red light on your camera should closest to the left wall of your gun when holding it in a shooting position, hopefully that makes sense. Anyway, good luck and let me know how ya go :)
Oh I completely forgot something important, some recent batches of this camera have the camera tilted (manufacturer porblem), so if it works weird with camera in the right orientation, just tilt it 90į left or right, and it should be working.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 24, 2019, 05:50:25 pm
Thats great man! Yeah, I've been using this one from aliexpress https://www.aliexpress.com/item/32963414424.html?spm=a2g0s.9042311.0.0.7ce44c4dEOVMFi which only has the 6 leds and it works great. I'm pretty sure most of the proper wii ones have an extra 4 leds but I think they should still work can't confirm thou as I haven't been able to test. From what I can tell I don't think the aimtraks will work thou, due to the different layout of Leds.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 26, 2019, 06:31:57 pm
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: hyo2012 on October 27, 2019, 10:29:49 am
Wow.. handmade custom lightgun! I just ordered component you mentioned.

By the way, I have a question.

Is this lightgun have a off-screen reload function?

Off-screen reload is... when IR camera can't find LED module, pulling trigger act like right mouse click, not left click.

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 27, 2019, 12:15:10 pm
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

Iíd be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think thatís a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 27, 2019, 03:15:31 pm
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

Iíd be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think thatís a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk

The shell is the very last thing I'd want from a Guncon 3. It's just the only home IR gun I have used that is accurate enough to play shooting games without crosshairs on-screen. As it's a USB device, I have been hoping someone would figure out drivers for Windows.

As I already have two, it would be nice to be able to use them with some Teknoparrot shooters. It kinda sucks that they only work with 3 PS3 games.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 27, 2019, 08:06:49 pm
What you would probably find is that 98% of that accuracy was in the software and thus unless the driver code was really well written they wouldn't behave like you want them to.  Light gun ports on the wii were fantastic, but playing the same games on the pc with homebrew wiimote drivers.... not so much. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 28, 2019, 12:10:25 am
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

Iíd be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think thatís a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk
Can't we already do that with RPCS3?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 28, 2019, 03:50:26 am
Do you think it would be possible to use an Arduino to make a Guncon 3 work on a Windows PC?

I have been after a solution for this for a while. Someone was able to make one work on a Linux pc by writing custom drivers. How hard would it be to make an Arduino translate Guncon 3 traffic to move a mouse cursor or act as an analog joystick in Windows?

Why would you want that? This gun works in a similar way to the gcon 3 anyway and if you wanted, you could put it in the shell.

Iíd be more interested in having this emulate the gcon3 outputs so you could use it on the PS3.

I think thatís a difficult thing to do though. I think I remember reading about someone trying to make some Windows drivers for the gcon 3 and they struggled because the traffic was encrypted or something.


Sent from my iPhone using Tapatalk
Can't we already do that with RPCS3?

Does rpcs3 have lightgun support?
I havenít tried it yet.


Sent from my iPhone using Tapatalk
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 28, 2019, 04:01:24 am

Does rpcs3 have lightgun support?
I havenít tried it yet.

I saw somewhere that it has mouse support, so yes I guess, but I haven't tried it yet either, too busy configuring every game for Mamehooker lately :P
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on October 28, 2019, 04:54:17 am

Does rpcs3 have lightgun support?
I havenít tried it yet.

I saw somewhere that it has mouse support, so yes I guess, but I haven't tried it yet either, too busy configuring every game for Mamehooker lately :P

I wasnít sure if it might be difficult if the drivers for the gcon were in the game.
I havenít been able to run it yet but Iím building a new system that should do it.
Iíll give it a try.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 28, 2019, 05:31:14 am
@hyo2012 Awesome! I love to know how you go. Currently pointing off screen is setup to move the mouse to it's extreme co-ordinates when it cant see any leds (i.e. you've pointed off screen) and then you can shoot to reload as this was how all of the emulators/games that I've tried re-load system works. But I could write an alternative sketch that also makes the right mouse button click if need it. Just let me know if ya do.

@Zebra I haven't actually played with a GunCon 3 so I don't have any idea to be honest. But lucky if looks like you'll get some help here anyway :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 28, 2019, 05:41:06 pm
What you would probably find is that 98% of that accuracy was in the software and thus unless the driver code was really well written they wouldn't behave like you want them to.  Light gun ports on the wii were fantastic, but playing the same games on the pc with homebrew wiimote drivers.... not so much.

That seems to be true with real light guns on consoles. Someone created patches to allow you to use a Namco Guncon 1 on games that only had support for Konami's Hyperblaster and the accuracy remained poor. It was nowhere near the performance when using the same gun on Time Crisis.

On the other hand, you get terrible accuracy with most 3rd party light guns on the PS2 but excellent accuracy when playing the same game with an official Namco gun. So, the gun hardware definitely matters. People also claimed huge differences between act labs accuracy and those Lik Sang guns they competed with.

I thought it was different with PC emulators though as they all seem to map gun controls to either a standard mouse or analog joystick. PC guns like Aimtraks, Act Labs and USB2GUN boards all act as a standard mouse or analog joystick so they are usually equally accurate for all games. If a good job was done on the Windows drivers, would this not also be the case for a Guncon 3?

I've only used a Wii remote on a Wii but they are never accurate enough to use without crosshairs on-screen. It's hard to say if Namco would have been able to make a Wii remote work as well as a GC3 for Time Crisis 4. I think there is a hardware limitation in there somewhere that prevents it though. The Wii remote performs poorly on all Wii light gun game ports.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: pbj on October 28, 2019, 06:03:05 pm
Guns worked well on the Wii games that were designed around being on the Wii.  Big Buck Hunter was actually pretty damn fun.

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 29, 2019, 01:41:35 pm
Guns worked well on the Wii games that were designed around being on the Wii.  Big Buck Hunter was actually pretty damn fun.



They work OK if you play with crosshairs on-screen but accuracy is not required for that. It's fine for a lot of people but, for some reason, I find it hard to enjoy shooting games with crosshairs on-screen if the original arcade didn't have them. It just makes them too easy and it feels like I'm using a mouse instead of a gun. It's why I don't like using my Aimtrak to play Time Crisis in mame.

It's a shame because the Wii is the only console for a bunch of arcade shooters. I know of no other way to play games like Terraburst and Op Thunder Hurricane or Ghost Squad.

The PS3 has a bunch of gun games too but most of them use the PS Move which is only a little better than the Wii remote. A lot of it's games would have been worth playing if they would have added an option to use a Guncon 3. The key difference in the hardware seems to be that it uses two led clusters instead of one and they are spaced further apart.



Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 29, 2019, 01:52:04 pm
I'm talking about arcade game ports that were released on the wii, not wii exclusive games.  The sega ones in particular.... if you calibrated in-game every time you played and didn't move around (in other words stand in the same spot) the accuracy was great... no cross hairs needed.  It wasn't the wii or it's OS software that increased the in-game accuracy, but rather the game's calibration code.  The reason wiimote games worked great on most first party Nintendo titles and the major developers that actually took the time to make good ports is because there was custom code made for each individual game to translate the mess of sensor data the wiimote fed back into good tracking. 

The reason homebrew drivers don't work well is because they typically just take the ir tracking data, bind that to a mouse axis and that's it.  If done correctly it should be far more complex. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 29, 2019, 03:19:56 pm
I'm talking about arcade game ports that were released on the wii, not wii exclusive games.  The sega ones in particular.... if you calibrated in-game every time you played and didn't move around (in other words stand in the same spot) the accuracy was great... no cross hairs needed.  It wasn't the wii or it's OS software that increased the in-game accuracy, but rather the game's calibration code.  The reason wiimote games worked great on most first party Nintendo titles and the major developers that actually took the time to make good ports is because there was custom code made for each individual game to translate the mess of sensor data the wiimote fed back into good tracking. 

The reason homebrew drivers don't work well is because they typically just take the ir tracking data, bind that to a mouse axis and that's it.  If done correctly it should be far more complex.

OK you've peaked my interest in trying again with my Wii. I gave up on it after trying the House of the Dead games, Ghost Squad and Mad Dog McCree. Which disc would you recommend for me to try (to shoot without crosshairs). I have a bunch of ideas for a custom Wii arcade gun if I can find some games to make it worth the time.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 29, 2019, 03:55:10 pm
I remember Ghost Squad being particularly good... it's really short though.  HOTD OK also worked well with the wiimote.  If you didn't find the accuracy acceptable then it might just be you never are. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 30, 2019, 01:45:43 pm
Were you able to play Ghost Squad on the Wii without crosshairs? I couldn't find that option. I'm going to dig out my Wii and take another look.

My problem is that I'm spoiled by the PS1 and PS2 Guncon games. I was playing Virtua Cop 1 and 2 on the PS2 yesterday and it was pure magic. With the official Namco Guncon 2 in an arcade recoil gun shell it felt just like I was playing the coin-op. Every shot landed exactly where I aimed etc. I wish I could use that gun for all shooting games.

Still, it looks like we won't have to wait too long before we get an arcade-accurate home IR gun. Between the commercial projects like Sinden and the various diy projects I'm sure one if them will deliver. I want to try the 4 sensor diy design. If it works well, I could use it with a Wii emulator.

On a separate note, I noticed yesterday that the Raw ThrillS Terminator Salvation IR gun doesn't appear to use a separate I/O board like other arcade guns. The gun camera and all ten sensor boards run directly to the PC via a USB harness. The recoil is handled by a small "kick board" inside the gun shell and that also connects to the USB harness. Would it be possible to make the diy Samco gun without an Arduino and just run the code on the PC instead like the Raw Thrills gun?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on October 30, 2019, 04:22:13 pm
There's no option to turn it off.... I believe it even had cross hairs in the arcades due to how the game worked.... I just meant you could point and shoot without having to rely on it. 

As for all the new options on the way I hope they turn out ok, but I'll believe it when I have them in my hand. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on October 30, 2019, 08:39:45 pm
There's no option to turn it off.... I believe it even had cross hairs in the arcades due to how the game worked.... I just meant you could point and shoot without having to rely on it. 

As for all the new options on the way I hope they turn out ok, but I'll believe it when I have them in my hand.

I feel the same. Manufacturers always claim that their gun controllers have unprecedented accuracy regardless if they are pin point or if you couldn't hit a bus with one. They often claim to be "arcade quality" too but when you get them in hand, you usually find yourself wondering if they have ever actually been to an arcade. It's getting hard to trust what they say.

To date there has only been two or three accurate home guns and none that are both accurate and arcade quality at the same time (without a diy transplant to an arcade gun shell).

Luckily for us there are still some trusting people who are prepared to be first adopters of the new guns based only on the manufacturers sales pitch. I'll wait to see what they have to say first. They are like the first penguin to jump through the ice into the ocean. The one that gets eaten by a seal but clears the path for the rest of the penguins. Never be the first penguin!



Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: hyo2012 on October 30, 2019, 10:54:33 pm
Were you able to play Ghost Squad on the Wii without crosshairs? I couldn't find that option. I'm going to dig out my Wii and take another look.

My problem is that I'm spoiled by the PS1 and PS2 Guncon games. I was playing Virtua Cop 1 and 2 on the PS2 yesterday and it was pure magic. With the official Namco Guncon 2 in an arcade recoil gun shell it felt just like I was playing the coin-op. Every shot landed exactly where I aimed etc. I wish I could use that gun for all shooting games.

Still, it looks like we won't have to wait too long before we get an arcade-accurate home IR gun. Between the commercial projects like Sinden and the various diy projects I'm sure one if them will deliver. I want to try the 4 sensor diy design. If it works well, I could use it with a Wii emulator.

On a separate note, I noticed yesterday that the Raw ThrillS Terminator Salvation IR gun doesn't appear to use a separate I/O board like other arcade guns. The gun camera and all ten sensor boards run directly to the PC via a USB harness. The recoil is handled by a small "kick board" inside the gun shell and that also connects to the USB harness. Would it be possible to make the diy Samco gun without an Arduino and just run the code on the PC instead like the Raw Thrills gun?

You can remove CrossHair on Ghost Squad Wii version by this way.

Game on -> Arcade -> Customize -> Aim Reticle off

 ;)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Zebra on November 03, 2019, 05:53:02 pm
The wii version actually looks fairly playable on the Dolphin emulator:

https://www.youtube.com/watch?v=VjKwRIgEm8A

Maybe I can leave my Wii packed up in a box somewhere and just play it's gun games on my PC with my preferred gun tech. I kinda like the original Ghost Squad arcade guns but used ones are still a bit pricey on ebay. Still, Ghost Squad has to be played with a machine gun so I might have to pony up for a cab.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on December 07, 2019, 12:47:31 am
Hi Guys,

Just a quick update. I've added a test sketch to my GitHUb so anyone can test there gun is setup corectly before they upload the final code. Here's a short video on how it works.

https://youtu.be/Mzek1c2WMb0
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on March 19, 2020, 12:56:28 am
Hi Guys, it's been a while but I finally got around to updated my PCB boards to work with the ItsyBitsy 32u4 and probably more exciting than that I've also now got a new GunCon2 compatible board. Anyway here's a link to my new vid if you want to check them out.

Cheers Sam(co)

https://youtu.be/LizXdsRqRpE
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: pepeporras on March 21, 2020, 12:28:28 am
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun 

http://www.youtube.com/watch?v=IxpMHORxmcQ
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: pepeporras on March 21, 2020, 08:54:11 am
How to insert YouTube videos?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: nipsmg on March 21, 2020, 10:12:41 am
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun  ;)

[youtube]http://www.youtube.com/watch?v=IxpMHORxmcQ[/youtube]

put the url without any tags.. no URL tag, no youtube tag, just the bare url. see:

http://www.youtube.com/watch?v=IxpMHORxmcQ
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Foxhole on March 21, 2020, 12:31:28 pm
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun  ;)

[youtube]http://www.youtube.com/watch?v=IxpMHORxmcQ[/youtube]
Pepe, how are you using those guns on the pc? Ems topgun driver?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: pepeporras on March 21, 2020, 04:17:26 pm
Hi Samco, i have connected two guncon2 on my PC, no sensor bar, really lightgun  ;)

[youtube]http://www.youtube.com/watch?v=IxpMHORxmcQ[/youtube]

put the url without any tags.. no URL tag, no youtube tag, just the bare url. see:


Thanks bro  :notworthy:
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: pepeporras on March 21, 2020, 04:28:34 pm

Pepe, how are you using those guns on the pc? Ems topgun driver?

hello, yes, for the guncon2 use that driver but only with that driver it does not work well, I have created a code to flash the screen when shooting and another to delay the shot so that it enters the flash so that it detects the position well.

I am not going to talk about this here anymore, that this topic is from Samco, if someone wants to know more about this, speak to me privately or I will open a new topic if someone wants.

By the way Samco, your system is wonderful, as soon as the alarm passes, I will buy a couple of PCBs from their ebay store to test my LCD.

good job :applaud:
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on March 21, 2020, 05:06:32 pm

Pepe, how are you using those guns on the pc? Ems topgun driver?

hello, yes, for the guncon2 use that driver but only with that driver it does not work well, I have created a code to flash the screen when shooting and another to delay the shot so that it enters the flash so that it detects the position well.

I am not going to talk about this here anymore, that this topic is from Samco, if someone wants to know more about this, speak to me privately or I will open a new topic if someone wants.

By the way Samco, your system is wonderful, as soon as the alarm passes, I will buy a couple of PCBs from their ebay store to test my LCD.

good job :applaud:
Hey, Iíd love to know more about this. How are you making it work?

It would be great if you wanted to start a thread or pm me if you donít want to.
Thanks.


Sent from my iPhone using Tapatalk
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Foxhole on March 21, 2020, 06:02:14 pm

Pepe, how are you using those guns on the pc? Ems topgun driver?

I am not going to talk about this here anymore, that this topic is from Samco, if someone wants to know more about this, speak to me privately or I will open a new topic if someone wants.
True, sorry, samco, sent you a pm, pepe.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on March 24, 2020, 11:45:10 pm
Thanks Pepe! Your setup looks sweet, nice work!

Yeah, wonít be able to send out any PCBs for a while all inessential businesses have been suspended here in NZ for at least a month so had to shut down my eBay listing for now.

Stay safe out the peps, at least we now have more time for projects :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on May 01, 2020, 12:27:40 am
Hi Guys,

Just a quick update, I've started selling my PCB's again...

https://www.ebay.com.au/usr/samcocontrollers

... and have made a 4 LED sketch (just encase you missed it) :)

https://youtu.be/JJPcwmTc5X0
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: lightgungamer on May 01, 2020, 03:21:29 am
Hey samco, this looks great.

Do the 4 leds help keep the system accurate if you change position relative to the screen like side to side or stand up etc?

Doing that would require you to recalibrate the aimtrak for example.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on May 01, 2020, 07:10:56 pm
Hi Lightgungamer,

Yeah, currently definitely works better if you play from the position you calibrated so similar to Aimtrak. But I have an idea of how to add perspective correction that I'll start working on next week which could fix that. I'll let ya know how I go.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on May 24, 2020, 01:54:31 am
Hi Guys,

Just ironed out a few bugs in my 4 LED code and updated my GitHub. If anyone wants to try it out and let me know what they think Iíd appreciate it.

Cheers Sam(co)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 18, 2020, 01:32:31 am
Hey Guys, just uploaded my GunCon2 vid...

https://youtu.be/k_JsqBy0rr4
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on June 18, 2020, 01:43:44 pm
So do we have a running total for the parts list now?  Been thinking of building one since the sinden gun keeps getting delayed. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 18, 2020, 09:48:25 pm
Hi Howard,

GunCon2's vary quite a bit but lets say $40US for the sake of argument. DF Robot IR Positioning Cameras are $23.55US + postage on there website, the cheapest ItsyBitsy you can get is $9.95US + postage and my PCB's are $10US + $3US postage. You might be able to save a little on potage by getting the Camera & ItsyBitsy board from a maker website so a safe estimate would be a little under $90US (+ postage) it you had to buy all the parts. Obviously you can save quite bit if you have an old GunCon2 floating around or can find one cheap :)

https://www.dfrobot.com/product-1088
https://www.adafruit.com/product/3677
https://www.ebay.com/itm/184265539060

Cheers Sam(co)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Howard_Casto on June 19, 2020, 03:14:04 am
Thanks for the reply.  I was actually thinking of making a custom 3d printed enclosure.  I'm not sure though.... that might not be worth the effort. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 20, 2020, 08:02:30 pm
Yeah, that would be cool! But a lot of work :) If you're building your own Gun then you wouldn't need a PCB and could use any 32u4 board you like so the only so the only real cost would be the IR positioning camera. So be quite a bit cheaper but a lot more work. Cool idea though I'd love to know how ya go.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: LightFun on June 21, 2020, 09:13:34 am
Hey Guys, just uploaded my GunCon2 vid...

https://youtu.be/k_JsqBy0rr4
Noticed this pop up on my YouTube feed a few days ago. I look forward to watching, your first video was great.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: hyo2012 on June 28, 2020, 05:05:07 am
I succeeded in make Samco 4IR light gun.
Strange thing is I have to rotate IR Camera about 90 degree to work correctly.
And works properly, that was amazing.
Compared to Aimtrak lightgun I used, Samco 4IR light gun's working distance that monitor from light gun is decreased. So playing gun game is more fun :laugh:

I have a suggestion.
When I use light gun, other mouse is not movable. To use mouse, I have to push calibration button on light gun.
It is better I think, if light gun can't see IR light, stop working with out pushing calibration button.
And.. Is it possible add fuction 'offscreen trigger reload'?

Thank for your works. I ordered 3unit of guncon2 pcb from your ebay ;D
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 30, 2020, 10:37:07 pm
Thanks, for the feedback @hyo2012. I'm glad you like it :)

Yeah, apparently a bunch of the DF Robot camera had the labels stuck on the incorrectly it's a real common problem. Glad you worked it out.

I'm a bit busy with other stuff at the moment but I'll have a look into your suggestions when I get some spare time and let ya know how I go. Out of curiosity which game are you playing that you would like to add the offscreen trigger reload?

Cheers Sam(co)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: hyo2012 on July 01, 2020, 02:11:17 am
Thanks, for the feedback @hyo2012. I'm glad you like it :)

Yeah, apparently a bunch of the DF Robot camera had the labels stuck on the incorrectly it's a real common problem. Glad you worked it out.

I'm a bit busy with other stuff at the moment but I'll have a look into your suggestions when I get some spare time and let ya know how I go. Out of curiosity which game are you playing that you would like to add the offscreen trigger reload?

Cheers Sam(co)

most of demul lightgun games - hotd 2, confidential mission, maze of kings... 

As I know, these sega arcade gun games are support offscreen reload on original arcade cabinet.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: judokan on September 04, 2020, 10:21:28 am
Hello, Iīm from spain (murcia), I have bought 2 motherboards from ebay, I already have everything else, I have assembled it to test it and it does not work with the Adafruit ItsyBitsy 32u4 5v the pins is different for 5v.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: judokan on September 10, 2020, 05:22:14 pm
Arduino:1.8.13 (Windows 7), Tarjeta:"Adafruit ItsyBitsy 32u4 5V 16MHz"

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::AbsMouse_()'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::AbsMouse_()'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::init(unsigned int, unsigned int, bool)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::report()'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::move(unsigned int, unsigned int)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::press(unsigned char)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse_::release(unsigned char)'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\AbsMouse.cpp.o (symbol from plugin): In function `AbsMouse_::AbsMouse_()':

(.text+0x0): multiple definition of `AbsMouse'

libraries\Samco_2IR\AbsMouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::DFRobotIRPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::DFRobotIRPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::~DFRobotIRPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

Se encontraron varias bibliotecas para "Wire.h"

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

Usado: C:\Users\usuario\AppData\Local\Arduino15\packages\adafruit\hardware\avr\1.4.13\libraries\Wire

 No usado: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire

(.text+0x0): multiple definition of `DFRobotIRPosition::~DFRobotIRPosition()'

Se encontraron varias bibliotecas para "AbsMouse.h"

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

Usado: C:\Program Files (x86)\Arduino\libraries\Samco_2IR

 No usado: C:\Program Files (x86)\Arduino\libraries\Samco_4IR

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::requestPosition()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::readX(int)'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::readY(int)'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::writeTwoIICByte(unsigned char, unsigned char)'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::begin()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\Samco_4IR\DFRobotIRPosition.cpp.o (symbol from plugin): In function `DFRobotIRPosition::DFRobotIRPosition()':

(.text+0x0): multiple definition of `DFRobotIRPosition::available()'

libraries\Samco_2IR\DFRobotIRPosition.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compilando para la tarjeta Adafruit ItsyBitsy 32u4 5V 16MHz.



Este informe podrŪa contener mŠs informaciůn con
"Mostrar salida detallada durante la compilaciůn"
opciůn habilitada en Archivo -> Preferencias.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on September 10, 2020, 06:20:45 pm
Hi judokan, this might be caused by having an extra library in your libraries folder. Try and remove the AbMouse library and DFRobot Library if you have it as a stand alone libraries and only put one of the Samco libraries (either Samco_2IR or Samco_4IR) in your libraries folder.

Cheers Sam(co)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: tomton on September 23, 2020, 04:23:23 am
Hi Samco,

This project is great! As soon as I saw it I started sourcing all the elements and finally was able to put it all together last night.
Uploaded your sketch successfully and new HID device appeared in the Device Manager (windows) but I don't see any output in the serial monitor window.

I have tried reuploading your sketch, restarting my PC and a few other things but no luck.

I have attached screenshot showing what I see after uploading your code.

Have you got any idea what could it be?


Thanks in advance,
Tom
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: kim_sama_999 on September 23, 2020, 07:41:47 am
Awesome work  8) !!! I bought the pieces and the PCB to try out. I really like the 2 sensor bar option which makes the gun work better. If I have good luck with making it I would buy the new pieces and PCB and put it in a Namco arcade gun shell  ;D
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on September 26, 2020, 07:55:51 pm
Hi tomton, sorry for the late reply. Sometimes with the ItsyBitsy the Com Port can change when you upload a sketch so you could try changing your COM port before running the serial monitor. Opening the serial monitor is mainly just to check the sketch is running properly so alternatively you could just try and calibrate with it closed. Hope this helps let me know how ya go.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: tomton on September 27, 2020, 05:17:39 pm
Hi Samco,

Thanks for your reply.

I have spent more time with this today and tried to upload your sketch to Arduino nano and this produced loads of errors saying "error: 'AbsMouse' was not declared in this scope"
Weirdly I don't get those errors when uploading to ItsyBitsy  :dunno . I have tried redownloading AbsMouse but still getting those errors.

I have tried doing this on another PC but still no luck...   :banghead:

Any idea?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on September 28, 2020, 08:16:44 am
Hi Samco,

Thanks for your reply.

I have spent more time with this today and tried to upload your sketch to Arduino nano and this produced loads of errors saying "error: 'AbsMouse' was not declared in this scope"
Weirdly I don't get those errors when uploading to ItsyBitsy  :dunno . I have tried redownloading AbsMouse but still getting those errors.

I have tried doing this on another PC but still no luck...   :banghead:

Any idea?
I don't think the absmouse is compatible with nano?
But it might be possible to fix that by manually modifying the library.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: tomton on September 28, 2020, 05:48:37 pm
To me it looks like there is no communication between ItsyBitsy and PC.

I have now uploaded "Test" sketch to ItsyBitsy and used it with "Processing" but I got all red buttons so as suggested I have tried different port numbers from 1 to 10 but "Processing" just keeps crashing saying
Code: [Select]
COM1 COM5
ArrayIndexOutOfBoundsException: "port number that I have tried"

I think I'm either doing something very wrong or I'm using wrong board for this. Below link to the board that I'm using.
https://www.ebay.co.uk/itm/Adafruit-Itsy-Bitsy-32u4-5V-16MHz/142656639851?hash=item2136ff936b:g:aBkAAOSwQwZaXF5a

Any suggestions or help would be appreciated.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on September 29, 2020, 08:14:46 pm
Yeah, JayBee is correct. The nano is not compatible with the absmouse library. But the link to the board is the right board.

When you upload test sketch do you get anything over the serial monitor?

If not try this simple sketch that will just repeat "Hello world" in the serial monitor...

void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("Hello world");
delay(1000);
}

Just to confirm that serial is working.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: tomton on October 01, 2020, 04:54:06 am
I should have said it earlier but I have tested my ItsyBitsy board with similar piece of code to yours and serial output worked fine.

I finally got it working last night! Long story short my board for some reason was unable to provide 5V to the IR camera on pin5, under load it dropped to ~0.7V. When I wired camera directly to 5V supply the red LED lit on and tbh until then I didn't know it should be on :o . I have then wired IR camera positive directly to 5V pin on the board and it now works. Along the way it also turned out that on my camera SCL/SDA were the other way round (Green is SDA and Yellow is SCL).

It works but still no shooting for me as I can't get it calibrated. Could be my dual monitor setup or Wii bar that I'm using which has more than two IR LEDs
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: JayBee on October 01, 2020, 08:47:30 am
I should have said it earlier but I have tested my ItsyBitsy board with similar piece of code to yours and serial output worked fine.

I finally got it working last night! Long story short my board for some reason was unable to provide 5V to the IR camera on pin5, under load it dropped to ~0.7V. When I wired camera directly to 5V supply the red LED lit on and tbh until then I didn't know it should be on :o . I have then wired IR camera positive directly to 5V pin on the board and it now works. Along the way it also turned out that on my camera SCL/SDA were the other way round (Green is SDA and Yellow is SCL).

It works but still no shooting for me as I can't get it calibrated. Could be my dual monitor setup or Wii bar that I'm using which has more than two IR LEDs
Ah yes, some boards simply don't have enough current available through the digital pins to power the cam.
I always recommended to power i2c devices through either 5v or 3v3 power pins (depending of the device specs).

For the calibration not working properly, have you check the cam orientation? I know most dfrobot cams have the up sticker on the wrong side (up sticker should be on the side, not up).
I'd suggest adjusting it manually with the test processing app, because sometimes it's not even aligned correctly with the sticker.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: tomton on October 01, 2020, 10:45:45 am
Camera is definitely facing correct way up and cursor follows gun movement left/right/up/down but I can't get it to screen corners to calibrate. If I just calibrate it with area that is accessible it then works fine in small "window" on screen and once I move out of this "window" cursor just jumps randomly all over the place. I'm guessing this is because it's not calibrated correctly.

I will give it another go tonight.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: killthefreeman on October 06, 2020, 06:22:32 am
Hi Samco,
First, i would like to thank you for your project.
I just wanted to know if it is possible to use the gun in flycast (within retroarch) with house of the dead 2?
Thanks.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 11, 2020, 10:26:15 pm
@tomton, sorry again for the late reply. How did you go? Maybe try and calibrate from a bit further back you want be about 2 /12 screen widths back for the 2 led sketch and 1 1/2 for the 4 led sketch.

@killthefreeman Thanks man :) I haven't tested that emulator myself but I have seen videos of people using it with an AimTrak which works in similar way so if you can find a guide for AimTrak you should be able to get it going. I'll try and do a test when I get some spare time.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: tomton on October 14, 2020, 04:37:12 am
Thanks for all the help guys! I've got it working now  :)
I have used test sketch to align IR camera perfectly and then moved further back to calibrate.
It works fine but because it doesn't like dual monitor setup I will not be adding it to my MAME cabinet (I have main display and marquee monitor connected).
If i was to add it I would look into adding an LED to indicate when the gun is active or when it is in calibration mode.

EDIT:
I was just looking at your code and was wondering if it would be possible to define light gun calibration/work area independently to screen/desktop resolution.
For example i have 2x 1920x1080 monitors side by side which makes my desktop 3840x1080 but all emulators I use utilize only one screen so would it be possible to limit light gun to only work on one monitor by somehow offsetting/limiting it?
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 10, 2021, 11:22:28 pm
Hi Guys, just a quick update for anyone out there still using a SAMCO. Have just updated my code to have saved calibration & increased acuuracy. Get out the my new vid...

https://youtu.be/xPWTQeqoiII
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Owillingham on June 20, 2021, 09:13:40 am
Any schematics for including recoil on the Samco lightgun?  have parts on order to build the Samco gun, but would be nice to include recoil at the same time of building.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on June 21, 2021, 12:20:17 am
Hi, think I already answered this on facebook. But yeah, have schematics available on my GitHub (for ItsyBitsy but should be easy enough to adapt to other boards and can already change Pin assignments in code if you need to). Recoil is still a work in progress so no documentation yet.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Dam0 on August 04, 2021, 03:51:06 am
SAMCO, after many months of leaving your 1.0 arduino kit on the shelf, i finally re-plugged the gun in and it works flawlessly....

so thanks for all your hard work, now to gather the light-gun games i got into a single frontend.

i "think" my issue in the end was i was standing too close buy about a good metre maybe more. so all up, for a 24" screen i recon id be 5-6 foot away from the screen for the cursor to operate properly.

i kinda thought on it a bit in hindsight, that after reading about some ppl using lenses on their gun4ir setups to reduce the focal length makes some sense .

anyhow, thanks for your hard work . very happy i waited this time, before i cracked a poopy pants
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on August 07, 2021, 01:06:48 pm
I made an enhanced version of the SAMCO project. The enhancements are:

Much of the code was re-worked but the positioning math calculation is all from SAMCO. It is fantastic how well this works!

One big change is with the button handling code that allows button combinations. For example, you can assign a button combination to enter pause mode that you will never press while playing a game so the reload button can be assigned a mouse button or key press.

The other big enhancement is the calibration profiles. I found myself sometimes wanting to play on my big screen TV and other times on my monitor. Combine that with 4:3 aspect ratio games requiring different calibration data, adding multiple profiles is an obvious solution. While the calibration procedure is simple, it's even faster to just press a button to select a profile.

Support for the ATmega32U4 boards was a bit of a last minute addition and not as well tested, but it should work (though I haven't tested saving to EEPROM).

The buttons in the sketch are configured for a SAMCO 2.0 GunCon 2 build. If your gun has different button pin assignments then you will have to modify the sketch.

You can get the source code from: https://github.com/Prow7/ir-light-gun
See the readme files on GitHub for more details.

Big thanks to Samco for this project. Your custom PCB made it super easy to mod a GunCon 2! Also thanks to Gustavo for his Apexel lens adapter models. A fantastic solution to the less than ideal narrow FOV that the camera has.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on August 08, 2021, 08:48:13 pm
Wow, this is awesome Prow! I was hoping that a gun coder would get their hands on my code at some stage.

Haven't got a spare SAMD board to try it out yet but just looking through your code, I'm super impressed. Can't wait to try it out!

Cheers Sam(co)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on September 11, 2021, 07:00:01 pm
Hiya!New face peeking in to say thanks, because this project's given me the perfect inspiration to get and mod a GCon 2 for myself. Would be the first good lightgun solution I've found that isn't in some desolate theater arcade.

Had a few asks, though:I know all of that might be a mouthful, but I'm admittedly only just now discovering lightgun mods so these are things I'm considering before diving in head-first for parts. AFAIC, SAMCO sounds cooler and more convenient for my setup, but I want to be sure is all!  ;D
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on September 16, 2021, 10:01:10 pm
Had a few asks, though:
  • How accurate is the SAMCO compared to other solutions? And for anyone who's used it, how is the performance any different with @Prow's enhanced fork? I feel like that may as well be the version I use whenever I get around to building this.
  • From what I can tell, the Gun4IR seems to be scarily similar to SAMCO, down to using the same board and camera, but I'm curious what the differences are between the two. For example, the SAMCO uses Wii-styled lightbars which I already have plenty of from using my Wii remote on PC, so it seems awfully more convenient than the specific IR light pods that the G4IR uses. Is there an appreciable difference in accuracy between these two?
  • Sort of an appendix to the last question, but from what I can tell it looks like the G4IR will be getting some form of PS1/2 support as an emulatable Guncon 1. Since both of these projects are more or less running the same handful of Arduino-compatible boards at the core and use the same camera as one another, with just different sketches/software/calibration being the most apparent differences, is it possible the SAMCO will also see similar support? Admittedly, it's one of the reasons I got an EMS TopGun a couple years ago, to use with original hardware because PS2 specifically is a PITA for configuring with lightguns - not to mention the latest 1.7.x builds of PCSX2 removing plugin support, and subsequently killing the nuvee plugin this would rely on.
I know all of that might be a mouthful, but I'm admittedly only just now discovering lightgun mods so these are things I'm considering before diving in head-first for parts. AFAIC, SAMCO sounds cooler and more convenient for my setup, but I want to be sure is all!  ;D

I can't compare the performance to other solutions but the SAMCO 4IR Beta code, which is what I used, has perfect accuracy for a single player directly in front of the screen. I'm currently using light sensor bars from an original EMS LCD TopGun. The only thing I have to do is block the middle IR LEDs on the one sensor bar that has 3 spots. This was one consideration for why I tried out the SAMCO build; it was very easy for me to make a little foam mount for one of the sensor bars to sit on top of my big screen TV.

I guess the main differences with Gun4IR are: different IR emitter layout, a configuration GUI, closed source project, and I think you must use a Pro Micro board (though check the project to confirm the supported boards).

Even though my code will build for the Pro Micro and the 32u4 ItsyBitsy boards, I recommend using an M0 or M4 SAMD board instead. Or, if you wait a bit, then hopefully soon I'll add support for the RP2040 ItsyBitsy and it will be another good option, at least for my code. I actually have it prototyped and working, just need to clean up the code a bit. :)

Interesting you mention PS1/2 support... I tried to find information on the original Xbox light guns, but couldn't find any information, so that was as close as I got to any console support.

Yes, it's a cool project and the custom SAMCO PCB is awesome! makes modding a GunCon super easy. 8)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on September 17, 2021, 12:53:38 pm
I can't compare the performance to other solutions but the SAMCO 4IR Beta code, which is what I used, has perfect accuracy for a single player directly in front of the screen. I'm currently using light sensor bars from an original EMS LCD TopGun. The only thing I have to do is block the middle IR LEDs on the one sensor bar that has 3 spots. This was one consideration for why I tried out the SAMCO build; it was very easy for me to make a little foam mount for one of the sensor bars to sit on top of my big screen TV.

I guess the main differences with Gun4IR are: different IR emitter layout, a configuration GUI, closed source project, and I think you must use a Pro Micro board (though check the project to confirm the supported boards).

Even though my code will build for the Pro Micro and the 32u4 ItsyBitsy boards, I recommend using an M0 or M4 SAMD board instead. Or, if you wait a bit, then hopefully soon I'll add support for the RP2040 ItsyBitsy and it will be another good option, at least for my code. I actually have it prototyped and working, just need to clean up the code a bit. :)

Interesting you mention PS1/2 support... I tried to find information on the original Xbox light guns, but couldn't find any information, so that was as close as I got to any console support.

Yes, it's a cool project and the custom SAMCO PCB is awesome! makes modding a GunCon super easy. 8)
+1 for open source!
I was considering getting the M0 based on your recommendation on the repo, and for futureproofing anyways. But is there any user facing difference going for the RP2040 instead? I mean, I guess saving $2 on raw parts has its plus!I'm certainly patient, since I'd have to wait about a month on the camera alone anyways.

On the note of console support, apparently there's another SAMCO fork that allows it to work on actual PS2 hardware as a Gcon2 (https://github.com/88hcsif/IR-Light-Gun) - or at least, that's the claim, as I obviously don't have a working setup to know for sure. It's only in the last two days I realized the post on this board. Now, it's obviously a stretch to suggest that these changes could be implemented retroactively in your project, but even just the possibility of having that compatibility is enough to make me genuinely more excited than I perhaps reasonably should be. :P
Anyways, glad to hear. I'll be waiting to see what updates comes to your code. It really has reinvigorated my interest in light gun games again. (^^
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on September 18, 2021, 06:09:05 pm
+1 for open source!
I was considering getting the M0 based on your recommendation on the repo, and for futureproofing anyways. But is there any user facing difference going for the RP2040 instead? I mean, I guess saving $2 on raw parts has its plus!I'm certainly patient, since I'd have to wait about a month on the camera alone anyways.
It looks like it should be a drop in alternate to the M0 or M4, at least for the SAMCO project from what I can see. I think even all of the Arduino pin numbers for the buttons match up for the GunCon 2 SAMCO PCB, so the button configuration in the sketch doesn't even need to change.

Quote
On the note of console support, apparently there's another SAMCO fork that allows it to work on actual PS2 hardware as a Gcon2 (https://github.com/88hcsif/IR-Light-Gun) - or at least, that's the claim, as I obviously don't have a working setup to know for sure. It's only in the last two days I realized the post on this board. Now, it's obviously a stretch to suggest that these changes could be implemented retroactively in your project, but even just the possibility of having that compatibility is enough to make me genuinely more excited than I perhaps reasonably should be. :P
Anyways, glad to hear. I'll be waiting to see what updates comes to your code. It really has reinvigorated my interest in light gun games again. (^^
I don't have a PS2 so I can't test out that code. It would be cool to have that working though.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on September 20, 2021, 09:13:22 am
It looks like it should be a drop in alternate to the M0 or M4, at least for the SAMCO project from what I can see. I think even all of the Arduino pin numbers for the buttons match up for the GunCon 2 SAMCO PCB, so the button configuration in the sketch doesn't even need to change.
That looks to be the case.And since the M0 is out of stock, I guess I'm going RP2040.Just ordered all the parts for myself. It'll be a bit belated, but I think it'll be a good enough gift for myself. :p
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on September 22, 2021, 01:47:24 am
Hi ThatOneSong, yeah from what I can tell the ItsyBitsy RP2040 should work fine with the M0 sketch. But if you have any problems just let us know either here or on my facebook. https://www.facebook.com/groups/2456595207897603 :)

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on September 22, 2021, 10:49:25 am
Hi ThatOneSong, yeah from what I can tell the ItsyBitsy RP2040 should work fine with the M0 sketch. But if you have any problems just let us know either here or on my facebook. https://www.facebook.com/groups/2456595207897603 (https://www.facebook.com/groups/2456595207897603) :)
I'm looking forward to it! By which I mean, a while for the board and other parts to arrive. Unfortunately I wasn't quick enough on the trigger for the camera so it's on backorder for the moment, but everything--aside from the ItsyBitsy RP and a 3m cable--is being imported anyways. (^^;
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on September 22, 2021, 12:34:20 pm
Hi ThatOneSong, yeah from what I can tell the ItsyBitsy RP2040 should work fine with the M0 sketch. But if you have any problems just let us know either here or on my facebook. https://www.facebook.com/groups/2456595207897603 :)
One thing to note is that the ItsyBitsy RP2040 currently will not work with your sketch. The RP2040 does not support the Arduino USB stack and the AbsMouse library only supports the Arduino USB stack.

My modified AbsMouse5 library is working with the Adafruit TinyUSB stack now, which is an option for the RP2040. This update is not yet on my GitHub project, but hopefully soon I'll get back to working on it.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on September 30, 2021, 10:52:58 am
Just came in to say I've just received both IB-RP2040 and Samco boards - extra props to samco of course for the quick turnaround. The GCon2 itself is still on its way, but unfortunately the camera has been sitting on Backordered for a bit now. Not sure how long it takes DFrobot to fulfill orders; I didn't anticipate them being in such high demand.
Regardless, I'll be waiting eagerly on the 2040 sketch update.  :applaud:
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on October 01, 2021, 10:48:36 pm
The update for the ItsyBitsy RP2040 is now available.

One thing to note is the button pin values in the sketch must be modified if you use the ItsyBitsy RP2040. The sketch uses the Arduino pin numbering as printed on the top of the PCB but these values don't work for the RP2040. The button pin values must be the physical GPIO pin numbers printed on the bottom of the PCB (or see the Adafruit pinouts page). More details on this in the readme. It was a bit odd to me since the A0 through A3 pins are defined, but the digital pins aren't translated... for example D7 is defined as 7, which doesn't translate Arduino to GPIO. Į\_(ツ)_/Į

Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: samco on October 05, 2021, 08:22:39 pm
Nice one Prow! Thanks for the heads up on the AbsMouse Library too. I don't have too much time to tinker at the moment so I'll be keeping an eye on this thread to see how this goes and what you guys think of the RP2040.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on October 06, 2021, 07:57:30 pm
So I will say the process of getting here was a bit of an experience for me...
First off, without even having gun in hand, following the procedures in advance setting the board up had me for a loop.Firstly, even getting an RP2040 recognized in Arduino software--which Adafruit's store page and documentation contradict one-another atm (one says there is no support, another generic Raspberry Pico page was updated saying there is...)--was difficult since it's a third-party repository (https://github.com/earlephilhower/arduino-pico) that needed a bit of searching to find. Would be nice to add this in the SamcoEnhanced readme for 2040-ers.Sidenote, this might just be my PC, but the board wasn't being assigned a serial driver like it's supposed to, but was stubbornly hanging as an unknown device with no known drivers. I had to force the 'RP2 USB' device to use a Microsoft-brand USB Serial Device. But at least afterwards, I can assign the port number and it was able to be flashed just fine.
One thing that was unclear as a first-timer was the note in the Enhanced repo;
Quote
If you are using an ItsyBitsy M0 or M4 then I recommend you set the Optimize option to -O3 (or faster). If you are using an ItsyBitsy RP2040 then I recommend the -O3 Optimize option.
I was looking and couldn't find any such Optimize flag options; neither in the Preferences, or the Sketch/Tools dropdowns that Ada's documentation suggested should be there (https://cdn-learn.adafruit.com/assets/assets/000/074/814/original/adafruit_products_m4-performance.png?1556044075). Nada.And results when searching for "Arduino optimization flags" kept bringing up coding habits, but not the GCC flags. There was only one I could find after going through multiple pages that pointed to C:\Program Files (x86)\Arduino\hardware\arduino\avr\platform.txt where I could change the references of -Os to -O3. If there is something I'm overlooking here, feel free to say, but maybe a note should be appended on what exactly this step means on the latest Arduino IDE.
Anyways, from there, code runs, that's all I could get at the time. Fast forward to today and my GCon 2 arrives. Time to get to work.Disassembly and all that wasn't hard at all, thanks to Samco's own video documentation on the process. This was my first substantial soldering work in quite some time, so I was proud to see good joints coming out of it.My main difficulty came when I was adding in a microswitch mod where I had to rip out the original trigger tact switch (what a frick that was), and plant in a microswitch alongside a replacement arm attached to the trigger. While that worked out, it made cable routing feel kind of precarious - of which I also had a bit of trouble, since I tried attaching my microUSB to the board after attaching the B button board, which wouldn't work. I had to take out the button standoff and put the cable in before reattaching, but it felt quite tight. Thankfully, it all ended up coming together in the end.
Prow is all too right about the GPIO mapping. But I figured it out with just a bit of cross-referencing Samco's documents;
Code: [Select]
Trigger = 6
D-Up = 9
D-Left = 8
D-Down = 7
D-Right = 10
C = 11
A/B/Start/Select/Pedal stays the same.
While I'm unfortunately still not able to use the gun due to the camera still being backordered, I can at least confirm all the inputs work (after changing the sketch mappings) as well as the calibration toggle. It will unfortunately be another lengthy wait I imagine before this is really finished, but the process so far has been fun and leaving me with great anticipation for what it's like when it's really working.
A lot of rambling for a lot of nothing seems to be my only contributions here, but I'm kind of okay with that. (^^;
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on October 11, 2021, 07:46:50 pm
Self-bumping update: I got the camera, and aside from the TOP label being off by 90 degrees clockwise, it all seems to be working. I'm glad I got one more sensor bar than I needed because the sole one I've had on my monitor for a few years for my Wiimote has such a narrow FOV compared to the new ones I'd just ordered, it's crazy.
I did manage to play through Time Crisis on MAME without any issue, it tracks surprisingly really well and no latency--especially when coming from a wireless EMS.
But after I decided to play T2 Arcade, a few minutes in, the trigger started acting a bit funny and some of the depressed shots were only firing off for a frame or something. It didn't seem to be consistent, but weird how it crops up so late into it.
From what I can tell, I think on some inputs, it's double-clicking instead of firing once and holding like I want it to? Because it's not just the trigger - the start button also on rare occasions can spurt out 1111 which was odd (esp. since it's one of the buttons directly embedded to the Samco2 board).
I was going to say it worked better some time later, but when playing a Naomi shooter through the Flycast core on RetroArch, again halfway through, all my on-screen shots just... stop registering? And when I alt-tabbed, this very messagebox I'm typing this in was being spammed with 1111's.
It's stuff like that which makes it hard for me to believe it's just the trigger microswitch that's bad... it's literally brand new and I even triple-checked my solder points; no joints touching one-another or anything. After writing this part I played Point Blank with lr-Duckstation with no issues, just like with Time Crisis (though I did note two small instances of double-clicking). Maybe it's just brandist against anything non-Namco.

@Prow, any idea what's up here?

EDIT:L Update to the update. Of course, the next morning I try to confirm the trigger issue and it's working perfectly again. But the D-pad (and kinda start button) is still sticky sometimes.

But I've noticed on two separate instances that after some time (pretty much *only* happens after putting the gun down for a bit then up again), the calibrated aim is offset a quarter-screen to the right, despite not having moved at all since. But it's fixed with a re-calibration, so... I don't have a clue really.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on October 13, 2021, 01:08:52 am

From what I can tell, I think on some inputs, it's double-clicking instead of firing once and holding like I want it to? Because it's not just the trigger - the start button also on rare occasions can spurt out 1111 which was odd (esp. since it's one of the buttons directly embedded to the Samco2 board).
I was going to say it worked better some time later, but when playing a Naomi shooter through the Flycast core on RetroArch, again halfway through, all my on-screen shots just... stop registering? And when I alt-tabbed, this very messagebox I'm typing this in was being spammed with 1111's.
Adjusting the debounce time will hopefully fix this. I'm not sure why I set the debounce times lower than they need to be. I'll make a note to fix the sketch. With that said, I don't have any issue with my gun and the buttons.

Quote
But I've noticed on two separate instances that after some time (pretty much *only* happens after putting the gun down for a bit then up again), the calibrated aim is offset a quarter-screen to the right, despite not having moved at all since. But it's fixed with a re-calibration, so... I don't have a clue really.
Interesting you report this as I had this happen once recently. In my case, I reconnected the USB cable and it was fine since I have the calibration stored in NVRAM. Just as you say, I recall I set the gun down for a bit and then when I picked it up the aim was way off. If you can reproduce this it would be interesting to know if the calibration values somehow change. You can view them in the serial monitor (or any serial terminal program). I was unable to reproduce it, but only tried a few times.

Quote
I was looking and couldn't find any such Optimize flag options; neither in the Preferences, or the Sketch/Tools dropdowns
I jumped the gun on this one... I submitted a Pull Request to the Arduino Pico project and expected an update to be released before anyone would actually use an RP2040 build. It actually may not matter all that much, but might as well optimize for speed. I'll update the wording to describe it as an optional setting if it's available.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on October 17, 2021, 10:33:35 pm
Heeey, sorry for the wait. Been pulled away for some time on some PC upgrades and switching to Linux. Fun.
Interesting you report this as I had this happen once recently. In my case, I reconnected the USB cable and it was fine since I have the calibration stored in NVRAM. Just as you say, I recall I set the gun down for a bit and then when I picked it up the aim was way off. If you can reproduce this it would be interesting to know if the calibration values somehow change. You can view them in the serial monitor (or any serial terminal program). I was unable to reproduce it, but only tried a few times.
Seems like we've both only had this happen once without any way to reproduce. But this hasn't happened often. And I appreciate the honesty - easily forgiven, though no less confusing for a first-timer. I think it's safe to say the debounce--or lack thereof--only affects my membrane buttons, but definitely not an issue with the trigger (the unresponsiveness might've just needed some time to get worn in. shrug).
As of now, I'm just trying to work out how to get this working in X11. Not the most straightforward thing to say the least. :laugh:
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: DeKay on October 25, 2021, 07:03:59 pm
Hey Prow.  You and Samco are doing great work here!  I sent you a few minor fixes for things I tripped over getting my ItsyBitsy M4 set up this weekend in a github pull request.  I really have to learn to use git properly one of these days   :)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: woordmand on January 07, 2022, 12:03:20 am
I made an enhanced version of the SAMCO project. The enhancements are:
  • Increased precision for maths and mouse pointer position
  • Glitch-free DFRobot positioning (DFRobotIRPositionEx library)
  • IR camera sensitivity adjustment (DFRobotIRPositionEx library)
  • Optional averaging modes can be enabled to slightly reduce mouse position jitter
  • Enhanced button debouncing and handling (LightgunButtons library)
  • Modified AbsMouse to be a 5 button device (AbsMouse5 library)
  • Multiple calibration profiles
  • Save settings and calibration profiles to flash memory (SAMD) or EEPROM (ATmega32U4)
  • Built in Processing mode for use with the SAMCO Processing sketch

Much of the code was re-worked but the positioning math calculation is all from SAMCO. It is fantastic how well this works!

One big change is with the button handling code that allows button combinations. For example, you can assign a button combination to enter pause mode that you will never press while playing a game so the reload button can be assigned a mouse button or key press.

The other big enhancement is the calibration profiles. I found myself sometimes wanting to play on my big screen TV and other times on my monitor. Combine that with 4:3 aspect ratio games requiring different calibration data, adding multiple profiles is an obvious solution. While the calibration procedure is simple, it's even faster to just press a button to select a profile.

Support for the ATmega32U4 boards was a bit of a last minute addition and not as well tested, but it should work (though I haven't tested saving to EEPROM).

The buttons in the sketch are configured for a SAMCO 2.0 GunCon 2 build. If your gun has different button pin assignments then you will have to modify the sketch.

You can get the source code from: https://github.com/Prow7/ir-light-gun
See the readme files on GitHub for more details.

Big thanks to Samco for this project. Your custom PCB made it super easy to mod a GunCon 2! Also thanks to Gustavo for his Apexel lens adapter models. A fantastic solution to the less than ideal narrow FOV that the camera has.
I used your improved version of sanco firmware on 32U4, it is really good.  But compared to gun4ir, it lacks support for electromagnets.  Calibration is not very friendly either.  Hope to see the updated version of the firmware.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: sparehead1 on January 07, 2022, 05:49:23 am
Hi there! I've ordered some Samco boards, guncon 2's, cameras, and itsy-bitsy M4's. I want to use them on a projector screen so I was wondering if there are guides for the distance from the screen in relation to screen size? Can I use fish eye or wide-angle lenses? Should I still use Wii sensor bars or can I use 4 IR LED's spaced out a little more? Thanks in advance! I'm looking forward to building them!
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on January 07, 2022, 12:24:50 pm
Hi there! I've ordered some Samco boards, guncon 2's, cameras, and itsy-bitsy M4's. I want to use them on a projector screen so I was wondering if there are guides for the distance from the screen in relation to screen size? Can I use fish eye or wide-angle lenses? Should I still use Wii sensor bars or can I use 4 IR LED's spaced out a little more? Thanks in advance! I'm looking forward to building them!
From my experience you will want to use at least a wide angle lens.

If you already have 2 Wii sensor bars then might as well just try it out with them first.

For a bit of reference, I use sensor bars from an original EMS LCD TopGun which have the IR emitters approximately 33cm apart. I have a super wide angle lens on my gun (the FOV is less than a fish eye lens) and I can be positioned around 2M away from my 65" TV.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: sparehead1 on January 07, 2022, 10:46:52 pm
Thanks Prow :)

I dont have sensor bars yet so I think I'll make some IR LED arrays. Any recommendations for super wide or fish eye lens's? I want to use it on my 110" screen.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on January 08, 2022, 03:49:09 pm
I dont have sensor bars yet so I think I'll make some IR LED arrays. Any recommendations for super wide or fish eye lens's? I want to use it on my 110" screen.
Good idea to make your own IR emitters. I can only guess maybe Wii sensor bars may not be spaced out enough for a screen that large.

For the lenses, I bought an Apexel lens kit. However, I have noticed many people in the Gun4IR Discord buy a cheap 3 in 1 mobile phone lens kit which includes a wide angle and fish eye lens. I don't know if some accuracy aiming at the corners will be lost when using a fish eye lens due to the distortion, I haven't tried it. :dunno I saw that mentioned which is why I initially used the wide angle lens but then swapped in the super wide angle lens.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: rbarr110 on January 09, 2022, 03:00:14 pm
I am so glad I found this thread.  I wanted light guns soooo bad 10-15 years ago when I was more active here.  My current machine I built is too big for my wife, thanks CRT monitors.  So I have been toying with a new cabinet design off and on for years and finally got to a point that I think I can make what I want.

Had the GunCon 2's for a while and the SAMCO solution looks soo easy that I had to do it.  Everything is ordered, only thing that may hold this back is the damn backordered DF robot cameras. 
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: sparehead1 on January 10, 2022, 05:14:34 am
For the super wide lens this the one that's recommended? (https://www.aliexpress.com/item/33021146589.html?spm=a2g0o.store_pc_groupList.8148356.9.644e1b7aoKv2C4)
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: Prow on January 10, 2022, 12:16:40 pm
For the super wide lens this the one that's recommended? (https://www.aliexpress.com/item/33021146589.html?spm=a2g0o.store_pc_groupList.8148356.9.644e1b7aoKv2C4)
I have the APL-DG7 lens kit (7 in 1). So that kit does look similar and gives you the 3 useful lenses to try out.
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: ThatOneSeong on January 18, 2022, 01:37:10 pm
However, I have noticed many people in the Gun4IR Discord buy a cheap 3 in 1 mobile phone lens kit which includes a wide angle and fish eye lens. I don't know if some accuracy aiming at the corners will be lost when using a fish eye lens due to the distortion, I haven't tried it. :dunno
I can speak to being one of those "many people." It's okay I suppose. The fisheye causes too much distortion for the dual light-strip array, presumably whacking out the rectangular field that the sketch expects. Using the wide angle combination seems to work better, about as fine as vanilla, though I had to bump up the sensitivity by one level to make it work consistently (dunno how much of that is just having more sunlight than usual).
If only I'd known this earlier; the super wide lens seems the best option for Samco in general. But that'll have to wait until after I've moved house. Another two months long wait for shipping from China.  :badmood:
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: sparehead1 on January 18, 2022, 07:04:59 pm
I went with the super wide which is now on a slow boat. I thought I'd snagged the last 2 cameras from element14 but now my order says they are on back order and not expected to ship until June  :(
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: sparehead1 on May 14, 2022, 08:13:08 pm
My camera's turned up :D

now I need to find a way to attach the wide-angle lens's :/
Title: Re: SAMCO DIY Arduino Powered IR Light Gun
Post by: scratcher53 on May 19, 2022, 05:02:39 pm
Hi All,
New to light guns but have a few questions.
i have built two Samco guncon2 guns and using the 4 ir sketch, may use prow enhanced sketch, is there a way to re asign some keys. EG move the calibration key to the down key on the d pad and asign ESC to the up key. Also move the reload key from the left side to the bottom (currently the calibration key) ?
Thanks,