TFT LCD Keyboard

Hello there

I think that it is finally time to show what I’ve been working on now for ages – On and off when I had some additional time available.

For my automated irrigation system I need a HMI or a human machine interface. I started off by first purchasing a 5″ TFT LCD from ebay with a shield for my Arduino Mega to be able to interface with the display.

I never really worked with anything else except for the Arduino UNO, the Nano and the Mega so I thought that the Mega should have enough flash memory to hold a program to do what I wanted to do. I am however starting to doubt that at this stage 🙂

The program size is hardly my main concern. I soon realised that the Arduino Mega’s clock speed of 16 MHz was waaaaaaaay to slow to drive the LCD for what I wanted to do with it. So I started venturing into ARM based boards – i.e. say hello to the Arduino DUE. The Due runs as a clock speed os 84 MHz which is 5.25x as fast as that of the Mega and it has double the program memory available.

So on I went to purchase my Arduino Due and a shield that I required from ebay. After this I did a little comparison to view the difference the clock speed makes when driving the board:

I then started working on a keyboard input interface that I will require to program names and schedules into the system – still a long long way to go… sigh.  So a keyboard could not be so bad or difficult to make, nay, a keyboard that enables lower case and upper case characters could not be so difficult to make, nay, a keyboard that utilises extended ASCII code to insert currency symbols and more, nay, that could not be that difficult to make…. could it?

Turns out that Arduino doesn’t support extended ASCII code and neither does the UTFT library that I used to drive the display. So I had to come up with a plan. I was able to get the keyboard working the way I wanted but it took forever – please keep in mid that I am not a coder so this is not as easy a feat for me.

What I did was to create another font to be able to display the special characters that I wanted to display. I then cross referenced the characters to another “Special Character Trigger” array which was used to trigger a change in font to be able to display what I wanted to display.

I was putting the keyboard through its paces for the past few nights and it seems to be working except that I may need to redo my calibration of the touch panel on my display. But enough of me talking about it, please see the video detailing the operation below:

Next up I will start working on the menu structure and some other things. I already started playing with some sensors which I would like to incorporate into this project. Sensors that I would like to include is a GPS sensor, temperature, humidity and barometric pressure. Also to be included is a SD card module to save the setup to an SD card for data logging purposes and to have a local copy of the data available.

One thing that I must still mention about the Arduino Due driving the display is that yes, it is a massive improvement when compared to the Mega but it still isn’t great. So moving forward I will probably be looking at driving the display with an Raspberry Pi. I’ve never coded in Python so I probably won’t be jumping onto this anytime soon. I will most likely keep on using the Arduino DUE to proof test the functionality and the system before moving over to a Raspberry Pi based display driver.

You will notice that when I redraw the keyboard then there is a delay that can be noted. But let me know what you think and I hope that you enjoyed.

Some more pictures that shows a bit more detail:

2 - Upper Case

Upper case keyboard – Initiated using the “A..” button at the bottom left

1 - Lower Case

Lower case keyboard – Initiated using the “a..” button right of the “A..” button

3 - Special Char 1

Special characters keyboard 1 – Initiated using the “123” button left of the space

4 - Special Char 2

Special characters keyboard 2 – Initiated using the “#+=” button right of the space

5 - Special Char Demo

Just displaying some special characters

7 - Key highlight

Showing the key highlight. The white highlight is better visible when you observe it directly.



Tagged with: , , , , , ,
Posted in Uncategorized
One comment on “TFT LCD Keyboard
  1. Elecrom says:

    Interesting ! btw … coding in python is quite simple.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: