Ok, I’ve been looking into this myself lately and you’re right: this kind of thing is fairly simple!
First off, read http://www.lasertagparts.com/mtdesign.htm
The gun is basically an IR-led placed at the focal point of a lens (explained on the site I linked to). This makes the IR-light travel in a pretty straight beam, almost like a laser, thus giving you the range you need.
The points you can hit on your opponent consist of IR-demodulators. These are found in TV’s, dvd-players, essentially anything that has an IR-remote. They have a power pin, a ground pin and a data pin that changes from high to low when the sensor is hit by modulated IR light.
By “modulated IR light” I mean IR-light that is turned on and off a certain times per second. Most tv’s and such use 36-40KHz. The reason for this is that sunlight (amongst other sources of light) emit infrared light, and this would interfere with the signal if not for the modulation.
This means that the IR-led in the gun needs to flash on and off at a freqency matching the sensors you choose. This can pretty easily be done in code with the Arduino so you probably don’t need to build a 555-timer or anything fancy like that.
Now for the data-part:
When the gun is sending out a beam of IR-light flashing on and off at, say, 40KHz, the sensors read a signal; ON, and when there is no light, it reads OFF. The most common way to encode data in this kind of system is what’s called “pulse length modulation” meaning that depending on the length of the ON-pulse, either a 1 or a 0 is transmitted.
First off though, the gun sends a “header”, which is just a way to tell the vest that data is coming. Don’t pay this much mind, it just means turning the light in the gun on for a set period of time before sending the actuall data.
Ok, lets say that the header is 2600us (microseconds) long, a ‘0’ is 600us and a ‘1’ is 1200us.
________ ___ ______ ___ ______ ___ ______
| |____| |____| |____| |____| |____| |____| |
header 0 1 0 1 0 1
Does that make sense? Hope it does. When the signal goes on, you are turning the IR-light in the gun on and off at 40KHz, when it’s low the IR-light is off. The long pulses (1200us) will represent '1’s and the shorter '0’s.
For this very simple example, you could let the left-most 2 bits represent the team (in this case 01; team 1) and the next 4 the players ID (0101; player 10). With this stream of data sent over and over, the vest recieves it and records that player 10 on team 1 has killed him. The killed players vest, gun and display lights turn off for 5 seconds, and is turned back on again.
I imagine the reciever would use events to hook whenever the sensor goes from low-to-high or high-to-low and count the time the sensor is on. If it’s more than 1200us it has recieved a ‘1’, if it’s less (but more than 600us) it has recieved a ‘0’.
You could of course freely extrapolate this protocol however you wish. You could add one more bit to tell if the shot is a “ressurect” shot or a regular shot. Or, you could just make the code treat it as a ressurect if the player who shot you is on the same team as yourself.
Hope this made sense. I’m very talented at going off on rants. Heh… x)