Jump to content


Photo

Ammo counter

BASIC Stamp 2, BASIC code, 8xLED display, two pushbuttons

19 replies to this topic

Poll: Ammo counter (76 member(s) have cast votes)

Do you have any programming experience?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.

Do you have any electronics experience?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#1 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 09 August 2011 - 05:56 PM

(This is all copied from my posts at FU.)

Hey guys, just wanted to show you this. I made a "working" ammo counter using a BASIC Stamp Homework Board. The chip is built into a circuit with a solderless breadboard next to it, so you can make some cool prototypes. I'm too poor to buy all the stuff needed to make a "real" version, I made this out of stuff that came with the kit. If any of you guys have any experience with BASIC, feel free to make suggestions on the code, and I'll try them out.

It would be PROPER to solder everything together, then mount it in a gun, but this was just a starter kit, and I didn't want to solder anything, which is why it's on a board, and I technically can't solder it together into an "actual" circuit, because the chip is actually part of the kits prototyping board. I think that the kit was about $80, but it comes with a pretty good book, all the parts I used to make this, and some others. I got it at fry's.

It works quite well, I just noticed recently that you have to push the trigger button after it reaches zero, then the reload button will work, it won't work if you just scroll to zero, the trigger has to be pressed again.

The line where it says something like "When ammo is zero, push and release reload button to reload" can be modified and placed somewhere else to say "When reload button isn't being pushed, ammo is zero". This would be said, of course, in CODE. If you put the button in a place where the button would be pushed by the clip, then when you take out the clip, and put a new one in, the ammo counter would reset.

----------------------------------------------------------------------------------------------------------------------
' {$STAMP BS2}
' {$PBASIC 2.5}

ammoCounter VAR Byte

OUTH = %00000000
DIRH = %11111111

DO
FOR ammoCounter = 9 TO 0
LOOKUP ammoCounter, [ %11100111, %10000100, %11010011, %11010110, %10110100, %01110110,
%01110111, %11000100, %11110111, %11110110 ], OUTH
DEBUG " ", DEC2 ammoCounter, " ", BIN8 OUTH, CR
DO
LOOP UNTIL IN3 = 1
DO
LOOP UNTIL IN3 = 0
IF ammoCounter = 0 THEN DO
LOOP UNTIL IN4 = 1
DO
LOOP UNTIL IN4 = 0
NEXT
LOOP
----------------------------------------------------------------------------------------------------------------------Video:
I'm hammering out a few bugs on a slightly upgraded version, one that can use multiple clip starting ammounts.

Edited by Exo, 09 August 2011 - 05:58 PM.

  • 0

#2 thedom21

thedom21

    Member

  • Members
  • 462 posts

Posted 09 August 2011 - 06:22 PM

Whay do that when you can just buy some clear pvc and use it on your hopper? This would only be useful for a homemade clip blaster.
  • 0
Funny Irc moments

22:32 hookerninja I would just switch to 2 full 69's
22:32 hookerninja that would diddle shit

11:44 Zorn Her butt is too tiny even for limp 6th grade penis?
11:44 Zorn ergo the dildo

#3 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 09 August 2011 - 06:27 PM

Whay do that when you can just buy some clear pvc and use it on your hopper? This would only be useful for a homemade clip blaster.

Why NOT do this? This is designed to be used on a clip gun. I could see this in a LS, they MIGHT have enough space for the wiring/junk.
  • 0

#4 Y-Brik

Y-Brik

    Member

  • Members
  • 199 posts

Posted 09 August 2011 - 07:21 PM

This would be so much fun, but I think it'd be much more cost effective if it was worked out in Medium-scale integration instead of on a pricey microcontroller. Excellent work putting more electronics into nerf than just lights and lazors!
  • 0

As I said I have not not alot of testes yet but I will be once I finish the mod.

Why I am boycotting Hasbro

#5 Ozymandias

Ozymandias

    Member

  • Members
  • 201 posts

Posted 09 August 2011 - 09:48 PM

This looks a bit complicated. Something similar in purpose that I would recommend:

SgNerf's Calculator Based Ammo Counter.

You might have to be a member to view that link.

Anyway, its a helluva lot cheaper.

Edit:

Here is his YouTube video of it working.

Edited by Ozymandias, 09 August 2011 - 09:49 PM.

  • 0
If you wish to post anything HvZ related, here ya go.

"...if you've ever suffered the effects of a fucking faggot retard overpopulation, you'll understand what devistaiting effects it can have on one's psyche." - Talio

#6 Archangel45

Archangel45

    Member

  • Members
  • 119 posts

Posted 09 August 2011 - 11:14 PM

hmmmmmmm I think I could do this. though I would go with the cheap option and program the amount into the memory on the calculator. probly attach it to the side of an 18 round mag. I shall work on this in my free times.
  • 0
"He who is made of air should not acuse the wind."

#7 arfink

arfink

    Member

  • Members
  • 246 posts

Posted 11 August 2011 - 09:32 AM

I saw that you used a BASIC stamp and did a double take. I thought arduino had killed the BASIC stamp dead. I guess not.

Anyway, you can do this very easily (and in a teensy tiny package) using an arduino. You can get one that's the size of your thumb.
  • 0
A2GS + 4 meg RAM + 128 meg CF + 9600 Baud Lantronix = WIN

#8 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 11 August 2011 - 06:42 PM

I got into robotics, so my parents got me the kit, and I just wanted to try to make an ammo counter, as a test of what I knew, and then maybe other people would see that and get into programming or try something else. There are OBVIOUSLY better methods, like clear ammo chambers, or more advanced chips, but the BASIC language is pretty easy to learn, and a nice place to start. I'm not plannig on making a "real" version of this, because it WOULD be expensive, and I personally don't have any guns worthy of tech like this.

AS OF 8/14/2011:
I have made an updated version of this, just because I wanted to, and I was bored. It now makes noise, the 0 flashes, and is battlefield reprogrammeable for different preset clip ammounts using a trimpot (turning dial). If anyone wants me to make a video/post pics and code, I will be glad to.

Edited by Exo, 14 August 2011 - 04:48 PM.

  • 0

#9 Curly

Curly

    Member

  • Members
  • 201 posts

Posted 14 August 2011 - 05:51 PM

From my limited experience using my Recon, reverse the counter. Rather than having to manually change the ammo count, have it count up from 0 so you don't need to change anything. Having a constant supply of the exact same size clips is near impossible, and starting with a drum mag is common. During long rounds you may also not have fully loaded clips, so counting from 0 is more practical in more situations.

EDIT: Stampedes would love this, especially if one of the clip safety buttons reset the counters.

Edited by Curly, 14 August 2011 - 05:52 PM.

  • 0

#10 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 15 August 2011 - 12:04 PM

From my limited experience using my Recon, reverse the counter. Rather than having to manually change the ammo count, have it count up from 0 so you don't need to change anything. Having a constant supply of the exact same size clips is near impossible, and starting with a drum mag is common. During long rounds you may also not have fully loaded clips, so counting from 0 is more practical in more situations.

EDIT: Stampedes would love this, especially if one of the clip safety buttons reset the counters.


There are two buttons, The trigger button and the reload button. On the more advanced version, the reload button is depressed by the clip, which activates the counter. when you pull the trigger, the trigger pushes the trigger button, so the countdown advances.

If you had any experience with basic, you could set this up however you really want. I just set it up like this because I knew that I wouldn't be making a real version, and anyone who would be, would have some form of experience with whatever chip they were using. I honesly wouldn't reccomend using this with a recon, they don't really have the space for the neccesary components, no matter how small the chip gets, and this was made in mind for those kinds of guns where the maker is putting everything into it, like Ice/Uin13's supershot, lasers and flashlights and pump action.
  • 0

#11 jubjub517

jubjub517

    Member

  • Members
  • 174 posts

Posted 15 August 2011 - 02:44 PM

A few months ago I was toying around with an idea similar to this. I have no real experience with breadboards and shit like that, so I started out with a basic $2 pedometer. Unfortunately I still haven't picked up a stampede yet, so I had to do this to my age old Ls. I hooked up the counter directly to the catch, and the reset to the mag release. I liked the fact that it counted up, it made it more practical given all the different types of clips and drums, nevermind whatever's on the drawing board over at hasbro.

As cool as it was, it's purpose was pretty useless. Obviously this would be different for a stampede, or future clip fed full auto blasters.

If you really want to invest your time and money, and program yourself a pulse rife, that's your choice; If your really lazy you can just cut a window in your magwell. But a pedometer or a calculator is more than enough to get the job easily done.
  • 0
[18:17] <+Jugs> Hey beefy
[18:17] <+Nerfer> pls dont call me that
[18:18] * Nerfer is now known as Guest17574
[18:18] <+Lucian151> Woah its Beefy Theify
[18:19] <+Guest17574> STOP CALLING ME THAT IM NOT FAT
[18:19] <+Guest17574> pls

#12 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 15 August 2011 - 05:55 PM

If you really want to invest your time and money, and program yourself a pulse rife, that's your choice; If your really lazy you can just cut a window in your magwell. But a pedometer or a calculator is more than enough to get the job easily done.


Didn't I just say "This would be used on big project guns where everything (Useful or not) is going into it"?

Edited by Exo, 15 August 2011 - 05:57 PM.

  • 0

#13 PVC Arsenal 17

PVC Arsenal 17

    Member

  • Members
  • 115 posts

Posted 16 August 2011 - 10:02 AM

μCs have tons of potential for Nerf as I've demonstrated a couple times. That said, this is a bit over the top, but definitely cool.
  • 0

#14 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 16 August 2011 - 04:03 PM

μCs have tons of potential for Nerf as I've demonstrated a couple times. That said, this is a bit over the top, but definitely cool.

Thank you. Someone who understands what I was going for with this.

BTW, I checked the Propeller's price, and a 40 pin DIP chip is $8. Obviously, you'd have to learn Spin, and make up a program with Spin, but it would be a lot cheaper with the Propeller than with a BASIC Stamp.
  • 0

#15 PVC Arsenal 17

PVC Arsenal 17

    Member

  • Members
  • 115 posts

Posted 16 August 2011 - 04:19 PM

If you really want to cut back on size, the new PICAXE 08M2 (8-pin DIP) would be more than capable of handling the task. It also uses BASIC. The chip itself is only $3 (of course you still need the development tools) but if you wanted to preprogram a few and distribute them to people for evaluation, that would be cost effective way of doing so.

Aside from basic counters and such, it would be cool if you used some optical sensors or mechanical switches to actually keep tabs on the ammo itself rather than just trigger pulls. That could help with implementing this in full-auto blasters - a factor which would certainly justify the use of a microcontroller over, say, a calculator or pedometer.

Keep up the good work, this is a step in the right direction for Nerf IMO.
  • 0

#16 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 16 August 2011 - 06:13 PM

Wow, awesome find. I think I would need the 14 pin version, the LED takes up 8 pins, the two pushbuttons take up two pins, and I don't really know what kind of pins it neeeds for power/reset. THISlooks like a good place to start. And, I already know BASIC.

I thought a little bit about Autos when making this, I think a simple way to do it would be to put a pause line instead of a button release line in the code, then just figure out how long the pause would be, and then it would advance as each shot is fired. Might be a little glitchy, but whatever.

In terms of mechanical switches, it would be a totally different code. It wouldn't be counting, just sensing and displaying.
  • 0

#17 PVC Arsenal 17

PVC Arsenal 17

    Member

  • Members
  • 115 posts

Posted 16 August 2011 - 10:00 PM

You can always use a multiplexer to free up some pins. That complicates the circuit a bit though. And you might want to check the datasheets for that LED and whatever microcontroller you use to avoid exceeding the maximum current draw when displaying the numbers (like 8) assuming you're powering the LEDs directly from digital outputs. An easy fix would be to power them all from a 5V line and simply switch them on and off with digital outs.

Edited by PVC Arsenal 17, 16 August 2011 - 10:02 PM.

  • 0

#18 Y-Brik

Y-Brik

    Member

  • Members
  • 199 posts

Posted 17 August 2011 - 01:19 AM

On the topic of micro controllers, Texas Instruments is selling its launchpad microcontroller with interface and IDE for $4.30! The controller is a 14 pin Dual Inline Package (Read- can fit in a AA battery), C-programmable, and looks to be great for our low-power, low-skill, low-cost application.
//Slight off-topic- TI also makes a programmable, wireless watch with accelerometers. Could this be used in a high-tech nerf gun? Possibly, probably not, but it's cool.
  • 0

As I said I have not not alot of testes yet but I will be once I finish the mod.

Why I am boycotting Hasbro

#19 Exo

Exo

    Member

  • Members
  • 391 posts

Posted 18 August 2011 - 04:25 PM

I don't think so. A biometeric controlled gun would be pretty awesome, but I don't see how the (to use a nerf term) stock watch would tell the gun to do anything, unless you got a receiver that you could plug into a chip, which could command the gun.
  • 0

#20 Pascal

Pascal

    Member

  • FNG1 
  • 1 posts

Posted 01 November 2015 - 10:06 PM

This person did an ammo counter with an arduino on an OLED display.
  • 0


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users