Need some thoughts on an idea.

Hi all, So I've been tweaking with arduinos for a few months now and am currently planning out an idea for a laser tag setup.

To improve realism I want to make it so the user has to physically remove the magazine when empty. To save on cost and so as not to mean the players have to carry around loads of magazines I'm trying to think of a method of reusing the one magazine a limited number of times.

Again to reduce costs and to keep things simple I ideally what only passive components in the magazine.

Basically I'm looking for a method to create some kind of counter that the arduino can interface with. I think I only want the magazines to be used 4 times, so the 'counter' would only need 4 values.

One idea I have is to use a capacitor arrangement whereby a full cap means the mag is unsused and an empty cap means that its been used 4 times, with charge levels in between indicating the 1 2 and 3.

Now RC circuits aren't my strongest point so I'm basically looking for some clarification as to if this idea will work or not.

If on every reload the RC circuit is discharged for a set amount of time will the Arduino be able to determine the remaining charge and thus calculate how many reloads are remaining in that magazine?

Thanks for reading, if you need anymore clarification just ask.

Geuben

Could you have the gun count the number of times the magazine has been removed and replaced?

For example, the magazine would have a connector, and the gun would have a mating connector. The magazine connector would have two pins connected together. When the magazine is in place, those two pins would connect an Arduino pin to ground. When the magazine is removed, the Arduino's internal pullup resistor would pull the pin high. 0 = magazine in, 1 = magazine out.

One problem is that the players will soon discover that they can reload by pulling the magazine out just a little bit and then putting it back in.

You could solve this problem by making the magazine reversible, with a connector on each end. The connectors would use different pins, so the gun could tell which end of the magazine was in the gun. One end = odd loads, the other end = even loads.

To reload, the player would have to remove the magazine, reverse it, and put the other end into the gun.

You could use a third Arduino pin to reload the gun. You would make a master magazine that would connect the third pin to ground. When your program saw this pin go low, it would reset the counter to 4, or whatever you want a full load to be. To recharge a gun completely, you would just insert the master magazine, then remove it and insert the player magazine.

It would also be pretty cool if the gun had a 7-segment LED display (one digit would do) that showed how many loads were remaining.

Your project sounds like fun. Please post some pictures.

-Mike

It's a bit early for pictures, the project is still mainly in my head. With some stuff jotted down so I don't forget my ideas.

While your idea keeps things pretty simple it removes on aspect of the game I forgot to mention, Id like the players to be able to pick up magazines around the battlefield or from a team mate etc. With your method there is no distinction between different magazines (at different reload levels) so once the player has used 4 magazines they wont be able to use any more until they reset with the master mag.

If you've ever played Halo then it might be easier for me to explain how I want it to work. The Battle rifle on halo has 36 rounds per mag and you can carry 108 rounds (3 full mags), if you find a battle rifle in game (from a fallen ally) then you only pick up what ammo they had remaining. I'm looking to implement something similar, but figured that having a 108 value counter might be bit more complicated so was just going to deal in full magazine amounts.

The idea with the capacitor arrangement (if it works) allows for magazines to be refilled (by charging the capacitor) at specific locations (i.e bases).

I do plan to have a display for ammo on one of the bigger guns (the plan is to eventually have multiple weapon types).

Also the problem with forcing the player to have to completely remove the mag to reload: Well I was thinking of some sort of switch/trigger that is only tripped when the mag is completely removed from the slot.

I would have a switch in the gun, in the magazine compartment (maybe a magnet in the mag, and a magnetic sensor in the gun.)

The user has to remove the mag when the rounds in the gun are exhausted. The switch detects the insertion of a new magazine when a new mag is inserted - and the software decrements the number of mags, and fills up the current rounds available.

Something like:

// in setup:
#define ROUNDS_IN_MAG 50 // 50 rounds in each magazine.
int iMagazines=4; // 4 mags to start the game, 1 in the gun, 3 in the 'pocket'
int iRoundsThisMag=ROUNDS_IN_MAG;

loop()
{
...

if(iMagazineInserted && iMagazines>0)
{
// reset the number of rounds in the gun, we have a new magazine.
iRoundsThisMag = ROUNDS_IN_MAG;
// remove a magazine from our "pocket"
iMagazines--;
}

if(TriggerIsPressed && iMagazineInserted)
{
if(iRoundsThisMag>0)
{
// fire.
return;
}
}

// click. No ammo, or no Magazine if we get here.

Pretty cool idea you have there... :wink:

Thanks for you detailed reply. Its a good idea however its not quite what I'm looking for.

Having the magazine count controlled just in software limits the player to a maximum of 4 mags. With a real gun you change mag when it runs out and you put in a new full mag. As making lots of mags would be a bit expensive (and the player would have to carry lots of mags) I've decided to make 1 mag = 4 mags, so a single mag can be reloaded 3 times before its depleted. At this point the software solution prohibits the player from getting any more ammo.

What I'm after is a method that allows a mag to be reused 4 times but after that the play has to find another mag that has not been depleted in order to reload.

It would be more fun, I think, to require multiple magazines. Then you have people frantically scrabbling for their ammo belt to reload, dropping them, etc...adds another level of strategy.

To store the "ammo" it seems like a no-brainer to find the cheapest, smallest EEPROM chip possible. You only need to store one byte, but you'll get more than that if you want to do other things like store the type of ammo. For example, here's an 16 byte EEPROM in DIP-8 that starts at 30 cents qty 1 and goes down from there: http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=24C00/P-ND

You might be able to find even cheaper ones, maybe larger capacity but more common. 128 byte chips are about the same price.

Don't worry about read/write cycles, you'll get at least a million writes out of these.

Next you need to figure out a durable 4 pin connector that survives some rough treatment.

Expensive but cool spring contacts:
Female http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=70ADH-4-F-ND
Male http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=70ADH-4-M-ND

Or try something common like USB.

I agree that having single use mags would be more fun and realistic it's just the logistics of making them all (if I'm going to have 3 or 4 different types of gun and lots of players).

The EEPROM idea sounds perfect. However I don't have any experience with EEPROM chips, how would they interface with the arduino? If it's done serially via a single pin then that could work (I might not have enough spare pins for parallel).

I guess the idea is to simple store a value in the EEPROM and have the arduino read that value when the mag is loaded and decrement accordingly. I could then make a magazine recharging station consisting of an arduino that resets the stored value back to its full value.

I think what you are looking for may be able to be done with RFID tags in the magazine, and an RF reader in the gun. RFID tags have a small range in which they work, so it may be possible to use it both to identify the magazine, and to see when it is removed. IF on the other hand it requires the magazine to be removed to, too far of a distance you may have to use two technologies together. One to count the mag removal, and the second to make sure a "deplete" magazine cant be reused.

I am thinking something along the lines of a reed switch to detect magazine removal, and an RFID tag to designate the magazine. This gives you your magazines which are identified, and your counter, and the magazine would be filled with "inert" items.

The only problem I see and I dont know if it is a real problem would be the magnetic strip close to the RFID tag... which is probably not good. But some easy shielding may solve this also. AGAIN its probably easily do-able JUST with the RFID tag, as once the magazine is moved away from the reader, it will more then likely lose communication, which could be counted.

Heres how I see it working....

Run a magnetic strip down the whole side of the magazine. The reed switch will be placed at the low end of the magazine slot. This way the magazine has to be FULLY removed, and then placed back in to simulate swapping it.

SO when a magazine is first inserted into a "cleared" gun at the start of the game... The RFID is read by the reader in the gun, this magazine ID is now stored, and the counter for that magazine set at 0. So that magazine can now be removed, the reed switch sees this, adds one to the counter, and now that magazine with that ID has 2 more uses. When the magazine is used up (the counter hits 3), then that magazine is no longer usable. So the player must discard it and pick up a new magazine with a new RFID number. This even insures that the player couldnt pick up one mag, and keep the other around, and just keep swapping between the two mags. EACH mag would be saved in the gun and only useable 4 times each.

Then at the end of the game you simply reset all the guns clearing the RFID's saved inside and the whole thing starts over.

I hope that helps. You could even use a magnetic card reader strip (like are on credit cards), and literally have the magnetic card reader strip be right on the side of the magazine. Just a thought also.

Hope this helps,
Chris

While your RFID method seems like it should work, and I do plan on using RFID tags in other parts of the system the previously mentioned EEPROM idea beats it dramatically on cost.

I just had a look and Farnell sell 16x8bit EEPROM for £0.16 their I2C too, so shouldn't use up any pins.

With just a quick search I found this...

I know there are MUCH cheaper ones available, this one just happens to be at the most expensive electronics store there is...

I've seen that one, it's prohibitively big though which will no doubt compromise the size and aesthetics of the guns I have in mind. The RFID readers I'm planning on using for the other parts of the system are the tiny ones that Sparkfun sell.

The EEPROM verson will work AWESOME, and you should be able to find a sufficent connector too, so YES go with that!

I think I will go with the EEPROM method. It will also allow me to work on an individual bullet level instead of just magazines. So effectively you could find a half full mag.

That's why it would be cooler to have multiple magazines, because if someone finds a "dead body" and the gun is lying there with half the bullets left, the player can just pick up the gun and use it without bothering to switch magazines. In that case you wouldn't really even need to have detachable magazines, if each gun has only one magazine with a certain number of reloads in it. With multiple magazines the player can collect the unused magazines from the other player's ammo belt. And then you can have concepts like players on the same team tossing each other spare magazines, or having different classes of players like ammo carrier and medic.

While each magazine will only have a limited number of rounds in it, there's nothing stopping the player using a different magazine with their gun. The only reason to make each magazine reusable a set number of times is to reduce the number of magazines I have to make.

My new problem now is how to make a visual indication that a magazine is empty. This would be to avoid a player picking up an loaded a mag only to find its empty. Again this needs to follow the same criteria as before - Simple and cheap.

The obvious solution is to add a LED that is turned on when empty or something, but that requires a power source and a latch within the magazine which isn't ideal.

What fun is laser tag without the ability to steal magazines from other players (that you maybe have already killed...)

:slight_smile:

This may have been already mentioned but perhaps give each mag a unique id, and implement a timer in the gun so that the mag has to "recharge" before you can slap it in the gun again? This would prevent a player from pulling it out and putting it right back in again, and help add to the realism.

The EEPROM method is defiantly the way I'm going to do it as it's so cheap and allows me to do a lot of different things in the software if I wish to do so, such as unique IDs for each mag and timers etc.

As I said earlier my latest problem is how to show that a mag is empty without adding to the complexity (and cost of the mag).

Well, you could have the player carry 3-4 mags, and each would connect a different pin. Then in the software, you could make it so the player had to put a different mag in each time. That way the mags could each have 4 rounds of bullets in them, but you couldn't just pu in and remove the same mag. Maybe you could also have a base like thing where you could plug a cord into your gun and all the mag limits would be reset if they were at zero.