0

I've recently gotten into Arduino, due to a friend asking to be part of a project. The project requires a few 24V LED strips to be controllable via PWM, probably over MOSFETs (we have someone else in the team that will look after the electronics, I will be mostly responsible for the code) and also various sensors to measure the environment. However, the project should also include a touchscreen that will be used for programming these LEDs based on time and date, and displaying the data from these sensors, or program further events based on their input.

As far as I understand it should be possible to drive a TFT touchscreen via I2C? I've done some googling over the past two hours or so and could barely find any information about what screens to use for such projects, no tutorials, nor if there are any libraries available.

Is it doable to do a project of this magnitude with a Uno R3, or should I consider a Due or Mega?

I have a touchscreen shield right here, but it leaves me with only one PWM and one analogue pin if I don't plan on using the SD card that is on its back.

Maybe I'll find the answer myself, but I have literally only joined the Arduino/microcontroller fun a few days ago and am reading up on the whole topic in a 'for dummies' book which is very interesting, but it only touches on I2C at the very end and I don't want to confuse myself too much by jumping ahead and reading about stuff that doesn't directly answer my questions. So I turn to you guys for at least pointing me in the right direction on what I should read up on or linking me to tutorials.

Also, if you guys have any books to recommend on the topic I'll be glad to take recommendations.

Thanks in advance

1

A TFT touchscreen actually normally consists of two completely separate items:

  • TFT Display
  • Touchscreen and optional interface chip

While you can get both of those together on a board with both using I2C it is quite rare. It is far more common to find boards with either SPI or 8- (or 16-) bit parallel interfaces for the TFT screen, and SPI (or sometimes 4 channel analog - a direct connection to the touch screen itself) for the touch screen.

I2C is really only used for very small screens. The slow speed of the I2C protocol means that updating the display is very slow, which results in very poor performance for anything bigger than, say 128x128 pixels. It's usually used for things like small OLED displays rather than larger TFT displays.

Touchscreens with I2C are normally capacitative rather than the cheap resistive, so tend to be a little more expensive and harder to work with. The most common touch screen chip, the XPT2046, is SPI.

Fitting everything you want to do into an Uno is going to be tight, and not just because of the number of IO pins a display usually demands. Working with displays usually means lots of graphics (icons, symbols, fonts, etc), and that means a lot of flash memory. A Mega2560 would be a better choice for that if you want to remain with 8-bit.

However better graphical results would be obtained using a more powerful board. The Arduino Due, with its 32-bit ARM chip, would allow you to do much more graphical manipulation, such as drawing nice graphs etc.

My personal preference, though, is to use a PIC32 based board and the chipKIT core, coupled with my own powerful DisplayCore library. But then I'm biased.

  • I see, thanks a lot for your comment. I've also found out that SPI is more suited for our targeted screensize. – Streamline Feb 8 '18 at 21:25
  • I think for now I'm going to stay with Arduino since I'm still new to all of this, and having so many tutorials and books at my disposal is great until I understand better how all of it works. I've already ordered a Mega since I already understood that it's going to be tight with I/O anyway if we want to control x amount of LED strips, tho I do also know about shiftregisters capable of PWM such as the TLC5490, which is also underway. Mega will be nice for prototyping anyway. – Streamline Feb 8 '18 at 21:32
  • Absolutely, though I have to plug my stuff when I can ;) The TLC5490 is nasty to work with. The TLC59116 is far far better. – Majenko Feb 8 '18 at 21:34
  • In what way is it nasty to work with? I'll look into the TLC59116 too. – Streamline Feb 8 '18 at 22:34
  • From what I remember the protocol is custom and very awkward to use. The TLC59116 is just plain I2C. – Majenko Feb 8 '18 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.