Showing posts with label Bluetooth. Show all posts
Showing posts with label Bluetooth. Show all posts

Monday, 9 May 2016

Chronograph completed - Finally

As anyone who's read this blog before will know, there's a common theme throughout, the DIY Chronograph I made for measuring the speed of an airgun pellet.

Well since getting a 3D printer I've finally managed to finish off the project and put it in a case, it's not often I actually put things in a nice case.

The first case with the Nokia display, it was a bit clunky and easy to break, when I dropped it that is!

Second attempt, this is the one I've been using.  This one uses the Bluetooth module to talk to an app on the phone here
Collection of bits held together with heatshrink
The final one, this one contains all the gubbins from the shot above inside the cover.
The end that screws on with the USB connector below and the front
view with the on/off switch and battery charge connector
Side View

This one uses the Bluetooth adapter and connects to an app on the phone and has an internal lithium Ion battery than can be recharged using an external supply and charging module, you can leave out the battery and use the USB connector of the Nano to power the chronograph from your laptop or a battery pack with a USB power output. (if you do this then the switch doesn't do anything)

The enclosure is essentially two parts, a carrier, that holds all the electronics and a slide on cover.
Both parts are a push fit onto the aluminium tube (16mm Dia. x approx 100m long)

Parts list: -

Item

Source

Approx. cost

3D printed enclosure - Thingiverse www.3dhubs.com
www.shapeways.com
£10 - £20
Arduino Nano (could be mini pro etc.) Ebay £2
Slide switch Ebay£2
Battery (Turnigy Nano-Tech 600mah 1S 3.7v 35-70C Lipo E-Flite) Ebay £5
Aluminium Tube - 16mm OD Ebay £5
Bluetooth Module Ebay £4
3V to 5V converter (NCP1402-3.3V STEP-UP BREAKOUT) Proto Pic £4
JST wired plug connector Ebay £3 for 10 off
IR Emitter x 2


Ebay
Farnell
RS Components


RS= £2.25, 5 off
IR Detector x 2 Ebay
Farnell
RS components
RS=£5, 5 off
Arduino SketchHere Free
Android App apk file (from Aptoide store) Here Free

So around £44 to put together, £24 'ish if you can 3D print your own enclosure.
You could also do away with the battery and 3 to 5V converter if you powered it from you laptop USB or battery with a USB socket on it.

More images

Battery and PCB modules in place with the tube

Barrel end showing the USB connector

Front end showing on/off switch fitted
Inside the cover

The Bluetooth module wired to the Nano

Nano and BT module in the carrier

Everything wired up... nearly. 3 to 5V converter top left under the battery
Tried and tested and working OK, the app works fine and I'm looking to add a graphing function so you can see the performance over a string of shots.

Fritzing schematic

As usual feel free to ask questions and comment below.

Tuesday, 1 October 2013

PCBs for mounting the Chronograph sensors

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.


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  

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


Friday, 5 July 2013

Finally the DIY Chronograph meets Android

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.

Testing LoRA transmitters and receivers

I've wanted to have a play with 868MHz LoRA transmitters for some time now but never got around to it until,  a while ago, I did an hard...

Popular Posts