Hey everybody, I need help with a project I'm thinking about attempting. Basically what I want to do is make an arduino controlled round counter for an AR15. It would attatch to the side of my gun and have two pieces. The front most would house an Arduino Nano, a screen, and other components, the back most would have an rfid transmitter. It would scan the magazine as it was inserted and display how many rounds are left in it, subtracting 1 from its memory each time it senses the gun is fired. And that's the part I need help with.
What I think would work is to use a digital accelerometer. I could hold a button on the side for say 3 seconds putting it in calibration mode. Then I would fire a shot, then press the button again, exiting calibration mode. What I would want the Arduino to do in this case, is record the speed and intensity of the shock it would feel, and only register similar shocks, that way it would know when I fire the gun. but not falsely register shots from say walking with the gun in hand, inserting the magazine etc.
Anyone have any input? Anyone who has worked with digital accelerometers, is this a possible way of doing this? Any better ideas? Thanks in advance yall! Also, any advice on how to code this would be much appreciated as well. I'm a ME so I'm not super fluent in coding, but I can usually stumble my way through things like this.