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

Poll

*New Poll* Would you like to see this firmware coming to other board models, like the itsybitsy m0 or teensy?

Yes, I already have a gun with another board, so I would like to use it with this firmware (please specify which model)
1 (50%)
Yes, I don't have other boards but I would like more inputs/outputs in my gun
0 (0%)
No, I am perfectly happy with the Pro Micro, it's cheap and easy to find
1 (50%)

Total Members Voted: 2

  

Author Topic: JayBee DIY 4 IR Led Lightgun System (no calibration needed)  (Read 24642 times)

2 Members and 3 Guests are viewing this topic.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« on: September 30, 2019, 01:25:12 pm »
Ultimate 4 IR points lightgun system
Instead of using the usual 2+ LEDs sensor bar, this system uses one LED in the middle of each side, which allows a far better aiming system overall.
I also added tons of features, and will keep it updated whenever needed.

Feel free to tell me what you think about it and if you have any suggestions of improvement.

If you like my projects and want to support me and help me maintain it, or just pay me a beer, here is the PayPal link for donation :cheers:


First, a small obligatory disclaimer: like with any DIY project, I am not responsible of any damage you might do to your hardware/yourself. Always take the security measures with electronic projects. Don't do it if you are not sure of what you are doing. Be sure to read everything careful before using my firmware.
Also I am not a professional in electronic, the solenoid/rumble circuits I am using are my own, but they might not be perfect. I am giving all the schematics and pics as example, use them at your own risks. And feel free to make your own, or giving me any improvement suggestion.
This manual is a work in progress, it will take time to make and upload everything (schematics, pics...).
And of course, this firmware cannot be sold alone nor in a package/hardware, it is completely free. If some people sold it to you, they are scam.


Features of this system:
  • auto calibration: it calibrates itself automatically whenever it sees the 4 IR Led, so you should have a good aiming no matter where you are (as long as you are under the LEDs range of course). The only calibration needed is IR Camera offset calibration, but you will need to do it only once, at first use.
  • precise line-of-sight aiming: thanks to the 4 led system, the aiming is very precise and is far less jittery than other IR solutions.
  • reduced minimum distance: since this system can track you down to 1~2 led, the distance you need to be from the screen is a lot less than other systems. Right now you only need to be able to see the 4 LEDs at the same time when aiming the center of the screen (for calibration), but that might be changed in the future too.
  • out of screen aiming support: as you as the IR cam can still see one LED, it will continue to track you outside of the screen, allowing to move the cursor on the sides.
  • out of screen firing mode: when firing outside of the screen (or outside or IR LEDs range), the trigger will activate the reload button instead of the fire button, to allow more authentic gameplay when playing Virtua Cop for instance. Of course you can also use the reload button (or the pedal/handle button) if you prefer. You can even use both at the same time.
  • mouse released when off range: when the camera doesn't see any IR led, it release the control of the mouse, so you don't need to unplug or pause the gun to use other mouses (in windows for instance).
  • mouse/keyboard and joystick mode: there are lightgun device emulation modes, that can be switched at any time with a single push of A button + calibration button. In mamehooker mode, you can also trigger them automatically for each game or each emulator:
     - mouse/keyboard mode (default mode): uses mouse for aiming, mouse buttons for the first 4 buttons (trigger, A, B, Pedal/Handle buttons), and use keyboard for the rest of the buttons.
     - joystick mode: uses joystick for aiming, and joystick buttons for all buttons.
     - hybrid mode: uses mouse for aiming, and joystick buttons for all buttons. Useful for devices and games that support mouse aiming but not so much mouse+keyboard. (MiSTer fpga project for instance)
  • 16/9 and 4/3 aspect ratio support: there are 3 aspect ratio modes, that can be switched at any time with one single push of the calibration button. In mamehooker mode, you can also trigger them automatically for each game or each emulator.
     - 16/9 (default mode), so it should work with any 16/9 screen no matter the resolution (should also work fine with other close to 16/9 ratio, like 16/10). But for convenience I also added 2 modes:
     - 4/3 in 16/9 with pillar boxes (for 4/3 gaming on a 16/9): as you can guess, it allows you to play 4/3 games on a 16/9 screen, no more full screen stretch needed.
     - native 4/3: when playing on a 4/3 screen.
  • Manual screen calibration: This will allows you to calibrate the screen in case your leds are not right next to the screen or if you have an unusual aspect ratio.
  • solenoid/rumble support: Added functions for solenoid and/or rumble support. The solenoid is activated when firing on screen, and switches to auto mode when holding the trigger. The rumble is activated when reloading or firing off screen, and when switching modes. In mamehooker mode, they will react to the game if supported.
  • Mamehooker support: with supported games and emulators, it will automatically setup things like aspect ratio and aiming/button modes. You can also use it to force those settings at all time (if always playing on a real 4/3 screen for instance). As stated before you will also get solenoid/rumble support for each games that support them. However due to the way this arduino system works, and to prevent solenoid burning, there is a limit of activation timing for those, in some games with fast switching (like terminator 2 full auto mode), the timing might be slightly off.
  • Solenoid temperature sensor support (not fully implemented yet): with a temperature sensor, this allows to control the speed of the solenoid depending of the temperature, to prevent it from dying. It will completely switch it off if the limit temp is reached. I still have to figure what are the nominal temps to use.
Limitations:
The main limitation, the same as with any other IR system, is the IR LEDs, they need to be powerful enough and have good enough angles to meet your needs.
The other one is the limited tilting angle the gun can use, to around 50 degrees on each side (100 degrees in total). There is no proper way to fix that completely unless we have a gravity sensor inside the gun. It's not as bad as it sounds however, unless you like to hold the gun on the side, you shouldn't have any problem.
Also, even if it sounds obvious, there is no support for multi screen setup unless you use the joystick mode, due to the way the mouse coordinates works.
If you want to add a solenoid, keep in mind that those small models I am using are rarely made to withstand full auto mode, especially during long period of time. So if you want to use games that have longer full auto mode, I would advice adding a rumble motor and use MameHooker to drive them (or simply disconnect the solenoid power supply).

Hardware needed:

For the gun:
  • An old lightgun where the IR Camera and the Arduino can fit (Guncon 1&2, Virtua Gun...)
  • Arduino Pro Micro Atmega32u4 5V/16MHz (no support for the itsybitsy m0 yet, as it lacks of some functionalities)
  • long enough micro USB cable
  • the DFRobot IR Camera
  • push button with shaft longer than the shell thickness
  • electronic cables to connect everything
  • soldering iron & solder
  • hot glue or whatever you want to use to prevent anything from moving inside the gun
Optional:
  • mosfet, diode, resistor and pcb for the solenoid control
  • solenoid that fits inside the shell without hitting anything when activated
  • long power cable for the solenoid
  • AC power supply matching the solenoid needs
  • rumble motor (Xbox controllers or any 5V motors will work)
  • temperature measurement chip to regulate the solenoid speed (not fully implemented yet)
  • Corrugated Tube to hide the cables and prevent them from bending too much or get damaged.
  • 3D printed clicky trigger with an arcade switch, for a better trigger feel
Here is the pins listing and their functions in the next table. (the schematics will come next)
Note that you don't have to connect everything, just connect whatever you have available for your gun.
The DFRobot IR Cam sometime have the sensor tilted, so you might have to tilt the camera on left or right to make it work properly. I would recommend you to install the camera first and test the aiming before doing anything else.

Pin number Connected device Functionality Mouse/Keyboard button Gamepad button
19 (A1) Calibration button calibration and modes switching - -
20 (A2) Trigger button gun trigger Left mouse button Button 0
21 (A3) A button reload/cover Right mouse button button 1
4 (A6) B button extra button Middle mouse button button 2
6 (A7) pedal button pedal/GCon2 handle Right mouse button button 1
8 (A8) Select button GCon2 Select Keyboard 5 key button 3
9 (A9) Start button GCon2 Start Keyboard 1 key button 4
14 (MISO) Down button GCon2 Down Keyboard Down arrow dpad Down
15 (SCLK) Up button GCon2 Up Keyboard Up arrow dpad Up
16 (MOSI) Left button GCon2 Left Keyboard Left arrow dpad Left
10 (A10) Right button GCon2 Right Keyboard Right arrow dpad Right
7 Recoil solenoid output Recoil trigger output pin - -
5 Rumble motor output Rumble trigger output pin - -

The corresponding pins on the Pro Micro as reference:


Notes:
  • you don't have to use every pins, just use the ones you want and leave the other pins free.
  • connect the camera to pin GND, VCC, 2 (SDA), and 3 (SCL)
  • the pedal and A button have the same function right now, for compatibility purpose. I might change that in the future.
  • when firing offscreen, the gun trigger will use the secondary button (A button) instead. It is used for offscreen reload.

Here is a diagram of the feedback circuits I am using for the rumble and solenoid, as sample;

You can of course make your how or adapt it the way you want, as long as the Arduino rumble and solenoid pins are correctly used.

For the led system:
  • 4 (or 8 in duo, or 12 for trio) powerful 940nm IR LEDs with angle wide enough (at least 30° for 8 and 12 leds, more for 4).
  • resistors, cables and USB connector
  • USB ac power supply powerful enough
If you're using something bigger than a computer screen, I recommend using 2 or 3 leds by point, with a slight angle between them, for a better angle without reducing the maximum distance.
I personally use 8 SID1K10CM (5MM 940NM 200mw/sr 1.3-1.5v 30°), because they are very powerful, but any led with similar specs will work. Just avoid the wide angle leds since they are not powerful enough to play from a distance more than 1.5m.

You can calculate the resistor needed and the power supply here:
http://led.linear1.org/led.wiz

As an example, here is the schematics and data of my circuits:
Those data are only good with the specific leds I am using, for different leds use the website above!
The +5V and GND are connect to a the VCC and GND of a USB plug.



And here how it looks once done:

Place the LEDs at the exact center of each side (up, down, left, right), as close as the screen as possible, to have a good accuracy, like that:

It's a temporary installation with tape, I would recommend a better more stable one  :lol

Software needed:
  • Arduino IDE (this will just be needed to flash the firmware)
  • Mamehooker, for synchronizing the gun recoil/rumble to the game (Optional) (Windows only)
  • Demulshooter, to improve dual gun support on many emulators and games (Optional) (Windows only)
  • And of course all the games and emulators you want to use
Installation:
- to avoid any issue, I would recommend to flash the arduino firmware first, test the camera, and then if everything work, build the rest of the hardware.

Firmware flashing process:

Warning: Very important, DO NOT flash any other arduino than the Atmega32u4 5v/16MHz with this firmware, or you might brick it. I repeat, DO NOT flash it on other arduino devices.
Read the following instructions carefully and make sure you understand everything before starting.
It is better to do the firmware flashing before closing your lightgun, just in case you need to access the "reset" pin.
You are warned ;)


1 - unplug any other arduino or usb devices that use a COM port from your computer
2 - download the firmware zip file and extract it anywhere
3 - execute flash.bat
3b - if anything goes wrong during flashing process, try reflashing it. If your device doesn't want to go in bootloader anymore, connect the RST pin to the GND pin and retry.
4 - once the hex file is flashed correctly build the rest of the hardware
Optional:
- To install Demulshooter and Mamehooker, please refer to their own websites.

MameHooker setup:
To use Mamehooker with this system, first follow those steps:
- Change the COM port of your gun 1 and 2 to be respectively COM1 and COM2 (you can do that in devices manager).
- Make sure Mamehooker is correctly configured for your system and detects the emulators you want to use (follow the instructions on its website).
- I will provide a zip file of my Mamehooker config files once I finished them, but meanwhile here is the command list:
 Each of those command have to be sent by serial to the arduino (Com write)
Commands that must be sent at game/mame start or stop:
 Start serial mode: S
 End serial mode: E
 Screen aspect ratio:   16/9: A0     4/3   in 16/9: A1    4/3: A2
 Joystick mode:    Mouse/KB: J0     Joystick: J1     Hybrid: J2
Ingame feedback trigger commands:
 Solenoid trigger:     on: s1    off: s0
 Rumble trigger:     on: r1    off: r0

Usage:
- Aiming: after plugging in your lightgun, simply aim the screen (anywhere on the screen, as long as the IR cam see the 4 LEDs at the same time at least once), you should see your cursor starting to follow your motion right away (if nothing happens, there might be something wrong with your LEDs, check them with your phone digital cam if you can see them bright enough from where you are aiming).
- IR cam calibration: On the first use, your aim might be off centered. It is normal, each camera sensor has a slight offset. To correct this offset, hold the calibration button until the cursor jumps to the center of the screen, release it, carefully aim for the cursor, and press the trigger, then press the calibration button briefly to quit the calibration mode. Your sensor should now be calibrated, and since it's saved to the Arduino EEPROM, you won't have to do it ever again, even when changing your screen setup.
- *new* Manual screen calibration there is now a way to force the screen calibration (if your leds are not right next to the screen, or if your screen or contents are not the standard 16/9 or 4/3). Instead of pressing the calibration button after the sensor calibration, aim the upper left screen corner, press the trigger once, aim the lower right screen corner, press the trigger once more. It should now automatically exit calibration mode. The calibration data is saved to the arduino, and will stay at each reboot. To reset the calibration to default just reenter the calibration mode and quit the mode right away.
- Aspect ratio change: to alternate between each screen ratio modes, do a single press of the calibration button.
- Mode change: to alternate between lightgun mouse/joystick modes, hold the A button then do a short press of the calibration button.
- Aim tracking: once your lightgun is working, it should now follow your aim as long as it sees at least one LED on camera (or 2 LEDs if you aimed out of the LEDs range, to get "back on track"). It means you have a huge range of motion offscreen, the cursor will follow your aiming in the borders of the screen.
- Offscreen shooting: if you shoot offscreen, it will trigger the A button (Right mouse click) instead of the trigger, useful for games that need offscreen shoot to reload.

IR camera testing tool:
You can get this tool in the attached "JB_IRLightGun_4Points_IR_test.zip" file.

The zip file contains;
The IR cam test firmware (can be used only with the testing tool), to be flashed with the .bat file.
A folder with the .pde file to be used with the processing IDE.

The install and use process is simple:
  • Unplug any other arduino/serial device
  • Install Processing (https://processing.org/download/)
  • Flash the test firmware
  • Be sure to close any app that might use the serial port (for instance the Arduino IDE)
  • Open the .pde file with Processing
  • Edit the COM port number or app resolution in the beginning of the file if needed
  • Press the execute button
Inside the gray screen, the detected IR leds should be displayed, with this color code:
Unrecognized IR point = Black
Left IR point = Red
Top IR point = Green
Bottom IR point = Blue
Right IR point = Purple
Calculated center point = White
The duplicated and slightly grayish points are the same but with the tilt correction, they are showed to check if everything is working correctly.

It's very convenient to see when the points are misdetected, you will have wrong point colors, wrong corrected points, or an incorrect center point.

Troubleshooting:

Problem: The aim is not working at all, even on windows desktop.
Solution: Is something happening when pushing the buttons? If yes, it means the camera can't see your LEDs correctly. You might want to check them. If not, it means you are either in the wrong mouse/joystick mode, or there is a connection problem with your Arduino.

Problem: The aim is suddenly messed up (still moving but not in the right way).
Solution: It means either the gun is tilted too much or the camera has trouble seeing the LEDs. When it happens, check if your gun is not tilted, aim outside of the LEDs range and aim back at the screen. It should go back to normal.
If it doesn't come back to normal, or happens too often, you might want to check your LEDs, your camera orientation, and check if you are not in the wrong screen aspect mode.

Problem: The aim is working in the center of the screen, but on the sides it's not aiming properly.
Solution: You are obviously not in the right screen aspect mode.

Problem: The lightgun cough fire and burned your house.
Solution: Wait, what? What did you do with it? :P

Updates history:

* 2020/02/16 - 1.75
- fixed the combo buttons functions (joystick mode, offscreen shot...)
- reworked the buttons management to decrease risks of bugs and future-proof it
- did a lot of small optimization to increase the execution speed.
- changed the zip file, firmware name and flash bat again, now you can know which firmware you have, and choose between normal and test firmware. Please don't mix with the previous files.

* 2020/02/15 - 1.70
- restored the cursor accuracy without increasing the load, it should eliminate most wobbles
- put everything in only one zip and renamed the batches file for more clarity.
- added diagrams for the gun feedbacks

* 2020/02/13
- added the fullscreen IR testing tool

* 2020/02/12 - 1.68
- Improved the 2 points detection and optimized the other functions
- updated the .pde sketch for IR testing, now it can be edited easily to fit any setup/resolution/com port

* 2020/02/12 - 1.66
- fixed some bugs and re implemented the 2 points detection

* 2020/02/11 - IR cam testing tool
- I uploaded the Processing sketch for testing the IR points, and the firmware that works with it.

* 2020/02/09 - 1.55 beta
- Rewrote a big part of the aiming calculation, it should be far more stable.
- Added a better tilt/twist detection, now the gun should still work fine when tilting it, it increases the maximum tilt to 89 degrees on each side.
- Added a function to disable the press of secondary button when shooting offscreen.
  + You can disable it by holding trigger button and pressing the calibration button briefly.
  + Enable it back the same way.
  + For now this parameter isn't saved in the EEPROM, it will reset on power cycle.

* 2020/01/20
- added flash tool to the zip file

* 2020/01/19 - 1.35
- slightly improved the led detection code and the calculation, now the twist is a bit better.

* 2020/01/18 - 1.3
- cleaned some code and added the option for screen calibration.

* 2019/10/26 - 1.2
- first public version



Special credits:
Samuel Ballantyne (SAMCO), who started the idea of doing a DIY arduino lightgun with the DFRobots camera (https://github.com/samuelballantyne)
DFRobot, for their camera and libraries (https://github.com/DFRobot/DFRobotIRPosition)
Jonathan Edgecome, for his absmouse library (https://github.com/jonathanedgecombe/absmouse)
Matthew Heironimus, for his Joystick library (https://github.com/MHeironimus/ArduinoJoystickLibrary)
Toni Spets, for his great ideas on 4 leds detection system (https://github.com/hifi)
Howard Casto, for his Mamerhooker program and his help on making it work with this system (http://dragonking.arcadecontrols.com)
PL1 for his Pro Micro diagram
Foxhole for his support and careful testing
And everyone else in the forum for supporting this project and keeping the arcade love alive  :cheers:
« Last Edit: Yesterday at 02:59:07 am by JayBee »

Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 64
  • Last login:January 30, 2020, 02:13:56 am
  • Arcade enthusiast !
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #1 on: October 01, 2019, 03:16:32 am »
Great work JayBee, looking forward to more details  :applaud:

ryoken

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 53
  • Last login:February 13, 2020, 02:25:38 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #2 on: October 01, 2019, 03:41:38 am »
Very impresive... nice for sharing

Titchgamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3603
  • Last login:Today at 08:21:38 am
  • I have a gaming addiction.....
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #3 on: October 01, 2019, 04:36:52 am »
Cool :)

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:December 07, 2019, 12:46:55 am
  • SAMCO Light Gun Creater
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #4 on: October 02, 2019, 05:57:54 am »
Nice work JayBee, can't wait to check out your code.

I was wondering is the reason you mentioned you have to stand in front of the screen to fie because of the tight angle of the leds? Just because I've looked around and found some wide angle leds on AliExpress https://www.aliexpress.com/item/32491780864.html?spm=a2g0s.9042311.0.0.41bf4c4dNxe3jj they don't have UV coating on them so wouldn't suggest for everyday unless you want to mount them behind a UV filter (or even better eventually find some that already have it like the Adafruit ones). But these increase the viewing angle massively.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #5 on: October 02, 2019, 06:55:22 am »
Nice work JayBee, can't wait to check out your code.

I was wondering is the reason you mentioned you have to stand in front of the screen to fie because of the tight angle of the leds? Just because I've looked around and found some wide angle leds on AliExpress https://www.aliexpress.com/item/32491780864.html?spm=a2g0s.9042311.0.0.41bf4c4dNxe3jj they don't have UV coating on them so wouldn't suggest for everyday unless you want to mount them behind a UV filter (or even better eventually find some that already have it like the Adafruit ones). But these increase the viewing angle massively.
Actually this time I'm not sure I will share the source code yet, for ease of use, update and prevent any problem.
Instead I was thinking of providing two things: a sketch that will write to the Arduino EEPROM all your custom settings you need, like pin numbers, screen res and all, and bin files, one for each Arduino type. Like this you just need save your settings once, no need to modify the sketch again every time I update it  :)

Yes, I mentioned at the same time for led angle, and because the system doesn't work that well if you are too much up or down (works fine from left and right).
I actually bought 200mW/Sr LEDs with 30degrees angle, they work quite nicely so far, but don't have UV filter or coating. What's the risks without UV filter? I have a limited knowledge on the matter.

samco

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 23
  • Last login:December 07, 2019, 12:46:55 am
  • SAMCO Light Gun Creater
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #6 on: October 02, 2019, 08:44:53 am »
Sweet, sounds good man.

Unfortunately I don't know too much about UV filters either apart from a few Google searches. Mainly just didn't want to suggest a solution that was potentially unsafe which seems to be the general consensus from the little research I've done.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #7 on: October 03, 2019, 01:31:52 pm »
Quick news, now the code is fully functional and very stable for full use. More infos, videos and code coming soon, stay tuned  ;)

SammyWI

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 414
  • Last login:Yesterday at 11:30:15 am
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #8 on: October 03, 2019, 03:03:04 pm »
Very cool.  Great to see more options coming out.  :applaud:

lllll44

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:February 03, 2020, 05:10:47 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #9 on: October 12, 2019, 04:38:22 pm »
cant wait to hear more! amazing.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #10 on: October 14, 2019, 01:49:26 pm »
Good news, thanks to Howard_Casto and his Mamehooker software, I was able implement mame output with my lightgun. I can send recoil, rumble and led control and parameters directly to the guns for each game independently.
For the games/emulators that support output, the solenoid, rumble motor or led that you have installed in your gun will react like in the real arcade machine.
It will also be very easy to customize.
And since it's switching the games automatically, for games that don't support output, the recoil, rumble and led will go back to be controlled by the Arduino.

This is very close to complete!
Next, I will add a way of checking the solenoid temperature with a small chipset, to modify its speed of actuation if getting too hot, and avoid frying it.
It could also allow you to continue to fire in full auto but with reduced speed as long as the solenoid is hot.

Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 64
  • Last login:January 30, 2020, 02:13:56 am
  • Arcade enthusiast !
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #11 on: October 15, 2019, 04:34:16 am »
Good news, thanks to Howard_Casto and his Mamehooker software, I was able implement mame output with my lightgun. I can send recoil, rumble and led control and parameters directly to the guns for each game independently.
For the games/emulators that support output, the solenoid, rumble motor or led that you have installed in your gun will react like in the real arcade machine.
It will also be very easy to customize.
And since it's switching the games automatically, for games that don't support output, the recoil, rumble and led will go back to be controlled by the Arduino.

This is very close to complete!
Next, I will add a way of checking the solenoid temperature with a small chipset, to modify its speed of actuation if getting too hot, and avoid frying it.
It could also allow you to continue to fire in full auto but with reduced speed as long as the solenoid is hot.
:applaud: :applaud: :applaud:

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18082
  • Last login:Today at 02:27:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #12 on: October 15, 2019, 01:59:44 pm »
You got it done before I even had a chance to sit down and work on it.   :afro:

What type of interface did you use?

One thing I would suggest would be to add a pulse mode to your code.....  99% of the mame and model 2 library pulse the output for you with games like terminator 2, ect., but If I remember correctly Operation Wolf just has a steady on when the gun is firing.  It has to do with the mechanical operation of the guns... (op wolf and a couple others use a motor spinning a piston instead of a solenoid).  I have the outputs mapped for the model 2 emulator and some of the pc/techno parrot stuff as well, but I haven't released an updated troubleshooter 2 yet. 

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #13 on: October 16, 2019, 02:11:07 am »
You got it done before I even had a chance to sit down and work on it.   :afro:

What type of interface did you use?

One thing I would suggest would be to add a pulse mode to your code.....  99% of the mame and model 2 library pulse the output for you with games like terminator 2, ect., but If I remember correctly Operation Wolf just has a steady on when the gun is firing.  It has to do with the mechanical operation of the guns... (op wolf and a couple others use a motor spinning a piston instead of a solenoid).  I have the outputs mapped for the model 2 emulator and some of the pc/techno parrot stuff as well, but I haven't released an updated troubleshooter 2 yet.
It wasn't so hard, your tool makes things so much more simple :cheers:

I'm using your serial write command to send combinations of characters and numbers, and read the serial buffer in the arduino. I'm really happy with the way it works, reading the serial buffer is very fast and doesn't add much latency to the overall execution.
Plus I am also sending special commands to completely control the behavior of the gun, meaning I won't have to change any settings manually anymore.

For the pulse mode, I already have one (king of) in my arduino code, it automatically starts full auto mode when holding the trigger button. I can also trigger it with a serial command, so it should be easy :D

The only issue I have is with games that have a variable speed pulsed command like terminator 2.
In my arduino code, I read the serial buffer every 3~5ms, and I also rely on specific timing for the solenoid holding and the minimum pause between each trigger (to avoid it to overheat). So the code detects the pulse command within 3~5ms, and then triggers the solenoid only if it's ready to be triggered. It means the game pulse and the solenoid pulse are getting totally out of sync.
Still scratching my head trying to find an elegant solution for that  ???

Yeah I didn't test the m2emulator outputs yet, but I will sure do it, would love some good Virtua Cop with accurate recoil!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18082
  • Last login:Today at 02:27:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #14 on: October 16, 2019, 07:57:13 pm »
Honestly getting m2emulator ready to run with mamehooker is a giant pain in the butt, mostly because I'm getting it to do something it isn't supposed to do.  I'm working on it though. 

Yeah getting the pulse synced up is an issue.  Wait commands can be used to hold the solenoid open a bit longer so things can be slowed down somewhat, but that's about it.  I guess finding a solenoid that fires at the same rate as some of the positional guns would be the ideal solution, but I don't know how hard that would be. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #15 on: October 18, 2019, 11:06:48 am »
I can send you the Arcade Guns Aimforce dongle software to look at if it would be helpful?

It looks like they borrowed some of your work with mame hooker and added their own front end with some additional options. It essentially allows you to set up recoil for each game individually including the type of recoil (auto or semi) and the speed of recoil. It works with any gun game including Model 2 and 3. Plus, it also has a hooker option to take instructions from the game like mame hooker, and space to add your own code.

Changing the speed of a solenoid should just be a case of changing the frequency. I do it manually with a pot on my ne555 board. I use the 0-50hz jumper and then turn the pot until I get roughly 6-10 activations per second. I assume this would be possible to set any solenoid to the right speed for the game in software with the right know how.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #16 on: October 18, 2019, 11:17:59 am »
Honestly getting m2emulator ready to run with mamehooker is a giant pain in the butt, mostly because I'm getting it to do something it isn't supposed to do.  I'm working on it though. 

Yeah getting the pulse synced up is an issue.  Wait commands can be used to hold the solenoid open a bit longer so things can be slowed down somewhat, but that's about it.  I guess finding a solenoid that fires at the same rate as some of the positional guns would be the ideal solution, but I don't know how hard that would be.
Yeah I guess it has to be very hacky to get support in m2, like memory read and stuff? looks like a huge headache to make that work  :-\

By the way, in Mamehooker if I use the mamestart in a game ini file, it's overwriting the default ini mamestart, right?
Is it possible, in some way, to no overwrite it but execute both in order? (default mamestart => game mamestart => playing game => game mamestop => default mamestop)
With my setup pretty much all lightgun games will need to open/close the serial connection, and send the default parameters commonly used by mame (used screen aspect ratio for instance), then some games have specific parameters I need to send (recoil/rumble mode).
I can of course copy paste the commands one by one for each games, but I wanted to ask you in case you have a better way of doing it.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #17 on: October 18, 2019, 11:35:23 am »
I can send you the Arcade Guns Aimforce dongle software to look at if it would be helpful?

It looks like they borrowed some of your work with mame hooker and added their own front end with some additional options. It essentially allows you to set up recoil for each game individually including the type of recoil (auto or semi) and the speed of recoil. It works with any gun game including Model 2 and 3. Plus, it also has a hooker option to take instructions from the game like mame hooker, and space to add your own code.

Changing the speed of a solenoid should just be a case of changing the frequency. I do it manually with a pot on my ne555 board. I use the 0-50hz jumper and then turn the pot until I get roughly 6-10 activations per second. I assume this would be possible to set any solenoid to the right speed for the game in software with the right know how.
It is technically possible to activate the solenoid at the right frequency with Mamehooker and my arduino code, with a 3-5ms precision, but unless we have the matching solenoid for each game, the activation/hold/release/pause timings will not match my solenoid, and won't work or make it overheat. It's not really an issue with games without variable speed full auto, where speed of solenoid activation doesn't matter so much.
For instance games like terminator 2 have a recoil working clearly way faster than any of our solenoids can handle, so it gets out of sync when its speed is changing (gun overload and all).
Right now, I am actually building a rumble system beside the solenoid that I want to use instead of recoil in those games, it won't feel the same but will sure work better and more in sync.
« Last Edit: October 18, 2019, 11:37:58 am by JayBee »

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #18 on: October 18, 2019, 01:27:01 pm »
I think there's two different issues. One is obviously choosing a solenoid that is rated for continuous duty and that can handle full auto recoil. That has to be done no matter what. I have rescued and repurposed a lot of arcade guns and any that used full auto recoil via a solenoid in the original coin-op will generally work fine with other games, even if other games had faster recoil.

The second issue is setting the recoil speed for each game. Now, it's true that there are differences between solenoids because the length of piston and range of travel varies. As does the force of the return spring. Also, a lot of full auto only arcade guns use a recoil motor instead of a solenoid. This doesn't mean you can't use one solenoid for multiple games. It just means you can't switch solenoids without redoing the speed settings.

With software that allows you to adjust recoil speed for each game (like the Aimforce software), you can simply find one gun with a decent full auto solenoid and set each game to your liking. Or, with mame hooker, you can use the original games frequency. But...Unless you had direct knowledge of the original recoil speed for each game, I doubt you'd get it exact. But, it wouldn't be far off as most of my arcade solenoids have around 10mm of travel. For games that used a solenoid, I doubt most people could perceive a difference between 10 activations per second and 12.

It's also worth noting that one T2 cab (for example) would vary in recoil speed to another, just based on the age of the solenoid and how recently they oiled the piston. The difference is huge immediately after you add a little oil. So the original speed we remember may not be exact either. Most Time Crisis guns I have used in the wild have really slow and anemic recoil due to poor maintenance. My TC arcade gun recoil is a beast.

Personally, I think it's more trouble than it's worth to worry about making the recoil speed exact. The amount of enjoyment it adds is minimal compared to the headache. I think it's more important to make the full auto recoil speed feel convincing to me than it is to make match an original speed.

I set mine up to recoil once when I pull the trigger and full auto when I hold it down. This works well for 99% of the gun games I ever played. The only one it doesn't work so well on (so far) is Alien 3 the gun, as I get full auto recoil even when I have the flame thrower...



Perhaps the bigger issue for me is that I prefer to use the PS2 for light gun games, so none of the current software solutions are compatible. The Arcade Guns guys said they were working on a recoil box that would offer Aimforce-like recoil control for any console, computer or PCB. I haven't seen it yet though. I might invest in something like that as the PS2 is unmatched for this genre. Kickstarter anyone?
« Last Edit: October 18, 2019, 01:29:59 pm by Zebra »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 18082
  • Last login:Today at 02:27:54 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #19 on: October 18, 2019, 01:36:38 pm »
Well the main reason for recoil is to make the player aware of the gun's status, as gun games and be frantic and an excitable player might not notice that they are out of ammo, or the gun has over heated, ect.  So long as "firing", "overheat", "empty" and possibly "special" are distinguishable from each other, it should be close enough. 

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #20 on: October 18, 2019, 06:00:11 pm »
It's definitely nice if a gun behaves just like the coin-op but, for me, recoil makes it feel more realistic and fun. It's still worth it even if it doesn't stop recoiling when you run out of ammo. The gun just feels dead without it.

Not that many games let you run out of ammo. It's technically possible in games like Op Thunderbolt and Op Wolf but only if you don't shoot the falling ammo. The ones that make you reload by shooting off-screen usually shout "reload, reload" at you, and I usually reload before that out of habit. I always notice. Most people play these games at home with no recoil at all so keeping an eye on your ammo is just part of the game. The potential for overheating is a real issue though. I've seen it happen.

Some solenoids can get hot enough to melt the gun plastic. It's one of the reasons why I prefer to use guns with a recoil motor for full auto only games. Games like Crisis Zone on the PS2 require long periods of continuous full auto fire to dispense end of level bosses. It's more relaxing if I'm not worried about the solenoid.

I could never get the over heating warning working right in the Aimforce software. These guns don't have heat sensors so you can never rely on it anyway, so I gave up on it. It kinda seemed like it needed setting up for each game and I lacked any meaningful data to do it right. One thing I would say though, my full auto arcade guns rarely over-heat if set up right. The one I had issues with was my Aimtrak solenoid. It's really not suitable for full auto.



JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #21 on: October 18, 2019, 10:45:48 pm »
Actually the temperature sensors I ordered for my lightguns are on the way, it will be very easy to add solenoid speed variation depending on the temp. It should make it a lot safer to use.
For the speed variation and timing, I can already change them for each games, have auto full auto and things like that, that's not an issue.
Not matching the game speed is not an issue either.

As I was saying, the only issue is with games that have solenoid speed variation.
In T2, the game recoil full auto is supposed to start at full speed, then the longer you will hold it the more it will slow down.
But since my solenoid is out of sync, the faster speed is kind of slow, then suddenly become faster at lower speed, when the game recoil speed gets around the same speed as my solenoid. So far it's pretty much the only game where I had this issue.
That's why I want to use rumble motors, that don't have this timing issue.
The second solution I was thinking about is sending a special command to my Arduino to tell it to measure the timing between each activation/deactivation, and change the solenoid full auto speed accordingly.
It's not that hard to do, I just need some time, and it should cover every game that behaves like that.

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #22 on: October 19, 2019, 01:44:03 pm »
OK I understand the issue now. T2 doesn't just change recoil speed for heat control though. It changes for different guns you pick up along the way too. A number of arcade games do this. I noticed it on the Jurassic Park (Raw Thrills version) too. It would be awesome to be able to replicate that feature. Recoil should pick up the pace if you grab a gatling gun in-game.... Have you managed to make this work?

I haven't seen any arcade guns that have a heat sensor inside. I'd be interested to hear how you'd make the game change recoil speed based on the output from the heat sensor. I'm not sure how much difference it will make in practice though.

My experience has been that full auto arcade recoil gun solenoids don't dangerously overheat, even after a long play session. That is, assuming they are set up right. They are made to take a hammering all day every day so typical home play doesn't really tax them. I spent over two hours playing Time Crisis 3 and Crisis Zone yesterday and my Time Crisis arcade gun solenoid was barely warm. It's the same with my Op Thunderbolt and Gen X guns (if I keep the pistons oiled).

If a solenoid is getting dangerously hot during regular play then I'd assume it was either the wrong type of solenoid or it was set up wrong (too much power or a duty cycle that's too high). Either way, I'd want to stop using it all together and let it cool down properly instead of reducing the frequency. When I tested my Aimtrak solenoid with full auto, after three minutes of play, it got hot enough to burn my fingers and melt the surrounding wires. This was using the same 555 circuit (with the same frequency) as I use for my arcade gun solenoids. It taught me an expensive lesson.

It's important to know if you have a momentary or continuous duty solenoid. Momentary solenoids (like the one in the Aimtrak) usually pack more force but require cool down time between activations and shouldn't stay activated for more than a second or two. Continuous duty solenoids are designed to say activated for longer periods of time (without burning up the coil). They usually pack less force but they generate less heat and are more suitable for full auto.

Have you experienced over-heating issues with full auto arcade gun solenoids? If so, I'd be interested to hear which guns had issues and what frequency you used?


JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #23 on: October 19, 2019, 03:05:16 pm »
OK I understand the issue now. T2 doesn't just change recoil speed for heat control though. It changes for different guns you pick up along the way too. A number of arcade games do this. I noticed it on the Jurassic Park (Raw Thrills version) too. It would be awesome to be able to replicate that feature. Recoil should pick up the pace if you grab a gatling gun in-game.... Have you managed to make this work?

I haven't seen any arcade guns that have a heat sensor inside. I'd be interested to hear how you'd make the game change recoil speed based on the output from the heat sensor. I'm not sure how much difference it will make in practice though.

My experience has been that full auto arcade recoil gun solenoids don't dangerously overheat, even after a long play session. That is, assuming they are set up right. They are made to take a hammering all day every day so typical home play doesn't really tax them. I spent over two hours playing Time Crisis 3 and Crisis Zone yesterday and my Time Crisis arcade gun solenoid was barely warm. It's the same with my Op Thunderbolt and Gen X guns (if I keep the pistons oiled).

If a solenoid is getting dangerously hot during regular play then I'd assume it was either the wrong type of solenoid or it was set up wrong (too much power or a duty cycle that's too high). Either way, I'd want to stop using it all together and let it cool down properly instead of reducing the frequency. When I tested my Aimtrak solenoid with full auto, after three minutes of play, it got hot enough to burn my fingers and melt the surrounding wires. This was using the same 555 circuit (with the same frequency) as I use for my arcade gun solenoids. It taught me an expensive lesson.

It's important to know if you have a momentary or continuous duty solenoid. Momentary solenoids (like the one in the Aimtrak) usually pack more force but require cool down time between activations and shouldn't stay activated for more than a second or two. Continuous duty solenoids are designed to say activated for longer periods of time (without burning up the coil). They usually pack less force but they generate less heat and are more suitable for full auto.

Have you experienced over-heating issues with full auto arcade gun solenoids? If so, I'd be interested to hear which guns had issues and what frequency you used?
I'm not using arcade fun solenoids, just the cheap one with enough strength that fits in the gun. I know what you are going to say, but I'm very happy with those  ;)
They overheat only after something like non stop 15-20 minutes of full auto, and one (the bigger one) is heating way more than the other.
I couldn't find any affordable not quality continuous duty solenoid. But if you know places where I can get some, it would be very usefull.

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #24 on: October 19, 2019, 10:30:02 pm »
The only affordable quality recoil solenoid I know of is the one for Terminator Salvation arcade guns. There aren't many arcade companies left these days but Raw Thrills parts are generally far more reasonable than Namco and Sega parts. They can be found for a little over $30. If a person can't afford $30, my suggestion would be to not spend anything on gaming peripherals at all until they can.

The other cheap option, and probably the one I would recommend for a project, is a used PS1 jolt gun. They have a decent full auto solenoid and you benefit from also getting a shell designed to fit it. It saves a lot of time and wasted cash.

The issue with cheap solenoids over-heating isn't just that they get hot. If you can feel a noticeable amount of heat building up in a properly lubed solenoid, it's because you are burning up the coil. In other words, it won't last long. I destroyed a bunch of "cheap" solenoids before I realized that it was cheaper to just buy one that was suitable for the job. Ultimately, you want to be able to play without worrying about this stuff, or it's not fun.

I spent a good amount of time searching for decent continuous duty pull solenoids on ebay a while ago. They can be found but the saving over the Raw Thrills solenoids is usually too small to matter.

I can't honestly criticize what you are trying to do with the cheap eBay solenoids as I tried to do the same and for the same reasons. I'm almost 100% sure that you'll eventually come to the same conclusion though.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #25 on: October 20, 2019, 05:48:52 am »
The only affordable quality recoil solenoid I know of is the one for Terminator Salvation arcade guns. There aren't many arcade companies left these days but Raw Thrills parts are generally far more reasonable than Namco and Sega parts. They can be found for a little over $30. If a person can't afford $30, my suggestion would be to not spend anything on gaming peripherals at all until they can.

The other cheap option, and probably the one I would recommend for a project, is a used PS1 jolt gun. They have a decent full auto solenoid and you benefit from also getting a shell designed to fit it. It saves a lot of time and wasted cash.

The issue with cheap solenoids over-heating isn't just that they get hot. If you can feel a noticeable amount of heat building up in a properly lubed solenoid, it's because you are burning up the coil. In other words, it won't last long. I destroyed a bunch of "cheap" solenoids before I realized that it was cheaper to just buy one that was suitable for the job. Ultimately, you want to be able to play without worrying about this stuff, or it's not fun.

I spent a good amount of time searching for decent continuous duty pull solenoids on ebay a while ago. They can be found but the saving over the Raw Thrills solenoids is usually too small to matter.

I can't honestly criticize what you are trying to do with the cheap eBay solenoids as I tried to do the same and for the same reasons. I'm almost 100% sure that you'll eventually come to the same conclusion though.
As I already told you, none of the options you suggest are available here in Japan where I live.
Plus, a good gun solenoid will also require a proper gun shell, so it will increase the price way more no matter what.
I calculated the price I would have to pay to make a proper gun with a proper recoil, it would cost me at least 200$~400$, everything included.
My guns cost me a bit more than 60$ each in total, and they are only for casual use.

Your comparison is like saying to someone who only use his car once a month for short travel "you should buy this very expensive sport car, it will be more comfortable". Of course it would be more comfortable, but that's not the point.

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #26 on: October 20, 2019, 04:31:44 pm »
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".

I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.

Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #27 on: October 20, 2019, 05:46:10 pm »
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".

I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.

Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
The jolt gun I found + sending fees was more than 100$ in total.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #28 on: October 26, 2019, 10:07:08 am »
* 2019/10/26 - 1.2
- first public version

It's here guys!
Feel free to test it and give me your feedbacks ;)
A lot of schematics and pictures are still missing, I will add them later.
« Last Edit: October 26, 2019, 11:52:33 am by JayBee »

lightgungamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 36
  • Last login:Today at 08:52:30 am
  • I love playing Light Gun Games
    • LightgunGame.com
JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #29 on: October 26, 2019, 12:51:16 pm »
This looks great. Can’t wait to get it built and try it out.
https://LightGunGamer.com - every Lightgun game and how to play them

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #30 on: October 26, 2019, 01:35:37 pm »
This looks great. Can’t wait to get it built and try it out.
Yeah, I should be adding schematics and pictures of everything tomorrow ;)

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:February 08, 2020, 01:17:24 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #31 on: October 28, 2019, 06:36:31 pm »
Thanks, @JayBee @Samco @Hifi and all others involved, you're awesome!
After retrofitting my old trusty sluh-00017 Konami Justifier with the JayBee 2 point software, i stumbled upon Hifi's software and actually started to make the same.
but now i found this, so i guess its not needed anymore.
Though i tried to implement the ir led offset from the screen, to make it 100% accurate.

If this is needed i do not know, as im currently waiting for a package of 100 940nm leds from china.
For those interested in the link:
https://www.aliexpress.com/item/32755919314.html?spm=a2g0s.9042311.0.0.21694c4dLn44LN

As for the gun itself, i didnt use the DFRobot IR positioning camera.
But rather the IR camera from a wiimote, which i found out you can actually take out of the metal/plastic housing, so you dont even need to desolder it from the wiimote, just pry it out of the holder, and you have 8 solderpads on the rear.
(I will provide pics for the next gun, i'm planning to build)
The reason for taking that route is that i thought that the DFRobot camera was pretty pricey, and i actually had a wiimote at my disposal.
The rest of the components was/is accessible free of charge at the local hackerspace in which i'm a member. (except for a 3.3v switchmode regulator that cost about 0.43$ incl. shipping)

If anyone is interested in going that route i could whip up a pcb in kicad and the components as a kit for a modest price (most certainly not the reason for making this post!)

I guess most of you have seen the old wiimote arduino guides?
Well they do level conversion of the i2c signal which is overly complicated and completely unnecessary!
I just powered the camera through the previously mentioned 3.3v regulator, pulled the SDA and SCL lines to that 3.3v through 2.7k resistors.
The 5V atmega32u4 reads those 3.3v i2c signals just fine.
Other than that its just a 20MHz crystal, 2 capacitors and a 33k (or lower) resistor to hold the reset pin on the camera HIGH.

@JayBee, i know it seems like a good idea to only release the hex file, though if you'd be willing to i'd very much like to have the sketch provided, i will ofcourse contribute if i come up with something good :D

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #32 on: October 28, 2019, 07:56:59 pm »
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".

I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.

Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
The jolt gun I found + sending fees was more than 100$ in total.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.


It sucks to be in Japan (for light gun fans)....

You should be able to find one cheaper than that though. I can order a jolt gun right now off ebay for $35 delivered. For you, it's probably best to search for UK sellers. These guys will send me this PS1 recoil gun from the UK for less than $30 delivered:

https://www.ebay.com/itm/Playstation-2-SATURN-SILVER-AVENGER-PRO-LIGHT-GUN-CONTROLLER-PS2/333345578110?hash=item4d9cf1dc7e:g:120AAOSwnD1dkejz

There is usually a lot of jolt guns there. If you put an offer in for ones like this, I'm sure they'll take it:

https://www.ebay.com/itm/Pistola-Gun-per-Playstation-1-PS1-e-Sega-Saturn-con-pedale-Funzionante/303335038088?hash=item46a02d5c88:g:MKcAAOSw~KpcduNN

In terms of solenoid models, just add the word "continuous" to an ebay search for pull solenoid, or check the specs for Duty cycle: Continuous.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #33 on: October 28, 2019, 09:12:54 pm »
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".

I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.

Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
The jolt gun I found + sending fees was more than 100$ in total.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.


It sucks to be in Japan (for light gun fans)....

You should be able to find one cheaper than that though. I can order a jolt gun right now off ebay for $35 delivered. For you, it's probably best to search for UK sellers. These guys will send me this PS1 recoil gun from the UK for less than $30 delivered:

https://www.ebay.com/itm/Playstation-2-SATURN-SILVER-AVENGER-PRO-LIGHT-GUN-CONTROLLER-PS2/333345578110?hash=item4d9cf1dc7e:g:120AAOSwnD1dkejz

There is usually a lot of jolt guns there. If you put an offer in for ones like this, I'm sure they'll take it:

https://www.ebay.com/itm/Pistola-Gun-per-Playstation-1-PS1-e-Sega-Saturn-con-pedale-Funzionante/303335038088?hash=item46a02d5c88:g:MKcAAOSw~KpcduNN

In terms of solenoid models, just add the word "continuous" to an ebay search for pull solenoid, or check the specs for Duty cycle: Continuous.
I think I already told you, jolt gun delivery fees to Japan are >50$, and for the last time, I am not interested in buying those, I am very happy with my current guns, thanks.
Can you show me any push-pull solenoid that is actually continuous duty? I don't believe that even exists, for a simple technical reason; solenoid ALWAYS heat when staying activated, no matter the power/type/size.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #34 on: October 28, 2019, 09:21:13 pm »
Thanks, @JayBee @Samco @Hifi and all others involved, you're awesome!
After retrofitting my old trusty sluh-00017 Konami Justifier with the JayBee 2 point software, i stumbled upon Hifi's software and actually started to make the same.
but now i found this, so i guess its not needed anymore.
Though i tried to implement the ir led offset from the screen, to make it 100% accurate.

If this is needed i do not know, as im currently waiting for a package of 100 940nm leds from china.
For those interested in the link:
https://www.aliexpress.com/item/32755919314.html?spm=a2g0s.9042311.0.0.21694c4dLn44LN

As for the gun itself, i didnt use the DFRobot IR positioning camera.
But rather the IR camera from a wiimote, which i found out you can actually take out of the metal/plastic housing, so you dont even need to desolder it from the wiimote, just pry it out of the holder, and you have 8 solderpads on the rear.
(I will provide pics for the next gun, i'm planning to build)
The reason for taking that route is that i thought that the DFRobot camera was pretty pricey, and i actually had a wiimote at my disposal.
The rest of the components was/is accessible free of charge at the local hackerspace in which i'm a member. (except for a 3.3v switchmode regulator that cost about 0.43$ incl. shipping)

If anyone is interested in going that route i could whip up a pcb in kicad and the components as a kit for a modest price (most certainly not the reason for making this post!)

I guess most of you have seen the old wiimote arduino guides?
Well they do level conversion of the i2c signal which is overly complicated and completely unnecessary!
I just powered the camera through the previously mentioned 3.3v regulator, pulled the SDA and SCL lines to that 3.3v through 2.7k resistors.
The 5V atmega32u4 reads those 3.3v i2c signals just fine.
Other than that its just a 20MHz crystal, 2 capacitors and a 33k (or lower) resistor to hold the reset pin on the camera HIGH.

@JayBee, i know it seems like a good idea to only release the hex file, though if you'd be willing to i'd very much like to have the sketch provided, i will ofcourse contribute if i come up with something good :D
I didn't know you could use the wiimote IR cam, that's really cool! Yeah if you can show us more about that, I would gladly test it too.
For the sketch, I should make it open source at some point in the future, but right now I have many reasons not to.
I know it's not so convenient, and I'm sorry for that, if there was a way to make it better I would  ;)

Mysli0210

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 34
  • Last login:February 08, 2020, 01:17:24 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #35 on: October 28, 2019, 09:45:53 pm »
I will most certainly do that! i would take pictures of what i have made, but it wouldnt be much use as i have hot-snotted everything together.
yeah, the DFRobot camera, is as far as im aware the exact same camera, but with the supporting components attached in a neat shell.

I totally get it! and im looking forward to testing it... but alas i have to either source the ir leds locally or wait that month or so for the ones from china.
but its okay, as i will then have time to get hands on another gun... or maybe make one from scratch in lasercut wood.

Ginsonic

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 64
  • Last login:January 30, 2020, 02:13:56 am
  • Arcade enthusiast !
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #36 on: October 29, 2019, 05:43:03 am »
Congratulations JayBee, great work  :applaud:

Will you update the source code at GitHub later on, or is the project closed source now?

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 183
  • Last login:Today at 07:40:09 am
  • If I can't buy it, I build it.
    • Github
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #37 on: October 29, 2019, 06:21:43 am »
I will most certainly do that! i would take pictures of what i have made, but it wouldnt be much use as i have hot-snotted everything together.
yeah, the DFRobot camera, is as far as im aware the exact same camera, but with the supporting components attached in a neat shell.

I totally get it! and im looking forward to testing it... but alas i have to either source the ir leds locally or wait that month or so for the ones from china.
but its okay, as i will then have time to get hands on another gun... or maybe make one from scratch in lasercut wood.
Ah yes, finding good IR LEDs for this kind of project is really a pain. Currently working with powerful LEDs but that have terrible viewing angle, and still waiting for the 120° LEDs I ordered from China 2 weeks ago, to see how they will perform (will post them in the first post if they work well.

Congratulations JayBee, great work  :applaud:

Will you update the source code at GitHub later on, or is the project closed source now?

Thanks :)
Yes it's closed source right now, but I will probably make it open source later.

hyo2012

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 42
  • Last login:December 15, 2019, 08:12:26 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #38 on: October 29, 2019, 08:27:46 am »
I just ordered IR camera and LED.

You did a good job :)

I can't wait how it works.

Zebra

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 566
  • Last login:Yesterday at 08:49:57 pm
  • I want to build my own arcade controls!
Re: JayBee DIY 4 IR Led Lightgun System (no calibration needed)
« Reply #39 on: October 29, 2019, 01:11:41 pm »
It's more like saying "regardless if you plan to use the car once per month or every day, you should get one with brakes that work". And, "if you can't afford a car with working brakes, it's better to get nothing at all".

I don't live in Japan or know the market there but I don't believe that it's not possible to buy a continuous duty solenoid. Especially as some of the solenoid brands I've seen are Japanese companies. Plus, there is a bunch of low cost arcade parts sellers that are based in Asia and ship internationally. And, there are plenty of ebay sellers who ship internationally. I order stuff from Japanese sellers all the time. I'm sure that if you kept an eye on ebay, you'll find a jolt gun from a seller who'll ship to Japan.

Also, Namco, a Japanese company, sell new Time Crisis 4 gun shells and recoil solenoids for $120 in America. I'm sure they will have a parts distributor for their home market and that it wouldn't be significantly more expensive which means, if you know where to look, there will be used parts selling for less.
The jolt gun I found + sending fees was more than 100$ in total.
Arcade parts here are actually more expensive and hard to come by than outside of Japan, thanks to the high demand of arcade centers that are everywhere here, that would pay any price to get their parts.
Plus none of those gun part shop is open to the public, only people with an arcade company can order. They are protective of their market and tech.
So getting official part would be very expensive for me AND extremely troublesome.
But if you can show me some model of continius duty solenoid you think are good and than can fit in my guns, I will gladly take a look at it.


It sucks to be in Japan (for light gun fans)....

You should be able to find one cheaper than that though. I can order a jolt gun right now off ebay for $35 delivered. For you, it's probably best to search for UK sellers. These guys will send me this PS1 recoil gun from the UK for less than $30 delivered:

https://www.ebay.com/itm/Playstation-2-SATURN-SILVER-AVENGER-PRO-LIGHT-GUN-CONTROLLER-PS2/333345578110?hash=item4d9cf1dc7e:g:120AAOSwnD1dkejz

There is usually a lot of jolt guns there. If you put an offer in for ones like this, I'm sure they'll take it:

https://www.ebay.com/itm/Pistola-Gun-per-Playstation-1-PS1-e-Sega-Saturn-con-pedale-Funzionante/303335038088?hash=item46a02d5c88:g:MKcAAOSw~KpcduNN

In terms of solenoid models, just add the word "continuous" to an ebay search for pull solenoid, or check the specs for Duty cycle: Continuous.
I think I already told you, jolt gun delivery fees to Japan are >50$, and for the last time, I am not interested in buying those, I am very happy with my current guns, thanks.
Can you show me any push-pull solenoid that is actually continuous duty? I don't believe that even exists, for a simple technical reason; solenoid ALWAYS heat when staying activated, no matter the power/type/size.

That's why I gave you a link to someone selling one with cheap international shipping. Just because you looked once and found one that was expensive, it doesn't mean they all are. But I get it, you can't afford one. No matter what the price.

On the continuous duty solenoid, as I said, search eBay for "pull solenoid continuous" and you'll see there are lots of options:

https://www.ebay.com/sch/i.html?_from=R40&_trksid=m570.l1313&_nkw=Pull+solenoid+continuous&_sacat=0&LH_TitleDesc=0&_osacat=0&_odkw=Guncon

Or don't. Whatever.