Airsoft Ammo Counter?

Hello there, I am looking at creating an ammo counter for my airsoft gun. I've done some searching online for these, and there are several ways to going about it, but I would like some advice from you guys as to which route would be most feasible. I am on somewhat of a budget, and would like to keep this modification under $20 (I have an Arduino Duemilanove and a 0.36" 7 Segment Super Red LED Display 3 Digit Anode already).

In addition to what I have already, I envision I will need two buttons/switches. One to reset the ammo counter display (perhaps hook it up somehow to the mag release); and another button to toggle between different mag capacities (e.g. 30 for low cap, 130 for mid cap, and 400+ for high cap).

Where the solution differs is in how I would sense or account for each launched pellet. Some people have put a pedometer like sensor on the trigger or gas blowback; while some have put some sort of light sensor at the end of the barrel where the pellet exits. The accuracy of the count is not too important, but I would have to say that the later is the most reliable because the airsoft gun may shoot blanks sometimes. To me, it's whatever is cheaper really.

Anyhow, what sort of sensors would I need? I shop primarily at Seeed Studio, but do not know where to begin with this. The counter and reset stuff I should be ok. I may need some help with understanding on how to drive the 3 digit LED display.

Do the sensors provide serial feedback? Anyhow, some guidance here would be much appreciated, or even some sample work that I can look at. Thanks!

For those interested, this is the basic concept of how the internals of the airsoft gun work:

And this here is the 3 digit LED anode:

Hi Xtrykr

Here a post I did and a schematic http://arduino.cc/forum/index.php/topic,65026.30.html My program and schematic only use 2 digits, but 3 is no problem, just and another PNP transistor and a base resistor. And modify the code.

I am on somewhat of a budget, and would like to keep this modification under $20

I understand that very well. Sensor : use a phototransistor, a small light bulb or a small laser ( from a laser pen ) , a 3 position switch ( for ammo selection ), a push button ( to reset the counter ), resistors, a 74LS47 for the display, some transistors, a encoder chip 74LS147, some PCB board. That should be under $20 ( US ? Can ? ) The most expensive is the 3 position swtich. I don't know where you live ( I am assuming USA ). Here a place in Quebec http://www.abra-electronics.com/ to order online. Or others location online DigiKey Here a link Electronic Components and Parts Search | DigiKey Electronics. For me, I shop localy at http://www.sayal.com/ It only a few minutes drive ( on Steeles Ave W or the 401 )

The opto sensor should be located at the end of the gun barrel. Or drill a through hole, across the barrel ? Maybe not...

I hope it help

For detecting a mag release, a lot of mosfet systems use a simple pushbutton glued to the part of the mechbox that is visible from the magwell(For the non-airsofters here: Airsoft MOSFETs are not just mosfets, they are simple computer systems that allow for fine-tuning of the airsoft gun's firing system, early designs used a mosfet to separate the trigger circuit from the high amperage motor circuit, since the mechanical triggers were slow, high-resistance, and had a tendency to burn out. Newer designs are a lot more complex.).

The easiest way to put a sensor on a gun would be to hide it inside a large flashhider or supressor. There isn't a lot of room inside the hop-up or the mechbox, and you dont want to be drilling into the barrel.

Thanks guys! I will give it a skim through. How would you guys do the wiring from the suppressor for the photosensor? Or is there like wireless way of communicating back?

Think I can get away with putting the IR photo interrupter sensor at the magazine siphon point? Only reason why I am thinking of this is because I have no idea how I would be able to get it inside the silencer/flash suppressor tube, which would also require lengthy wiring.

Right at the begining of the magazine, ( when bullets start loading inside barrel ) ...That is a good idea. I guess you may have to use a drill to install the opto sensor. ( LED / phototransistor ) . Just an idea.

Xtrykr:
Thanks guys! I will give it a skim through. How would you guys do the wiring from the suppressor for the photosensor? Or is there like wireless way of communicating back?

You could make your own arduino on a breadboard, or get one of the smaller ones, and hide the whole thing inside a supressor (they are all hollow, are required by law), or you could run some thin wires between the inner and outer barrel. For a typical M4/M16 clone with collapsible stock, you can hide a Duemilanove inside a PEQ box mounted on rails, inside a battery bag, or inside a mag pouch.

What type of gun are you putting this on? Madbull makes a hop-up for M4/M16 clones that has a window on the side for mounting LEDs to charge "tracer" bbs, you could use that instead of trying to drill into a hop-up yourself.
http://www.airsoftpost.com/product_info.php?products_id=32281

You can probably find it cheaper somewhere other than Evike.

Thanks guys for the feedback.

This mod is for a Echo 1 XCR.

I live in Canada and Evike charges a hefty premium for shipping up here.

The photosensor is roughly 1cm x 1cm, shaped like a gate with one pillar emitting the IR and the other pillar as the sensor.

Would this work? http://www.seeedstudio.com/depot/seeeduino-film-p-689.html?cPath=132_133

I am concerned that this controller may be overkill for my purposes.

I live in Canada and Evike charges a hefty premium for shipping up here.

Where in Canada ? I am just curious. Do you have the datasheet for the sensor / IR ? Post a link.

First, have you decided where you are going to mount the sensors?

If you put the sensor on the hop-up unit, you will have to run wires from it to the arduino, which could be placed in a battery bag, PEQ box, or somewhere else.

If you put the sensor and the arduino inside a suppressor, you wont have to worry about wiring, but you will have to make sure your sensor is fast enough to pick up on 10 - 30 rounds per second traveling at 300 - 450feet per second (91.44 - 137.16m/s) and you will need a smaller arduino.

I have never had an XCR in my hands, so I can't give specifics on wire routing. I assume the battery is stored in the empty space within the heat shield? Or do you use the PEQ box that comes with it?

I will most likely be using a PEQ box or bag for the arduino. There is a mod for the XCR that allows me to remove the fake gas tube that is just above the gas blowback to provide me with lots of room to stuff in there as well. I'm not so concerned about the muzzle velocity, I'd probably be more concerned with the Rounds Per Second, at stock with a 7.4 Lipo can give about 15 rps, with a 11.1 Lipo in excess of 22 rps... Is this sensor capable of measuring the rate of fire at these levels?

I'd like to put the sensor by the magazine feed, however, I am worried that if I drill a hole through this feed, it may affect the feeding/suction mechanism.

I am from Winnipeg.

This is the datasheet for the Photo Interrupter: http://garden.seeedstudio.com/index.php?title=Photo_interrupter_(OS25B10)

@Xtrykr

Here a site near you located in Calgary, Alberta...http://www.hvwtech.com/ I have a look at your opto sensor, interesting, that is not a simple coupler to install. The coupler I was talking about is "more" separated. Check the picture.

Oh I forgot...

I'm not so concerned about the muzzle velocity, I'd probably be more concerned with the Rounds Per Second, at stock with a 7.4 Lipo can give about 15 rps, with a 11.1 Lipo in excess of 22 rps... Is this sensor capable of measuring the rate of fire at these levels?

My answer will be yes. 1st Depend of the resistor in serie with the opto-transistor. 2nd. You may need a comparator circuit ( op-amp ) or/and a 74LS14 ( schmitt trigger ) NOT gate to improve the sensibility of the opto-transistor. In your program, you have to use AttachInterrupt function.

Xtrykr:
I will most likely be using a PEQ box or bag for the arduino. There is a mod for the XCR that allows me to remove the fake gas tube that is just above the gas blowback to provide me with lots of room to stuff in there as well. I'm not so concerned about the muzzle velocity, I'd probably be more concerned with the Rounds Per Second, at stock with a 7.4 Lipo can give about 15 rps, with a 11.1 Lipo in excess of 22 rps... Is this sensor capable of measuring the rate of fire at these levels?

I'd like to put the sensor by the magazine feed, however, I am worried that if I drill a hole through this feed, it may affect the feeding/suction mechanism.

I am from Winnipeg.

This is the datasheet for the Photo Interrupter: http://garden.seeedstudio.com/index.php?title=Photo_interrupter_(OS25B10)

You wont have to worry about any suction in the hop-up unit, the nozzle seals off that section when a round is "chambered". You may run into feeding issues though. Just try to make the holes as smooth as possible. You could add a piece of clear acrylic on the inside to guide the BB if you have to. As long as there is nothing for the bb to catch on, the spring inside the mag should have enough force to push the bb through.

Wow, awesome tips you guys! I'll see what I can do.