Here is a parts list. The ebay links are just examples of the types i used.
Jump to content
There have been 133 items by Kingbob (Search limited from 05-February 94)
Here is a parts list. The ebay links are just examples of the types i used.
I actually managed to mount it just above the magazine release switch. That way it can be reached by the trigger finger without having to change grip at all.
And, with that, mechanically and electronically its finished!
The software is 95% done, everything works, but i'm just making some tweaks to the screen layout and getting it all working just how i want it.
Made great progress today, had to do some switching around of what is connected to which arduino pin since i had used all the pwm pins for non-pwm functions.
The firing mechanism and detection is all done. Got the jam door open detection and firing prevention working (decided that was necessary after it tried to eat my finger during testing). Got the single/triple/full auto firing working, and stops at 0 ammo. And buzzes to let you know you're out.
Would you believe my biggest problem now is working out where to mount the joystick???
Good progress on it today! Firing all works now, everything as intended.
Only issue ive discovered is that when the arduino is first turned on, the control pin to the h bridge goes high while it boots. Which means it fires about 5 times when turned on.
Only way i can think of around it so far is to route that signal pin through the safety switch, so wont fire with the safety on. But means i have to remember to turn the safety on every time.
Edit: occurred to me i might be able to just put a pull down resistor on it, might do the trick.
Edit 2: Yup, pull down resistor does the trick!
Did a bit of research, the H-Bridge i'm using is based on an L298N driver, which will do 4A and seems to be holding up so far, though the max ive run it at is 60% power.
If (or when) it cooks, i'll replace it with one based on the BTS7960B which can handle 43A. Though I'm guessing thats combined both channels, but its still 21.5A per side.
Checked ebay and they can be bought for $10-12US:
Yeah the battery i'm using is rated to 20C continuous, which is why i chose it. I used to competitively race RC cars so know all about batteries, but i didnt know the specs of the motor. The h-bridge i'm using is rated to 4A, and seems to be holding up fine atm.
Will have a look and see if i can find a higher rated one.
Nah i wasnt happy with having the tray going in and out with all the parts in a decent way. So ended up removing the rear of the tray from the main part and just used the bay instead.
Yes that is a switch, just a dpst, but only using one side.
That wire on the spring isnt fully fitted yet, was just laid on top for sizing by length. It will go underneath the spring and be glued down out of the way.
Its lucky i had a bunch of nano's in my parts box. Down to just 4 spares now! Though theres no reason i couldnt use a pro mini, a Uno or even a Mega would fit in the battery compartment of the Stampede.
A H bridge basically is a regulator. Just takes the pwm signal and outputs the proportional voltage to match. The stampede runs on 6x D cells so the motor should run on ~9V anyway, so 11.1V shouldnt be a stretch. I'm guessing the motor controller i was using was designed for an analog signal input instead of a PWM input. Basically fried the FET's input.
Right, so i got another nano wired in, tested and the screen wouldnt work. Swapped wires around and all sorts, just refused. Tested the screen on a MEGA, worked fine. Can only conclude one of the pins it uses on the nano wasnt working. So scratch that nano.
Grabbed the next one out of my parts box, decide i'll test the screen on it before hooking it up. Plugged it in to usb to load the sketch, wouldnt even power on. Dead as a door nail.
Grabbed ANOTHER nano from the box, plug it to test, and hurrah! powered on! Hooked up the screen, and works! yay! So thats 3 nanos down (those 2 plus the one i blew up).
Hooked it all up, and all the switches, sensors, screen, and all that work! yay! Next step, hook up the motor and driver. As soon as i turned it on it went to full power. Did some testing and its looked like the FET had failed closed, so just sent the whole battery voltage straight to the motor. Went and got a replacement (luckily only $7 locally), tested it and seemed ok. Wired it in, and slowly started to power it up, and all of a sudden, it went straight to full power as well! Checked the FET and it was red hot! Tested and lo and behold, failed closed again. Its rated to 5A 24V, and i'm only using a 1500mAh 11.1V battery yet it cooked.
I'm going to order a couple of decent H bridges to use instead, so until they arrive the actual motor drive is on hold.
The wiring and software are there for it though, so until they get here, i'll concentrate on getting all the rest of it put together, functional, and tweaking the software to how i want it. Then just have to add the bridge when it arrives.
Yeah i have a solder sucker and de-soldering braid as well, but of course i have to rip all the wiring off to get to it.
I've ended up just separating the boards out, makes working on it easier. I did accidentally fire it up briefly while testing the battery connection. I think it fed full voltage to the motor, must have been firing at at least 4 rounds/s. Scared the crap out of the dog!
Got sick of soldering/wiring though so put that aside and did some physical work cutting a hole in the shell to mount the screen etc.
I've decided to wire in an extra switch, using the one that was the safety for the jam door.
Figured since the arduino will be controlling the firing, it will be possible for it to shoot 3 rounds, or full auto, with that access open. Could be hazardous to fingers, so going to add it back in as a safety, and add a box to the lcd display saying "Jam Door" or similar.
Actually no, the nano can accept 7-12V because of its onboard regulator.
But its not recommended to draw more than 20mA per pin from the arduino, and after i had that IR problem in my Rayven i worked out the actual draw of the bits and pieces that I had connected to the +5V output. The hall effect sensors draw ~10mA each, the IR LED draws about 20mA, the IR transistor about 5mA, 5mA for the buzzer, and up to 10mA for the i2c current/voltage board. Thats 60mA already, then have to add in the 1.8" LCD. I couldn't find the exact specs for the lcd i'm using, but found one similar and it has a 150mA regulator onboard. So max could be looking at 210mA draw.
Goes way over the per pin rating, and its recommended the whole arduino not exceed 200mA total!
So the regulated power supply runs all the bits and pieces so they don't draw through the arduino, but still get a nice stable 5V.
I was just going to use a 7805 5V regulator, which is $2 locally, plus a couple of $0.50 capacitors for smoothing, and a $2 small bread board to put it on. But when i went to the electronics shop, i saw that little pre made unit for $6. Only $1 more and saved me the hassle of building it, so figured why not?
On the left is the regulated power supply for the arduino etc. Takes the 11.1V from the battery and provides a nice 5V for everything.
The blue board at the top is an i2c voltmeter and ammeter.
The black board at the bottom is a buzzer, for indicating when out of ammo etc.
The nano is obvious.
Then theres a double row of headers on the right that will connect to the various switches, display etc etc in the gun.
Board built, and installed in the battery tray with an 11.1V LiPo.
New wiring in to the relevant switches, screen, and other bits and pieces.
Need to trim the wiring to length and put the proper connectors on instead of the temporary ones i used while testing.
So im trying to decide where to mount the screen. It will be on the side of the magazine slot since thats a nice big flat area, but i cant decide whether to put it on the left or right.
Nor can i decide whether to mount it internally, or externally and make a plastic case for it.
Or to go whole hog and make it fold out.
Atm i'm leaning towards internally on the left.
Well, ive started!
Ripped out the existing wiring from the Stampede, removed a few bits of un-needed plastic, and soldered in new wires for the motor, trigger switch, safety switch, and magazine sensor switch. Just waiting for my 11.1V LiPo to charge so i can do some testing on the motor.
Decided to use the existing motor mechanism for now, wired in a h-bridge so the Arduino can control it. Need to do some testing to make sure i can properly control single/triple/full auto shooting.
If i blow it up, or cant get the timing right, then i'll look at using a stepper or servo instead.
Yeah i was planning to remove the various bits of plastic in the tray and drop it all in there. I could even fit a MEGA in there if i need to, but i have spare UNO's and Leonardos. Once theres a wiring loom taking the various switches, sensors etc back to the tray will just make it easier to work on.
I've had a look at where to put the IR sensor for firing, i'll probably remove that little door flap where the dart inserts, and use the existing opening with just a hole for the LED.
Once this Stampede is done i'll probably re-visit my rapidstrike and add in a stepper or servo to control the pusher.
This particular design doesnt actually interact with flywheel motors. But, since brushless speed controllers work like a servo with a PWM signal, then yes it would be relatively simple to add in. Would still need a brushless speed controller though.
So far the design looks roughly like this.
Note that this is from memory, probably not the same as whats on my breadboard at the moment so might have errors. I'll update and correct it as I go.
I'm using a MEGA2560 Arduino at the moment simply because it has more flash and ram than the nano's i normally use. That way i dont have to worry about sketch size until its ready to go. Dont yet know what arduino i'll actually use. Whatever I use will be mounted in the battery tray so theres no shortage of space.
The servo may also get swapped for a stepper motor and controller.
This is the circuit (i think), hall sensors for magazine size detection, one switch for magazine insertion detection, and other switch for trigger.
The IR LED/transistor for RPM counting are still connected in the Stryfe, and the code is still there, but i'm not displaying it on the screen until i can get a hold of an oscilloscope to work out why it drops out.
The OLED screen also needs a 3.3V source, and fortunately the nano has a regulated 3.3V output.
Edit: Parts list: http://nerfhaven.com...e-3#entry352455
Edit: Circuit: http://nerfhaven.com...e-3#entry352456
Edit: Arduino code: http://nerfhaven.com...e-3#entry352474
So my first arduino in a nerf was a 7 segment based counter with magazine size detection for a Stryfe and Rapidstrike:
The mk2 added an OLED screen, and voltage monitoring in a Rayven:
Now comes the mk3 for a Stampede.
This one still has all the things from the others like round counting and magazine size detection etc, but adds a full colour 1.8" LCD screen, battery voltage and current draw display, safety switch, a joystick to select single shot, 3 shot burst, and full auto firing mode selection, and a buzzer to indicate when its out of ammo.
The mk1 and 2 were in flywheel blasters so the motor control wasn't done by the arduino. But the Stampede isn't flywheel, and will have its motor controlled by the arduino which lets me select the firing mode (1/3/auto).
At the moment its breadboarded while i code it, but will probably open up the stampede and start looking at installation this week.
More to come!
I hate to admit it, but the RPM counter has me beat.
It works fine but only when the arduino is connected to USB.
Tried running it all off a higher Ah capacity battery, upped tthe voltage, added in a 5V regulator, ran everything off that. Tried applying power via the usb port, even tried running it off a usb battery.
Gonna have to live with it until i can get an oscilloscope to see whats going on. Might mock another one up on breadboard and test different types of arduinos too.
Just about there, I cant be bothered swapping the IR sensor, so just gotta write some code so it says MAX instead of dropping to zero.
On the plus side, these just arrived:
Works great. Havent used the SD card to load an image yet, but hooked it up for testing and its all good. Does need some extra double sided tape between the LCD and PCB though.
I suspect its the IR receiver, i did some testing with a spare one, and if the signal it gets is constant, its output stops. So yeah i figure its detecting so frequently that as far as its concerned its a constantly ON signal.
I do have a couple of other IR receiver/transistors to try, see if they're more capable.
I'm half inclined to just tweak the software to say "MAX" instead of the RPM if it exceeds the RPM its capable of reading
Spoke too soon. Whilst i did solve my power issues, i've found another.
The rpm counter is using a standard IR LED/receiver pair mounted on each side of a flywheel. Theres a hole in the flywheel allowing the IT receiver to get a signal once per revolution. All pretty standard.
The code im using counts the number of signals received every 250ms, and multiplies it out to give an rpm count. The reason i do it every 250ms is so the display updates at that rate. Whilst its more accurate if I count for say 1 second, it also means the display would only update every second which is very slow.
The way the arduino counts the signals is by using one of its interrupt pins, so whenever the IR receiver gets a signal, it interrupts the arduino and forces it to count, before going back to what it was doing. Thats what the interrupt pins are designed for, and work well.
BUT, what ive found in practice, is that when the motors are at max RPM, (somewhere around 25,000rpm) the counting fails.
It could be the IR sensor not being able to output fast enough, its rated to 37,000hz, which seems coincidentally close to the 25000 count as the max i've seen.
OR, the interrupt pin cant interrupt and execute fast enough to count the signal its getting.
I'm inclined to think its the IR sensor since the interrupt pin would count as much as it could so i'd still get a high count. Instead at high RPM the count simply drops off to almost zero, implying the sensor cant get a clean "sense" of the LED.
I'm going to look for an IR sensor with a higher frequency, see if that helps.
I also have a new arduino on its way that runs at 48Mhz instead of the 16Mhz of the nano. Possible it may be able to keep up with the interrupt counting if thats the issue.