Jump to content


Photo

Shot counters for my Stryfe and Rapidstrike


37 replies to this topic

#1 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 24 September 2015 - 11:22 AM

Edit/Update 1: current circuit diagram here http://members.iinet...rf/circuit2.jpg

Please read this post about the 2 bits circled in red, they're optional: http://nerfhaven.com...trike/?p=349981

 

Edit/Update 2: Arduino sketches can be downloaded here:

Rapidstrike: https://drive.google...iew?usp=sharing

Stryfe: https://drive.google...iew?usp=sharing

Read this post for details: http://nerfhaven.com...e-2#entry351112

 

 

 

 

Hi all, a noob here.

After recently getting hold of a Rapidstrike, i decided i'd add a shot counter, in preperation for a repaint to look vaguely like an Aliens assault rifle. Figured while i was at it i'd make 2 and add one to my Stryfe as well!
I'm good with electronics, and decided an arduino would be the way to go, ordered everything on ebay and finally put it together over the last few days.

Breadboarded it first, used an Arduino pro mini since theyre small and cheap, added a 7 segment driver, couple of discrete components and the displays and voila! There are 4 switches on the breadboard, the 2 lever switches are for power, and triggering. The idea of the power one is it will only turn the circuit on when a magazine is inserted. And 2 small pushbuttons which will be used for magazine size detection. More on that in a bit.
1.JPG

Since theres loads of room in a Rapidstrike to the right of the magazine, i wired it all up on a single board that fits nicely. The leads are long but will shorten them when i actually install it. This has red digits.
2.JPG

I wire wrapped the back instead of soldering, far simpler when prototyping.
3.JPG

But that whole board is too big for a Stryfe, so i made a smaller version with the displays seperated. The little red/black wires you see disconnected go to the trigger switch and will be soldered at installation time. This has blue digits.
4.JPG

To save space, after soldering in headers to the Arduino to use for wire wrapping, i use double sided tape to stick the 7 segment drive underneath the arduino. Makes it nice and compact.
5.JPG
6.JPG

Decided to install in the Stryfe first, so cut out a hole for the displays and glued in the trigger microswitch. You can see here how the trigger mechanism presses against it.
8.JPG
9.JPG

I left the jam door switch connected, but bypassed the magazine insertion switch, and instead wired that up to turn the arduino on whenever a magazine is inserted. Wont drain battery that way, and acts to reset the counter when a mag is inserted.
Theres a space in the top of the gun above where i installed the trigger switch which is perfect for the arduino board, and obviously i sized the length of the cables to reach where the display sits. The display isnt fixed in place yet, just sitting there in the pic.
10.JPG

All assembled. The lighting makes the displays look superbright, but they're not, the brightness is controlled by the arduino and is actually turned right down. Just a camera lighting trick making them look super bright.
11.JPG


At the moment the Stryfe counter doesnt have magazine size detection, since i was going to try and make the placement of the switches the same in the Rapidstrike and Stryfe so i dont need to do much to the mags. Where i planned to put them in the Rapidstrike at the front of the mag wont work in the Stryfe. But i have now worked out how to do it, they'll be mounted on the left side of the gun near the top of the magazine.
Basically, all the magazines have molded ridges on them, like this:
7.JPG

So i'll just add a couple of notches to those ridges (where circled) to encode the magazine size. With 2 switches, i can set 4 sizes.
ie:
Pressed/Pressed = 18
Pressed/Not Pressed = 12
Not Pressed/Pressed = 6
Not Pressed/Not Pressed = 35 drum

And its just a matter of adding a notch (or not) on the appropriate ridge. Pressed means there is no notch and the ridge presses the switch. That way i dont need to do anything to my mags which are mostly 18's. And the 12 and 6's i have each only need 1 notch on the correct ridge, so minimal effort. The only one left out is a 25 drum, but that could be done by adding another switch. The arduino can do it, i just havent bothered since i dont have a 25 drum.


Not including wire/tools/time, the common parts cost (in US$) was:
Arduino Pro Mini with headers $2.92 each
7 segment driver $0.54 each
7 segment displays $0.79 each
Lever microswitch $0.65 each
Tactile switches $0.10 each

The larger one also has:
PCB $0.30
Wirewrap IC sockets $0.95 each, used 4
10k resistor $0.24 each
10uf 16V electrolytic capacitor $0.30
100n ceramic capacitor $0.32
(the 2 capacitors arent strictly necessary)

So total cost for the big one: $10.85
Small one: $6.13
Plus a few hours assembling and coding.


Edited by Kingbob, 25 January 2016 - 11:51 PM.

  • 0

#2 jwasko

jwasko

    PowerBeard

  • Moderators
  • 1,021 posts

Posted 24 September 2015 - 11:52 AM

Great job, it seems very simple and efficient (in terms of functionality and cost).

This arduino is 5V logic, correct? Are you just powering the whole blaster (including motors and the arduino) off of alkalines, then?

Edited by jwasko, 24 September 2015 - 11:52 AM.

  • 0

-Jwasko, STILL Sole Surviving member of Steel City Nerf and Sober Sister of the Sex Dwarves
We NERF ON all day, and FUCK OFF all night


#3 Aeromech

Aeromech

    Member

  • Moderators
  • 434 posts

Posted 24 September 2015 - 01:29 PM

Expected BS noob post. Got awesome working counter. Was not disappointed.

Where do you go for resources on this stuff? I have an arduino but coding isn't my specialty.
  • 0
Watch my shitty videos

This is so ghetto but so awesome.


#4 The2ndBluesBro

The2ndBluesBro

    Member

  • Members
  • 576 posts

Posted 24 September 2015 - 03:59 PM

Very cool but remove the locks in the blaster. They only make operation less smooth, and especially the dart lock can be a real pain which could cause problems with the counter if you get a jam.

TLDR; Remove locks to improve operation.
  • 0

Nerf, Gaming, knives: https://www.youtube....FjcObRZTl2KReDQ

 


#5 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 25 September 2015 - 12:48 AM

Great job, it seems very simple and efficient (in terms of functionality and cost).

This arduino is 5V logic, correct? Are you just powering the whole blaster (including motors and the arduino) off of alkalines, then?

Its one of the things i love about arduino's can use a simple tiny little board, and do so much with it. All the smarts around sensing the trigger, working the counter, detecting magazines etc can be done in software, without the need for loads of additional electronics. As it is, the pro micro has 14 digital IO pins, and i'm only using 6! Could easily add more features to it.

And yes it is a 5V version, but another handy feature of the arduino is an onboard 5V regulator. It can happily run off up to 12V, so a 3 cell lipo setup at 11.1V would be no problem. And with the addition of a $1-2 external regulator, could handle up to 25V! And yes at the moment it is just running off alkalines, I havent yet done any voltage mods to the motors, or replaced the wiring. Thats the next stage.



Expected BS noob post. Got awesome working counter. Was not disappointed.

Where do you go for resources on this stuff? I have an arduino but coding isn't my specialty.

Heh, thanks. I have an electronics and software background, so its quite simple for me. The official www.arduino.cc webpage is a great resource, but it helps if you know what you're looking for there. Another great resource is www.adafruit.com which sell parts, but have a great learning resource section. Check out https://learn.adafru...getting-started for the first of their arduino lessons.


Very cool but remove the locks in the blaster. They only make operation less smooth, and especially the dart lock can be a real pain which could cause problems with the counter if you get a jam.

TLDR; Remove locks to improve operation.

I have removed some of the locks in the Stryfe and RS, but not all yet. At the moment my aim is to get the counter installed and working, then i'll look at going through and doing voltage mods, re-wiring, and remaining lock removal. The RS once painted and modded to have the Aliens pulse rifle look will probably be more a show piece than play gun anyway.



Ive been test fitting the bigger counter in the RS. Removed the orange wire cover in the middle, was taking up too much space. I'm re-using the switch that was one of the electronic locks to detect a magazine is inserted, to turn the counter on instead. (the bottom left). The plastic lever isnt inserted at the moment, keeps falling out when i move the gun, same for the magazine release lever. You can also see a small 4 pin connector just to the right of it, that will go to the magazine detection switches on the left shell of the gun. A connector will make it easier to disassemble/reassemble. I was going to use a little micro switch behind the trigger to detect firing, but then remembered the RS is full auto, so that wont work. Instead the switch now sits in front of, and to the right of the pusher arm, and gets pressed whenever it extends to push a dart. It does safely clear the magazine there.
Posted Image

I have however found that the counter is thicker than i had planned on. As a result some of the pins actually rub against the magazine, and push it a little off centre. When the gun is closed up the mag will be straight, but will probably bend the pins it touches. They do scratch the top of the mag. So since the parts are cheap enough, and i have the design working fine, i'm going to make another counter for the RS, but compact it down like the one in the Stryfe. Will sit in the same place, but take up less room and wont interfere with the magazine.
Posted Image

So watch this space.

Btw, happy to provide a circuit diagram/parts list/arduino code if anyone wants them.
  • 0

#6 jwasko

jwasko

    PowerBeard

  • Moderators
  • 1,021 posts

Posted 25 September 2015 - 09:27 AM

Oh yeah, forgot about the regulator...well, and I wasn't sure if the Pro Mini had one/could go up to 12V. Convenient.

It seems like you found a good way to count the RS shots already, but I think you could have also used the (stock) cycle control switch (which makes sure that the pusher arm always retracts completely). I believe this is a DPDT switch.

This switch is held closed when the arm is retracted. You could wire the arduino to Common and Normally Closed on one "side" of the switch while you feed power to the pusher motor on the other side.

A lot of people solder the pairs of contacts together on this DPDT (turning it into a SPDT) to allow more current, but if you aren't looking for performance then you might be ok doing this if you have trouble with your current setup.

And, yes, circuit diagram/parts list/arduino code would be most welcome when you get a chance.

Edit: At least, I don't think you can use the same SPDT to both control the motor and keep count...pretty sure you'd need to keep the circuits isolated.

*rank amateur electronics hobbyist here*

Edited by jwasko, 25 September 2015 - 09:39 AM.

  • 0

-Jwasko, STILL Sole Surviving member of Steel City Nerf and Sober Sister of the Sex Dwarves
We NERF ON all day, and FUCK OFF all night


#7 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 25 September 2015 - 10:00 AM

I had thought about using that switch.
I spent a while dismantling the trigger assembly etc and seeing what pushed what, locked against what, etc. And i technically could use it.

Good thing about the arduino is that i can set the code to look for a high or low, open or closed circuit so its possible. But, since i haven't yet done any power upgrades to the switches, wiring and motors, i decided to use a seperate switch in case that switch doesnt end up staying once i do the upgrades. If that makes sense?
  • 0

#8 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 28 September 2015 - 01:02 AM

And, yes, circuit diagram/parts list/arduino code would be most welcome when you get a chance.


Voila. It really is absurdly simple really.

Theres still 8 unused digital pins on the Pro Mini, so still plenty of scope for expansion, and i didnt use the analog inputs at all. Though i'm thinking of adding a light sensitive resistor which will automatically adjust the brightness of the display for day or night use to one of the analog inputs. The pro mini does need a USB to TTL cable to program it since it has no onboard usb controller. But, theres no reason the pro mini couldnt be swapped for an Arduino Nano or equivalent.

The MAX7219 LED driver can actually drive 8 digits, so other things could be displayed. Mighty handy that it fits under the pro mini! I even managed to squeeze the brightness resistor underneath between the MAX and the arduino pins.

I built my prototype without the 2 recommended capacitors, and had no issues, so the version i've installed doesn't have them. I've yet to have any issues without them so can save $0.50 if you want to skip them!

The pin numbers i chose for the 3 switches, and for connection to the MAX are based on the physical layout of the pro mini and were convenient to group. Can really use any pins, as long as they're defined correctly in the software.

Posted Image
  • 0

#9 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 28 September 2015 - 06:48 AM

*
POPULAR

All installed. You can see a little black 4 pin socket in the bottom right, mates up directly with a male plug on the other half of the shell, makes it easier taking it apart all the time. Also trimmed the rails the jam door rides in so it opens all the way now.

Posted Image

Installed the switches to detect the magazine, running to the connector to the other half of the shell. I used pushbuttons, but i'm not happy with them, the actual button piece wobbles too much, and can be pushed aside instead of pressing in. So i think i'll replace both with lever type microswitches.

Posted Image
  • 1

#10 shmmee

shmmee

    Member

  • Members
  • 467 posts

Posted 01 October 2015 - 12:22 PM

What about magnetic switches instead of levers or pushbuttons? Glue a magnet onto the clip in the appropriate position. That would reduce the moving parts issue that may develop from repeated lever switch use - though i don't know how rugged magnetic switches are...

Very impressive work btw.

Edited by shmmee, 01 October 2015 - 12:23 PM.

  • 0
"and we should respect the people who make our blasters. Even if we do molest the hell out of them..."
~BritNerfMogul


#11 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 02 October 2015 - 03:05 AM

What about magnetic switches instead of levers or pushbuttons? Glue a magnet onto the clip in the appropriate position. That would reduce the moving parts issue that may develop from repeated lever switch use - though i don't know how rugged magnetic switches are...

Very impressive work btw.


Actually i was sitting test fitting, and umming and ahhing about how to mount things, and magnetic was starting to appeal to me as well. Not necessarily because of moving parts failing, just that it would be less intrusive, and less of an issue if the magazine wobbles.

So i jumped on ebay last night and ordered some little magnets, and some hall effect sensors. Good thing is that by using them, i can move the connections on the arduino to analog pins instead, and free up a couple of digital pins for something else. Be 2-3 weeks before the parts show up though. But since i got 10 sensors for $2 with free delivery from china, versus $8 each locally, i'm happy to wait!
  • 0

#12 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 08 October 2015 - 07:55 AM

Got bored waiting for my parts to show up from ebay, so picked up a sensor and magnet from the electronics shop to test with. $7.75 for one sensor locally, or $2 for ten from china!
With a neodymium magnet, the sensor can detect it from at least 15-16mm away! So wont have any issues with wobbling magazines causing misreadings.

Also when coding the arduino, i worked out that i can get more values by using a magnet that a switch. Two switches gives me four readings:
off/off
on/off
off/on
on/on.

But because of how the hall effect sensor works, i can detect no magnet, or north or south polarity. Which with two sensors gives me nine combinations:
none/none
none/N
none/S
N/none
N/N
N/S
S/none
S/N
S/S

At the moment I only have 18, 12, and 6 shot magazines, so really i can get away with using a single sensor and magnet, and just code those 3 sizes. Or lose the 6 and replace with a 25 or 35. And the 18's will be set to none/none, so dont need to mess about with them, and will only use a single magnet on each of my remaining 12's and 6's.
  • 0

#13 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 09 December 2015 - 05:32 AM

So I finally had some time to sit down and swap the switches out for hall effect sensors. Works a treat! Put them in the Rapidstrike and Stryfe, configured the same so the magazines detect the same in either blaster.

I also swapped out the switch i was using for the trigger counter in the Rapidstrike. It was detecting the movement of the pusher arm but i found if the blaster was held at an angle, the lever on the switch would jam against the pusher arm. So i swapped that out for a hall effect sensor too.

 

This is the insides of the Stryfe, you can see the hall sensors on the left half of the shell, connected to a 4 pin socket, which mates with a 4pin plug on the other half. Makes assembly/disassembly easy. And all works fine. They're on a piece of white styrene glued in to put them at the right distance from the mag.

 

stryfe1.jpg

 

stryfe2.jpg

 

And heres a short youtube clip showing the detection in action. Theres a slight delay of a second or two after insertion because putting the mag in turns on the Arduino, which has to boot.

 

https://www.youtube....h?v=DUmSJL-isHE


Edited by Kingbob, 09 December 2015 - 05:48 AM.

  • 0

#14 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 13 December 2015 - 05:21 AM

Here is an updated circuit diagram. The 2 parts circled in red are mutually exclusive, its one or the other. Can use a switch, or hall sensor for the trigger depending on the gun.

 

circuit2.jpg


  • 0

#15 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts

Posted 19 December 2015 - 05:27 PM

Wow dude, have you considered a different type of display or even doing a "camera" sight which would route a small camera in front to a display in the back? Kinda like that nerf gun with the camera but minus the recording option...
  • 0

#16 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 30 December 2015 - 03:42 AM

Wow dude, have you considered a different type of display or even doing a "camera" sight which would route a small camera in front to a display in the back? Kinda like that nerf gun with the camera but minus the recording option...

 

This one was specifically going for the counter look from Aliends for a RapidStrike, but I'm currently playing with a couple of small OLED displays. One is a blue monochrome 128x64 dot display thats about 1" wide, another thats an awesome red but about 2.5" wide and doesnt really fit most Nerf guns, and a small 1.3" full colour OLED.

 

Looking at things like displaying batt voltage/maybe current draw, mag size, rounds used, possibly motor RPM etc. Also add a switch for single/rapid fire and have that mode displayed. Could also add a purely fun switch/display to select ammo type such as Normal, Armour Piercing, Tracer, Explosive etc :D

Plus when the rounds reach zero it can flash "Reload" or something.

 

Am looking at fitting one to a Stampede or a Rayven once i work it out properly.

 

I did even consider adding a range finder, and have the range displayed, but the cheapest suitable components i can find are about $100. Dont want to spend that much.


  • 0

#17 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts

Posted 30 December 2015 - 09:59 AM

I'm actually considering similiar with a modulus after I finish my current mod project, which is a mega centurion.

Going to be removing locks, AR, fix the Rev plunger tube, mod for elites/stefan clips, add mag size detection, shot counter, possible light up front..... just a few things.
  • 0

#18 jwasko

jwasko

    PowerBeard

  • Moderators
  • 1,021 posts

Posted 30 December 2015 - 11:53 AM

Just wanted to take a moment while this was revived to say thanks to Kingbob for taking the time to provide the circuit diagram.


  • 0

-Jwasko, STILL Sole Surviving member of Steel City Nerf and Sober Sister of the Sex Dwarves
We NERF ON all day, and FUCK OFF all night


#19 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts

Posted 30 December 2015 - 02:46 PM

His diagrams are a big help to me. Or will be once I get working on my modulus
  • 0

#20 meltedspades

meltedspades

    Member

  • Members
  • 6 posts

Posted 30 December 2015 - 03:06 PM

for unmarked clips a 4 bank dip switch could be used in a 2-6-10-25 should be able to cover any standard clip with only 4 io
  • 0

#21 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts

Posted 30 December 2015 - 03:11 PM

Never heard of that kinda switch
  • 0

#22 meltedspades

meltedspades

    Member

  • Members
  • 6 posts

Posted 30 December 2015 - 03:23 PM

Never heard of that kinda switch


They are SPST switch banks used mostly in the 80's and 90's arcade machines, replacing jumper blocks (pins shorted or not shorted to set 1/0) not very common anymore
  • 0

#23 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 31 December 2015 - 11:45 AM

The 2 hall effect sensors i used are capable of detecting 9 different magazine sizes between them (and only using 2 inputs in the arduino). Thats more than enough for all the nerf magazines: 6, 12, 18, and 18, 25, 36 drums. But yes could add a 4 bank dip switch accessible from outside somewhere. But the magnets i used were like $3 for 50 on ebay, and only takes a few seconds to add one to a clip.

 

Btw if anyone wants the Arduino code for the circuit above, happy to share.


Edited by Kingbob, 31 December 2015 - 11:46 AM.

  • 0

#24 nerfa-derpa

nerfa-derpa

    Member

  • Members
  • 10 posts

Posted 31 December 2015 - 01:32 PM

I clicked on this expecting to see some scrub posting "how i cont muh durts fur nuerf gun", but instead I saw some solid work in the forum which is surprising. Good job, I hope to see more cool things like this in the Nerf community.  ( you also could totally sell these)


  • 0
D.N.F.F

#25 Kingbob

Kingbob

    Member

  • Members
  • 133 posts

Posted 01 January 2016 - 01:47 AM

Sonofa... just put my Rapidstrike back together after a paintjob, and looks like ive lost or thrown away the little white plastic piece that pushes the switch at the front of the magazine, which is normally used as a lock, but i re-purposed to turn on the arduino! Probably threw it out thinking it was a part i didnt need! Suppose i better grab some styrene and look at making a replacement!

 

16b.jpg


  • 0


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users