DIY - Arduino Shot Timer

A place to review and talk about firearms, ammunition, optics, etc.

Moderators: admin, Inquisitor, ForumModerator, WebsiteContent

Post Reply
Message
Author
User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

DIY - Arduino Shot Timer

#1 Post by Fiddler » Sat Mar 22, 2014 1:11 am

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.

Fukshot
Carpal Tunnel
Posts: 17556
Joined: Thu Dec 15, 2011 2:42 am

Re: Arduino Shot Timer

#2 Post by Fukshot » Sat Mar 22, 2014 1:37 am

I'm definitely impressed. Nice!

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: Arduino Shot Timer

#3 Post by Fiddler » Sat Mar 22, 2014 1:44 am

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.

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: Arduino Shot Timer

#4 Post by Fiddler » Sat Mar 22, 2014 11:57 am

[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.

User avatar
Sheepishlion
Been around awhile
Posts: 444
Joined: Tue Nov 15, 2011 10:34 pm
Location: LGC MEMBER: ATX
Contact:

Re: DIY - Arduino Shot Timer

#5 Post by Sheepishlion » Sat Mar 22, 2014 2:25 pm

GUN NERDS!!! :clap:
Ordering Shapelock and parts now.
thanks.
"We'll have to call it early quantum state phenomenon. Only way to fit 5000 species of mammal on the same boat."-River Tam

User avatar
Inquisitor
Site Admin
Posts: 14555
Joined: Sun Apr 12, 2009 7:19 pm
Location: Boston, MA
Contact:

Re: DIY - Arduino Shot Timer

#6 Post by Inquisitor » Sat Mar 22, 2014 2:46 pm

I was just messing with RPi. Figure arduino is next...

User avatar
ErikO
Carpal Tunnel
Posts: 15463
Joined: Sun May 29, 2011 10:49 pm
Location: LGC MEMBER: St Louis, Missouri
Contact:

Re: DIY - Arduino Shot Timer

#7 Post by ErikO » Sat Mar 22, 2014 3:52 pm

Waiting on the SD. Well, and for circumstances to improve a bit.
In a bacon, egg and cheese sandwich the chicken and cow are involved while the pig is committed.

User avatar
senorgrand
Verified Member
Verified Member
Posts: 19225
Joined: Mon Jul 18, 2011 3:05 am
Location: LGC MEMBER: Calif Central Coast
Contact:

Re: DIY - Arduino Shot Timer

#8 Post by senorgrand » Sat Mar 22, 2014 3:55 pm

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.
Image

Grand Poobah and Bass Player for the Conspiracy of Weenies.

User avatar
Inquisitor
Site Admin
Posts: 14555
Joined: Sun Apr 12, 2009 7:19 pm
Location: Boston, MA
Contact:

Re: DIY - Arduino Shot Timer

#9 Post by Inquisitor » Sat Mar 22, 2014 4:32 pm

This would make an awesome blog post on the website :)

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: DIY - Arduino Shot Timer

#10 Post by Fiddler » Sat Mar 22, 2014 4:42 pm

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

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: DIY - Arduino Shot Timer

#11 Post by Fiddler » Sat Mar 22, 2014 4:45 pm

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?

User avatar
Inquisitor
Site Admin
Posts: 14555
Joined: Sun Apr 12, 2009 7:19 pm
Location: Boston, MA
Contact:

Re: DIY - Arduino Shot Timer

#12 Post by Inquisitor » Sat Mar 22, 2014 4:53 pm

If you wouldn't mind, yes please :)

User avatar
shinzen
Site Admin
Posts: 18864
Joined: Wed Nov 07, 2012 10:52 pm
Location: Northern California
Contact:

Re: DIY - Arduino Shot Timer

#13 Post by shinzen » Sat Mar 22, 2014 5:01 pm

Sweet! Nice write up and resourcefulness! I may have to build one of these doohickey's to keep me from spending money on other stuff.
Image

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: DIY - Arduino Shot Timer

#14 Post by Fiddler » Sun Jan 08, 2017 12:44 pm

Just a random thread necro to indicate that the latest updated code is on github:

https://github.com/hestenet/arduino-shot-timer
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.

User avatar
spara
Verified Member
Verified Member
Posts: 1365
Joined: Wed Jun 11, 2014 5:42 pm
Location: San Antonio
Contact:

Re: DIY - Arduino Shot Timer

#15 Post by spara » Sun Jan 08, 2017 2:52 pm

Oh wow, I hadn't seen this thread. Definitely will build one now and test it out. Might even build several to keep around the club.

User avatar
spara
Verified Member
Verified Member
Posts: 1365
Joined: Wed Jun 11, 2014 5:42 pm
Location: San Antonio
Contact:

Re: DIY - Arduino Shot Timer

#16 Post by spara » Sun Jan 22, 2017 10:28 pm

So I finally got around to building it, had to swap a couple of libraries because I'm using a Uno and it measures the first shot but nothing after that. I guess I'll have to poke a the code to see what's up. UTSL and all of that

Image

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: DIY - Arduino Shot Timer

#17 Post by Fiddler » Mon Jan 23, 2017 12:29 am

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.

User avatar
spara
Verified Member
Verified Member
Posts: 1365
Joined: Wed Jun 11, 2014 5:42 pm
Location: San Antonio
Contact:

Re: DIY - Arduino Shot Timer

#18 Post by spara » Mon Jan 23, 2017 1:53 am

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

User avatar
Fiddler
Grizzled Veteran
Posts: 535
Joined: Tue Sep 18, 2012 12:31 pm
Location: Portland, OR
Contact:

Re: DIY - Arduino Shot Timer

#19 Post by Fiddler » Mon May 29, 2017 4:57 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest