Posted: 5/9/2010 2:08:12 PM EDT
|
What kind of chip/processor would I need for a simple count down device? Say, I'm using a accelerometer and a small lcd screen and want it to count down from a pre-programmed number. I'm trying to make an LCD round count magazine for my AR, and already ordered the screen and accelerometer, but I don't know what to get to control them. |
|
You may of jumped the gun on ordering the the LCD and accelerometer if your asking that question. First off an accelerometer is about the last thing I would use for that, aside from that a PICAXE may be best suited its a 8 pin package, your only going to need a pin or 2 for the accelerometer and a serial pin to drive the lcd. |
|
I've been thinking about the accelerometer most of this afternoon (from the other thread). I guess it depends on how you implement it. Just seems like it's asking for trouble though. Bang your gun around the wrong way accidentally (or because you have to) and you could accidentally cause a decrement. |
|
Quoted:
You may of jumped the gun on ordering the the LCD and accelerometer if your asking that question. First off an accelerometer is about the last thing I would use for that, aside from that a PICAXE may be best suited its a 8 pin package, your only going to need a pin or 2 for the accelerometer and a serial pin to drive the lcd. You and fiver are correct...I've got no idea what I'm doing. But I'm gonna try damnit. So where to start then? I don't mind that I wasted 20 bucks. Help me! I want to make one, since nobody else will.
I'm sure there is a reason others have not made it, but I don't care if it costs me a hundred bucks for one mag...I want one by god.
|
|
I know how to do this, I have been thinking about it on and off for a year now, I just have not had time to sit down and prototype it and reacquaint myself with the wonders of micro-controllers. I would say more, but if I get it working right, work will want it. |
|
Quoted:
I've been thinking about the accelerometer most of this afternoon (from the other thread). I guess it depends on how you implement it. Just seems like it's asking for trouble though. Bang your gun around the wrong way accidentally (or because you have to) and you could accidentally cause a decrement. You'd have to get one with the right setting...so it wouldn't go off when you bang it on something. But it will never be 100% accurate, but it could get damn close. Look at FN's black box for guns. |
|
Quoted:
I know how to do this, I have been thinking about it on and off for a year now, I just have not had time to sit down and prototype it and reacquaint myself with the wonders of micro-controllers. I would say more, but if I get it working right, work will want it. Well tell me what to get already...pm me if you don't want to post it here. I really want to make one! |
|
What do you have chosen for parts for the accelerometer? Digital or Analog output? LCD or LED display? PIC uC can do this fairly easily. If you aren't experienced with it, you can design it on a PicAxe or Arduino dev board, which are kinda big, but make prototyping quicker. I just use PICs for most all things though. Don't even bother with a BASIC Stamp, way to expensive and slow. If you know C and can learn a new CPU, it is pretty easy to connect to an LCD, read analog values, read digital signals, etc. Total cost for the programmer and starter kit is $49 (PicKit 2 and 44 pin demo board). Something like the 18F2550 ($5) for the uC would be fine. |
|
There are a lot of options and without knowing anything about either the display or accelerometer you'll only get very general advice.
I happen to like PIC's. There are a lot of options for configurations and dev. kits. Most PICs are probably overkill, and lower cost devices could do the same thing more efficiently. For prototyping a PIC is probably the way to go. The use of the accelerometer is a little interesting. I might have opted for a more mechanical solution, like a limit switch in the upper receiver or buffer tube, and keep the counter on the gun. Assume 30 round magazines and have it reset on bolt hold back. By keeping the device on the gun you can rationalize a slightly more expensive part set and you have more room and triggering options. *shrug*. You can post data sheets for the accelerometer and display, but honestly I think you may just be in over your head. I admire the determination, but as simple as this project is there is a certain level of knowhow you need to get it done. Expect to open up a book or two (PICs for Dummies is probably a good start, assuming it's been written). Good luck. |
|
Quoted:
There are a lot of options and without knowing anything about either the display or accelerometer you'll only get very general advice. I happen to like PIC's. There are a lot of options for configurations and dev. kits. Most PICs are probably overkill, and lower cost devices could do the same thing more efficiently. For prototyping a PIC is probably the way to go. The use of the accelerometer is a little interesting. I might have opted for a more mechanical solution, like a limit switch in the upper receiver or buffer tube, and keep the counter on the gun. Assume 30 round magazines and have it reset on bolt hold back. By keeping the device on the gun you can rationalize a slightly more expensive part set and you have more room and triggering options. *shrug*. You can post data sheets for the accelerometer and display, but honestly I think you may just be in over your head. I admire the determination, but as simple as this project is there is a certain level of knowhow you need to get it done. Expect to open up a book or two (PICs for Dummies is probably a good start, assuming it's been written). Good luck. I've admitted I don't know what I'm doing...that's why I'm asking for advice here. If it's so simple, why hasn't it been done? And don't say because it's not needed, because a shit-ton for the AR is not needed.
So I buy PICs for dummies, but what hardware do I need to buy? |
|
Quoted: Bump so Fiver or JB can tell me what to buy. ![]() The thing is that there are countless different ways to do this. If you just want to do a simple prototype and mess around for fun, I would just snag a development kit like this. Yeah, it will be big and ugly but you want to get everything designed, tested and thought out before you start worrying too much about form factor. The worst that would possibly happen is you learn some new stuff I haven't done any PIC work in years. About a decade now that I sit and think about it. Anyway, I'm sitting here brainstorming how I would do this. -You could use an accelerometer like you are thinking of. What I don't like about this the most is that you need to manually set round counts. And then there are things like if you dump a round manually for whatever reason (bad primer, malfunction, etc.) -You could put a pressure sensitive resistor on the floorplate. Assuming it had high enough resolution, every position of the follower would have a different resistance value. You would assign each different resistance to a round count. You're kinda married to your spring at this point though. A "power spring" or a spring that was at the end of its useful life would fuck everything up. You could always have an "initialize" procedure that lets you press a button to tell it what a full and empty mag are and then try to do the math on the way. Not sure about that at all could get messy. -You could put a membrane potentiometer at the back of the magazine for the full length and measure the follower position that way. -You could install an array of membrane switches similar to above. Lots of other ways that I can't quite formulate in my mind too. You could do some neat things with optical sensors, but power starts to be a concern. However it ends up needs to use very little power so you aren't worried about battery size/life. |
|
PIC's or maybe an MSP430 (TI)
Analog Devices for the accelerometers. You can get them with linear outputs, but to hell with that, just go straight I2C or SPI into the uP and then do whatcha will with the data. Go here and read and follow the data sheets & application notes |
|
Quoted:
Quoted:
Bump so Fiver or JB can tell me what to buy. ![]() The thing is that there are countless different ways to do this. If you just want to do a simple prototype and mess around for fun, I would just snag a development kit like this. Yeah, it will be big and ugly but you want to get everything designed, tested and thought out before you start worrying too much about form factor. The worst that would possibly happen is you learn some new stuff I haven't done any PIC work in years. About a decade now that I sit and think about it. Anyway, I'm sitting here brainstorming how I would do this. -You could use an accelerometer like you are thinking of. What I don't like about this the most is that you need to manually set round counts. And then there are things like if you dump a round manually for whatever reason (bad primer, malfunction, etc.) -You could put a pressure sensitive resistor on the floorplate. Assuming it had high enough resolution, every position of the follower would have a different resistance value. You would assign each different resistance to a round count. You're kinda married to your spring at this point though. A "power spring" or a spring that was at the end of its useful life would fuck everything up. You could always have an "initialize" procedure that lets you press a button to tell it what a full and empty mag are and then try to do the math on the way. Not sure about that at all could get messy. -You could put a membrane potentiometer at the back of the magazine for the full length and measure the follower position that way. -You could install an array of membrane switches similar to above. Lots of other ways that I can't quite formulate in my mind too. You could do some neat things with optical sensors, but power starts to be a concern. However it ends up needs to use very little power so you aren't worried about battery size/life. I Need to find out how the FN black box works...If it's an accelerometer, I think it would work for a magazine too, it just can't be too sensitive. I don't imagine there will be one that's 100% accurate, but it would be close...and cool. |
|
Quoted:
PIC's or maybe an MSP430 (TI) Analog Devices for the accelerometers. You can get them with linear outputs, but to hell with that, just go straight I2C or SPI into the uP and then do whatcha will with the data. Go here and read and follow the data sheets & application notes Thanks! |
|
Quoted: I've admitted I don't know what I'm doing...that's why I'm asking for advice here. If it's so simple, why hasn't it been done?It's simple to develop something "that works" A sharp person with experience doing sensor could put this together in a few hours. Granted it might be ugly as fuck and have any number of usability problems. Pull any kid out of your local university robotics club and they'll say "oh that's easy we can have something to test tomorrow" To actually make something that works well, integrates with the gun, is easy to use and DURABLE, and most importantly that people would adopt is the real trick. Will it work if you drop your AR in the river? How long do batteries last? Can it handle the repeated shock? Will it ultimately be a burden or an asset to the operator? Can I see the display in bright sunlight? What about in the dark? Will getting Break-Free someplace you aren't supposed to cause problems? The list goes on and on. |
|
The way to do this is easy: the big acceleromter market driver is airbags, excedd a couple of G's and whammo, in kicks the circuit.
The power problem is also relatively simple, you can have digital circuits that idle along at nA (nanoAmperes, that's 10-9) or you can duty cycle them. Basically, you are looking for a very low pwoer device that only delivers an output whenever a certain threshold is exceeded. Oh yeah, lots of the accelerometers these days are three-axis, so you can differentiate recoil from something else. Read the AD app notes, that will get you a long way down the path to knowledge. |
|
Quoted:
I'd use a micro-switch tripped by the bolt flying home. Requires a bit of a mod, but much more reliable. Actually the accelerometer is probably more reliable, as it is a sealed system. Just senses motion. Any open switch in the chamber is gonna get fouled. You could mount the motion sensor, battery & display in a little Picatinny mount box, or in the nadgrip, or in the stock (depending on which model) I think the Picatinny would be the easiest to integrate. LOL, I wrote 'nadgrip' instead of 'handgrip' Too funny to edit out. Damn Coors and touch-typin got me agin |
|
Quoted:
Quoted:
I've admitted I don't know what I'm doing...that's why I'm asking for advice here. If it's so simple, why hasn't it been done?It's simple to develop something "that works" A sharp person with experience doing sensor could put this together in a few hours. Granted it might be ugly as fuck and have any number of usability problems. Pull any kid out of your local university robotics club and they'll say "oh that's easy we can have something to test tomorrow" To actually make something that works well, integrates with the gun, is easy to use and DURABLE, and most importantly that people would adopt is the real trick. Will it work if you drop your AR in the river? How long do batteries last? Can it handle the repeated shock? Will it ultimately be a burden or an asset to the operator? Can I see the display in bright sunlight? What about in the dark? Will getting Break-Free someplace you aren't supposed to cause problems? The list goes on and on. Hey, at least I'm trying. I know drugs, you have any questions about them...I'm there for ya.
|
|
I'd make it so it sits over the right side of the receiver, opposite the mag release, so you could use the mag release itself to reset the counter. To detect a shot, you'd probably need an accelerometer or two vibration sensitive switches (one sensitive, one not so sensitive). If there is continual heavy movement, don't count a shot, if there is a period of no "noise" followed by heavy movement, count a shot. This would make full auto difficult to count, but it would be pretty accurate up to about 5 rounds per second. LCD could be added for debugging to get the vibration/movement/shot detection algorithm figured out, but otherwise just a yellow and red 3mm LED on the right side, yellow lights up when you have 5 rounds left, red lights up when you are out. A switch to designate 20 or 30rnd magazines, a switch for mag release, that's two pins, and one analog input for accelerometer, two for the LEDs, use an 18 pin PIC SOIC (big surface mount) or DIP (through hole), and you'd have enough left over I/O pins for an LCD display as well. Support circuitry needed would consist of 6 or 7 resistors, and a couple 0.1uF capacitors, and whatever the accelerometer or vibration sensors need. The newer uCs have an internal clock (4Mhz-20Mhz), so there isn't much else to worry about other than power. For power, I'd use a "flat pack" 2 cell LiPoly, rechargeable, which is about 2"x1"x0.25", and would run the circuit for quite a while. |
|
The way to differentiate a sjot from recoil or other spurious movement is easy.
Level detect for a shot (I need this many G's to say 'ok, that was a shot') Use a standard switch debounce circuit (just Google it - there are scads of chips and circuits ranging from a simple RC time constant to more sophisticated stuff) that says "after I detect a shot, I will ignore any other signals for the next ___ milliseconds. Then toss it to a counter and away ya go. |

So where to start then? I don't mind that I wasted 20 bucks. Help me! I want to make one, since nobody else will.
