AR Ammo Counter

Status
Not open for further replies.

Jacgren

Member
Hi everyone, I'm in the process of building a replica AR and I was going to make it a functioning airsoft gun. I was wondering if any of you guys and gals have any idea on how to make the ammo counter actually work, i.e. count down from 32 each trigger pull/go down automatically in full auto.
 
The counter would actually be pretty simple to design. Research nand, nor, and inverter gates which you need to use. Pretty much every clock like the one attached is just a power supply and ground, an input signal to tell if each segment should be powered and a clock which just counts up or down in bits (0s and 1s). In your case you want to start at 32 (10000) to 0 which is still 00000 in binary. Once it hits 0, you need to make the counter repeat the number 0 until you send power to a reset button ( which somehow would be activated by you inserting a magazine) which would bring it back up to 32. I know this is confusing and probably doesn't make a lot of sense yet because what you're planning on designing is fairly complex for an amateur but fairly easy once when you understand more extensively. Check out if your school has the program multisim which will be a great place to practice designs and logic gates. Look into textbooks that cover logic gates, jk flip flops and other types of flip flops. This is not something you can learn from youtube videos or by searching the internet really. Here's a video of a counter in multisim
clock_in_flash8.jpg

clock_in_flash8.jpg
 
Last edited by a moderator:
a ot of what you said sounds a lot like minecraft redstone... in fact they do have logic gates.
 
The photodiode method Artifice linked to would be the most reliable (only counts fired rounds, not just trigger pulls). I only skimmed briefly but I assume the code to run it is similar to what I'm about to suggest.

The counter would actually be pretty simple to design. Research nand, nor, and inverter gates which you need to use. Pretty much every clock like the one attached is just a power supply and ground, an input signal to tell if each segment should be powered and a clock which just counts up or down in bits (0s and 1s). In your case you want to start at 32 (10000) to 0 which is still 00000 in binary. Once it hits 0, you need to make the counter repeat the number 0 until you send power to a reset button ( which somehow would be activated by you inserting a magazine) which would bring it back up to 32. I know this is confusing and probably doesn't make a lot of sense yet because what you're planning on designing is fairly complex for an amateur but fairly easy once when you understand more extensively. Check out if your school has the program multisim which will be a great place to practice designs and logic gates. Look into textbooks that cover logic gates, jk flip flops and other types of flip flops. This is not something you can learn from youtube videos or by searching the internet really. Here's a video of a counter in multisim

This would be the "official" way to do it if you're an Electronic Engineer. Assuming you don't have a degree in engineering or a hard science, Arduino is definitely the way to go.

You can program a simple one-button event handler which triggers a loop, which has no condition to allow it to go below zero. Then a second button (actuated by magazine insertion) triggers an interrupt pin which resets the loop and returns to the original button handler. The Arduino could then send the appropriate signal to a segmented LED display with a built-in serial-based controller chip, or, probably slightly easier, you can just program the arduino to send the appropriate parallel pin signals yourself, directly to the LED array controller, or even just drive a two-digit LED display directly by putting the appropriate binary values into the array (one being LED on, 0 being LED off). Depends what LED display unit you use, really.

There's a good chance you might run into matrices though, so you probably have two choices: 1), do it the hard electronics way, 2) do it the hard C++ way.

Oh, or three: Just buy one here: http://www.westaby.net/store/index...._id=24&zenid=fcf206388eaf90f8f6f34758f15c8103 - which is probably made with the logic circuit method rather than a microcontroller. It now says contact for price, but as I recall it's about $35. It's kind of expensive, but no more so than buying an Arduino Uno and LED display, and it might be the best option if you have limited electronics experience. All you'd need to do is replace the trigger switch with a photodiode if you want to count shots rather than trigger pulls.
 
Last edited by a moderator:
The photodiode method Artifice linked to would be the most reliable (only counts fired rounds, not just trigger pulls). I only skimmed briefly but I assume the code to run it is similar to what I'm about to suggest.



This would be the "official" way to do it if you're an Electronic Engineer. Assuming you don't have a degree in engineering or a hard science, Arduino is definitely the way to go.

You can program a simple one-button event handler which triggers a loop, which has no condition to allow it to go below zero. Then a second button (actuated by magazine insertion) triggers an interrupt pin which resets the loop and returns to the original button handler. The Arduino could then send the appropriate signal to a segmented LED display with a built-in serial-based controller chip, or, probably slightly easier, you can just program the arduino to send the appropriate parallel pin signals yourself, directly to the LED array controller, or even just drive a two-digit LED display directly by putting the appropriate binary values into the array (one being LED on, 0 being LED off). Depends what LED display unit you use, really.

There's a good chance you might run into matrices though, so you probably have two choices: 1), do it the hard electronics way, 2) do it the hard C++ way.

Oh, or three: Just buy one here: http://www.westaby.net/store/index...._id=24&zenid=fcf206388eaf90f8f6f34758f15c8103 - which is probably made with the logic circuit method rather than a microcontroller. It now says contact for price, but as I recall it's about $35. It's kind of expensive, but no more so than buying an Arduino Uno and LED display, and it might be the best option if you have limited electronics experience. All you'd need to do is replace the trigger switch with a photodiode if you want to count shots rather than trigger pulls.

Oh that kit will make things a lot easier. So if I wanted it to count down based on each shot and not necessarily each trigger pull I'd need to install a photodiode at the end of the barrel inside the flash hider, correct?
 
Oh that kit will make things a lot easier. So if I wanted it to count down based on each shot and not necessarily each trigger pull I'd need to install a photodiode at the end of the barrel inside the flash hider, correct?

or you have to measure the rate of fire so you have it count down at that rate. I see that as a more practical option than a photodiode but less accurate at counting. I just don't know how sensitive a photodiode would be detecting light change from a 3mm bb traveling at 350+ fps. But maybe I'm wrong and they have ones that are that sensitive. Make sure you post updates I'm curious how this turns out!
 
I run the westaby.net page. I have made counters with photo detectors before. Is the recommended method for ammo counting fully automatic airsoft / nerf.
 
Status
Not open for further replies.
Back
Top