Thursday, 9 April 2015

Finished Shortcut Keyboard

The Acrylic tops and bottoms arrived yesterday for the keyboard so I thought I'd update the blog with a picture of the finished item side by side with the concept design,
I must say I'm quite pleased with it, the holes actually line up with the buttons :-).

Finished article
3D concept design


Saturday, 14 March 2015

Time saving Keyboard shortcuts for the PC

It's been quite a while since my last post but sometimes life throws you a curved ball and changes your focus for a time.  Anyway this little project came about due to a friend at work having to replace his PC keyboard but not being able to find one with single pre-programmed buttons for copy and paste, as did his current one, and I said " I can do that with an Arduino".

So the idea was to use an Arduino Leonardo clone that can emulate a mouse or keyboard and then program the keyboard sequences to be triggered from the press of a button.  Initially I was going to do just the copy, cut and paste but as I was going to use the standard 5cm x 5cm Seeedstudio PCB service I thought I could add some more buttons.

I decided to do a PCB with six momentary push buttons, mainly because they were what I had in my box of components.

The botom row, blue, black and white buttons are copy, cut and paste respectively and I assigned the red, amber and green buttons to change the background colour of Excel cells to match the button colour (this was a request from another friend at work who uses Excel a lot)

The buttons could have any combination of key-presses assigned to them I suppose, 'Ctrl+Z' for undo etc.

Circuit Diagram

The connections are a bit out of order due to pinswaps on the PCB!

I used the "Sick of Beige" 50mm x 50mm PCB template from Seeedstudio as I intend to use their Acrylic laser cutting service to create a top and bottom box to house the keyboard.
Keypad Concept

Due to space availability I placed the Leonardo PCB on the underside of the PCB, this did mean that it was a bit fiddly soldering the pins for the Leonardo as I didn't want any pins sticking through the PCB into the body of the switch so solder the pins first and make sure they are flush with the button side surface, NOT protruding.
Make sure the pins don't go too far through.
The pins can be trimmed

Everything is powered by the USB lead plugged into the PC and there is an optional SMD or 3mm TPH LED on the button side that connects to a PWM capable IO pin, I set this to indicate power at 7% duty cycle and then pulse to 78% duty cycle for 50mS whenever a key is pressed.

I've ordered the acrylic tops and bottoms from Seeedstudio but they've yet to arrive.

All the files, including the Eagle schematic, PCB, gerber files and the sketch are here.

Wednesday, 2 July 2014

External Wireless Temperature measurement

This project was required so that I could monitor the temperature inside a temporary lean-to / greenhouse I made to winter some frost hating plants in.

There are basically two modules, the transmitter and the receiver.
Receiver
Transmitter
The transmitter uses a Jeenode from Jeelabs to read the temperature from two DS18B20s, one inside the greenhouse and the other in the form of a probe placed outside the greenhouse to measure the ambient temp.

The receiver uses one of my own PCBs which is essentially a jeenode with an added uSD card slot, the display is from Jeelabs and is designed to sit directly on top of a Jeenode but it's not the cheapest display you can use.  The receiver can also be made using a standard Jeenode instead of my PCB.

I run the transmitter off some old lithium rechargeable 1850 cells taken from an old laptop battery, the receiver also runs on a lithium battery from a mobile phone but you can use any batteries you like from 3 to 5 V.

The battery voltages of both the transmitter and receiver are monitored and displayed on the LCD, the code for the battery monitoring was taken from the Jeelabs blog here and the sleep functions were also from the same post using the Jeelib libraries.

Sketches can be downloaded for transmitter and receiver.

Any questions or comments, feel free.








Monday, 27 January 2014

Monitoring Data with the Arduino and ThingSpeak

In conjunction with my last post I thought I would monitor my hot water tank to track the temperature variations throughout the day, mainly to use the temp change to identify when someone has taken a shower and judge the need to heat the water up so there is some left for bed time (this will be done automatically by the Arduino code).

First I searched around for a free cloud data storage solution, I'd used Pachube/COSM previously but COSM had changed hands again and I found it was always a bit unreliable for me anyway.

I tried Nimbits.com first of all but found it quite difficult to get the UNO working with the code on offer and the help information was a bit of a mismatch with sample code not being up-to date with the latest API, having said that the forum was well supported and I got quick answers to my questions.  The main problem is that when I got it working my data on the graph contained random values which made the chart useless, I thoroughly checked the values that I was posting and the spurious data was not coming from me.  One plus was that they had an Android app on the Appstore so viewing the data was easy.

I then tried ThingSpeak, getting the UNO/Ethernet shield up and running was a lot quicker and I was posting temperature values within minutes.  Another nice feature was the ability to clear the current data from the channel, ideal when logging data during development that's not relevant to you actual job.

The chart looks nice, updates continuously and if you hover over the points a nice panel pops up with the data point details.

I've only just scratched the surface of ThingSpeak so there's still loads of stuff I just don't know about but it definitely enabled me to get up and running very quickly.  One thing missing from ThingSpeak was a dedicated Android App but after a couple of hours with App inventor I was able to put together a usable App that lets me view the data whilst out and about (sad I know).
It is also possible to embed the charts into other web pages using an Iframe.
There are plugins that can be created, there is a sample of a Google gauge but I still can't get it to work.  The forum doesn't seem to be as well supported as the one on nimbits, maybe there are less users.

The App inventor source can be found here. (updated to appinventor 2, import the aia file to app inventor 2)
The APK file can be downloaded here.
After running just type in your channel number and read key and click "set" and then "update"

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, 6 November 2013

Another update to the OLED 1602 Library

I've made a change to the 1602 OLED library and also added a new function.

I've modified the sendString() function to now include the cursor position data and added a new function called sendFloat(), this allows you to send float data values, such as temperature, to the LCD ant it gets converted to a string before being sent to the display.

The sendFloat function takes the following parameters: float value, minimum length inc. decimal point, number of positions after the decimal point, the start column position, the start row position.

I've updated the library in my GitHub repository here

Please note that older sketches using the sendString() function will not work with the new library and will need to be altered.

/*
Demo sketch to display Strings and float values 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
 */

#include "Wire.h"
#include "OLedI2C.h"
OLedI2C LCD;
float digit;

void setup()
{
  Wire.begin();
  LCD.init();
  digit = 21.6;//This would normally be the float value returned from a temp sensor or other sensor
}
void loop()
{
  LCD.sendString("Temp",0,0);// now includes the cursor position data (col, row)
  LCD.sendFloat(digit,5,2,7,0);//Send the string to the display
  while(1);
}

Saturday, 26 October 2013

Updated wide.HK OLED 1602 Library

Thanks to Nathan from http://nathan.chantrell.net/ there is now a scrolling function in the Library.

This allows you to specify some text, the line to display it on and the speed to scroll it at.

Sample code by Nathan (modified by me to remove the scrollString function as it's now in the library).

/*
Scrolling demo on the OLED 1602 display from Wide.HK.
Uses Library by Phil Grant http://www.gadjet.co.uk
Scrolling by Nathan Chantrell http://nathan.chantrell.net
*/

#include  "Wire.h"
#include  "OLedI2C.h" // http://www.gadjetsblog.blogspot.co.uk/2013/09/oled-1602-display-and-library-for.html

OLedI2C LCD;

void setup() {
Wire.begin();
LCD.init();
LCD.clearLcd();
}

void loop() {
scrollString("Slowly scrolling text on line one...",0,200);
scrollString("and faster on line two...",1,100);
}


Download here: Updated OLED 1602 Library

Now on GitHub

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