Props MA5C, more dakka, more electronics!

Status
Not open for further replies.

Katsu

Well-Known Member
I got one of Justinian's awesome assault rifle kits a while back, and in the past months I started tinkering around with microcontrollers to try and get my own custom electronics system for it installed!


arelec01.jpg

So the set isn't finished yet, I'm working on a sound system so it can go "drhxdjdrxjtjxdtj!!!!" or whatever. It looks gutted now! The controller and displays are on a breadboard taped to the side of the rifle so I can test all of the buttons without having to have more than two things floating around (barrel and stock). I am using the safety button as a power button, there is the lit power buttons on the side of the barrel but putting a button there was going to interfere with the space for the power pack and the sound controller. I also cut out a hole for the fire selector - I know it's not 100% canon, but the switch IS there just to the front of the safety button: http://images.wikia.com/halo/images/c/c6/Gungj8-MA5C-transparent.png
The fire selector works, but I broke my selector switch trying to install it.

arelec02.jpg

A closeup of the lights on the front half of the rifle.

arelec03.jpg

The main display. You can see on the left on the screen I've changed it slightly to show the current fire mode (set to full auto in that picture, it also has safety and semi auto)

arelec04.jpg

After firing a few rounds.

arelec05.jpg

Pulling the magazine out leaves one bullet in the chamber (if available)

arelec06.jpg

Pop the magazine back in to "reload" the gun.

arelec07.jpg

Here is the first style for the display, this one foregoes the flourishes on the sides of the ammo counter to have an ID and the bullet displayed below the number. This one is more akin to the Halo3 incarnation.

arelec08.jpg

The second style for the display, I haven't gotten around to making it display the font for the numbers shown in the previous picture. This one foregoes the ID and the bullet logo below the numbers in exchange for the details on either side of the ammo. I tried really hard to get everything crammed in, but it would require shrinking the size of the ammo number and I wanted that to be as big as possible to reflect the way it looks in-game. This means I have to choose whether to show the ID (which can be edited to whatever I want), or the nifty details on the sides. There wasn't an OLED screen I could find that would properly fit inside the top of the rifle and also display all pertinent information.

arelec09.jpg

There is a real working compass on it also, it isn't super precise, especially since a lot of the mechanisms in the rifle use magnets, but it's been fine tuned to still give a relatively accurate reading of north. Unfortunately we're not on a Halo Ring, so I can't test if it points to the nearby planet properly. I am not good enough at graphics on simple displays, so I am just drawing it on the fly using simple shapes. It looks close!

Next up is to get sound working, replace the fire selector, and glue the whole thing together before slapping some paint on it. Unfortunately, I wrecked the top of the stock, so I ran out of room to also install a kickback system, this version will only have lights, ammo, compass and sound.
 
Wow, creativity to the max!! I love it! Great work, this is big and I bet a lot of people wish they had your skills! I know I do! xD
 
Unfortunately, I wrecked the top of the stock, so I ran out of room to also install a kickback system, this version will only have lights, ammo, compass and sound.

Oh come on now. This just begs for an airsoft conversion!

Seriously, in lieu of kickback system, add a low frequency rumble motor from an XBOX controller to give it some feel until better options become available.

Redshirt
 
I tried a rumble motor and it ended up feeling a bit too erm... inappropriate? If there is electricity for a motor after the new stuff I've added, I'll try sticking one in with a different pulse pattern.

It was very tempting to make it shoot something, but I guess it'll be easier to get into conventions this way.
 
Copy on that underwhelming feeling. I use the rumblers to let me know something more overwhelming is about to happen. You probably have enough trons left over to run a relay. You can always add another battery and mechanism to be driven by the relay. I am really looking to do an airsoft conversion to one of the existing kits after my Spartan Laser is done. I'll probably do an M6 to go with it, but then what? So many choices . . . I am really interested in your counter/display though.

Redshirt
 
Great work.. Love the OLED and display graphics.

Using anything for your second switch? Usually connected to the flashlight.

edit/
Kickback is hard.. Arcade guns use 50 to 100V solenoids to deliver the kick..Not really an option on battery power.

Also, I am curious. What sound module are you using?
 
Awesome work. I approve!
Thank you!

Great work.. Love the OLED and display graphics.

Using anything for your second switch? Usually connected to the flashlight.

edit/
Kickback is hard.. Arcade guns use 50 to 100V solenoids to deliver the kick..Not really an option on battery power.

Also, I am curious. What sound module are you using?

The OLED is awesome, I just wish it would fit a bit better in the gun so I could get all of the details I wanted out of it.

If the second switch is the power button on the side of the grip, I am not using it. I have a maglight that has a magnet to snap it in for the flashlight on the front, and ran into difficulty fitting a button onto either of the power buttons. It'd be nice to try and put the system together a bit better next time. The problem I ran into is... the battery door is right under the "power buttons", and the battery pack fits in with barely any clearance for the LED pins coming from the buttons to light them.

I was tempted to duplicate the system used by the plasma pistol toy sold by rubies or whoever, it uses the battery pack on a stick as a slug, and a small dc motor to pull and release it on a spring. But it's pretty size intense and I had to use some steel bars inside the gun to reinforce some of my mistakes.

The sound module I was trying out is the adafruit Waveshield:
http://www.adafruit.com/products/94

I couldn't find anything that was a bit more user friendly, unfortunately the shield is designed to mount directly onto arduinos without any pin specifications. So I've been going through the header files to try and figure out how to interface with it, and where to wire which pins with my teensy3. If there is a better sound module that could easily drive a speaker without using a LOT of my controller's pins (this one seems to use 3 for the sd card, two on the power pos/neg rails, and one extra SPI pin since the other SPI pins can be shared), I'd rather use something a bit better documented. Being arduino sized, it's a bit bigger than my battery pack, though the volume knob is nifty.
 
I have one of those plasma rifles too and have taken apart to see how it does it's AMAZING kickback feature. Motor driven camshaft movement of the battery compartment. Love it~! Needs a bit of room and mechanical engineering, but could be made to work in a diy build. Downside is that it is near impossible to synchronize with the actual fire rate.

-------------
There are other sound modules that are smaller and slightly cheaper, but nowhere near the sound quality of the waveshield. You made a good choice.

The pinouts are listed on the FAQ page, 13, 12, 11, 5, 4, 3, 2. Just need to cross reference that back to arduino proper to convert to your teensy's wiring.
http://www.ladyada.net/make/waveshield/faq.html

grr, just read the library. That spi interface for the SD card is written in c, not arduino cpp. Makes it a bit trickier because they refer to port pins addresses instead of arduino's digital pin numbers. The arduino refers to these port pin addresses as PORTB, the teensy is .... not an AVR chip (gasp, lol), is an ARM chip even compatible with arduino c coded libraries? ... Different register assignments.. Worries me that you'll have to replace the wavesheild's included SPI library with an ARM version.
http://arduino.cc/en/Hacking/PinMapping168
http://www.pjrc.com/teensy/schematic.html

Anyway, it sounds like a great project you have going and you've made some excellent progress.


edit: found one more link on the teensy / waveshield. Doesn't look good.
http://forums.adafruit.com/viewtopic.php?f=31&t=36059
 
I've messed with a few things from adafruit, and while I love their hardware, their software tends to be really hit or miss. I recently got a magnetometer/accelerometer combo from them, and it was completely crippled. The software loaded and ran fine, but it was just not reading data correctly, it turned out that there was a lot of type-casting issues in the adafruit library. I found and modified a library from the chipset manufacturer and bashed it into the demo code and got it to work a lot better, you can probably find my back and forth with the adafruit staff on their forums in regards to that...

The teensy3 seems to work fairly well with arduino code, usually I only need to tweak the pinouts to correspond correctly. Paul takes really good care of making sure those things work with as much stuff as possible, and with a spiffy powerful ARM processor.

I was hoping to avoid messing with the libraries too much for the waveshield, but it seems unavoidable. When I return from my trip I'll have fun tearing those six or so libraries apart and hope it's even possible, I haven't really messed with pin addresses before so that will be fun. I looked at the FAQ (Thanks for the link, I usually ignore FAQs because there usually are less useful questions in them) and will take a look a the libraries to figure out what exactly each of those pins is controlling as well, so I know which teensy3 pins to wire them to as per this:
http://www.pjrc.com/teensy/pinout.html

If it comes to it, a different audio module may be needed, one that's more generic branded, since this one is designed around working with JUST arduino.

I was looking into designing a lower profile version of the plasma pistol kickback, with the AR the fire rate is high enough that it probably wouldn't be too obvious that the kickback is off, but with the plasma pistol spring-loaded batteries, or a solenoid I am going to be pretty heavily limited on fire rate for the actual kickback, a rumble pack may end up being the closest I can get despite its weaker kick. That or rigging up airsoft components like redshirt suggests! But there's no way I'd fit that in now. I never realized how narrow that rifle is until I tried cramming a ton of electronics into it!

Thanks for all the insight, you guys rock!
 
Thanks.

In a non-update, I had to gut the entire thing. I found the wire I was using was way too tiny of a gauge (Like 26 or something...) and was fraying and tearing badly inside the gun. It's nice because I'll be able to more efficiently wire it this time around, and I was able to successfully salvage my teensy3 from the breadboard.

Once I get it rewired with some high quality (Radio Shack haha) wire, it should be back on track.
 
Status
Not open for further replies.
Back
Top