DIY - Arduino Shot Timer

1
There's no software sub-forum, so I figure the hardware forum is as good as any. ;)

About a year ago I wrote some code for a shot timer running on an Arduino Uno R3.

EDIT: I've moved the code repository to Google Code GitHub https://github.com/hestenet/arduino-shot-timer

Here's a (really crappy) video demonstration of some of the features:

I WARN YOU NOW - THIS THING IS ENCASED IN AN UGLY HUNK OF SUGRU - I'm no sculptor. :wtf:

[youtu_be]http://youtu.be/lpuMynV3e8k[/youtu_be]

Features:
- 200 shots in a string
- Configurable sensitivity (gets sensitive enough for dry fire)
- Echo rejection
- Configurable beep - delay, with 2 random intervals
- Up to 10 configurable par times.

It does not at present store multiple strings of fire. I have code for a version that stores the settings and strings to an SD card, but the Arduino Uno doesn't have enough flash memory to run the SD interface along with the other libraries I'm using. I'm looking into trying it on a Teensy or an Arduino Due.

Anyway - I just thought I'd share. :thanks:
Last edited by Fiddler on Sun Jan 08, 2017 12:45 pm, edited 5 times in total.
Secretary of Oregon LGC and LGC Instructor
Cowboy Action Shooting Alias: Jabber Walk.
Member, TCGC. | Firearm Safety
Paid your dues? | Subscribe to your local thread.

Re: Arduino Shot Timer

3
Thanks!

I use it for my regular practice sessions, and apart from being ugly as sin it seems to work just as well as a Pocket Pro II or similar (stores more shots, actually..).

I think I have my heart set on buying the ShotMaxx watch-style timer eventually - but I had a lot more fun building my own.

Re: Arduino Shot Timer

4
[NOTE: Some of this content has also been posted at: Pistol-Forum, because the thread there has been one of the top google results for 'arduino shot timer' for years, but no one's ever actually shared code]

Re: Future development -- I'm almost certainly going to keep tinkering. If I don't have a project I tend to fill my time buying new firearms, so it saves me money to have something to do. :p

Re: SD Card support - I'd really love to get this running, because I've got code working locally that should allow an unlimited number of shots, and unlimited length of strings (you'll notice the timer display goes up to 99 hours..). I could probably also add in things like pre-programmed 'qualifier' par system that does multiple par times in sequence as you start/stop the timer.

The problem is this model of Arduino doesn't quite have enough program memory to run the SD code and the timer code(or else my I need to optimize my code better). 32kb is not a lot to work with. Going to try using a Teensy board or a Due which should be enough.

If you want to build your own: EXISTING CODE IS FOR THE NON-SD CARD VERSION ONLY
PLEASE BE SURE YOU'RE COMFORTABLE AROUND A SOLDERING IRON
I estimate the component cost for building the no-SD support version of these is:
- Arduino Uno R3 - $27.95
- Electret Microphone breakout with gain - $6.95
- RGB LCD Shield, with buttons - $24.95
- 9v batter pack for arduino - $3.95 or 3 AAA pack - $1.95
- Piezzo Buzzer - 3-24dvc - 95 db - $9.50 at amazon, but way cheaper at an electronic parts store or ripped out of something else. More like $3 or less
--- NOTE: you can only drive the buzzer so loud with the Arduino's voltage level - tuning the frequency to the resonant frequency of the buzzer helps, try and find a low frequency resonance if you want a lower pitched buzz.
--- There are a couple ways you could increase the voltage to drive a louder buzzer: Project 1, Project 2

That's $67.80 for the base components.
+ shipping for parts if you order online
+ whatever it costs you to build an enclosure/add a belt clip
+ whatever your time is worth

It is more capable than a Pocket Pro II or PACT Club Timer, just uglier (And you can fix that if you're a better craftsman than I!). Not quite at the level of the CED7000, but once I get the SD card version working... well that'll be something.

Just to put it out there, the SD card version will use everything above with the following changes:
+ Substitute the Arduino Uno R3 for an Teensy 3.1 - $19.80 (Yes, it's cheaper, smaller, AND more powerful - harder to work with though, and mine hasn't arrived yet, so YMMV) (How to Power a TEENSY)
+ Adafruit SD breakout board - $14.95-- (This I have used and tested - works great, just don't have the program memory to run it and all the timer code at the same time on the Arduino R3)
+ 4gb MicroSD card - $7.95

+ Of course a modified version of the code - which is still a work-in-progress.

Est. Cost for SD components: $82.55

Anyway - as I said before - I just wanted to share. Please feel free to build your own, use my code, fix my code if you think it's crap, sell kits(please provide attribution?), post your own code.. whatever. I may put the code up on Google Code so it's easier to collaborate on, or maybe Codebender will add version control and community commit features.
Last edited by Fiddler on Sat Mar 22, 2014 4:26 pm, edited 3 times in total.
Secretary of Oregon LGC and LGC Instructor
Cowboy Action Shooting Alias: Jabber Walk.
Member, TCGC. | Firearm Safety
Paid your dues? | Subscribe to your local thread.

Re: DIY - Arduino Shot Timer

10
senorgrand wrote:Wow...great job!

Maybe you could code one for the new Samsung smart watch? I mean, it's on your wrist...it could probably detect a dry fire.
Might be doable? Depending on what the hardware it'd probably work about as well as the iPhone and Android apps work. Those things are pricey though!


The watch size shot timer does now exist: Shotmaxx

Re: DIY - Arduino Shot Timer

11
Inquisitor wrote:This would make an awesome blog post on the website :)
Wuh oh! Now you're making me nervous :oops:

It feels pretty rough around the edges to me, but I guess I wouldn't mind putting something out on the blog. PM if you want me to clean up my post into something blog-worthy I suppose?

Re: DIY - Arduino Shot Timer

18
Fiddler wrote:Hmm. I was using an uno as well (revision 3). You're using the 2.0.0 release, I assume. What libraries did you swap?

Mine's currently in bits because I cannibalized it for parts but I may be able to get enough of it back together to do some troubleshooting.
TinyWireM
Adafruit_TinyRGBLCDShield

Here's the repo: Adafruit_RGBLCDShield

Re: DIY - Arduino Shot Timer

19
Hi @Spara - 5 months later I found your reply. :sorry:

Did you ever figure out the problem with those libraries? Only recognizing the first shot could be any number of things:
  • Running out of memory for some reason (Do you have all the EEPROM/EEWrap libraries properly working do you think) -- Are you able to hit 'select' and stop the string after recording just the first shot? What happens when you try to scroll through shots after that?
  • Is the constant kMicPin definitely set to the right input?
  • Have you set the sensitivity?
  • Do you get anything interesting in the debug output if you have the console open while running?
My Arduino is still a pile of bits. I need to rebuild it before I can properly test again myself.
Secretary of Oregon LGC and LGC Instructor
Cowboy Action Shooting Alias: Jabber Walk.
Member, TCGC. | Firearm Safety
Paid your dues? | Subscribe to your local thread.

Who is online

Users browsing this forum: No registered users and 17 guests

cron