Jump to content


Photo

Arduino gun controller mk3


75 replies to this topic

#1 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 27 February 2016 - 11:34 PM

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:

http://nerfhaven.com...nd-rapidstrike/

 

The mk2 added an OLED screen, and voltage monitoring in a Rayven:

http://nerfhaven.com...hot-counter-v2/

 

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.

 

stampede1.jpg

 

stampede2.jpg

 

More to come!


Edited by Kingbob, 28 March 2016 - 05:28 AM.

  • 0

#2 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 February 2016 - 04:30 AM

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.

mk3.jpg


Edited by Kingbob, 28 February 2016 - 04:46 AM.

  • 0

#3 nicework88

nicework88

    Member

  • Members
  • 8 posts

Posted 28 February 2016 - 08:06 AM

What would you have to change to make it work on a rapidstrike??

Edited by nicework88, 28 February 2016 - 08:06 AM.

  • 0

#4 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 February 2016 - 08:42 AM

Nothing major. I'll be using the servo/stepper to push/pull the loading/firing mechanism on the Stampede.

In a Rapidstrike, id use the servo in the pusher instead.


  • 0

#5 xXD3V1LXx

xXD3V1LXx

    Member

  • Members
  • 258 posts
  • Location:Greenport, NY
  • State:New York
  • Country:United States
  • DevilNerf on Youtube

Posted 28 February 2016 - 08:57 AM

Could you possible use this on brushless motors? I would love to make a brushless select fire rapidstrike.
  • 0
A quote from Ice Nine
"Use the golden rule: Don't be a dick."

NERF On
-Devil

#6 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 February 2016 - 09:04 AM

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.


  • 0

#7 nicework88

nicework88

    Member

  • Members
  • 8 posts

Posted 28 February 2016 - 01:58 PM

Just wondering if a servo would fit inside a rapdistrike as it is designed for 130 sized motors. Would it be possible to do it with 130 sized motors to make them maybe spin for a certain amount of time instead of a rotation in things such as a servo and stepper motor??

 

Also, what are you using to power this??


Edited by nicework88, 28 February 2016 - 03:34 PM.

  • 0

#8 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 February 2016 - 08:26 PM

Dont need to use a full size servo, a little micro servo will work fine as a pusher.

 

I've got a load of lipo's i can use. 11.1V 2600mAh, 7.4V 4000mAh, and 2x 7.4V 2500mAh. Plenty of room in the battery tray without 6 D cells!


  • 0

#9 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 28 February 2016 - 08:55 PM

I'm glad I'm not the only one who was thinking about using part of the battery tray as a board mount location. I'm likely gonna utilize an Uno r3 in my stampede because of that fact.

Im glad yours is coming together, and I like the look of your display. Are you going to put a hole in the barrel for the IR sensing or are you gonna mount it differently?

We've already talked and talked about how we wanna do this, though yours is much further along then mine we have similiar plans for it.

You can use just a stepper motor and a pusher arm in a rapidstrike and eliminate the huge box completely if you wanted to since steppers can go forward and backwards without much work.
  • 0

#10 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 February 2016 - 09:37 PM

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.


  • 0

#11 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 28 February 2016 - 10:27 PM

I'm hesitant to remove that door but I might look into it also
  • 0

#12 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 28 February 2016 - 10:38 PM

I couldnt see any particular reason for it to be there other than being part of all the various safety mechanisms. Most of which i'll be ripping out or disconnecting.


  • 0

#13 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 04 March 2016 - 06:39 AM

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.


  • 0

#14 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 05 March 2016 - 12:00 AM

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.

 

Thoughts?

 

Atm i'm leaning towards internally on the left.


  • 0

#15 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 05 March 2016 - 08:21 AM

Fold out and able to attach to either side
  • 0

#16 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 05 March 2016 - 09:53 AM

Detachable and swappable between sides? Hmmm


  • 0

#17 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 06 March 2016 - 07:49 AM

Board built, and installed in the battery tray with an 11.1V LiPo.

stampede4.jpg

 

stampede5.jpg

 

stampede3.jpg

 

 

New wiring in to the relevant switches, screen, and other bits and pieces.

stampede6.jpg

 

Need to trim the wiring to length and put the proper connectors on instead of the temporary ones i used while testing.

stampede7.jpg


  • 0

#18 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 06 March 2016 - 08:13 AM

What all is in the tray on the board i see the nano but what else is there?
  • 0

#19 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 06 March 2016 - 08:25 AM

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.

 

stampede8.jpg


  • 0

#20 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 06 March 2016 - 01:44 PM

interesting use for the regulated power supply...  is that only because of the size of the battery your using??


  • 0

#21 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 07 March 2016 - 04:13 AM

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?


  • 0

#22 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 07 March 2016 - 04:19 AM

Have also decided for practical wiring reasons to put the screen on the right, mounted internally but flush with the side of the mag slot.


  • 0

#23 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 07 March 2016 - 11:15 AM

You got a product name for that regulator? The 6 dollar pre-built one?
  • 0

#24 Kingbob

Kingbob

    Member

  • Members
  • 133 posts
  • Location:Western Australia
  • State:Western Australia
  • Country:Australia

Posted 07 March 2016 - 09:59 PM

My local electronics store happens to have quite a few arduino bits they get from china.

 

Its identical to this:

http://www.sainsmart...-1-23v-30v.html


  • 0

#25 DjOnslaught

DjOnslaught

    Member

  • Members
  • 350 posts
  • Location:Maryland
  • State:Maryland
  • Country:United States

Posted 08 March 2016 - 06:43 AM

OK I saw those on amazon.. I'll likely use one just in case I upgrade my power source later. Is the little board down next to the battery a inverter or something?
  • 0


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users