Monday 8 July 2013

DIY Chrono Shopping list

A few people have expressed interest in making a DIY chronograph so I said I'd put together a shopping list.

There are quite a few options for the display type so I try to give the pros and cons at each step.

Firstly, the processing power.
All my projects are done using the Arduino family, including the many clones out there, I've used original Arduinos and Clones from China all without any problems. (A PIC Micro will do just as well with the same hardware)


Arduino Mini Pro

Arduino Nano



These are available in 5V 16MHz and 3.3V 8MHz versions, I used the 5V versions @ 16MHz to get the best uSecond resolution, I believe that the 5V versions can be run at 3.7V and still run at 16MHz.
This device needs an external USB to serial adapter to allow programming but, once progr ammed, can be fed from a 7V source via the on-board regulator (RAW input) or a regulated 3.3 to 5V supply on the VCC pin.
I bought mine on Ebay from here for less than £3 but it took 27 days to arrive.
Others on Ebay search
These are the boards I've been using, mainly due to the USB connector for both programming and supplying 5V.  I use an Eveready unit that uses 2x AA batteries and steps up the voltage to 5V, I connect this with a standard micro USB lead.
Apart from the on-board USB and the in-circuit programming connector (far right) the specs are the same as the Mini Pro.
These can be bought on Ebay for around £4 from China and around £10 from the UK, they're a little more expensive due to the on-board USB.

Display Options

This is the top of the range display £7 from China but has the advantages of being colour and also touch screen.
I didn't go very far with this display but I think it would be good in a larger Chronograph that has a large detection curtain.

This is an I2C connected display and can come in yellow, blue, white and red.
This is my choice for my portable sensor.
It's very easy to program and is a similar size the the sensor tube so is a good fit, see this post.
You can only really display one value, I chose FPS because that doesn't require you to input the pellet weight, you can generate a little look up chart for you pellets.
I dug out an old Nolia 5110 phone display that was set into an Arduino UNO shield and added it to the DIY Chronograph family, it works pretty well and has a very good contrast for outside readability and the 5 way switch at the bottom centre allows for a menu system to enter the pellet weight.
I can't get the shields any more but the screen can be bought off Ebay for a couple of quid from China and around £7 from the UK, these displays not on the shield work on 3.3V only so require some level shifting when used with a 5V arduino.



A cheap and cheerful display that can be bought in many webstores an Ebay, they're nearly all the same connection standards and have Arduino Libraries readily available and can come with or without backlighting.
Similar to the 2 line 16 character display just a bit smaller, easier to package and can come with and without backlight, the non backlight versions tend to use an LCD technology that means they're a good contrast  and can be good in sunlight.


Fancy using your Android smartphone as the display then this is what you need, available from £5 in China to £15 in the UK.
Be careful, this board comes with and without the back PCB, without it is a bit fiddly to use and works of 3.3V only.
Ebay search

Other parts


I chose Aluminium tube because I wanted to thread it to fit my 1/2" UNF silencer adapters on my rifle and pistol but you could use any tubing you liked, depending on how you want to fix it.
I bought mine on Ebay from here.

You will need to get it cut to length and threaded if you want to do as I did.

Maybe you have an old silencer that you could modify.  See this post for assy. details
The sensor LEDs were bought from RS components, they are available on Ebay but at a huge markup

Photo sensor - OPL-550a
Ebay
Farnell
RS components

IR Emitter LED OP240A
Ebay
Farnell
RS Components

Software

Arduino
Android
I have quite a few version of the various sketches so if you would like a particular version just request it in the comments and I sort out a link.

Nokia 5110 shield sketch
Nano with 7 segment display
Chrono with 8x2 LCD

 Here

Aptoide store download


99 comments:

Anonymous said...

I'd love to see some sketches for the arduino. Save some coding time. I think the framework is probably enough. There will end up being changes needed from gadget to gadget anyway.

Gadjet said...

Links to some sketches added at the bottom of the post.

RAKESH said...

How did you set the pellet weight in the arduino sketches?

Gadjet said...

RAKESH,
It depends on the sketch, the Nokia display allows you to set the weight using the joystick after powerup, the 7seg display doesn't use the weight it only displays the speed and you do the calculations yourself.

Unknown said...

Hello writes translator so sorry,] I have a problem I used your code from 18/04/13 everything plugged in accordance with the post "Chronograph update" but something is not working. I have Arduino Leonardo trigger 1 & 2 Connect to pin d2 and d3. Saying that the plate must support interrupt but I do not see any commands? eg attachInterrupt
detachInterrupt
interrupts
noIntrerrupts

Unknown said...
This comment has been removed by the author.
Gadjet said...

Daniel,
I can confirm that interrupts are not used in that code, I was thinking about using interrupts but haven't done so yet, it's just a fast loop checking the inputs.
Can you check the inputs with a scope to check the sensors are working.

Unknown said...


The sensors are working as they cover my finger voltage falls to 0V. but I have one question I check the operation of the system by putting some small object into the tube, it can be wrong with the system for low speed does not work basically the system is to be a name to use for air rifle .22 cal

Gadjet said...

I tested my setup by dropping a .22 pellet down the tube and I get a reading in milliseconds.

One thing is the IR sensors, have you used the same ones I used, it can be that they are not detecting the object, how far apart are they, are they lined up together....

One thing I tried was two switches connected to the trigger inputs and pressed them together one slightly before the other to see if I got a time transmitted.

Can you share some images of your setup, do you have dropbox. google drive etc.

Unknown said...


I'm not home right now but I throw in fritzing evening schedule and some pictures

Gadjet said...

OK,
One other thing, I used my phone camera to look at the IR emitters, they glow a purple colour when powered up, just to make sure they are on.

Unknown said...

Okay now all ready asking for your login to Dropbox

Gadjet said...

Daniel,
Sorry, not sure what you mean, my login?
If you have a dropbox account I can give you my email so you can share a folder with me or you give me your email and I can share a folder with you.

Unknown said...

ok so tell me your email and I've shared folder on the

Gadjet said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Unknown said...

released about Dropbox folder on the e-mail address

Gadjet said...

Daniel,
OK, I've had a look at the pictures and firstly, the sensors are probably too far apart, try a much smaller tube, to have the sensors so far apart I think you would need more than one pair. Try dropping something larger (20mm) down the tube, this should trigger it, a .22 pellet probably wouldn't.

Unknown said...


Ok I'll try to reduce the diameter of the pipe and then we'll see. And how to connect a second set of sensors you can convert my project fritzing?

Gadjet said...

Daniel,
Did you try a larger object or use your camera to check the IR emitters were working?
Also, looking at the pictures it looks like the emitters and detectors may not be absolutely parallel to each other, they have a 40 degree angle on the emitters so at 25mm they would need to be lined up perfectly to work.

Gadjet said...

I just uploaded the IR emitter spec to the dropbox folder and it looks like 25mm would be too far apart, see graph on page 2.

Unknown said...

I checked the IR LED camera light very clearly. Today I will try to tube 15 mm

Gadjet said...

Hi Daniel,
Any progress, have you got it working?

Anonymous said...

Hi, is any chance to get chrono sketch with Bluetooth support?

Regards,
Chris

Gadjet said...

Chris,
There is nothing special about the Sketch for bluetooth, you just send the value of the time difference via the serial pins and it gets transmitted by the bluetooth module. If you can see the data on the serial monitor of the Arduino IDE on you PC then just disconnect the USB from you PC and connect the TX/RX to the bluetooth transmitter, that's it!.

Hope that helps.

Anonymous said...

Hi,
yesterday I connected my hc-06 with arduino pro mini and it worked perfectly with my Galaxy S4 :) (used 2 switches instead of phototansistors - as I don't have any of them yet).
Do you thinking about upgrading chrono APK? Will be nice to have velocity in m/s and energy in Joules. (can be changed between FPS/m/s and FPE/J).

BTW. do you know any cheaper replacements for ir elements?

Regards,
Chris

Gadjet said...

Hi Chris,
I'm moving the app over to app inventor 2 a bit slow going but when I do I'll add m/s and joules as an option.

Anonymous said...

Great news !!! Thank you Gadjet.

Regards,
Chris

Gadjet said...

Chris,
Sorry but I forgot to answer your question about cheaper IR parts.

I know one one person that tried to use normal analog IR emitter/detector and had quite a lot of trouble trying to use the analog output.
I used the digital output IR receiver because It doesn't require and signal modification and can trigger the input directly. You can use anything you like as long as you can get a reliable trigger into the Arduino input.

Cheers.

Anonymous said...

Hello Gadjet,
I already bought IR parts recommended by you. They has been delivered yesterday and in Monday I'll try connect all together.

Gadjet said...

Good news, post the results, good or bad........

Anonymous said...

Hi Gadjet,
I've bad news. I burnt out both or emitters :( is my fault because I didn't check dataset and feed them 5V :/ BTW. on yours photo showing pcb for emitters both leds are wrong placed ( long leg is - not +) and 150 Ohm resistor is a must for 5v. Now I'm waiting for new pair.

Regards,
Chris

Anonymous said...

In LED diodes long leg is always + and short is - .
Sorry Gadjet- my fault. Chris.

Anonymous said...

Hi, any news regarding the new release icnluding Joules and so on?

Gadjet said...

Sorry I've not really been doing anything with the chronograph for a while now other projects on the go, I'll have a look at it sometime soon though, do you mean the APK file from the appinventor gallery?

Unknown said...

Can I use OPL-550 ALTERNATIVE, for example TSOP1138 or HS0038 PHOTOTRANSISTOR?!
TANKS ALOT

Unknown said...
This comment has been removed by the author.
Unknown said...

Hello again.
I have a problem, When attemp to Upload codes to nano arduino board, give this error: compiling.This terminated.exit

#include
after delete this line, compilation was compilation, but I have not any action on my 16*2 lcd

Gadjet said...

The includes specify the libraries to be used in the code, do you have the libraries installed that are called with the includes?

Unknown said...
This comment has been removed by the author.
Unknown said...
This comment has been removed by the author.
Unknown said...

tank you alot. the compiler problem with this code line:

*include EEPROM Anything.h*

after delete this line, compiling was complete but I khonw its wrong way.

Gadjet said...

I think you are OK to remove all includes except the LiquidCrystal.h as they are not used, I did use it some other code to save pellet weight values to the EEPROM.

Unknown said...

can you help me for reconfiguration this Micro skech for use only with a i2c 2*16 lcd?!
tank you :)

Gadjet said...

Have a look here
http://playground.arduino.cc/Main/LCDI2C

Jrebic said...

HY!
Kann mir jemand helfen!!!
Ich habe die chrono mit 16x4Lcd gemacht!
alles funtioniert aber Ich wolten die result in M\S und energy im J!!!
Please help!!!

Gadjet said...

I will have a look at the sketch and let you know.

Gadjet said...

Jure,
Edit the code: - Change Fps to mps and ftlbs to Jls in the variable section at the top.
float mps = 0; //storage for meters per sec value
float Jls = 0; //storage for powerper sec value

Then edit the void "output_serial_info()" function to

void output_serial_info() {

firstShot = true; //First shot has been fired so clear pellet weight adj. message
lcd.clear();
mps = float((SensDist)/(Trigger_2 - Trigger_1))*0.3048;
mps = constrain(mps,0,999); //limit mps tp plus value upto 999
Jls = ((pWeight*mps*mps)/450240))*1.35582;
//Send datat to LCD
lcd.setCursor(0, 0);
if (mps<999.9) { //Check for large no.
lcd.print("mps ");
lcd.print(int(mps));
//lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print("Juls ");
lcd.print(Jls);
}
I have not tested this but hopefully it will work.

Jrebic said...

Danke!!!
Nach dem kleine änderung funktioniert!!!
Ich habe noch pWeith in Gram geändert, Alles funktioniert SUPER!
Ich habe schnelle phototransistor eingebaut,,und ich hofen mich zum wird das auch am meine Airrifle funktioniern!!!
Haben sie schon am airrifle test gemacht oder nur mit CO gun???

Vielen dank Für deine hilfe!

Gadjet said...

Good news.
keep the weight in grains, the formula is expecting grains.

Anonymous said...

Hi... I am just working with my version of chrono. I try use seven segment but links to your sketches dont work anymore?

Gadjet said...

Try it again, Dropbox have changed their public sharing link policy and I will nee to update all the links in my blog posts ARGHHHH!!! thanks Dropbox!

KK said...

Hi gadjet,
is important differences between opl550 or opl550a?
i bought opl550 model.
There is no mark 'A' end of part number.
is this matter for me?
Thanks

Gadjet said...

I think the only difference, according to the datasheet, is the 'A' version has a lower maximum power input of 1.4 mW/cm2 whereas the plain part has 2.4 mW/cm2.

John said...

Thanks for your great project, unfortunately the Android link does not seem to be working?

John

Gadjet said...

John,
The link was to the app inventor one site that has now closed.
I have added the link to the aptoide download store, you can download the app from there.

Jrebic said...

Halo Gadjet!
Ich habe das Chrono lcd schon gemacht,
Und ich wollte uber app probiern!
Bluetooth verbindung funktioniert ,
Aber das app bekommt immer fehlermeldung!
Wass kann ich machen!
Oder ist fehler beim app!
Danke im voraus

Gadjet said...

Haben Sie einen Screenshot oder eine Beschreibung des Fehlers, haben Sie das Pelletgewicht und andere Details in den Einstellungen eingegeben?

Jrebic said...

Ich become das fehler!
Bad argument to yail-divide!

Gadjet said...

Haben Sie das Pelletgewicht und den Abstand zwischen den Sensoren in den Einstellungen festgelegt?
Ich denke, das passiert normalerweise, wenn Sie versuchen, zwei inkompatible Werte wie Zahl und Text zu teilen oder durch Null zu teilen.

Jrebic said...

Ich Versuche nochmal mit neue sensor!
Die mache ich morgen fertig!
Und melde mich nochmal! Hast du noch die app mit Mps und Juls?

gab said...

Hello,
Finaly fantastic all work fine.
Could you do an update of your android APK file please ?

could you replace FPE (Energy) with velocity in Meter per second (in this case we can have the velocity in FPS unit ad MPS unit) or simply change FPS to MPS ? with this your apk will be 100 % better.

Regards and thank you foir your job.

Gadjet said...

Glad you got it going, I will have a look at the App to see what I can do but it will not be quick, maybe after Christmas.

Gadjet said...

Gab,
Just added an MPS box, not tested it, give the APK file a try and feedback.
https://www.dropbox.com/s/rnwi41ys4i50aqo/Bluetooth_Chronograph_AI2_with_MPS.apk?dl=0

gab said...

Hello,
thank you for your quick answer.
I will test it.
regards

gab said...

Hello, I test the two app Android.m'y chrono works.but on the two app, I think there is a problem, with statistic, velocity max is more actual measure velocity than maxi, I have a doubt about mean velocity and for delta fps i think it is delta between each shoot.
Standard déviation formulae is better and Has sens in statistic.
Listing of shoots on the lower screen don t work.
Regards and thank for your job.

Gadjet said...

Glad it's working, I haven't tried the app on my new galaxy 8 phone but I tried it this morning and it fails every time I start up ARGHH!
The problem is that App inventor is not the easiest tool to find out where the problems are.

There are a few people who've downloaded the app and they report it works fine so I suspect that it may perform differently on different phones/versions of Android !

Early feedback was that the Min/Max/Delta was the preferred method, I you wish to develop your own then I can send you the App inventor Code so you can make it do want you want :-)

Gadjet said...

Just having a look through he code and fixing the bug I found, currently the shot string data will only appear when the write to file checkbox is checked.

Anonymous said...

Hi Gadjet,

I've made order from RS before I found your blog. So for receiver I choosen the following one Vishay TSOP58438, 38kHz IR Receiver (https://uk.rs-online.com/web/p/ir-receivers/7733845/?searchTerm=773-3845&relevancy-data=636F3D3126696E3D4931384E525353746F636B4E756D626572266C753D656E266D6D3D6D61746368616C6C26706D3D5E285C647B362C377D5B4161426250705D297C285C647B337D5B5C732D2F255C2E2C5D5C647B332C347D5B4161426250705D3F292426706F3D3126736E3D592673743D52535F53544F434B5F4E554D4245522677633D4E4F4E45267573743D3737332D33383435267374613D3737333338343526)

Would this do the job?

Thanks in advance

Gadjet said...

I'm not sure if it would work or not, the reason I didn't use them is that the transmitting IR LED needs to be modulated at 38KHz, I believe that this modulation helps with cutting out interference from ambient light.

I suppose the transmitting LED could be driven by the Arduino but this would probably affect the trigger detection timing

They might work

Tibor said...

Hi Gadjet,

Finally I found the option to leave msg with name,

So about the above, If I understand you correctly, would it help if the IR transmitting led driven from outer circuitand not from the arduino board?

Other than that do you have a sketch what using 1602 16X2 Character LCD Module Display?

Many thank you!

Gadjet said...

Tibor,
Yes, in ,y design the LED transmitters are just driven by the supply with no modulation, I assume for your receivers you will need to modulate the transmitters, this would be bettr done using extra circuitry rather than the Arduino pin. You could try it but I suspect it would slow down the Arduino's response to the input triggers. I may be wrong though.

Have a look at this post, in the comments there are some posts about using an LCD display with code
https://gadjetsblog.blogspot.co.uk/2013/05/chronograph-update.html

The connections for the LCD are standard Arduino connections that can be found at www.arduino.cc or easily with Google :-)

Let me know if the LED receivers work OK

Tibor said...

Hi Gadjet,

Thanks for the quick reply, next week i should receive my delivery from RS, however site is tempolary down for delivery.

I'll give it a try with the parts from my choice, if I'll struggle just order the bits from your trials.

Regards

Tibor

Tibor said...

Hi Gadjet,

I checked my board and silver chip printed with 12.000 instead of 16.000. Will this cause high inaccuracy or will do the job?

Thanks.

Tibor

Gadjet said...

That's strange I thought they came in 8MHz or 16MHz, 16MHz is better because it will run more clock cycles in the time between triggers and therefore have a better resolution but should still be able to run OK, I'm not sure about the accuracy but if you think it affecting it then make the distance between the sensors a bit larger to compensate, say 80mm, a third bigger.

Tibor said...

Hi Gadjet,

After the first assembly looks okay, I made som adjustment on the 8x2 sketch to fit for my purposese.

Can you please confirm one stuff below?

unsigned long SensDist = 196850; // I wish to use 60mm or 80mm spacing between the sensors. Can you please tell me how this number calculated or what is this number? : 196850

Couldn't figure out :/

Thanks

Tibor

Gadjet said...


Hi,
for feet per second distance ((between sensor(mm) / 25.4)/12)x1000000 (because the count is in uSeconds)
The value is the distance between sensors in feet *1000000
Convert the distance in mm to inches. 60mm = ((60/25.4)/12)*1000000 =196850
therefore 80mm = ((80/25.4)/12)/1000000 = 262467

Hope that helps, if you have excel just put the calculation in a cell and fill in the distance

Tibor said...

Thats, great. Thanks Gadjet!

Soon I can post photos and test results.

Regards

Tibpr

Tibor said...

Hi Gadjet,

I've done my build, sketch, wireing all ok. On test phase if I break the ir beam with my finger I can see results but if I "throw" anything else(screw, bb pellet, even a pencil) through the tube it's just not working (Seems that the ir beam not break)

I use pvc pipe inner diameter 40mm and 60mm gap between sensors.

Any idea what did I wrong?

Thanks Tibor

Gadjet said...

Good that you've got it basically working, if you look at the bottom picture in this post you'll see the drawing of the tube and beam arrangement, as I only use one emitter and detector it is very important that the effective beam path is quite narrow so that a passing pellet will be sufficient to interrupt the beam completely therefore the gap is around 10mm and the walls of the tube are 2 or 3mm, which puts the receiver at the bottom of a tube which helps the shield it from other ambient light and makes it more sensitive to the beam being blocked by a passing LED.

With a 40mm tube I'm guessing you are getting a wide beam that will pass around the pellet and a large percentage of the IR is still reaching the receiver, when you use your finger you are blocking a lot more IR light and triggering the sensor.

There are a lot of chronographs that have a wide tube but they use multiple emitters and receivers and are looking for a change in the IR light level caused by the pellet's shadow across several photo diodes.

I hope this helps explain things, a smaller thicker tube with a shorter distance between sensors should help, also the holes must be in-line with each other. I used my phone's camera to see the IR light and I could see that the light from the emitter was aimed at the hole in the other side of the tube.

Seyit said...

Hallo ich hab das ganze nachgebaut nur der skech fehlt mir kann mir jemand helfen "7 segment anzeige

Gadjet said...

Prüfe, was du eingefügt hast, stimmt mit der Skizze überein. Manchmal, wenn Sie kopieren und einfügen, werden einige Zeichen geändert. Was ist der Fehler?

Unknown said...

I am not able to find your ir emitter and i want to build one. Can i use a normal cheap ir emitter? Also since i am so late is there a better option for the ir recievers(photo diode)?

Gadjet said...

unknown,
The IR emitter and detector are still available from RS components, are you not able to buy from them?
I suppose you could use any IR emitter and IR photo-diode but you would need to interface the analogue photo-diode output digital input of the Arduino or edit the code and use an analogue input maybe?
I used the specific IR receiver because of it's digital output and high speed response time.

Unknown said...

oh okay, actually i live in india so supposedly they are quite difficult for me to find. I was able to find the reciever but not the transmitter. Also as you said analog will be quite slow so not worth it.

Gadjet said...

The receiver is the tricky part so if you can get that then you're mostly there, you can use a normal IR emitter instead of the one listed without any issues other than packaging it.

Unknown said...

Oh okay! I will use a normal one and I will try to modify the code to build it on raspberry pi Pico since it has a faster clock speed and will result in more accuracy.Thanks for the help! I guess I will make one now instead of spending 70 bucks on a commercial one which I will hardly use.

Unknown said...

Btw how many analog pins did you use on arduino? I hope it's less than 3 or 3 at most since I will have to build it on nano otherwise since Pico only has 3 analog ports

Unknown said...

btw i just checked your code and the one i will be building is one with 16x2 display. Your code uses 4 analog pins so i guess i will get back to arduino nano (the new arduino reconnect would have been great as it houses the same rp2040 microprocessor and has more analog pins around 7 but its 35$). The pico unfortunately has only 3 analog pins.

Gadjet said...

Although it's been a long time since I did it I can't remember why I used analog pins but I don't think there was any analog signals involved, there's no reason why you couldn't use digital pins...... I think.
I have got a Pi Pico and was thinking of writing the code for the chronograph on that as it is a lot quicker, the chrono that I have uses the Bluetooth interface to speak with the app on my phone but I've not used it for a long time.

Unknown said...

OH okay buddy, if you ever happen to write a code for pico as it is as easy now because you can program it with arduino ide let me know since i am interested to build one. If you have some spare time, please let me know if you do it . It would help me if you can send a pi pico based code, also i will probably be using a 16x2 display since its cheap and looks nice. Thanks for taking your time to reply to my queries.

Gadjet said...

If I remember correctly there are just 6 pins required, 2 for the two triggers and 4 for the LCD display, all these can be digital pins.
I'm learning to program the Pico in Python and C++ due to C++ being even faster than Python or the arduino IDE.

I am finding the micropython programming workflow a lot easier to use than the Arduino IDE, I'm currently using Thonny to write code and program, check out Youtube for some guides it's easier than Arduino IDE :-)

If I come up with some code I'll let you know but it's not at the top of my todo list at the moment, good luck and post here if you get it working.

Unknown said...

okay thanks buddy

Blobber said...

Hello Gadjet,
is there a latest version for the Android app available? On my new phone, the app is not supported anymore, I get the message, that the operation checked can not accept the arguments: (0)

Gadjet said...

I've not done anything with the app for a few years I'll have to have another go with it on my latest phone and seee if I can fix it.

Blobber said...

That would be great, thankyou :)

Gadjet said...

Blobber,
Give thid a try https://gallery.appinventor.mit.edu/?galleryid=5394502778355712
Not promising but it works on my S21 but I haven't got a working chrono to had to try it at the minute but the app fires up OK.

Gadjet said...

Hopefully you can download APK from here https://1drv.ms/u/s!AkqVSEM4Y7kDhJwpFNLiNIEqkZ7T0g?e=OnyOEi

Blobber said...

Hello Gadjet,
thankyou so much, now the APK is running very stable on my Xiaomi POCO M3. Finally also the velocity in mps, excellent job, thankyou :)

Three button WiFi Remote

Using the power control circuit from the Wirelesse door/Window sensor I have designed a simple 3 button WiFi remote with the intention of co...

Popular Posts