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

02/19 I will add RGB led support soon, I need for that to use 3 arduino PWM pins, which are currently being used by Pedal, Start & Right. I will do 2 firmwares, one with 11 buttons, and one with 8 button+led. How should they behave?

Leave the button pins as it is now, and disable the pedal, start and dpad right buttons when the RGB led is active
0 (0%)
Swap the pedal and start pins with some of the DPad ones, and disable only the DPAD when the RGB led is active
2 (50%)
Other (post a message to tell me what you think).
2 (50%)

Total Members Voted: 4

  

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

0 Members and 5 Guests are viewing this topic.

JayBee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 221
  • Last login:Today at 10:44:21 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.
It also has many other features, making it the most advanced IR light gun consumer solution.

If you like my projects and want to support me and help me maintain it, or just pay me a beer, you can find my Paypal and Patreon below :cheers:

My patreon

First, a small obligatory disclaimer: like with any DIY project, I am not responsible of any damage you might do to your hardware/yourself. Be sure to read everything careful before using my firmware. I am not a professional in electronic. I am giving all the schematics and pics as example, use them at your own risks.
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:
  • Auto calibration: calibrates automatically with 4 IR Led, on any screen/setup.
  • Precise line-of-sight aiming: very precise line of sight aiming, and far less jittery than other IR solutions.
  • Reduced minimum distance: as long as the system can see the 4 leds when aiming center, it should work.
  • Out of screen aiming support: out of screen tracking down to one led, allowing to move the cursor on the sides.
  • Out of screen firing mode: for games with off-screen reload, firing off-screen can trigger the reload button.
  • Mouse released when off range: releases mouse control when out of range.
  • Mouse/keyboard and joystick mode: you can switch between 3 input modes at anytime (mouse+kb, joystick, mouse+joystick).
  • Fullscreen and 4:3 aspect ratio switch: if your screen is not 4:3, you can enable/disable this mode at anytime, to play 4:3 games with pillar-box.
  • Manual screen calibration: manual forced calibration, just in case your leds are a bit far from the screen center.
  • Solenoid/rumble support with fullauto: you can use 1 solenoid and 1 rumble motor for various feedbacks.
  • Mamehooker support: for the supported games/emulators, you can use Mamehooker for customized feedback and settings.
  • Solenoid temperature sensor support: change the solenoid speed depending of the temperature.

Building the hardware:
- to avoid any issue, I would recommend to flash the arduino firmware first (see software installation guide), test the camera, and then if everything work, build the rest of the hardware.

Needed components 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 (e.g. 3m)
  • the DFRobot IR Camera
  • push button with shaft longer than the shell thickness (for the extra calibration button)
  • electronic cables to connect everything (e.g. kynar cables)
  • soldering iron & solder
  • hot glue or whatever you want to use to prevent anything from moving inside the gun
(optional) Hardware for the solenoid recoil:
  • n-channel logic gate mosfet (e.g. IRL540)
  • kickback diode (e.g. 1N4001)
  • resistors (e.g. 1kOhms and 100kOhms)
  • small pcb
  • solenoid that fits inside the shell without hitting anything when activated
  • long power cable
  • AC power supply matching the solenoid specs
(optional) Hardware for the rumble feedback:
  • NPN transistor (e.g. PN2222)
  • kickback diode (e.g. 1N4001)
  • resistors (e.g. 270ohms)
  • small pcb
  • rumble motor
  • power supply matching the specs of the motor if not 5V or too power for the arduino VCC
(optional) Hardware for RGB LED:
  • RGB LED with common cathode (common ground)
  • 3 resistors that match the LED specs
(optional) Extra hardware:
  • temperature sensor for solenoid speed control (TMP36)
  • 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.
IMPORTANT: The DFRobot IR Cam often 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 with the tool before doing anything else.

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

The corresponding pins on the Pro Micro as reference:


Notes:
  • Be careful of which firmware version you are using and the corresponding pins
  • 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. It can be disabled with a button combo.

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

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

Hardware 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
or here:
http://ledcalc.com/#calc

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:
  • If you have a Sparkfun Arduino Pro Micro, you will need the drivers --> Here <--
  • Arduino IDE (this will just be needed to flash the firmware)--> Here <--
  • (Optional)Mamehooker, for synchronizing the gun recoil/rumble to the game (Windows only)
  • (Optional)Demulshooter, to improve dual gun support on many emulators and games (Windows only)
  • And of course all the games and emulators you want to use
Installation:

Software installation process:
  • If you have a Sparkfun Arduino Pro Micro, install the drivers. Follow the steps --> Here <--
  • Install the Arduino IDE
  • Launch the IDE
  • From the board menu, install the "Arduino AVR boards"
  • Select the correct COM port
  • Create an empty sketch and flash it
  • If successful, you can go to the firmware flashing process
  • If unsuccessful, check the FAQ, or ask for help in this thread

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 ;)


  • unplug any other arduino or usb devices that use a COM port from your computer
  • download the firmware zip file and extract it anywhere
  • execute Firmware_flash.bat (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)
  • once the hex file is flashed correctly build the rest of the hardware
  • (optional)install Demulshooter and Mamehooker, please refer to their own websites

MameHooker usage:
To use Mamehooker with this system, first follow those steps:
- In your Mame.ini file (in Mame folder), change "output" option to "windows";
Code: [Select]

#
# OSD OUTPUT OPTIONS
#
output                    windows

- 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.
- 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.
- 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.
- Button combo mode changing: there are different modes you can change with buttons combo, you must first hold one of the following buttons and press the calibration button briefly for some to switch mode. If you have a rumble motor, it will rumble briefly to tell you which mode it activated.
  • Calibration button alone: enable/disable 4:3 mode
  • Trigger+Calibration button: enable/disable offscreen alternative button mode
  • A+Calibration button: change input mode
  • Pedal+Calibration button: change pedal button mode (unique/reload)
IR camera testing tool:
You can get this tool in the attached file.

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 not in the right screen aspect mode.

Updates history:

* 2020/02/28 - 1.85 major update, please read the changelog carefully before updating!

- rewrote the whole flashing and config tool, now a lot more user friendly!
- made a double timing test to be able to flash any arduino. No need to modify the bat file anymore.
- various optimizations
- IR points detection bug corrected, it should be a bit more stable now
- reworked the buttons management
- merged normal and test firmware, now the test tool should trigger the test mode (replug the arduino once to reboot in normal mode)

- added RGB LED support for the 7 button + LED firmware! If your gun uses more than 7 buttons or if you don't want LED support please use the 11 buttons firmware
- added temperature sensor support! connect a tmp36 sensor to pin A0
- added rumble and LED feedbacks when changing modes
- added various LED feedbacks
- added EEPROM save and load gun data

- updated the game screen ratio modes for better usage and compatibility, now there are only 2; fullscreen and 4:3. Obviously changing this option will have no effect if you have a 4:3 screen.
- updated the test tool, now the one pde tool supports both normal and full screen, and has more options (don't use the old tools)

* 2020/02/18 - 1.76
- reworked the buttons management again and fixed the remaining issues (with the calibration for instance)
- fixed the bug with the feedback when offscreen reload is disabled, now it should trigger the solenoid (the way it works remain unchanged when offscreen reload is enabled)
- modified the flashing batch file to be more compatible (detects bootloader whatever the model, and waits for 6 seconds now)
- rewrote part of the guide, added installation instructions

* 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/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: Today at 10:44:21 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:Yesterday at 10:32:43 am
  • 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
  • ***
  • Online Online
  • Posts: 3616
  • Last login:Today at 07:05:27 pm
  • 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: 221
  • Last login:Today at 10:44:21 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: 221
  • Last login:Today at 10:44:21 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:February 25, 2020, 06:58:19 pm
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)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 10
  • Last login:Today at 06:02:59 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: 221
  • Last login:Today at 10:44:21 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: 18098
  • Last login:Today at 03:13:43 pm
  • 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: 221
  • Last login:Today at 10:44:21 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: 18098
  • Last login:Today at 03:13:43 pm
  • 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 221
  • Last login:Today at 10:44:21 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: 221
  • Last login:Today at 10:44:21 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 18098
  • Last login:Today at 03:13:43 pm
  • 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 221
  • Last login:Today at 10:44:21 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 221
  • Last login:Today at 10:44:21 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 221
  • Last login:Today at 10:44:21 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 221
  • Last login:Today at 10:44:21 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: 221
  • Last login:Today at 10:44:21 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: 41
  • Last login:February 22, 2020, 01:32:36 pm
  • 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: 221
  • Last login:Today at 10:44:21 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:Yesterday at 12:34:07 am
  • 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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: 221
  • Last login:Today at 10:44:21 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: 221
  • Last login:Today at 10:44:21 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:Yesterday at 12:34:07 am
  • 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: 221
  • Last login:Today at 10:44:21 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:Today at 06:43:25 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
  • ***
  • Online Online
  • Posts: 589
  • Last login:Today at 07:13:42 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.