Tuesday, 1 October 2013

PCBs for mounting the Chronograph sensors

Latest project update for 2026 here


I've not really done much on the Chronograph for a while but I thought I'd have a go at the latest PCBs I'd ordered.
When I mounted the LEDs originally I used some Veroboard.


This solution was quite fiddly so I laid out a PCB that would allow me to use SMD resistors for the IR LEDs and detectors and not require the wire links that I needed for the Veroboard.

I was also using some Bluetooth modules for connecting to my android smart phone, these were difficult to solder to as they are designed as surface mount modules.  It was cheaper to buy the modules without the mounting PCB so I created a 50x50mm (Seeedstudio standard) PCB with the two LED/detector mounting boards and the Bluetooth carrier board.



With the LED board I was able to create some long solder pad contacts to solder the legs to rather than using through hole technology which would've caused the legs to short out on the tube.  I did the same thing for the connecting pads.

The mounting PCB for the Bluetooth was just a carrier board with an LED to indicate the connection status, this could be left off if not required.

Unfortunately I ordered the incorrect Bluetooth module, I made the carrier PCB for the HC-06 module but ordered an HC-05 by mistake, the HC-05 can be operated in both master and slave mode but requires a button input to set it into AT command mode whereas the HC-06 is in AT command mode until paired, therefore it's easy to configure the baud rate, pass code and name using a terminal programme on the PC.

The HC-05 also uses a different output to indicate it's connection status, hence the additional wire on the PCB, this isn't required with an HC-06.

For those using Jeenodes I laid out the connector so that it would plug on the end of a Jeenode FTDI connector and work as a serial link, not tried it yet though.......

The EAGLE PCB design files can be downloaded here, feel free to use/modify etc.
Link to the Bluetooth module on Ebay here.


Sunday, 29 September 2013

OLED 1602 Display and library for the SSD1311

Following on from the last post, the OLED 2 line 16 character display arrived from Hong Kong.




The display uses I2C to connect to the host and will work at 3.3 or 5V so is ideal to use with an Arduino board.

The supplier WIDE.HK supplies some sample code to get it running in the form of a QR code on the packaging that links to the the code and a couple of PDF datasheets.

The code uses a long winded method to initialise and write to the display, but it gets it working.

I have been thinking it was about time I learned how to create a library and this gave me the reason to give it a go, as well as not being able to find a library for this device anywhere on the web.

The very basic Library can be downloaded here, please remember this is my first attempt at creating a library, it works but I imagine it needs more functions adding before it becomes very useful.

Library updated 7/11/13 see here.

Here is the demo code I wrote using the library: -
/*
Demo sketch to display text on the OLED 1602 display
from Wide.HK. This uses a Lbrary that I've put together
containing some basic functions.
The I2C Address is set to 0x3C in OLedI2C.cpp
Phil Grant 2013 www.gadjet.co.uk

Sketch updated to work with new library 7/11/13
*/
#include  "Wire.h"    
#include  "OLedI2C.h"  
OLedI2C LCD;
void setup()
{
  Wire.begin();
  LCD.init();  
}
void loop()
{
  //Set cursor position to col and row, top row is 0, first col is 0
  // no longer required LCD.cursPos(4,0); //(col,row)
  LCD.sendString("Gadjet's", 4, 0);    //("String", col, row)
  // no longer required LCD.cursPos(6,1); //Set cursor position to col and row 
  LCD.sendString("BLOG", 6, 1);   //("String", col, row)
  while(1);
}

As usual, feedback welcomed, use the comments if you found this library useful ...... or not.


Monday, 23 September 2013

Microduino OLED Display

Having read about the Microduino on Kickstarter I thought it looked familiar and tracked down where I'd seen it before, on a website http://hobbycomponents.com/index.php/dvbd/microduino.html unfortunately there seems to be a bit of a dispute between Hobbycomponents and the Microduino people so they aren't selling them any more.

They are offering you the chance to win one though because they've got loads of stock left.

Anyway I was lucky enough to get one of the OLED LCD displays before they stopped selling them, that's the reason for the post in the first place.

The display http://hobbycomponents.com/index.php/dvbd/microduino/microduino-oled-display.html looked like a good display for a reasonable price and I liked the promise of really good contrast and low power consumption when compared to other non OLED illuminated displays.


The display uses I2C to communicate with the Arduino so not many pins required to drive it and I really like the fact that it has some good solid mounting holes on it, so many displays out there seem to forget this requirement.

The first thing I needed was a library to get it up and working and  tried a couple before I found one that worked, the library covers a vast number of LCD controllers and allows the use of loads of different fonts.

The library can be found here https://code.google.com/p/u8glib/

The library does use a chunk of available flash memory but there's still some left over for your code but you might struggle if it's a huge application, I believe there are other libraries out there and they may use less resources.

Using the examples available and after adding the library you'll need to un-comment the line for this display relevant to your display, I used this one: -

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE); // HW SPI Com: CS = 10, A0 = 9 (Hardware Pins are  SCK = 13 and MOSI = 11)

A modified version of the hello world example with a simulation of what the Chronograph display would look like can be downloaded here.

I really like the look of these OLED displays and I've found another one on ebay I like
It's an OLED version of the classic 1602 LCD, now I'm just waiting for the postman to get here from China!

Thursday, 22 August 2013

MegunoLink serial monitoring software Part 1- Graphing Temperature data

Some time ago I received a newsletter with some information on a piece of software called "MegunoLink" this software is basically a Swiss army knife for dealing with serial Comm's from the outside world.

I've been using it for a couple of weeks now and it's capabilities are wide ranging so I'm going to break up the review into bite-size chunks.

There is a 7 day fully functional version of the software you can download to see if it meets your requirements.

The software is modular and has a separate screen for each of its features, here's a few: -
 - Manage the serial ports, you can have multiple ports setup.
 - Monitor the raw data received by the comm port.
 - Create buttons etc. to trigger the sending of data out of the port.
 - Create a Google map of the location received over the serial port.

The most useful features for me were the ability draw plots based on X,Y data or time based data, using the PC clock for the X coordinate.

The premise of the software is that the source data includes the structuring information as well as the actual data.

The example I'll use is my application for monitoring two temperatures and a battery level from a remote transmitter via a receiver connected to the PCs USB port.

Although the website gives plenty of examples they didn't quite match up to my requirements so there was a bit of trial and error until I got it working, I also sent a couple of questions to the support which were promptly answered.

The task was to plot two temperatures over time and also the remote battery level.

Both of these required a timeplot setting up, first the Arduino code: -

 //Send data to megunolink graphing software on the PC
  Serial.print("{TIMEPLOT:"); *This tells Megunolink that the following data is for the timeplot graph
  Serial.print("Temperatures"); *This is the name of the channel, this will appear on the selection dropdown at the top of the graph
  Serial.print("|data|"); *This tells the timeplot that the data is a single datapoint
  Serial.print("Inside Temp"); *This is the name given to the series line on the graph
  Serial.print("|T|"); *This tells the software to add a timestamp to the datapoint, from the PC time.
  Serial.print(inTempC,1); *This is the actual data to plot on the graph, to one decimal place.
  Serial.print("}"); *This is to close the data packet.

The actual message sent over the serial port looks like this

{TIMEPLOT:Temperatures|data|Inside Temp|T|inTempC,1}

I also create a similar message for the second temperature

  Serial.print("{TIMEPLOT:");
  Serial.print("Temperatures");
  Serial.print("|data|");
  Serial.print("Outside Temp");
  Serial.print("|T|");
  Serial.print(outTempC,1);
  Serial.print("}");

This sends the outside temp. to the Timeplot using the same channel name but a new series name, this way both series will appear on the same graph when you select Temperatures from the dropdown box in the Timeplot window.
Below you can see an image of the graph, which was exported from MegunoLink.


You can also open multiple windows that appear on separate tabs, which you can name, so you can have one Timeplot tab for temperatures and another one for battery level, this helps because changing the channel selection from the dropdown box from Temperatures to Battery level has some confusing results, the trace drawn so far for the previously selected channel stays on the chart but no longer plots any points and the newly selected channel starts to draw it's data points.
Along the top of the chart there are a row of option buttons to edit the properties of the chart and any series lines, just make sure you've selected the series before editing it.
left to right - select the serial port, select the channel, edit chart, view summary of data, display/hide legend, run chart like chart recorder, edit series properties, remove single series, remove all series, zoom, pan, zoom all and zoom last

I'll list some more features in the next post, there are quite a few left yet.


Wednesday, 24 July 2013

Monitor Temperatures on your phone with an Arduino

After using the Bluetooth link to connect to the Chronograph I thought I'd use it to remotely monitor some temperatures, mainly because my fridge was acting up.

I connected the BT interface to the Arduino (my own version), this is quite easy because you just connect the TX from the Arduino to the RX of the BT interface and the sketch just uses the serial.print command.  This means you can test it out on your PC using the serial console in the Arduino IDE.

For testing I just make a small sketch to continuously output two random temperatures.

long randNumber;
long randNumber1;
long randNumber2;
long randNumber3;

void setup() {
Serial.begin(57600);
randomSeed(analogRead(0));
}

void loop() {
randNumber = random(5, 20);
randNumber1 = random(1, 10);
randNumber2 = random(5, 20);
randNumber3 = random(1, 10);
Serial.print(randNumber);
Serial.print(".");
Serial.print(randNumber1);
Serial.print("A");
Serial.print(randNumber2);
Serial.print(".");
Serial.print(randNumber3);
//Serial.print("A");
delay(10000);

}
The sketch outputs two decimal values delimited by the 'A' character, you can use any I suppose.


Within the App there is a settings screen where you can set Farenheit, enable the raw data to be seen on the main screen and edit the two temperature labels to something more meaningful.

I think I'll need to add the ability to alter the rate at which the app checks for data, currently it is 5 seconds, half of the 10 second rate from the arduino

My real world transmitter uses low power and only transmits once every minute and sleeps in-between.

If the transmitter used mains power and was permanently awake then I could request a reading when the app connects

App can be downloaded here or QR code  

Wednesday, 17 July 2013

DIY Chronograph - Nokia display

Latest project update for 2026 here

The Acrylic case arrived on Saturday for the Chrono using the Nokia 5110 display.

I just wired up the display to an Arduino Mini Pro and put the case together to make sure it all fit together.

The Nokia display is on top, the battery on the bottom with the Arduino Mini Pro in the middle.

No I have to fashion a joystick extension, sort out a power switch, build up the sensor tube and figure out to re-charge the battery with out taking it all apart.

Sketch can be downloaded here.
Sketchup and EPS files for the case are here.

Monday, 8 July 2013

DIY Chrono Shopping list

Latest project update for 2026 here


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


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