Friday, 5 July 2013

Finally the DIY Chronograph meets Android

Latest project update for 2026 here


Yes, I finally got a Bluetooth serial adapter to connect to my Arduinos.

I bought it off Ebay for £5, just search for HC-06 Bluetooth adapter but be aware that it comes with and without the mounting PCB.  The one in the picture comes with the back PCB which handles the level shifting from 5 to 3.3V as the transceiver itself is 3.3V not 5V and the connections are a bit small and difficult to solder to.

The connections are 5V, GND, TX and RX, the baud rate comes set to 9600 but can be changed using a terminal console and AT commands also the name and pass code can be changed, the default pass code is 1234.

Once this was connected to my Arduino I put together a little sketch to simulate some shot data, a loop counting from 300 - 340 incrementing by one every 5 seconds (saved a lot of pellets ;-))

I've did attach the transceiver to the sensor tube (as seen in part6) for a quick trial with the pistol and it worked fine.

Next came a couple of days writing the Android app using the App Inventor site, this is what it looks like
First you power up the transceiver and pair it to your phone, the same way you would any other device then enter the data: pellet weight, the distance between the sensors, pellet name and then press calculate.
Once the calculations have been done and stored you can press the top right button to select the paired device, it shows up as "invor" or similar, if you've not renamed it, I renamed mine "Chrono1"

Once selected press the top left button to connect, when connected the shot data should appear in the Shot, FPS and FPE boxes with the average and max. data showing below.

If you tick the speech box then the FPE value will be spoken out loud to you by your phone, the quality of this function may vary between phones.

Also, I'm not an App developer, this is my first App therefore there could be other issues like screen resolution etc. I wrote this for my Galaxy S4 and haven't tried it on any other phones so I'm interested in any feedback.

It can be downloaded here.

1st Feb 2016 - Link to the AI2 aia file here and the APK file here.

I found another AI2 project I did, the only problem is that when you first start it there is an error but if you press the back button and add the settings and then exit it works OK the next time. you can try it here, AI2 Gallery link to app here

I intend to add other features in the future like multiple speech options and logging shot data to memory etc. it depends how popular it is.

Saturday, 25 May 2013

Chronograph update

Latest project update for 2026 here


When I made the smaller screw on sensor that connected to the PC and fed the timing into a PC application, it got me thinking about different types of display that could be used and after a a good look around the net I came across a couple of options.

The first was a 7 segment LED display, these come in different shapes and sizes and could still be quite portable when added to the sensor.

The only problem with these displays is the amount of IO needed to drive them as each of the segments require driving. I then came across the Adafruit 7 display backpack, which takes all the hard work out of controlling the 7 segment displays.
The backpack details can be found here

The device is based on an Holtek HT16K33 chip that controls the LED segments and connects to the Arduino via the I2C bus and has a library that makes sending data to the display easy.

I bought one of the displays from Ebay and stuck it on the side of the sensor tube then added the code to the sketch to send the value for feet/second to the display after sending the uSecond value to the PC.


This would allow the chronograph to be used in conjunction with the PC via the USB lead or remotely with a battery pack, just reading the Feet/Second value.


Showing the feet/Second would require a lookup table to get the power from the velocity and the weight of the pellet, I suppose with a couple of small buttons added you could enter the pellet weight after power-up but before the first shot it could then alternate between the FPS and the power reading every 10 seconds?.

I then tried it out using my CP Sport Co2 pistol and it looks good.

I then used some of that PVC heatshrink, normally used for battery packs, it's really good as it shrinks using a hair drier and is quite hard when cool but can easily be removed with a pair of scissors or a knife.

Ideally I would have liked to use some clear but I only have red or white but surprisingly the LED shows through the PVC quite well.

Things to think about: -

  • Writing the shot data to EEPROM for later retrieval
  • Adding buttons to allow pellet weight to entered
  • put together a battery pack for remote usage
  • Think about power saving schemes
  • Display battery power on power-up?
  • Who knows?
Nano Sketch can be downloaded here you can use it with or without a PC, if you want the PC application let me know in the comments, it's still very BETA.
Fritzing file here.

More about the second option I found later.....

Monday, 13 May 2013

Cheap Colour TFT with the Arduino

As long as I've been working with Arduinos I've always wanted to use a colour TFT to display stuff but they were always quite expensive, well now I've found a quite cheap one that's relatively easy to programme. Ebay link.

I read a blog article from http://tronixstuff.wordpress.com/2013/04/26/tutorial-arduino-and-ili9325-colour-tft-lcd-modules/ about using an inexpensive TFT from Ebay (China) it costs about £7 inc. delivery, worth a try.

www.tronixstuff.wordpress.com is definitely worth a visit as there are loads of Arduino tutorials to read.

There's already a library available from another site http://henningkarlsen.com/electronics/library.php?id=51 called UTFT.rar, download it and install to your library folder.

The library comes with three fonts, small, large and a seven segment calculator type font, unfortunately the seven segment font doesn't come with a decimal point so when you use it to display floating point numbers with the printNumF command it doesn't display a decimal point just some small random characters.

I contacted the Library author Henning Karlsen and he was very helpful in pointing out information for creating your own fonts and some already created extra fonts. http://henningkarlsen.com/electronics/r_fonts.php

A couple of things to be aware of though: -
  • The fonts use up memory, quite a lot of memory for the full fonts so be aware.
  • The code includes all the drivers for all the various chipsets, to reduce the memory edit the memorysaver.h file in the UTFT folder and remove the commenting from the lines for the chipset you don't need.  If you don't do this then some examples compile to more than 32K.
  • On the screen I got, using the UTOUCH library from the same site as the screen library, the touch functionality wouldn't work.  I'm in contact with the supplier to try and understand if it's an issue with the screen or the library.
  • There is also an SDcard socket on the back of the PCB but I've not yet tried it out.
The library includes the ability to draw recangles, circles etc and I noticed a new geometery library that will let you draw arcs, pie slices.

Overall I think it's well worth the £7 even if the touch doesn't work although it would be fantastic if it can be made to work.

The memory limitations are a pain when you want to use a large font size but if it's a must then you could look at using a Arduino Mega or the Chipkit Uno equivalents, I beleive they have more memory to play with.

Finally, some pictures for the TFT, I've modified my Chronograph code to run with the TFT screen, the only issue is the lack of a decimal point in the seven segment font but I should be able to modify the font source to add one.

 
 
I've also started work on a shield for the UNO so that it can be plugged directly on top and also included five switches along the bottom, using a resistor ladder network so they only use up one analogue input.
 
If anyone interested in a shield then just let me know in the comments.
 

Thursday, 25 April 2013

Chronograph - Part 6

Latest project update for 2026 here


Working on this project has really got me thinking and now I have my air rifle I needed to get something finished and usable ASAP before I started to tune the rifle, I don't want to go over the legal limit.

Whilst thinking about the total cost of the parts to make a usable chronograph, the one most people buy is £50, I had the idea of removing the LCD and just using the serial link to the PC.

So I thought about strapping an Arduino Nano to an aluminium tube with a 1/2" UNF thread so that it would fit on the standard silencer adapter, this would make it very stable.
I decided to use the Nano because there wouldn't be the need for a battery to power it, the USB lead would carry power and data back to the PC, people would also be able to programme them without having to buy the serial/USB interface.

Marking out the sensor distance
Tube screwed into the silencer adapter for my rifle
Fully assembled prototype with a foam spacer
Finished part attached to the Air Rifle
I used some thin but very tough heat shrink sleeving the same as that used to hold battery packs together on remote control cars



Below is a screen grab of the PC software (Ignore the FPS value, I'd forgot to change the calculation to 60mm spacing instead of 100mm)
Now for some more testing.


Saturday, 20 April 2013

Chronograph - Part 5

Latest project update for 2026 here


Files
Here are the various files etc. if you want to make your own Chronograph.

Rar file with the files required to make the PCB using Seeedstudio.com are here

A copy of the sketch I'm currently using with my PCB is here, please note it's definitely a work in progress, use at your own risk.

Please note that the connections to the LCD are not the standard ones, I have changed them to suit my PCB requirements.

Items needed
8x2 LCD (16x2 can be used, just modify the code to suit) from here
5V Step-up converter from here
Arduino Mini Pro clone from here (check the pin out is the same prior to buying)
Switches from here

Circuit diagram

PCB

Friday, 19 April 2013

Chronograph - Part 4

Latest project update for 2026 here


The PCBs arrived, at last!

They look good and after assembling the parts, the design works, well I've not tested the 868MHz transceiver yet but the LCD display connected to the Arduino Mini Pro clone works fine and when connected to the sensor fitted to the gun all seems to be OK.

I used a scope to check the calibration of the value sent from the Arduino and it looks pretty good.
Front View - LCD and switches


Back View - the Mini Pro plugged in
Various part plugged in
The PCB is essentially a carrier board for the processor and the display and the 5V step-up converter.
Using an oscilloscope I fired some pellets with my pistol through the sensor tube and compared the timing reported by the Arduino, via serial to the PC, with the measurements taken with the scope.

Scope display showing time between pulses
As you will see from the picture the timings are not exactly the same but this could be due to rounding or the fact that the Arduino only has a 4uS resolution for the micros() function.  I will do some calculations to see what the effect on the final FPS or FPE values would be.



Thursday, 28 March 2013

Chronnograph - Part 3

Latest project update for 2026 here


A bit slow going but I've got a bit further with the Chronograph, I had to enlarge the hole at one end by about 1 mm so it would fit over the end of the barrel (thanks Les), then I actually fired some pellets through it and so far it looks to be making reasonably sensible measurements, of course until I can compare it to another chronograph then I can't be completely certain of the accuracy.

As usual, I end up thinking of all the different ways I could achieve my goal .... and then have a go at most of them at the same time: -

  1. Remote transmitter attached to the rifle, using a receiver with a graphical LCD to display the results.
  2. Remote transmitter with a normal 16x2 LCD receiver.
  3. Remote transmitter with a Jeelink/Jeenode connected to a PC running an VB application to display the data.
  4. As no. 2 but with a smaller 8x2 LCD.
  5. As no. 4 but with  no transmitter and the whole thing mounted on the sensor tube.
I've had a dabble at most of the above with some good results, the Jeelink connected to the PC and using a VB application worked quite well.

Images below showing the received data from the Jeelink.  I also receive the transmitter's battery voltage level.

To determine the energy generated by the rifle/pellet you need to know the weight of the pellet in Grains, this can be adjusted to cater for the .177 pistol or the .22 rifle or different types of pellets.

Results from my 34 year old Diana air rifle

Results from my CPS CO2 air pistol with fresh Cartridge
I saw a discount offer on Hobytronics for their display range, this gave me an idea for the Arduino Nano I had laying around in a drawer, I bought an 8x2 LCD and connected it the Nano, a bit of a mess but it worked OK for a prototype.
Arduino Nano connected to an 8x2 LCD
This was linked to the sensors and also two buttons to allow for the pellet weight to be adjusted up or down prior to the first shot being taken.

This package was quite neat and small so I got to thinking about mounting the whole thing on the aluminium tube using a step up converter so I could run the Nano Mini Pro (Smaller) at 5V (16MHz) from one, or two 1.5V cells or a small lithium ion cell.

To do this as neatly as possible I decide to dust off the Eagle PCB layout tools and do a PCB, after all it's only around £10 for 10 off 5cm x5cm PCBs.

Rendered view of the PCB with LCD

Rendered view of the back of the PCB showing the Mini Pro and RFM12B

It's a bit of a squeeze but I got the LCD on one side the Arduino Mini Pro on the other and even got an RFM12B 868MHz transceiver on there, I couldn't help myself, I also added a couple of spare switches at the bottom of the display and a space for a temp. sensor (DS18B20) this will give me some alternative uses, remote temp monitoring/display etc.

There is also the 5V step-up converter on there, it's one of these.

More to come ....

New Accessories for the AirChrony S3

With the increasing abilities of AI it has become so much easier to take an idea to a finished, working item in a really short time. I was t...

Popular Posts