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

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

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.

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