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 Try the site in https mode Site News

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

Poll

-- deleted poll --

-- deleted poll --
0 (0%)
-- deleted poll --
0 (0%)

Total Members Voted: 0

  

Author Topic: GUN4IR - The Ultimate 4 Points Lightgun System  (Read 390839 times)

0 Members and 1 Guest are viewing this topic.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #160 on: January 19, 2020, 07:39:02 am »
i'm installed arduino ide but in \AppData\Local\Arduino15\

dir packages not present, 
do I have to install anything else?

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:June 11, 2020, 06:08:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #161 on: January 19, 2020, 08:04:34 am »
Assuming that the dfrobot cam is the same as the wiimote camera (which I think I proved by building my gun with it)
your 55" screen is around 121.62 cm wide, so according to https://www.wiimoteproject.com/wiimote-whiteboard/wiimote-camera-angles/
you'd need to be 167.07 cm away from the screen to see the leds on the sides, not accounting for the vertically placed leds.
But as the vertical leds are placed at half that distance, you'd be able to divide the 167.07 by 2.
However you're still limited by how far away you can see the vertical leds as the height of the 55" screen is 65.99cm
which equals 123.13cm.

So I'd say 1.2 meters would be around the minimum distance you could use it reliably, I might be wrong though 😊

@kill_one later today i'll provide an alternative guide for flashing the pro micro with avr-dudess which is fewer steps but requires you to enter bootloader mode by shorting the rst (reset) pin to ground (can be done with any small metal object)

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9393
  • Last login:Today at 04:47:42 am
  • Designated spam hunter
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #162 on: January 19, 2020, 11:00:07 am »
i'm installed arduino ide but in \AppData\Local\Arduino15\

dir packages not present, 
do I have to install anything else?

Here are the avrdude install procedures from the miniArcade 2.0 User Guide. (pg 13)
- Not sure where Bruno originally found the driver for step 2.
- If you can't find it elsewhere, it is in the miniArcade 2.0 download files here.
Quote
Arduino boards:
1. Install the avrdude programmer.
Windows:  Files are located in the "avrdude" folder.
MAC OS:  The recommended way is to install brew as per single liner available from http://brew.sh/ then install avrdude with:
brew install avrdude
Linux:  sudo apt-get install avrdude
2. Windows only:  Install the Arduino Leonardo/Mini bootloader driver located in the "avrdude\drivers" folder as per the instructions at https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2

Here are the avrdude programming procedures from the miniArcade 2.0 User Guide. (pg 14)
- Put a copy of JayBee's .hex file in the avrdude folder.  (used in place of "MINIARCADE2.hex")
Quote
6. Find the COM port/device assigned to the Arduino bootloader.
Windows:  In Control Panel -- Devices and Printers, the bootloader port number is displayed in the device description when the board is put in bootloader mode by pressing the reset button (Micro) or double-click grounding RST 2x as described here. (Pro Micro)
MAC:  ls /dev/tty.usbmodem*
Linux:  Can be found via dmesg after pressing the Arduino reset button
7. Create a "miniArcade2.txt" file in the avrdude directory and insert the text for your OS.
Windows:  Change "COMX" to the Arduino bootloader port i.e. "COM7"
Quote
avrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
MAC:  Change "tty.usbmodemXXXX" to the bootloader device used by your Arduino i.e. "tty.usbmodem1411"
Quote
#!/bin/sh
avrdude -p atmega32u4 -P /dev/tty.usbmodemXXXX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
Linux:  Change "ttyACMX" to the bootloader device used by your Arduino i.e. "ttyACM0"
Quote
#!/bin/sh
avrdude -p atmega32u4 -P /dev/ttyACMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
8. Rename "miniArcade2.txt" to "miniArcade2.bat" (Windows) or "miniArcade2.sh". (MAC or Linux)
9. MAC or Linux:  "chmod 755 miniArcade2.sh" to set the execution permission bits.
10. To program the Arduino, launch the .bat/.sh file immediately after pressing the reset button or double-click grounding RST to put the Arduino into programming mode. (the board only stays in programming mode for 8 seconds)



For JayBee's firmware, you don't need to reprogram the EEPROM, so use this for the Windows text in step 7.
- Change "COMX" to the Arduino bootloader port.
- Change "MINIARCADE2.hex" to JayBee's .hex file.
Quote
avrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -C avrdude.conf


Scott

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #163 on: January 19, 2020, 07:44:39 pm »
Assuming that the dfrobot cam is the same as the wiimote camera (which I think I proved by building my gun with it)
your 55" screen is around 121.62 cm wide, so according to https://www.wiimoteproject.com/wiimote-whiteboard/wiimote-camera-angles/
you'd need to be 167.07 cm away from the screen to see the leds on the sides, not accounting for the vertically placed leds.
But as the vertical leds are placed at half that distance, you'd be able to divide the 167.07 by 2.
However you're still limited by how far away you can see the vertical leds as the height of the 55" screen is 65.99cm
which equals 123.13cm.

So I'd say 1.2 meters would be around the minimum distance you could use it reliably, I might be wrong though 😊

@kill_one later today i'll provide an alternative guide for flashing the pro micro with avr-dudess which is fewer steps but requires you to enter bootloader mode by shorting the rst (reset) pin to ground (can be done with any small metal object)
Your calculations look accurate, thanks  :applaud:
i'm installed arduino ide but in \AppData\Local\Arduino15\

dir packages not present, 
do I have to install anything else?

Here are the avrdude install procedures from the miniArcade 2.0 User Guide. (pg 13)
- Not sure where Bruno originally found the driver for step 2.
- If you can't find it elsewhere, it is in the miniArcade 2.0 download files here.
Quote
Arduino boards:
1. Install the avrdude programmer.
Windows:  Files are located in the "avrdude" folder.
MAC OS:  The recommended way is to install brew as per single liner available from http://brew.sh/ then install avrdude with:
brew install avrdude
Linux:  sudo apt-get install avrdude
2. Windows only:  Install the Arduino Leonardo/Mini bootloader driver located in the "avrdude\drivers" folder as per the instructions at https://www.arduino.cc/en/Guide/ArduinoLeonardoMicro#toc2

Here are the avrdude programming procedures from the miniArcade 2.0 User Guide. (pg 14)
- Put a copy of JayBee's .hex file in the avrdude folder.  (used in place of "MINIARCADE2.hex")
Quote
6. Find the COM port/device assigned to the Arduino bootloader.
Windows:  In Control Panel -- Devices and Printers, the bootloader port number is displayed in the device description when the board is put in bootloader mode by pressing the reset button (Micro) or double-click grounding RST 2x as described here. (Pro Micro)
MAC:  ls /dev/tty.usbmodem*
Linux:  Can be found via dmesg after pressing the Arduino reset button
7. Create a "miniArcade2.txt" file in the avrdude directory and insert the text for your OS.
Windows:  Change "COMX" to the Arduino bootloader port i.e. "COM7"
Quote
avrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
MAC:  Change "tty.usbmodemXXXX" to the bootloader device used by your Arduino i.e. "tty.usbmodem1411"
Quote
#!/bin/sh
avrdude -p atmega32u4 -P /dev/tty.usbmodemXXXX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
Linux:  Change "ttyACMX" to the bootloader device used by your Arduino i.e. "ttyACM0"
Quote
#!/bin/sh
avrdude -p atmega32u4 -P /dev/ttyACMX -c avr109 -U flash:w:MINIARCADE2.hex -U eeprom:w:EEPROM.eep -C avrdude.conf
8. Rename "miniArcade2.txt" to "miniArcade2.bat" (Windows) or "miniArcade2.sh". (MAC or Linux)
9. MAC or Linux:  "chmod 755 miniArcade2.sh" to set the execution permission bits.
10. To program the Arduino, launch the .bat/.sh file immediately after pressing the reset button or double-click grounding RST to put the Arduino into programming mode. (the board only stays in programming mode for 8 seconds)



For JayBee's firmware, you don't need to reprogram the EEPROM, so use this for the Windows text in step 7.
- Change "COMX" to the Arduino bootloader port.
- Change "MINIARCADE2.hex" to JayBee's .hex file.
Quote
avrdude -p atmega32u4 -P COMX -c avr109 -U flash:w:MINIARCADE2.hex -C avrdude.conf


Scott
Yeah I have to improve the explanation for that in my post, to make it more clear and convenient.
Also if you don't want or can't use the reset pin, with any program able to access the Arduino com port just open a connection at 1200baud then close it.
It will automatically trigger a reboot in bootloader mode, same as the rst pin would.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9393
  • Last login:Today at 04:47:42 am
  • Designated spam hunter
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #164 on: January 19, 2020, 10:20:04 pm »
Yeah I have to improve the explanation for that in my post, to make it more clear and convenient.
Feel free to use/remix anything I've posted.   :cheers:

Also if you don't want or can't use the reset pin, with any program able to access the Arduino com port just open a connection at 1200baud then close it.
It will automatically trigger a reboot in bootloader mode, same as the rst pin would.
That might be handy for boards like the Pro Micro that don't have an onboard reset button.   ;D

Maybe it's possible to write a single .bat file that opens a 1200 baud port, pauses long enough to ensure it is open, closes the port, momentarily pauses again, and runs avrdude to program the board.


Scott

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #165 on: January 20, 2020, 05:01:28 am »
That might be handy for boards like the Pro Micro that don't have an onboard reset button.   ;D

Maybe it's possible to write a single .bat file that opens a 1200 baud port, pauses long enough to ensure it is open, closes the port, momentarily pauses again, and runs avrdude to program the board.


Scott
That's exactly what I was thinking of doing, and include it inside the zip file along with the hex file. Would make it so much more simple, including for me :lol

Edit3: Ok I managed to do a bat tool to automatically update the arduino!
Of course it works only if you have just one arduino connected when updating it.
I will post it right away.

Edit4: DONE! Now flashing the firmware is as simple as running the bat file  ;D
That's be great if you guys could test it to see if it works properly for you ;)
« Last Edit: January 20, 2020, 08:54:35 am by JayBee »

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:June 11, 2020, 06:08:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #166 on: January 20, 2020, 01:46:57 pm »
Guess i dont have to create that avr-dudess guide anyways :P

However, i have a slight problem. and a weird one at that!
I couldn't use the B button of my pistol in games, as it did the same as the A button. (B set up as start button in retroarch)
figured it was just the game, but tested in desktop, the startbutton didnt middleclick, it rightclicks.
the same applies when i try to map the keys in retroarch, it says mouse 2 whatever button i press  :o
hooked it up to my pc, and fired up an online mousetest, every button is registered as mouse 2.
which is weird cause when i play rescue shot i can shoot and use the A button for grenade. but cant pause it just selects grenade just as the A button does.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #167 on: January 20, 2020, 07:45:24 pm »
Guess i dont have to create that avr-dudess guide anyways :P

However, i have a slight problem. and a weird one at that!
I couldn't use the B button of my pistol in games, as it did the same as the A button. (B set up as start button in retroarch)
figured it was just the game, but tested in desktop, the startbutton didnt middleclick, it rightclicks.
the same applies when i try to map the keys in retroarch, it says mouse 2 whatever button i press  :o
hooked it up to my pc, and fired up an online mousetest, every button is registered as mouse 2.
which is weird cause when i play rescue shot i can shoot and use the A button for grenade. but cant pause it just selects grenade just as the A button does.
I just tested my gun with the last firmware, it still has the B button as middle click.
Which pin is connected to the B button on your gun?
Be careful, the pedal button pin does have the same function as A button for compatibility purpose.
« Last Edit: January 20, 2020, 07:47:05 pm by JayBee »

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:June 11, 2020, 06:08:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #168 on: January 20, 2020, 07:53:20 pm »
I've connected the buttons according to your diagram.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #169 on: January 20, 2020, 11:48:47 pm »
I've connected the buttons according to your diagram.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.
It's weird, I tested my GCon 1&2 with the same diagram, they both work perfectly with middle button.
Did you check the pins again just to be sure?
Be careful, pin A6 is pin 4 and pin A7 is pin 6 (I really have to make it more clear in my first post).

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #170 on: January 21, 2020, 04:53:14 am »
Edit4: DONE! Now flashing the firmware is as simple as running the bat file  ;D
That's be great if you guys could test it to see if it works properly for you ;)

Thanks!!! Working perfectly :)

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:June 11, 2020, 06:08:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #171 on: January 21, 2020, 05:31:36 am »
I've connected the buttons according to your diagram.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.
It's weird, I tested my GCon 1&2 with the same diagram, they both work perfectly with middle button.
Did you check the pins again just to be sure?
Be careful, pin A6 is pin 4 and pin A7 is pin 6 (I really have to make it more clear in my first post).

I'll check just to be sure... Again d'oh

Edit: that fixed the middle mouse button. but the trigger still right clicks for some reason.
« Last Edit: January 21, 2020, 07:17:53 am by Mysli0210 »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #172 on: January 21, 2020, 07:28:26 am »
I've connected the buttons according to your diagram.
I didnt connect the pedal pin to anything.
just needed left, right and middle mouse button.
It's weird, I tested my GCon 1&2 with the same diagram, they both work perfectly with middle button.
Did you check the pins again just to be sure?
Be careful, pin A6 is pin 4 and pin A7 is pin 6 (I really have to make it more clear in my first post).

I'll check just to be sure... Again d'oh

Edit: that fixed the middle mouse button. but the trigger still right clicks for some reason.
The trigger is activating the right click when pointing outside of the screen (for games with off screen reload), is that doing the right click on screen too?

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:June 11, 2020, 06:08:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #173 on: January 21, 2020, 09:26:31 am »
sure seems like it is, but the trigger works fine ingame, its just registered as mouse 2 in mousetest aswell as in the keybind on retroarch.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #174 on: January 21, 2020, 10:10:47 am »
sure seems like it is, but the trigger works fine ingame, its just registered as mouse 2 in mousetest aswell as in the keybind on retroarch.
If aiming onscreen, it should always register as mouse 1, if offscreen, always as mouse 2. If only some softwares see it another way it's probably a software issue ;)

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #175 on: January 21, 2020, 12:24:42 pm »
@jaybee please where can I buy the same LEDs that you used? ;D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #176 on: January 21, 2020, 09:23:09 pm »
@jaybee please where can I buy the same LEDs that you used? ;D
Actually I bough mine in a local shop here in Tokyo, and I think this model is japanese only.
But any LED with similar or close enough specs will work ;)
However don't buy them on aliexpress or similar chinese website, the ones they are selling are usually very bad quality and won't work as well.
If someone can tell us what's the best model they found in US or online...  :cheers:

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #177 on: January 22, 2020, 01:58:25 am »
I added a poll to decide the way the input mode should be in this firmware  ;D

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #178 on: January 22, 2020, 12:43:18 pm »
@jaybee please where can I buy the same LEDs that you used? ;D
Actually I bough mine in a local shop here in Tokyo, and I think this model is japanese only.
But any LED with similar or close enough specs will work ;)
However don't buy them on aliexpress or similar chinese website, the ones they are selling are usually very bad quality and won't work as well.
If someone can tell us what's the best model they found in US or online...  :cheers:

i find in local shop in Italy this: http://pdf.icpdf.com/pdf4/LIGITEK/LIR33_datasheet_733433/119516/LIR33_datasheet.pdf

they should work but which resistance should I use for this?
thanks a lot JayBee

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #179 on: January 22, 2020, 08:39:58 pm »
@jaybee please where can I buy the same LEDs that you used? ;D
Actually I bough mine in a local shop here in Tokyo, and I think this model is japanese only.
But any LED with similar or close enough specs will work ;)
However don't buy them on aliexpress or similar chinese website, the ones they are selling are usually very bad quality and won't work as well.
If someone can tell us what's the best model they found in US or online...  :cheers:

i find in local shop in Italy this: http://pdf.icpdf.com/pdf4/LIGITEK/LIR33_datasheet_733433/119516/LIR33_datasheet.pdf

they should work but which resistance should I use for this?
thanks a lot JayBee
Not bad, they look like they'd work nicely!
Here is the info I can get from the website I mentioned in the OP ;)
Since the specs are almost the same as mine, 56ohms resistors should also work, but you will get less brightness.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #180 on: January 23, 2020, 10:49:08 am »
Not bad, they look like they'd work nicely!
Here is the info I can get from the website I mentioned in the OP ;)
Since the specs are almost the same as mine, 56ohms resistors should also work, but you will get less brightness.
thanks JayBee!!! Can you post other images on how you connected the LEDs to each other and to USB power for beginners like me? : D

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #181 on: January 23, 2020, 11:06:25 am »

this the gun I'm working on is a Bio Gun for the first XBOX inside there is a rumble motor connected to an on off switch,
 


can i use this by connecting it to the rumble and gnd pin of the pro micro or do i have to change it with one for xbox360?


JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #182 on: January 23, 2020, 09:26:12 pm »
Not bad, they look like they'd work nicely!
Here is the info I can get from the website I mentioned in the OP ;)
Since the specs are almost the same as mine, 56ohms resistors should also work, but you will get less brightness.
thanks JayBee!!! Can you post other images on how you connected the LEDs to each other and to USB power for beginners like me? : D
It might be hard to show anything more than the pics in the OP  :P
Basically for each IR point, you have one resistor and 2 LEDs in series. Each of those components group are directly connected to the common USB vcc and gnd.
To make it easier, what I did was to solder each point vcc and gnd to the next point vcc and gnd. It reduces the length of cables.

this the gun I'm working on is a Bio Gun for the first XBOX inside there is a rumble motor connected to an on off switch,

can i use this by connecting it to the rumble and gnd pin of the pro micro or do i have to change it with one for xbox360?
The Arduino digital and analog pins don't provide enough power for rumble, so you will need a transistor or a mosfet to trigger the rumble from the Arduino, and have a separate motor power source.
I personally power my Xbox 360 rumble motor with the Arduino vcc, because it's 5 volts and doesn't take so much current. but it's not really a recommended solution, especially if you don't have the motor specs (voltage, current, resistance...).
But in the case your motor is powered only by the Xbox USB power, it should be fine too I guess.
I will post the list of components you need for the control circuit later when I go home ;)

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #183 on: January 24, 2020, 04:51:23 am »
The Arduino digital and analog pins don't provide enough power for rumble, so you will need a transistor or a mosfet to trigger the rumble from the Arduino, and have a separate motor power source.
I personally power my Xbox 360 rumble motor with the Arduino vcc, because it's 5 volts and doesn't take so much current. but it's not really a recommended solution, especially if you don't have the motor specs (voltage, current, resistance...).
But in the case your motor is powered only by the Xbox USB power, it should be fine too I guess.
I will post the list of components you need for the control circuit later when I go home ;)

so if I understand correctly, I connect solenoid and rumble or just one of the two to your circuit (still to be created) and feed it at 5v better with a second separate usb cable and then from this circuit the Rumble and Recoil pins on the arduino right?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #184 on: January 24, 2020, 11:13:43 am »
The Arduino digital and analog pins don't provide enough power for rumble, so you will need a transistor or a mosfet to trigger the rumble from the Arduino, and have a separate motor power source.
I personally power my Xbox 360 rumble motor with the Arduino vcc, because it's 5 volts and doesn't take so much current. but it's not really a recommended solution, especially if you don't have the motor specs (voltage, current, resistance...).
But in the case your motor is powered only by the Xbox USB power, it should be fine too I guess.
I will post the list of components you need for the control circuit later when I go home ;)

so if I understand correctly, I connect solenoid and rumble or just one of the two to your circuit (still to be created) and feed it at 5v better with a second separate usb cable and then from this circuit the Rumble and Recoil pins on the arduino right?
Yes you understand correctly, each circuit has its own power and is connected to the corresponding arduino pin.
And they all have a common ground.
There are actually 2 kind of control circuits I made, one for the rumble with the simple transistor, and a bigger one for the solenoid with a mosfet, because solenoids circuits need to be stronger than motor circuits usually.
Which circuit/components you will use will depend of the specs of your rumble and solenoid.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #185 on: January 24, 2020, 11:56:50 am »
There are actually 2 kind of control circuits I made, one for the rumble with the simple transistor, and a bigger one for the solenoid with a mosfet, because solenoids circuits need to be stronger than motor circuits usually.
Which circuit/components you will use will depend of the specs of your rumble and solenoid.

OK thanks! Then I am waiting for you to place the two circuits and the list of components to create them...as soon as you are ready ;)

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #186 on: January 28, 2020, 12:37:03 pm »
Hello JayBee news ?  ;D

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #187 on: January 28, 2020, 08:45:46 pm »
Hello JayBee news ?  ;D
I've been quite busy in my personal life lately, and also trying to pull a huge update for my firmware to address the last flaws of this system (minimum distance and maximum tilt), so it might take a while before I can do the schematics and components list  :-\

Foxhole

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 287
  • Last login:March 04, 2024, 04:36:28 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #188 on: January 29, 2020, 12:31:05 am »
Hello JayBee news ?  ;D
I've been quite busy in my personal life lately, and also trying to pull a huge update for my firmware to address the last flaws of this system (minimum distance and maximum tilt), so it might take a while before I can do the schematics and components list  :-\
That's awesome, man. I'm still waiting for the parts.
Looking forward to building this gun. Any tips about mounting everything in a guncon 1 or guncon 2?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #189 on: January 29, 2020, 02:51:48 am »
That's awesome, man. I'm still waiting for the parts.
Looking forward to building this gun. Any tips about mounting everything in a guncon 1 or guncon 2?
Well I'm not super good for the hardware side of things, so my way might not be the best nor the cleanest, but if you want to check anyway you can see my other thread, where I show the inside of the first 2 guns I made (saturn gun and guncon 1).
You can also check the way I soldered everything on the GC2 motherboard at post #146 of this thread.

A bit more details:
The Saturn Gun is the largest of all, I was able to fit everything inside with ease. It has a big and loud solenoid. But it also has only 2 buttons.
In the GC1 I could fit a smaller solenoid, but no rumble (yet).
For the GC2 I didn't had time to try fitting a mini solenoid nor rumble yet, and it's way harder to fit anything inside due to the slim form factor and all the buttons.

More details will come with the schematics when I finally have time for it.

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #190 on: January 29, 2020, 05:09:07 am »
Hello JayBee news ?  ;D
I've been quite busy in my personal life lately, and also trying to pull a huge update for my firmware to address the last flaws of this system (minimum distance and maximum tilt), so it might take a while before I can do the schematics and components list  :-\

Of course JayBee the family first of all! : D I look forward to the new release then;)

SpatzST

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 229
  • Last login:April 18, 2021, 05:29:46 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #191 on: January 29, 2020, 10:05:10 am »
Does using this system make it track faster/better? Or is it more for 'no calibration'?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #192 on: January 29, 2020, 12:35:41 pm »
Does using this system make it track faster/better? Or is it more for 'no calibration'?
Yeah, beside the no calibration it does work faster and better to some extend; it minimizes input latency, works from a wider angle, tracks a largers area, adds a good off screen tracking, and reduces greatly the minimum distance the player has to be from the screen.
Beside that it also adds numerous other functionalities, the full list is in the first post  ;)

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #193 on: January 31, 2020, 05:24:37 am »
https://photos.app.goo.gl/AcDxtFS8RYcwP36XA

https://photos.app.goo.gl/gWf5H3t17kysawLd8

this is my first attempt, with the LEDs that I have taken I can stay at a maximum distance of one meter from the monitor, but considering that it is a 25" is okay! If I tilt the gun too much, the cursor goes crazy and is off-center, but it is a known problem, the trigger does not take the shot every now and then but maybe I have to better check the welded wire, the button B associated with the Middle mouse button if I try to configure it in MAME it does not insert anything and in mame it is seen the gun as GUNXX and the button A me it marks it the same as the trigger, in windows it works as a right mouse button.. apart from that it works great pointing very precisely and there is no flicker of the cursor! You are a great JayBee !!!;)

I can't do the calibration reset procedure, to overwrite the old calibration with new, how should I proceed?

now I just have to connect the rumble ... :)
« Last Edit: January 31, 2020, 05:31:50 am by kill_one »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #194 on: January 31, 2020, 10:15:34 am »
https://photos.app.goo.gl/AcDxtFS8RYcwP36XA

https://photos.app.goo.gl/gWf5H3t17kysawLd8

this is my first attempt, with the LEDs that I have taken I can stay at a maximum distance of one meter from the monitor, but considering that it is a 25" is okay! If I tilt the gun too much, the cursor goes crazy and is off-center, but it is a known problem, the trigger does not take the shot every now and then but maybe I have to better check the welded wire, the button B associated with the Middle mouse button if I try to configure it in MAME it does not insert anything and in mame it is seen the gun as GUNXX and the button A me it marks it the same as the trigger, in windows it works as a right mouse button.. apart from that it works great pointing very precisely and there is no flicker of the cursor! You are a great JayBee !!!;)

I can't do the calibration reset procedure, to overwrite the old calibration with new, how should I proceed?

now I just have to connect the rumble ... :)
Really nice setup, good job!  :applaud:
You probably know that already, but just in case; your screen is not vertical but the leds have to be facing the gun as much as possible if you want the gun to see them correctly ;)

Yeah the issue with the tilt is that this system doesn't have gravity sensor to know how it's tilted, so when you turn the gun more than 45 degrees it doesn't know where the up is anymore.
But that's one of the things I am working on for the big upcoming update I'm busy preparing, so that should be fixed soon if everything goes well ;D

For the A and B buttons not behaving correctly, can you tell me for each of them how they are behaving in windows? (try them on a basic webpage, convenient to test the right and middle clicks)
Also, I just realized your gun has A B X Y start buttons and a dpad, that's very unusual, I'm curious to know on which pins you wired them all.
Looks really annoying to find good soldering points on the motherboard.

In Mame I'm not sure what's happening, but it looks like the gun axises aren't mapped correctly in the input menu?
If you can see the mouse cursor behaving correctly in the mame menu (outside of the game), it means it's indeed not mapped correctly.

For the calibration process it's very simple: hold the calibration button for few seconds (until the cursor goes to the middle of the screen), aim the middle of the screen, shoot, aim the top left corner of the screen, shoot again, aim the bottom right of the screen, shoot one last time. If the calibration process went well it should be calibrated and you shouldn't have to calibrate it ever again ;)

Tell me how it goes  :cheers:

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #195 on: February 01, 2020, 07:25:47 pm »
Really nice setup, good job!  :applaud:
You probably know that already, but just in case; your screen is not vertical but the leds have to be facing the gun as much as possible if you want the gun to see them correctly ;)

yes the screen is tilted and I put the pairs of LEDs exactly on the central sides of the monitor, but I don't know if the second LEDs on the right and left are seen because they are covered by the internal wood of the cab, If I put them vertically could it improve detection?

Yeah the issue with the tilt is that this system doesn't have gravity sensor to know how it's tilted, so when you turn the gun more than 45 degrees it doesn't know where the up is anymore.
But that's one of the things I am working on for the big upcoming update I'm busy preparing, so that should be fixed soon if everything goes well ;D

if you can solve this you have created the perfect solution to use lightguns on Arcade games :)

For the A and B buttons not behaving correctly, can you tell me for each of them how they are behaving in windows? (try them on a basic webpage, convenient to test the right and middle clicks)
Also, I just realized your gun has A B X Y start buttons and a dpad, that's very unusual, I'm curious to know on which pins you wired them all.
Looks really annoying to find good soldering points on the motherboard.

Yes...i identified the pins of the buttons with the tester and soldered the wires that go from the arduino and I used the following combination of keys:

DPAD = DPAD Button
AUTO = CALIBRATION Button
START = START Button
BACK = A Button
X = SELECT Button
B = B Button

In Mame I'm not sure what's happening, but it looks like the gun axises aren't mapped correctly in the input menu?
If you can see the mouse cursor behaving correctly in the mame menu (outside of the game), it means it's indeed not mapped correctly.

I have reviewed the links and I think I have found and partially solved the problem...A and B Button work perfectly, Trigger button has a problem...

For the calibration process it's very simple: hold the calibration button for few seconds (until the cursor goes to the middle of the screen), aim the middle of the screen, shoot, aim the top left corner of the screen, shoot again, aim the bottom right of the screen, shoot one last time. If the calibration process went well it should be calibrated and you shouldn't have to calibrate it ever again ;)

where having used this calibration procedure I was no longer able to have a certain precision, I had to reinstall the firmware and do the automatic calibration

Tell me how it goes  :cheers:

I think I found a bug perhaps in the last fw that you released 1.4, in practice it is the problem I had on the mame and on the calibration, in practice after various trigger pressures, the trigger Button becomes A Button...I did various tests, and I can tell you that both in mouse and joypad mode it does the same, Joy Button 1 becomes Joy Button 2 and then returns to normal when he wants...if I connect the trigger button to arduino pin B button it works well, Joy Button 3 always remains for example.

so I guess it's either a firmware bug or the defective arduino,so seen that at the moment I don't have another arduino to try, if you can verify this anomalous behavior please? :)

links to photos and videos of the problem:

https://photos.app.goo.gl/iDWw3YxooWMLZWHS8


Thanks a lot!
« Last Edit: February 01, 2020, 07:29:12 pm by kill_one »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #196 on: February 02, 2020, 12:40:24 am »
yes the screen is tilted and I put the pairs of LEDs exactly on the central sides of the monitor, but I don't know if the second LEDs on the right and left are seen because they are covered by the internal wood of the cab, If I put them vertically could it improve detection?
You indeed have to place each leds point at the center of each side of course, but the leds have to be facing the gun camera because their angle is very limited. So if the leds are aligned with your screen they are facing upward and won't work correctly. And of course nothing should block their light. I checked your led specs again, and clearly if it's working at only one meter it's not normal, it should work from afar too if the leds angle is correct.

where having used this calibration procedure I was no longer able to have a certain precision, I had to reinstall the firmware and do the automatic calibration
Reinstalling the firmware shouldn't change anything nor erase your calibration. The manual calibration is not overwriting the automatic calibration, but offsetting it to match your screen setup.
But if something goes wrong with your calibration (for instance if the leds can't be seen correctly when doing it), you can reset it by reentering the calibration mode then leaving it without performing the calibration.
(more details in the original post)

I think I found a bug perhaps in the last fw that you released 1.4, in practice it is the problem I had on the mame and on the calibration, in practice after various trigger pressures, the trigger Button becomes A Button...I did various tests, and I can tell you that both in mouse and joypad mode it does the same, Joy Button 1 becomes Joy Button 2 and then returns to normal when he wants...if I connect the trigger button to arduino pin B button it works well, Joy Button 3 always remains for example.

so I guess it's either a firmware bug or the defective arduino,so seen that at the moment I don't have another arduino to try, if you can verify this anomalous behavior please? :)
It's not a bug it's a feature (see the "out of screen firing mode" in my original post). When firing offscreen it triggers the right trigger/button 2. It's used for the games that do reload by firing offscreen.
If it's still firing the button 2 when aiming onscreen, it means the gun can't see your leds correctly.

On your second screen screenshot, the axises are mapped wrong, each axis has both gun axises mapped on it  :lol

kill_one

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 138
  • Last login:March 07, 2023, 01:16:21 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #197 on: February 02, 2020, 04:39:16 am »
You indeed have to place each leds point at the center of each side of course, but the leds have to be facing the gun camera because their angle is very limited. So if the leds are aligned with your screen they are facing upward and won't work correctly. And of course nothing should block their light. I checked your led specs again, and clearly if it's working at only one meter it's not normal, it should work from afar too if the leds angle is correct.

Ok! Thanks! I put a little thickness on the top of the side LEDs to make them stand straight and now it is much better and the gun works even more than a meter, even if the cursor is less stable it starts to wobble a little ...

If it's still firing the button 2 when aiming onscreen, it means the gun can't see your leds correctly.
On your second screen screenshot, the axises are mapped wrong, each axis has both gun axises mapped on it 

As you can see from the video below, in windows now works correctly the trigger always corresponds to the left mouse button while in mame it is always seen with Gunxx B0 both the trigger and A button, but is it normal that it is seen as a GUN and not as a mouse? Forces is this the problem

https://photos.app.goo.gl/ChUJJa1RvkU63Gwf9

Inviato dal mio Redmi Note 5 utilizzando Tapatalk

« Last Edit: February 02, 2020, 08:18:46 am by kill_one »

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 498
  • Last login:Yesterday at 10:09:30 am
  • Creator of the GUN4IR
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #198 on: February 02, 2020, 09:28:26 am »
Ok! Thanks! I put a little thickness on the top of the side LEDs to make them stand straight and now it is much better and the gun works even more than a meter, even if the cursor is less stable it starts to wobble a little ...
Did you do the same for the top and bottom leds too?  ;D

As you can see from the video below, in windows now works correctly the trigger always corresponds to the left mouse button while in mame it is always seen with Gunxx B0 both the trigger and A button, but is it normal that it is seen as a GUN and not as a mouse? Forces is this the problem

https://photos.app.goo.gl/ChUJJa1RvkU63Gwf9

Inviato dal mio Redmi Note 5 utilizzando Tapatalk
I see, it's indeed not normal, it might have something to do with the way Mame is configured.
What do you have in "device mapping" in the Mame config menu? are you using any app for mame that might interfere with the inputs?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #199 on: February 02, 2020, 02:30:04 pm »
Regarding this led shallow angle issue.... why don't you guys just sand the LEDS?  That'll diffuse the light and they'll be viewable at any angle.