Arduino Chronograph for Airsoft and Paintball

Everyone that is into Airsoft should have a Chronograph in case they do some modifications so that they can make sure their guns are within field requirements before going to play, otherwise they will waste a lot of time at the field and may miss out on a game or two.

A commercial Chronograph for Airsoft and Paintball is at least $80CDN. I got one on amazon for that price, and while it works ok I find it annoying to use due to the crappy user interface.

Since I have been doing a lot of Arduino lately, I decided that it would be a fun challenge to try to build a Chrono to see if I could do it, and to see if I can do it for under $30!

I also wanted to make the device have no interface other than one setting for Airsoft or Paintball (for Nerf I won’t bother calculating Joules as they really don’t need it). Simply shoot through it and it should tell you the ft/s, rpm, and Joule ratings for various Airsoft BB weights (20,25,28,32), or for standard paintball rounds. This way it just works and we don’t waste a ton of time changing settings for each player. I have seen the settings changing waste a half hour for 30 people, so this would be the biggest improvement I could make.

I have a $5 Arduino Nano, and $2 worth of IR emitters and Receivers, and an 0.96 inch OLED that I got for free from a buddy (may buy a 3 inch LED for $20 on Amazon so it can display everything at once). I am using a 230 Ohm resistor in line with the IR Emitter from the 5V source to power the Emitters. The IR Receiver has a 30 MOhm resistor between ground and the IR Receiver leg, then from the other leg it is connected to the 5V supply. The Average analog reading I get with this setup is 25 (using 8 bits, but with 10 bit resolution you get readings from 0-1023) and it has more stable readings than when I use full 10 bit sampling.

In one evening I had a basic circuit done with 2 pairs of IR emitters and receivers. However I was using analog IR receivers, and they have not worked out very well.

Chrono Prototype

The first version of the code used the basic analogRead() functions, resulting in about 120 microseconds per read. This had really bad performance and the best I could measure was around 20 ft/s with a 5 inch gap between sensor pairs.

Using some low level code and interrupts to reduce the sample time (and resolution to 8 bits) of the analog pins, I was able to reduce the sample time to 15 micro seconds, which was much better but still not good enough for very high speed projectiles. Ideally I want to be able to measure between 250 ft/s and 500 ft/s with an accuracy of +-5 ft/s.

I have ordered some amplified IR Receivers from Amazon for $6.52 for 4 that are designed to provide a digital output ,on or off, to the Arduino. This should allow me to use the digital inputs, which from what I read should have zero delay for reading and not require interrupts, meaning it should sample at 16MHz (arduino clock speed, assuming no other code is running).

Here is a link to the code on the Arduino Editor.

As soon as I get the new IR receiver I will modify my code and update this page…. Hurry up Amazon!!!!