Laser Tag & circuit ideas

Hi guys. I did some research before posting but there was no thread that seemed to talk about setting up a circuit for a laser tag project. And i didn't post it in the Projects section because i still have to understand what exactly i want to build.

So i am here to show you some of my ideas, thought you could give me a hand pointing out which, according to you, is the best of the setups i've thought about. For those who don't know what laser tag really is: well, basically it's a game where every player has its own "pistol" and sensors on his body. The players use their pistols, which shoot IR signals, to try to hit other player's sensors. It's basically an IR firefight.

..and these are a few ideas i came up with: (not sure which one is the best)

SETUP 1


(those 3 legged squares are IR sensors)
-3 SERIN MCUs at the top, each one runs the SERIN command and as soon as they get something they tell that to the master. (these are used to receive signals sent by other pistols)

-Master: receives data from the top MCUs, decides if the shooter MCUs can operate (eg: if the player has still some hit points then let him shoot OR if there are bullets in the mag)

-Shooter: shoots, that's all. (aka: uses two of its outputs, one for PWM and one will be the SEROUT pin, to send the signal)

SETUP 2


-3 SERIN MCUs at the top, each one runs the SERIN command and as soon as they get something they tell that to the master.

-Master MCU: gets data from the other MCUs and does the shooting. The frequency of the shooting might not be totally precise as in the previous setup

SETUP 3



- Master: has 3 interrupts (28X2), goes to SERIN mode as soon as one of the 3 interrupts gets activated by one of the sensors. Tells the SHOOTER MCU whether it can shoot or not.

- Shooter: shoots. May substitute the master in magazine checking (eg:checking if the mag has enough bullets for the shooting, even if the master will still need to tell the shooter if it can shoot or not, since it is the master that calculates the remaining hit points.

That's all for now :)
 
Technical's hint was integrated in the above designs actually, even if it does not look like it.

In the first two setups you see three different MCUs attached to three different sensors, but actually each one of these will have its input pin attached to multiple IR sensors in parallel.

You might ask: then why are you using 3 MCUs? I am using three of them to detect from which direction the "shot" came from (=which of the three sensors got hit by the IR signal).
 

BCJKiwi

Senior Member
Could a single 28X2 be used for the entire system?

The X2 hintsetup enables three separate hardware interrupts with flags being set so you know which target was hit.

Should be plenty of code space and speed to manage it all in a single chip.
 
you mean i could place 3 interrupt flags on the input pins connected to the sensors and then switch to serin, right? This is similar to the third setup, cept for the master doing everything. Could be an idea. Later today i'll test the speed of a 28x2 and see if the switching between interrupt and serin is fast enough (i had poor results at 4MHz, it took 20 seconds to do this).
 

BeanieBots

Moderator
The 28X2 has background serin and hardware interrupts.
No switching between is required.
What was it doing for 20 seconds?

or did you mean 20uS?
 
Ahhh! yes sorry i meant 20ms! Though i was not using the 28x2. I was using a 28x1 and since i needed three different interrupts (the 28x1 doesn't have 3) i was doing something like this:

loop:
if pin1=1 then goto blabla
if pin2=1 then goto blabla
if pin3=1 then goto blabla
goto loop
pause 20
serin .......

i tried 15ms but i kept on receiving a different value. I'll try the hardware interrupt in a minute, to see what i can get out of it.
 

BeanieBots

Moderator
Within the interrupt routine, you could try something along the lines of:-

branch pins,(blah1,blah2,blah3....)

maybe with some up-front filtering
b0 = somefucntion of pins
branch b0,(....
 
@ BeanieBots: i may not be needing that. I now want to try using 28x2's three interrupt so i am not going to be needing the previously posted piece of code. But thanks for the suggestion.

@ BCJKiwi: well serial's job is to transmit data from one system to another (=from one player to another). The serial output pin is ANDed with the PWM pin so it can give the IR LED the right modulation to be received by the IR sensors of other players(each player has it's own system/setup).
 

Rickharris

Senior Member
In realistic terms you have a limited amount of Ammo and perhaps need to count hits. This seems to be within the range of a simple set up. Counting hits is done at the receiver and counting the shots in the gun. Why connect them together although if you need to then a wire a serial connection should do the job.

Why not - Use the fact that an 08M will send out coded IR signals and use a simple set up where the enemy only responds to the attackers coded signal so you can;t shoot yourself as it were.

This should be fairly simple to implement with an IR receiver target front and back.

The hardest bit in my IR experience is getting the beam to be narrow enough over any distance to require accuracy. Optics are a lot more tricky than the electronics.

Range is also difficult to achieve - putting more power into a bunch of IR LEDS seems a likely candidate but other factors also effect the range.

Why not use visible light? You still can't see it even in the dark until it hits something - at least then you know someone is shooting at you.
 
Last edited:
1) as for counting bullets in the magazine i thought about giving each magazine (say a player can have max 8 magazines) a unique resistor which works as a unique ID. The two electrical contacts on each mag end up going to V+ and to an ADC input. The central brain does the counting related to the kind of resistor. (differently from some other laser tag system where you have an EEPROM in the magazine which gets re-written every time a bullet is shot)

2) i would prefer using serout/serin other than irout irin as, after reading comments from various people, i think i might be choosing the 28X2

3) as for the optics : http://www.lasertagparts.com/mtoptics.htm
i guess it is the part that scares me the most: making something solid, that does not fall apart but also something standradized, every player has to have the same "optical tube" etc....

4) i've heard of a max distance (max= no sun shining on the receiver, open field) of 200m by driving an LED (precisely a TSAL6100) at 1A.

5) Visible light: it would be nice indeed, but how do you handle light coming from the sun for example? Wouldn't it somehow interfere more than it does with IR? (just asking, don't know much about this). And: are there sensors for decoding visible light at certain frequencies?
 

Rickharris

Senior Member
1) as for counting bullets in the magazine i thought about giving each magazine (say a player can have max 8 magazines) a unique resistor which works as a unique ID. The two electrical contacts on each mag end up going to V+ and to an ADC input. The central brain does the counting related to the kind of resistor. (differently from some other laser tag system where you have an EEPROM in the magazine which gets re-written every time a bullet is shot)
i don't know much about this mode of warfare but AFAIK most are played indoors in a semi dark room.

The reload situation requires you to got o a central point for your team and attach to reload connections.

2) i would prefer using serout/serin other than irout irin as, after reading comments from various people, i think i might be choosing the 28X2

3) as for the optics : http://www.lasertagparts.com/mtoptics.htm
i guess it is the part that scares me the most: making something solid, that does not fall apart but also something standradized, every player has to have the same "optical tube" etc....
Getting the optics aligned is a nightmare never mind sourcing them. Working with IR which you can't see just adds complexity.
4) i've heard of a max distance (max= no sun shining on the receiver, open field) of 200m by driving an LED (precisely a TSAL6100) at 1A.
Optomistic I would say judge it from a normal TV remote unit 20m would be very good.

At 200 m how wide would the beam be?
5) Visible light: it would be nice indeed, but how do you handle light coming from the sun for example? Wouldn't it somehow interfere more than it does with IR? (just asking, don't know much about this). And: are there sensors for decoding visible light at certain frequencies?
Using visible light you can now have a reason to code the light Receiving via an LDR or photo transistor allows for sensitive detection. You can see the beam in a darkened room with the application of a little air freshener or Talc into the air.

More power - get a high power halogen bulb or one of the LED flash lights that thrown a beam.

Light from ambient light can be reduced by putting the receiver at the bottom of a narrow black tube. The transmitted beam width can be reduced by using a long tube as a barrel as well.

I guess eye safety aside you could use a laser pointer HOWEVER your players would need to wear good eye protection as even these low power laser pointers can damage your eyes.

IF I tried to do this I would start with a static shooting range get the gun/optice working and then expand to a mobile target.
 
Last edited:

eclectic

Moderator
@Captain

I've had a quick look at that website.
No wonder the "real" guns cost hundreds or thousands.

Making a robust and accurate system, with high quality optics,
and in volume.

That's a LOT of metal-bashing. (Forming and fabrication).

A serious project for one person.
Best of luck.

e
 
I personally don't see that much work. The only hard thing is placing the optics correctly, but after all it doesn't look like a nighmare to me. I am not looking at a super-high quality laser tag system. I don't get what you mean about the metal-bashing, i am not gonna make the "gun" myself, i'll use an airsoft replica :)

And now to RickHarris:
1) the laser tag i wanted to develop is mil-sim(military simulation) style so it would involve the changing of magazines, that's why i thought about the resistor idea.

2) so many people have done it, why shouldn't i get it properly aligned? :) to see if you centered the gun right you just use a camera and point the led at something, then check the radius of the circle you see!

Laser pointers are dangerous and have a way too small radius, so, considering i am playing in open air, the IR remains the best option.
 

eclectic

Moderator
I personally don't see that much work. The only hard thing is placing the optics correctly, but after all it doesn't look like a nighmare to me. I am not looking at a super-high quality laser tag system. I don't get what you mean about the metal-bashing, i am not gonna make the "gun" myself, i'll use an airsoft replica :)

And now to RickHarris:
1) the laser tag i wanted to develop is mil-sim(military simulation) style so it would involve the changing of magazines, that's why i thought about the resistor idea.

2) so many people have done it, why shouldn't i get it properly aligned? :) to see if you centered the gun right you just use a camera and point the led at something, then check the radius of the circle you see!

Laser pointers are dangerous and have a way too small radius, so, considering i am playing in open air, the IR remains the best option.

1. My apologies again! I didn't know that you were modifying an existing product!!!

I must polish my crystal ball or my glasses!

2. I did not use the word "nightmare".

Best of luck.
 
:D you apoligise too much when it's actually me, i didn't write it before that i was going to use an airsoft replica!

Tomorrow i'll give the hardware serout and serin a go, i'll see what if i can get them working properly.
 

Rickharris

Senior Member
...
Laser pointers are dangerous and have a way too small radius, so, considering i am playing in open air, the IR remains the best option.
A laser dot may be small but so are bullets! A simple 10 in experiment with a magnifying glass and an LED keychain torch shows me that at around 10 feet I get a visible in the semi dark spot about 4 inches wide - depending on if you are closer or further away the spot size may be bigger or smaller at 200m it must be huge and faint.

With a gun firing a 4 inch wide bullet even I could hit the proverbial barn door!
 

smokinglighten

New Member
Lasers would be a little ridicules. You have to hit the ir detector not the person. Could you could widen a laser beam? I would think distance would be reduced but it would have to be better than ir leds. Plus it would be amazing to see a red flash show up on your kill shot.:)
 
if you say i can widen it i may take it into consideration. Do you know anything related to eye protection for lasers? (never used such things)
 

hippy

Technical Support
Staff member
Before embarking on a laser-based project, check your local legislation and what your event insurance says, and bear in mind what is permissable now may not be in future.
 

Dippy

Moderator
I think a little caution (practical not safety) is required for using lasers.

If you use a lensed (finely pre-focussed) laser module it will go through a standard (e.g. 1" diam) lens without touching the sides.
i.e. the dot remains a dot on the far wall.
Obv there will be some secondary effects as a lens isn't perfect.

If you had a module which was a 'perfect' point source then with a 'perfect' lens your 'dot' would be about the size of the lens - impossible of course.

The damage that can be caused is all about energy/area and duration. With a laser o/p at 'toy' levels (e.g. 1mW) producing a 1" dot I wouldn't be too worried about safety if it were modulated and was pulsed.

Legislation: good point. The state nannies are very active. They don't seem to mind about the Supermarket checkout lasers flashing in my eyes - but hey someone paid a lot of money to get approval. I remember enquiring with the 'powers that be' about laser safety when using modulation and flash. Two years later still no reply.

Pukka laser goggles are expensive. Ironically, the ones issued by the Admiralty were so good that you couldn't see the dot so you had to keep taking them off to see it.

On a practical point a small finely focussed dot is going to be difficult to sense with small detectors on the target.
If the sensor was on your left nipple and I hit your right nipple with a 1" spot then that would be a miss.
Whereas if I hit your nipple with a bullet then 'ouch', so comparing bullets to lasers is a little OTT.

AND your target will have to be hit for at least one or two bytes duration if using a Serin technique.

Some time ago I did a people detection thing. I used an IR LED pulsed at 2 Amps. This easily detectable at 50m with a IR ph/diode.
Both ends used a 1" Hi-Q lens. It could have gone a lot further than 50m but alignment was a problem.

In your case the receiver will have to be wide angle. But I'm sure if you use it in the gloom a reasonabley well focussed LED should give good results at a decent range. Its all about optimising signal/noise ratio to get the best results.

If I were designing a system I'd have an array of photo-Diodes feeding a gain block and demodulator separately, buts that may be difficult for easy DIY. How do the Big Boys do it?

Nice project. I'm sure others have tried this before on this Forum. I don't remember ever reading the results though.
 
Last edited:
This whole thing (plus other things) still lead me on the focused LED setup. Less to worry about, no protections needed.

They array of photo diodes with separate demodulator sounds quite nice, but i'll have to do some research before coming up with something, because the only things i've seen so far are photodiodes and demodulators all together (well i have seen photodiodes by themselves but no stand-alone demodulators, should be too hard to find though).
 

Andrew Cowan

Senior Member
A lot of these laster tag places have both laser and IR.

IR does all the actual firing/sensing, while a laser lets you see where your beam is. It means you can see if you are being shot, and the beams are just visible as it is very foggy with lots of smoke in the air. No goggles are worn - the lasers are very weak.
 

fizzit

Member
If you are using IR you should probably add maybe either a scope, sights, or a visible laser so you can see what you are shooting at. Otherwise, it really will not be enjoyable.
 
well yes of course. Each replica has its own iron sights, which are these :


the harder part will be to adjust them accordingly (much easier if you insert the IR led+lens in a silencer, so that the axis of the light beam is aligned with the barrel).

For every airsoft replica there are also scope/red dot mounts (we don't use them much in airsoft, but i believe they will play a MAJOR role in lasertag).

EDIT: since you won't see the bullets, it will be hard to understand if you're hitting the opponent. This is why i have though of adding some super-bright LED's that flash when somebody gets hit
 
Last edited:
it's me again!
i was examining the picaxe manual and read abot the setintflags command and thought it would be handy.

Basically what i thought of doing is this:
-setting up a hardware serin that works in the background and sends data to the scratchpad. this serial pin will be shared between the three sensor areas
-setting up three interrupts, one for each sensor area.

when an input is triggered it means some data has been received so the brain then goes checking in the scratchpad and then retrieves the data.
But i've got a question: how can i understand which of the three interrupts has been triggered? Is there a way to do this?

As the manual says in the setintflags command section "Only one input pattern is allowed at any time."....
 

BCJKiwi

Senior Member
That's the joy of the X2! - they're the first parts where you can actually tell the state of the pins at the time of the interrupt without retesting.

Have another read of hintsetup and setintflags.

While there can only be one configuration of interrupts at a time, it can cover the port/pin combos required.

The best thing to do is to write a little test routine and play with it in the simulator until you understand it's intricacies.
 
alright, let's see if i understood it correctly.

-First thing to do is use the hintsetup command, i decide which pins i want to use and if they set off the flag on the rising/falling edge. As far as i can understand this command alone doesn't do anything, it doesn't set off any flags by itself.

-the setintflags command launches an interrupt whenever the flags that you selected are true. From the manual: "Interrupt on a certain ‘flags’ byte condition."

So if the above are true, and for example i set flags on the three hardware interrupt pins, whenever one of these sets off a flag an interrupt routine is triggered. BUT the interrupt routine is always the same (right?), I don't have 3 interrupt routines, one for each hardware-int being triggered.

So again i don't see how to execute different functions based on which of the three interrupt pins got triggered.....

...but since you said I can do this, and I believe you, then I must have missed something...


EDIT: the manual doesn't specify this, but when the flags are set off the program goes to the routine called "interrupt" is it?
-
 
Last edited:

Peter M

Senior Member
I built a system using 2 14M's one handles which team your on (can be set red or blue), infrared input, led control (lights team colours and flashs both when hit) and which zone is hit (different points for 3 different zones)
whilst the other handles the shooting, dead time (for when you get hit), the scoring and the sounds -shoot, hit, game start, game end and revive.

I get about 50 meters with a focused (with a lens) IR led driven at approx 50 mA, and a ir receiver/demod chip (940nM) indoors

when your hit, I use B?=pins and then read this value for which zone is hit. This sequence is triggered by the single interupt on the 14M

And yes all this fits into 512 bytes including inter chip comms

Can't wait for the 20X2 to arrive on our shores, should be able to add a display etc.
 

hippy

Technical Support
Staff member
So again i don't see how to execute different functions based on which of the three interrupt pins got triggered.....
I think this is right, but check the manual ( I have to go and catch a train ) ...

HIntSetup %00000111 ' Allow Pin Interrupt Flags
HSetIntFlags %00001000 ' Interrupt on any Pin Interrupt Flag
Do : Loop

Interrupt:
If hint0flag = 1 Then ...
If hint1flag = 1 Then ...
If hint2flag = 1 Then ...
 
oh, i didn't know you could call "hint0flag" like that. I have to try it out, hoping that it does the checking fast enough (when the system goes to the interrupt routine maybe the interrupt pin has already changed its state, maybe i could use hserout's break option).

Peter, i don't get it. The reading begins when the interrupt is triggered, but how do you understand from which zone it is coming?
 
Last edited:

Rickharris

Senior Member
oh, i didn't know you could call "hint0flag" like that. I have to try it out, hoping that it does the checking fast enough (when the system goes to the interrupt routine maybe the interrupt pin has already changed its state, maybe i could use hserout's break option).

Peter, i don't get it. The reading begins when the interrupt is triggered, but how do you understand from which zone it is coming?

you can stretch pulses with a 555 timer very easy - so the picaxe has time to pick it up
 
i am not sure the manual doesn't tell much about these flags, maybe (something i havfen't thought of before) these "hintxflag" stay the same until a new interrupt occurs so there (maybe) won't be need of switching quickly.

And BCJKiwi's statement now makes more sense:
they're the first parts where you can actually tell the state of the pins at the time of the interrupt without retesting.
 

hippy

Technical Support
Staff member
Yes, that's the point of the Hardware Interrupt Flags; they latch their assertions, hintXflag remains set when the pin asserts ( even while executing a command, not just between commands ).

You can the check hintXflag later by polling to see if an assertion occured, or use SetIntFlags to have an interrupt occur automatically. The hintXflags have to be cleared by your program.

"Assertion" means activated, triggered, etc, regardless of whether the signal goes high or low.
 
I have to say that helps a lot. I guess i'll have to reset them with something like "let hintxflag = 0" or something like that (the manual doesn't say anything about a reset comand or such) but still it shouldn't be hard to figure out.

I guess i have all the knowledge to do the "full scale" testing. If it works it will be the official reception method!
 
Top