Saturday, 25 May 2013

Chronograph update

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.
 

Hot water control using a Raspberry Pi Zero W

Following on from the first blog about the hot water heating control here's what I put together for the mounting. Whilst looking for a...

Popular Posts