Showing posts with label arduino mini pro. Show all posts
Showing posts with label arduino mini pro. Show all posts

Tuesday, 21 January 2014

Central heating control using SMS and the Arduino

One of the things I set out to do after discovering the world of Arduino was to make myself a clever controller for my central heating but, not unusually for me, my focus wandered here and there finding new and probably easier things do do with all these little gadjets.

I got back into air rifles which meant most of the blog, over the last few months, has been full of my various versions of a chronograph! I've tried loads of different displays and even Bluetooth to get the speed of the pellet to my phone.

Anyway, the weather turned cold again and thoughts drifted toward the central heating again but this time something a bit simpler, something to switch the heating or water on for a period of time without leaving the comfort of my arm chair.... yes I'm that lazy.

I'd dabbled with the 868MHz RF links, Bluetooth links but after coming across a post on nathan.chantrell.net I found a source for a cheap GSM modem.

My original thoughts were to bow to the latest fashion of "IoT" but my dealings so far with the Arduino and Ethernet interfaces had been less than perfect, quite randomly the data flow would just stop and I never got to the bottom of it.  The SMS solution appealed because I don't need a data connection or even a smartphone and can switch the heating on before I get home even if the raspberry pi and the arduino etc. are switched off when I'm on holiday.  The SMS route seemed like a good solid proven technology.

The Modem was an ex-equipment modem from some old BT security line monitoring equipment (search "redcare GSM" on Ebay) and I picked up mine for £4 including delivery, not too expensive, the SIM card was an old Giffgaff card from a previous phone which still had few quid in credit and my contract phone had unlimited texts ... so I thought I would give it a go.

The overall system laid out on the desk
The modem came with an external antenna and the 2x50 header still attached to the PCB which was quite lucky because the connector is a 1.27mm pitch IDC on a ribbon cable, to get connections to the modem I used a hot air gun to sweat off the SMD connector from the PCB.

I made the connections to a standard pitch connector so I could interface to the rest of the system, the pins are very small and it wasn't easy.

The idea was to connect the the relays in parallel to the existing relays in the controller so that the current timer based operations would continue but I could switch on the heating or water remotely.  The relays would be switched by the Arduino Mini Pro via a soft serial connection from the modem, there was also an I2C OLED status display and a remote temperature sensor for the hot water tank.  Initially the temp sensor would just monitor the water temp and be sent to the phone on request but I intend to use it later to give a finer control to the water temp (I might log temp to and SD card for a while to get an idea of usage).

The SMS control takes the form of a simple short message coded for heat or water and a duration, heat on for an hour would be H60 whereas heat for 2 hours would be H120 ... I said it was simple. Hot water just uses a "W" instead of a "H".  There is also the function to request the temperature of the water, this causes the Arduino to send an SMS containing the temperature of the water.


The control is done by an App on my Android phone but could be done just as easily by sending a text normally or there are some automation apps that would allow a pre-defined text message to be sent from an icon on your home screen.  Actually I suppose you could control your central heating system from within an app such as Tasker, Tasker would allow you to setup timed text messages to carry out the operation, this would only make sense if you get free text messages though.

The Arduino code checks the incoming phone number to make sure it matches the one(s) you allow to control the heating and the response to the hot water temp request is sent back to the requestor's phone.

I'm also thinking of connecting in to my alarm system to send out an SMS when it gets triggered.
That's all for now, I'll post a link to the Arduino code and the Android app in the next post.

There's plenty of technical information on the modem and links to a SMS messaging library on nathan's blog post here.

Please feel free to ask any questions or make suggestions in the comments below.

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


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, 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