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

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

  

Author Topic: BYOLightGun???  (Read 2228 times)

0 Members and 1 Guest are viewing this topic.

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
BYOLightGun???
« on: June 13, 2003, 05:08:49 pm »
Ok, quick question... does anyone know the hardware needed for creating a circuit for a light senser that would only real a LED?  And do the sensers only pick up certain light frequencies?

I'm just wondering... if we could have 4 leds of 4 different light frequencies on each corner of our monitors....

Then create a 'gun' that would be somewhat pointed (in a shaft) that would pick up the light in degrees based on if it's pointing right towards it or not.

Then hook 4 of these up to some input (parallel first probably)...

Then try to write a driver for it (probably the easiest part... sadly enough)...


This time of solution would be great for a few reasons... You could easily add more then one gun, and you would have constant polling... so machine gun games would work...



So the questions are these..

1)  Do light sensors pick only specific ranges of light waves (so we could have 3 or 4 distinct ones)

2)  Do the light sensors allow you to know the strength of the light?  (so we could use the strength of the 3/4 to calculate the position)

3)  Does anyone know anything about the electronics behind it?  

4)  How much would the parts cost assuming all the rest is figured out?  (I really dont know how much the sensors are that could pick up that type of lights.... I'm not sure if that would be a real way to do it).
« Last Edit: June 13, 2003, 05:10:09 pm by Lilwolf »

Dave_K.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1807
  • Last login:July 06, 2022, 03:27:30 pm
    • Arcade Fever
Re:BYOLightGun???
« Reply #1 on: June 13, 2003, 09:41:04 pm »
Damn, how many threads you have open on this topic? ;D

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:BYOLightGun???
« Reply #2 on: June 13, 2003, 10:38:12 pm »
Just trying seperate two different ideas for hacking.  didn't want conversations about each to in one thread...

so 2 threads on different possible ways to make one... and one asking how they actually DO do it...

now to go look up ir sensors....

btw, any clue what types they use?  

Dave_K.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1807
  • Last login:July 06, 2022, 03:27:30 pm
    • Arcade Fever
Re:BYOLightGun???
« Reply #3 on: June 13, 2003, 11:33:47 pm »
I would say to just start expierimenting with the cheapest or easiest available (Radio Shack) sensors.  The hard part is going to be wiring a circuit to take the measurment, calculate the result, and then relay the x,y to a computer somehow (using a PIC processor?).  Or I guess you could have the sensors relay info directly to the PC (serial or paralell port?) and let the PC do the calibration and math to figure out the position.  Next you'd have to figure out how to get the input into Mame.  So lots more to think about than just the IR sensors.

I'd think this has been tried before (not just for lightguns, but for other "IR Tracker" projects).  I tried to do a google search and didn't pull up much.  I'd love to hear more people chime in, as I think its a great idea for homebrew project.
« Last Edit: June 13, 2003, 11:34:42 pm by Dave_K. »

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:BYOLightGun???
« Reply #4 on: June 14, 2003, 07:16:16 am »
Most shouldn't be a big problem.... in that thats what I do professionally  (read/write to PLC's for manufacturing equipment)... the trouble is I'm used to having a 100-5000 dollar piece of equipment inbetween.  

I'm going to see if I can get some equipment at work to test the hardware itself... but after that I'm in the dark.

One other idea I had.  I think that lego mindstorms have some ir stuff.  I wonder if they would work.  It would probably be more expensive (being lego) but there might be some people out there with some equipment.

Not to go see what radio shack has...

Spawn859

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:June 28, 2003, 05:25:48 pm
  • I'm a llama!
Re:BYOLightGun???
« Reply #5 on: June 14, 2003, 07:28:38 pm »
has anyone though about using an optical mouse?....  the cpu already knows how to interprit the signal from the mouse and so does mame.........

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re:BYOLightGun???
« Reply #6 on: June 15, 2003, 12:08:16 am »
has anyone though about using an optical mouse?....  the cpu already knows how to interprit the signal from the mouse and so does mame.........

I don't think optical mouse could work for light gun like use.  The sensor focuses on a spot very close to it, and even lifting the mouse 1/2" off the table renders the sensor useless.
Robin
Knowledge is Power

IIOIOOIOO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 295
  • Last login:August 04, 2003, 02:18:12 pm
Re:BYOLightGun???
« Reply #7 on: June 15, 2003, 12:40:30 am »
Why don't you pull apart a working light gun and start from there. Reverse Engineering from a working model is the highest form of flattery.

Xiaou2

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4135
  • Last login:August 01, 2025, 11:49:43 pm
  • NOM NOM NOM
Re:BYOLightGun???
« Reply #8 on: June 15, 2003, 04:27:54 am »
ive heard of a piece of software that turns a webcam into a tracking device.  I think i remember that good results came from it... tho I never tried myself.  

 From what I understood... I think you placed a certain colord dot on the object (gun) and it took the images and analized thier position - then turned them into screen coordinates.

  If such a technology exist... then even if the current method is laggy... modifications could be made to make greater accuracy.  It seems like a great idea.

 Anyone care to comment on this?

edit: I found this site that contains the software...
http://www.mousevision.com/index.html
   
 
« Last Edit: June 15, 2003, 05:21:04 am by Xiaou2 »

Dave_K.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1807
  • Last login:July 06, 2022, 03:27:30 pm
    • Arcade Fever
Re:BYOLightGun???
« Reply #9 on: June 15, 2003, 09:41:16 pm »
ive heard of a piece of software that turns a webcam into a tracking device.
Sweet idea!! I remember seeing this before also....but I have a feeling the resolution isn't going to be good enough (at normal lightgun distance from the screen).

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:BYOLightGun???
« Reply #10 on: June 16, 2003, 10:15:41 am »
It might be SUPER easy to do it... especially if you where willing to put a red border around the monitor... because then it's just taking the box, and figuring out whats in the middle....  and where the outside is.

but it would need to be able to tell somehow..

I'm afraid that the cpu utilization would be to much for modern pcs though.... but if you could get it working... you could probably use the technology in other locations for MUCH more then arcade... like autodriving cars that scan the cars infront of you...

I looked at some IR sensers.  And they where all pretty expensive (25bucks each where the cheapest in mass)... And since I would need 3 or 4... and still need in ir transmitter...

I'm now looking around to see if I can find any to hack...  I still think this might be a good solution...ESPECIALLY if I'm not using industrial IR sensers...  

I was thinking of maybe trying to use the IR standards for printers / notebooks / handheld devices for the devices themself.  I just am not finding enough quick info on the net about a few questions..

1) can an ir receiver pick up only specific ranges (in the cheap models)... This would be required for 2 player... And that would be needed.

2) can be done with cheap parts....

Still searching around... Would LOVE to get into this project, but not sure if I will have the time... At least to do anything soon.

Beley

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 116
  • Last login:September 14, 2013, 09:02:37 pm
Re:BYOLightGun???
« Reply #11 on: June 16, 2003, 04:55:35 pm »
IR sensors are acually fairly cheep, look up photodiodes and phototransistors, you used to be able to buy them at radioshaft until they stopped selling electronic components in canada.

as for different frequencies i think most of the ir ones work over the whole ir range.  but what you could do is modulate(flash) player 1 and 2 at different frequenices, then use bandpass filters to seperate the 2 signals from each other

grafixmonkey

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 743
  • Last login:October 16, 2010, 08:16:50 pm
  • must... tear self... away from... Tron...
    • My graphics/arcade/circuits site!
Re:BYOLightGun???
« Reply #12 on: June 17, 2003, 09:45:20 pm »

I was thinking of maybe trying to use the IR standards for printers / notebooks / handheld devices for the devices themself.  I just am not finding enough quick info on the net about a few questions..

1) can an ir receiver pick up only specific ranges (in the cheap models)... This would be required for 2 player... And that would be needed.

2) can be done with cheap parts....

Still searching around... Would LOVE to get into this project, but not sure if I will have the time... At least to do anything soon.


I'm hoping I understand what you want to do right - you want each gun to be able to tell how it's being aimed based on the IR signal it sees, right?  In answer to (1), yes there are different sensors that will pick up different ranges of light, but maybe not fine enough ranges within infrared...  better to use all the same emitters and sensors and use flashing frequencies and band-pass filters, like someone else suggested.  For (2), theoretically infrared sensors for the job you want should cost no more than $1 each max (check out www.newark.com and search for 'infrared phototransistor' to see).  Other supporting circuitry should be pretty cheap too long as you don't try and get it from Radio Shack.  They have a 10x markup on LEDs, and somewhere round a 2x markup for chips.

If you're going for a gun reading its aim based on infrared LEDs next to the monitor, you could go with three placed like in the picture I (tried to) attach.  Each gun can separate the three flashing signals with three band-pass filters and measure the strength of each signal.  The strength of the signal can give you the difference in angle between the aim of the gun and the direction of the LED (and the radius of the three circles in the diagram), but you'd have to stand at exactly the distance you designed the gun to work for or it'd all change.  

To get this to happen you can look at datasheets for infrared LEDs to find some that emit light uniformly in all directions instead of having a 'spotlight' beam.  Then scan datasheets for the phototransistors looking for one that has a detection curve that will work.  You'll need a compromise between one that only sees a light if it's pointed right at it, and one that doesn't change perception strength unless you go almost 90 degrees from the light...  might be tough without a lens.

If you get all that to happen, then each gun can have a cheap microcontroller that turns the three signal strengths (three circle radii) into an (x,y) point and outputs an analog joystick signal, one for each gun.  You can get microcontrollers capable of this for pretty cheap, if you have the equipment to flash their roms, and can do some assembly programming.  And because the gun is detecting its own aim, you can have two of them without needing different detection frequencies.  

Problem then is, your shooting game might not want an analog joystick signal for its lightgun input.  ;)   But I think this is a good place to start trying.  

Try Fairchild Semiconductor for your infrared stuff - I think they produce lots of optoelectronics.  I think they have a website with datasheets.

(just thought of something - if you hold the gun at arm's length the position of the gun changes more than the angle of the sensor - were you going for detectors on the screen, and emitters on the guns?  sounds like a tough project)
-----------
-- See my grafix, circuits and cab on my
-- new arcadey page:  http://www.bkgrafix.net

Dave_K.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1807
  • Last login:July 06, 2022, 03:27:30 pm
    • Arcade Fever
Re:BYOLightGun???
« Reply #13 on: June 18, 2003, 12:37:48 am »
I'm hoping I understand what you want to do right - you want each gun to be able to tell how it's being aimed based on the IR signal it sees, right?
The way I saw it is the gun has the IR Emmiter (flashing at a certain frequency per player) and the sensor array is whats on the monitor reading the gun(s) position.  Maybe I was wrong?
« Last Edit: June 18, 2003, 12:41:15 am by Dave_K. »

JustMichael

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1438
  • Last login:September 27, 2015, 01:19:40 am
  • Mmmmm!! Cheesecake!!
Re:BYOLightGun???
« Reply #14 on: June 18, 2003, 12:55:56 am »
Why not just use the scan pattern and rate of the monitor or tv to tell you where the gun is pointing?  What I mean is all tvs and crt monitors draw everything on the screen 1 spot at a time (using this spot the monitor draws a line from left to right and then drops down and does it again). By taking the difference in time from when the monitor started drawing the screen to when the gun sees the monitor drawing will give you the gun's position.

Dave_K.

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1807
  • Last login:July 06, 2022, 03:27:30 pm
    • Arcade Fever
Re:BYOLightGun???
« Reply #15 on: June 18, 2003, 12:59:31 am »
Why not just use the scan pattern and rate of the monitor or tv to tell you where the gun is pointing?  What I mean is all tvs and crt monitors draw everything on the screen 1 spot at a time (using this spot the monitor draws a line from left to right and then drops down and does it again). By taking the difference in time from when the monitor started drawing the screen to when the gun sees the monitor drawing will give you the gun's position.
This is the way traditional lightguns work (thus the flash when you pull the trigger).  We were thinking of other ways to grab a gun position independant of the monitor type (refresh, and resolution) being used.

grafixmonkey

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 743
  • Last login:October 16, 2010, 08:16:50 pm
  • must... tear self... away from... Tron...
    • My graphics/arcade/circuits site!
Re:BYOLightGun???
« Reply #16 on: June 18, 2003, 01:53:43 am »
I'm hoping I understand what you want to do right - you want each gun to be able to tell how it's being aimed based on the IR signal it sees, right?
The way I saw it is the gun has the IR Emmiter (flashing at a certain frequency per player) and the sensor array is whats on the monitor reading the gun positions.

that might be even easier, though you'd still have to stand with the gun exactly the right distance from the sensors - it'd be what I said in reverse, right?  the gun makes a splash of IR light, and the sensors measure their distances from the center of it?

Then each gun can flash at a diff. frequency, and you have the band pass filters in the cab somewhere...  then you only need one microcontroller, or maybe you could use the joystick port on the PC since it has analog inputs already.

I built a similar system for a EE class project, but mine just registered if the gun was being aimed at a sensor or not, and could tell what frequency the sensor was flashing (used this for scoring)  but I did it with visual light not infrared.  The phototransistor I used had a very narrow reception range, so if the phototransistor I used were mounted on an arcade screen and the light gun was 6 feet away, either the light gun would have to be inside a circle 1 to 1.5 feet in diameter or the phototransistor would have to have a lens on it of some kind.

here's some stuff at Newark:
http://www.newark.com/NewarkWebCommerce/newark/en_US/support/search/searchResults.jsp?action=0&First=0&QText=infrared+phototransistor

and a link to Fairchild Semiconductor:
http://www.fairchildsemi.com

Try looking at part numbers ASB320 and QSB320F
http://www.fairchildsemi.com/pf/QS/QSB320.html
http://www.fairchildsemi.com/pf/QS/QSB320F.html

they have a 120 degree reception angle (reception strength is 1/2 at 120 degrees) so they might work in this application.  (they differ in packaging - one has a clear coating, the other has black epoxy that's infrared transparent)

You can use 74LS124 chips to generate frequencies, but they're square waves and that might result in the detectors picking up all frequencies from each gun.  Maybe you could clean it up into a nice sine-wave-ish signal, but this might work too:
http://www.fairchildsemi.com/ds/ML/ML2035C.pdf
it's a nice looking $8 sine wave generator, but it has to be programmed serially.  This could be done with a rom and a counter, or with a couple shift registers with parallel loading, if you can figure out what to send to the serial inputs.

This is fun, I haven't had a challenging project to think about for a while!   :)
-----------
-- See my grafix, circuits and cab on my
-- new arcadey page:  http://www.bkgrafix.net

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:BYOLightGun???
« Reply #17 on: June 18, 2003, 07:25:25 am »
SWEET!

Do you have any information from your class project?  I would LOVE to see it!

I'm not an EE.  I usually work more on the software side for work, but do some hardware here and there.  

But here was my plan....

1) Finish all my other projects...  (hehe)

2) Try to get a simple circuit going with one transmitter and one receiver.  I was hoping to find some examples on the net.  I haven't found much.  If needed I would use some PLC's from work... but the trouble with them would be is it would change the project cost to hundreds/thousands quickly to duplicate.

3) Get it working with one light, and 3 / 4 receivers.  Then see how how the ranges of values go from close range.    If they don't have much range in values based on how direct the light is, then the project is off right there.  I hear they are VERY accurate so it shouldn't be a problem.  But if the ranges aren't linear, it might take more CPU horsepower to calculate the location then possible.

4) Last thing.  Try to generate a wave... and read only that frequency... To allow multiple guns.  If this didn't happen, it wouldn't be 100% failer.  If you could get one player going it would be still MUCH better with true tracking...  But the real goal would be 2 player.

Any chance you would want to help with the hardware side designs while I work on the software side?  Any interest in trying to repeat your old work with different equipment?





grafixmonkey

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 743
  • Last login:October 16, 2010, 08:16:50 pm
  • must... tear self... away from... Tron...
    • My graphics/arcade/circuits site!
Re:BYOLightGun???
« Reply #18 on: June 18, 2003, 08:24:59 pm »
argh, I've had login issues...   some windows update I downloaded changed something and I couldn't stay logged in at all.  Found out IE was blocking all cookies from the site.   :P

Sure, I'll help out with what I can!  I loves the electricy stuffs.  I don't have very much info left from my project, just some circuit diagrams that won't mean much, timing printouts, and one page of the writeup.  In my project, the gun was deciding if it was being aimed at an LED or not, so all it needed was one phototransistor and a lens in the gun - pretty different from using three detectors to determine a point in 2D space.

As for (1):   haha, you should see my list of "cool stuff I wanna do someday"

(2):  This is pretty easy to do.  You'll need either a 74LS124 chip, a 74LS624 chip, or a sine wave generator.  Then you'll need a capacitor anywhere between 0.1 and 1 microfarad, three variable resistors close to the 2 kohm range, a transistor, your infrared LED, your infrered phototransistor, and a speaker.  (if you have an oscilloscope you don't need the speaker - the scope is much better - but not many people have those.)

If you wire those up, then you can use the volume of the speaker to guesstimate how much light the phototransistor is picking up.  This'll tell you whether the project is feasible or not...  if you can't get a smooth relationship between the aim of the LED and the volume of the speaker's beeping, then you might be stuck.


(3):  I think it'll be the same relationship between signal strength and "circle radius" for each sensor, because they are identical and tuneable using pots, so the function to return circle radius given signal strength should be pretty small...  not sure about calculating point position from that.  What if you used a printed piece of transparency sheet to block out the IR light selectively, and give yourself exactly the spot of light you need?  Does IR pass through transparency sheets?


(4):  Band pass filters aren't my thing...  I've never built one and I don't recall how to go about doing so.  Maybe there are ICs that will do that somewhere.  Google is your friend   ;)
-----------
-- See my grafix, circuits and cab on my
-- new arcadey page:  http://www.bkgrafix.net