BRIT NERF Forum Index
Join! (free) SearchFAQMemberlistUsergroupsLog in
The Stryfe with No Name (build-a-long)
Page Previous  1, 2, 3  Next
 
Reply to topic    BRIT NERF Forum Index » Modifications View previous topic
View next topic
The Stryfe with No Name (build-a-long)
Author Message
Please Register and Login to this forum to stop seeing this advertising.







tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post  Reply with quote
So last night I spent some time in the shed with my dremmel, trying to get these shells to play nicely together. I again had to remove various bits of the Centurion shell and chunks from the Stryfe, being careful to keep all the bits needed for the blaster to remain functional. I just couldn't get the front end to sit nicely...... but I think I've got it now. A little pressure is needed at the front to keep the two shell halves of the Centurion together but I think it will be fine. I also need to decide exactly where I'm cutting at the front as I still have a chunk of extra plastic here.





I also had a bit of time to look into my little 8x8 LED display that I'm planning on using with the Ammo counter, I've managed to get it to show numbers, two little indicator squares for... things?!? and even a picture of a skull Smile

10 Second Youtube video of display in action - https://youtu.be/OwtYIVm5JlI
Wed Nov 30, 2016 10:30 am View user's profile Send private message Send e-mail
Franksie
Nerf Hippy


Joined: 11 May 2016
Posts: 416
Fav. Blaster: Stryfe
Location: Telford



Post Reply with quote
A skull? are you the baddies?
Wed Nov 30, 2016 12:27 pm View user's profile Send private message
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Franksie wrote:
A skull? are you the baddies?


Smile It was the only .ppm formatted image I had to hand to test with
Wed Nov 30, 2016 12:36 pm View user's profile Send private message Send e-mail
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Well tonight was a disappointing evening. Basically down to me, not being good with a soldering iron.
I spent far too long and much too much effort trying to solder a Zero LiPo board to 8 GPIO pins on a Raspberry Pi. Finally got it soldered together and it's not working.... Solder sucker ordered from Amazon and Ill try again (third time lucky) when I can properly clean off the solder.



Wed Nov 30, 2016 11:03 pm View user's profile Send private message Send e-mail
Dazzle740
Regular Member


Joined: 14 May 2016
Posts: 202
Fav. Blaster: OOOOOOOHHHH Nemesis.........
Location: St Annes



Post Reply with quote
Should of given me a shout first as i have a solder sucker lol.
Wed Nov 30, 2016 11:24 pm View user's profile Send private message
Franksie
Nerf Hippy


Joined: 11 May 2016
Posts: 416
Fav. Blaster: Stryfe
Location: Telford



Post Reply with quote
Are you using flux?
Thu Dec 01, 2016 7:32 am View user's profile Send private message
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Apparently I'm using and I quote "A lead-free alloy solder containing a non-corrosive flux"

I've been in touch with a friend who knows his electronics and he's going to take a look at it in a few days and hopefully sort it out for me Smile

Anyway......

Small update today, after playing with my 8x8 display and really liking it I popped onto eBay during lunch at work and had a mooch around and discovered a 0.98 inch OLED display for £8......it arrived today and it works and looks really cool, it's 128x64 so has an much higher resolution than the 8x8. Not decided for sure which to use yet but I'm definitely leaning towards the OLED!

Thu Dec 01, 2016 10:59 pm View user's profile Send private message Send e-mail
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post The Ammo Counter Reply with quote
It's cold outside and I'm waiting on some materials, so this week I've been working on the Ammo Counter for my blaster.

It's gone quite well, I've found some simple guides out there that have helped me with some specifics and the Python language isn't too difficult to understand, mainly due to me having to learn a little C# for my work in Unity at the office.

So I present to you the AMMO Counter! (It's a YouTube Video)

https://youtu.be/seNzL-gZt_Y

- edit - Since I recorded this last night I've slightly altered the Reload mechanism, now it doesn't detect a reload till the wire/button is pressed so it only reloads when a mag is actually put back in the blaster. While there is no mag the screen displays total shots fired and uptime of the Pi, although thinking about it I might turn the screen off to conserve battery power.

Also if anyone has any idea's for other things I can show on the screen then let me know. I'm struggling to think of anything.
Wed Dec 07, 2016 9:25 am View user's profile Send private message Send e-mail
Minky
Senior Member


Joined: 16 Oct 2016
Posts: 417
Fav. Blaster: Rampage
Location: Derby



Post Reply with quote
Perhaps you could have..
.. the total shots fired toggle-able to count down your mAhs of your battery? If you could work out the energy cost of the set up you may be able to have that coming off the total and so give a rough battery level indicator? Or even plug it into a Voltmeter and have that display through the display?
.. be able to toggle the display to a graphic of the gun and have it show what circuits are in use at any given time? May be actually useful as a self diagnostic device to show if something has broken.
.. perhaps have a button whereby you can count your tags/deaths?
.. Perhaps run brushless motors off a PWM thing? And have it so you can tell them to run at low speed at all times allowing zero spin up?
.. Perhaps it could somehow detect a jam? There's probably a clever way but maybe through a mic and motor noise? And have the display instantly flash it like a red alert warning all over the screen. Could be combined with...
...tiny cam and LED set up looking into the firing bay/flywheels? Perhaps save on all the energy of opening the jam door.
.. Perhaps have a motor temp gauge?
.. Perhaps fit it with a range finder of some description and then give it a level indicator so it can indicate the correct angle to reach the distance and then whether you have tilted the gun correctly?
.. Compass and perhaps map of area?

I know nothing about something like this but I can dream..

_________________
If there was any other way of doing this without being the biggest damn hero you have ever met..  I'd still do this.
Wed Dec 07, 2016 4:11 pm View user's profile Send private message
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Minky wrote:
Or even plug it into a Voltmeter and have that display through the display?


This I've looked into, and some very clever people online have told me how to do it, but it's way beyond me at the moment. https://www.raspberrypi.org/forum...p;t=167343&p=1077081#p1077081
Wed Dec 07, 2016 4:20 pm View user's profile Send private message Send e-mail
Boff
The Dealer


Joined: 08 Dec 2012
Posts: 3392
Fav. Blaster: (Modified) Stampede ECS
Location: Bristol, UK



Post Reply with quote
Huh, it surprises me the Pi doesn't have a built in Analogue to Digital Converter (ADC). It'd be trivial to then use that, a voltage divider and some rearranged equations to give you your voltage. If the particular Pi board you've got does sport ADC, let me know and I'll get you the bits you need to do it.

_________________
Boff: Managing Director, Blastersmiths UK & BUZAN Founder (formerly)
| Blog: nerfarmourer.tumblr.com | Website: www.blastersmiths.co.uk | Legal: http://pastebin.com/6sQ7c3jg |
Wed Dec 07, 2016 4:59 pm View user's profile Send private message Visit poster's website
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Boff wrote:
Huh, it surprises me the Pi doesn't have a built in Analogue to Digital Converter (ADC).


No it doesn't have ADC build in, I've seen these https://shop.pimoroni.com/product...ochip-analog-to-digital-convertor for a couple of quid. (wasn't sure if there would be a clash as I'm using SPI for the OLED)

Your offer is great thank you, if you believe the cost of required parts is pretty low then I think I'll give it a shot, I felt like the required build may be beyond me, but the fact that you used the word 'Trivial' in your reply has filled me with some confidence that this is a bit easier than I originally thought and if all does go wrong I can still fall back on the voltmeters on eBay Smile
Wed Dec 07, 2016 5:26 pm View user's profile Send private message Send e-mail
Boff
The Dealer


Joined: 08 Dec 2012
Posts: 3392
Fav. Blaster: (Modified) Stampede ECS
Location: Bristol, UK



Post Reply with quote
Yup, that's a 10bit ADC. On top of that you're going to need a 15k resistor and a 8.2k resistor. You then wire them according to the diagram here with R1 being 15k and R2 being 8.2k. This set up allows you to input a voltage up to around 13V and have it read somewhere below 5V for the ADC to then read. Since the voltage changes linearly with the input, you can back calculate the input voltage from the voltage at the ADC pin.

Since you've got a 10bit ADC then you've got 204.8 ADC units per volt so you need to convert your ADC reading to a voltage before you move to calculate the Voltage In. That means you need to divide the ADC reading by 204.8 (or simply 1024/5 if you prefer a more precise approach) to give you the Input Voltage.

The voltage divider equation is rearranged to this: Voltage In = (Voltage Out/R2) x (R1 +R2) Remember you'll need to use a float or other decimal friendly data type to store your voltage before outputting it to the screen.

I've been playing with similar stuff recently on Arduino for various reasons so here's my relevant code. It's public domain and obviously built for Arduino but reads the input voltage before converting it and sending along a serial (usually USB) connection. The delay is there to prevent the ADC from being swamped. The Arduino documentation recommends only taking ADC measurements every 100 microseconds or so. The Pi with its multi-threaded processor might not have such a restriction.

Code:

#define RESISTOR_1 15000
#define RESISTOR_2 8200

float VOLT_IN, VOLT_OUT;

void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:

  VOLT_OUT = analogRead(1) / 204.8;
  VOLT_IN = (VOLT_OUT / RESISTOR_2) * (RESISTOR_1 + RESISTOR_2);

  Serial.println(VOLT_IN);
  
  delayMicroseconds(100);
  
}


EDIT: Just re-read your post. SPI allows you to have multiple devices daisy chained together. You'll need to look at how that works specifically for the Pi since it's a much more complex architecture than an ATMega328 chip. Very Happy

_________________
Boff: Managing Director, Blastersmiths UK & BUZAN Founder (formerly)
| Blog: nerfarmourer.tumblr.com | Website: www.blastersmiths.co.uk | Legal: http://pastebin.com/6sQ7c3jg |

Last edited by Boff on Thu Dec 08, 2016 11:04 am; edited 1 time in total
Wed Dec 07, 2016 5:55 pm View user's profile Send private message Visit poster's website
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Wow, I think I actually understood that, that was nicely clear, it almost seems simple.

So I would splice into the wire from the LiPo,  add the first resister then connect to the ADC which then connects to the Pi. After the splice in the main wire I then add the other resistor and job done. (Besides the python code)

Something I'm unsure of is that there doesn't seem to be a returning wire? When wiring in a Voltmeter there's a couple of wires but the diagram only shows one?
Wed Dec 07, 2016 10:02 pm View user's profile Send private message Send e-mail
Boff
The Dealer


Joined: 08 Dec 2012
Posts: 3392
Fav. Blaster: (Modified) Stampede ECS
Location: Bristol, UK



Post Reply with quote
The far side of R2 routes to ground. I think it's probably best to think of it as a T junction. The link between the positive terminal and ground is bridged by the two resistors in series. The vertical part of the T is then linked to the input of ADC between the two resistors. I would fritz up a diagram but some fucker stole my land line. :\

_________________
Boff: Managing Director, Blastersmiths UK & BUZAN Founder (formerly)
| Blog: nerfarmourer.tumblr.com | Website: www.blastersmiths.co.uk | Legal: http://pastebin.com/6sQ7c3jg |
Wed Dec 07, 2016 10:17 pm View user's profile Send private message Visit poster's website
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
That makes perfect sense, it just seemed strange to me to have a wire come out from the main 'trunk' and not go back again.

My previous experience with LED's, Buzzers and Motors have all had two wires, I assume this one wire is because we are reading the information from the wire and not actually doing anything with it.

Right then I think I'm going to be buying an ADC etc tomorrow. Thanks again for really making this clear and easy to understand.
Wed Dec 07, 2016 10:38 pm View user's profile Send private message Send e-mail
Dazzle740
Regular Member


Joined: 14 May 2016
Posts: 202
Fav. Blaster: OOOOOOOHHHH Nemesis.........
Location: St Annes



Post Reply with quote
You showed me the reply you got back from the other guys on the tinterweb with their explanation of how to get voltage to display on your screen and then reading Boff's above and the difference is like night and day lol, so much so I think i even understood Boff's version!!
Wed Dec 07, 2016 11:36 pm View user's profile Send private message
Boff
The Dealer


Joined: 08 Dec 2012
Posts: 3392
Fav. Blaster: (Modified) Stampede ECS
Location: Bristol, UK



Post Reply with quote
You're welcome. I guess it helps not having a technical background in this area, I've had to do the idiot grade stuff, too, so explaining it to others is a touch easier. Smile

Edit:

Just done some poking around and I have to say, I'm super glad the Arduino ecosystem natively accepts ADC. The MCP3008 has lots of channels but between that and the SPI, you're looking at a lot more code and supporting architecture. For one ADC input, you're looking at 8 pins worth of wire plus any inputs. Yikes!

A couple of tips. First make sure you connect the ARef pin to a regulated 5V line for the conversion to work using the equations in my previous post. then have a pretty solid guide from there.

If you wanted a nice breakout board then this one is a few quid more. It's 16 bit but I could easily alter the code to cope for you. Smile

EDIT #2:

So I edited my original code. It's posted below. You can now change the number of bits on your ADC by just changing one number in the define block and it'll apply it at run time accordingly. I've built this for size not speed.

Code:

#define RESISTOR_1 15000 //Value of Vcc side resistor for V divider
#define RESISTOR_2 8200 //Value of ground side resistor for V Divider
#define ADC_BITS 10 //Number of bits your ADC unit has
#define ADC_PIN 1 //Analogue pin for voltage reading

float VOLT_IN; //Set up a float to store the full voltage including decimals for writing to the screen

void setup() {
  // put your setup code here, to run once:

  Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:

  VOLT_IN = ((analogRead(ADC_PIN) / ((2 ^ ADC_BITS)) / 5) / RESISTOR_2) * (RESISTOR_1 + RESISTOR_2);

  Serial.println(VOLT_IN);
  
  delayMicroseconds(100);
  
}


_________________
Boff: Managing Director, Blastersmiths UK & BUZAN Founder (formerly)
| Blog: nerfarmourer.tumblr.com | Website: www.blastersmiths.co.uk | Legal: http://pastebin.com/6sQ7c3jg |
Thu Dec 08, 2016 9:34 am View user's profile Send private message Visit poster's website
tbr
Veteran Member


Joined: 23 May 2014
Posts: 300
Location: Blackpool



Post Reply with quote
Boff wrote:

If you wanted a nice breakout board


I had read your original post this morning and then purchased a MCP3008 plus the required resistors, and then I saw this 25v Voltage Sensor Module http://www.ebay.co.uk/itm/-/181884273832?roken=cUgayN which does the same thing as the resistors but seems more sturdy (I know what my soldering is like). THEN I saw your edit about the breakout board, looks good and being able to use less wires is a definate plus....I might now grab one.

It's lucky I consider this whole electronics thing (and the integration) an "enjoyable journey" as I keep buying more and more little bits and bobs and it does all add up, but it's fun and that's why I do it Smile
Thu Dec 08, 2016 2:42 pm View user's profile Send private message Send e-mail
Boff
The Dealer


Joined: 08 Dec 2012
Posts: 3392
Fav. Blaster: (Modified) Stampede ECS
Location: Bristol, UK



Post Reply with quote
The carbon film resistors you need for the voltage divider are cheap as chips and pretty much idiot proof. I wouldn't bother with the board linked in the ebay listng, it's just more space and pins than you'd otherwise use. You'd still need the MCP3008 or the breakout board I linked to get ADC on your Pi.

It's amazing what you acquire during these projects and then go back and use for something completely different. That's the joy of a lot of this stuff, you can use it for pretty much anything if you get the software right. I'm currently working with RGB LEDs originally bought for the burst fire module but I'm working them into motion sensitive ballgown instead... Very Happy



_________________
Boff: Managing Director, Blastersmiths UK & BUZAN Founder (formerly)
| Blog: nerfarmourer.tumblr.com | Website: www.blastersmiths.co.uk | Legal: http://pastebin.com/6sQ7c3jg |
Thu Dec 08, 2016 3:31 pm View user's profile Send private message Visit poster's website
Display posts from previous:    
Reply to topic    BRIT NERF Forum Index » Modifications All times are GMT
Page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.
Create your own free forum | Buy a domain to use with your forum