Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up --- Bug Reports --- Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: SAMCO DIY Arduino Powered IR Light Gun  (Read 1303 times)

0 Members and 1 Guest are viewing this topic.

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
SAMCO DIY Arduino Powered IR Light Gun
« 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.



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

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 17605
  • Last login:Today at 02:16:37 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #1 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. 

thet0ast3r

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:July 28, 2019, 03:22:24 am
  • Chihiro ftw
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #2 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:
thet0ast3r

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #3 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

thet0ast3r

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 69
  • Last login:July 28, 2019, 03:22:24 am
  • Chihiro ftw
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #4 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. :)
thet0ast3r

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #5 on: June 23, 2019, 08:33:51 am »
Hi Guys, just a quick update. Build Guide is now available...

meltman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 219
  • Last login:Yesterday at 09:26:36 pm
  • Brilliant!
    • My arcade gallery
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #6 on: June 28, 2019, 04:33:49 pm »
Fantastic work man.

Dam0

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • Last login:July 12, 2019, 05:36:01 am
  • I want to build my own arcade controls!
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #7 on: July 06, 2019, 02:42:49 am »
nice, ive ordered the bits, cant wait.

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #8 on: July 28, 2019, 08:45:25 am »
Hey Guys, just another quick update. PlayStation 1 & SEGA Saturn setup video is now up!


Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 55
  • Last login:July 29, 2019, 08:13:27 am
  • Arcade enthusiast !
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #9 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)?

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #10 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.

Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 55
  • Last login:July 29, 2019, 08:13:27 am
  • Arcade enthusiast !
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #11 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
« Last Edit: July 29, 2019, 08:14:03 am by Ginsonic »

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:Yesterday at 12:21:07 pm
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #12 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.
https://LightGunGamer.com - every Lightgun game and how to play them

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #13 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...



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.

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:Yesterday at 12:21:07 pm
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #14 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?
https://LightGunGamer.com - every Lightgun game and how to play them

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #15 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

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 13
  • Last login:Yesterday at 12:21:07 pm
  • I love playing Light Gun Games
    • LightgunGame.com
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #16 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
https://LightGunGamer.com - every Lightgun game and how to play them

samco

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • Last login:Yesterday at 09:39:40 am
  • SAMCO Light Gun Creater
Re: SAMCO DIY Arduino Powered IR Light Gun
« Reply #17 on: Yesterday at 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 :)
« Last Edit: Yesterday at 09:36:59 am by samco »