Advice on touchscreen LCD?

Go To Last Post
24 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

So a friend called me because he had an idea for a product/prototype but lacks the skills to construct anything...

Anyway as I am familiar with AVRs I thought about buying a Mega328 xplained board because it has debugging and go from there. First off he wanted a timer and some buttons so I thought, yeah that's fine, slap in a HD44780 an some buttons. This morning he texted me saying he also wanted some kind of protection from tampering with the settings (enter a PIN/code to access settings) so I thought about adding a keypad. But summing up with buttons/keypad and character LCD I figured I might as well go directly for a touchscreen display?

 

However I've only ever worked with a graphical display once before with AVR and ARM, and it was a bit slow to update the screen (even slow-ish on the ARM) because you had to update the entire LCD every time you wanted to change something.

 

I don't plan on doing any extraordinary graphics on the screen, just a simple menu with some basic settings, some text like a timer counting down and of course a "keypad on screen" for the access PIN. I don't need a lot of resolution (enough to make the keypad on screen) nor a lot of colors, really I guess I could do with monochrome even.

 

Could you recommend me any cheap-ish, widely available touchscreen that I could use for my prototype? (Available on ebay?)

One that I can readily connect to an 8-bit AVR (maybe SPI)?

Maybe one that I can partially update the screen, so I don't have to write to the entire screen to change only a part of it? Or at least that I can update the screen fast-ish (less than 1 second)?

Maybe something where there exists example code somewhere on the internet to start out with?

 

 

Thanks

- Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What pixel (or character) resolution are you looking for (if character then also what font size)? Also mono or colour?

 

Remember that many displays may require you to keep a complete display copy in the RAM of the micro so the limited RAM in the AVR may have a knock on effect to the resolution of screen you can support.

 

Alternatively more "intelligent" displays/controllers have oodles of their own RAM on board so it may not require the host micro to keep a buffer itself.

 

Consider a fairly typical "AVR GLCD". You might be looking at 128x64 mono - that requires just 1K of RAM to keep a buffered image. If, on the other hand you start trading up to something "fancy" like 320x240 and 24 bit colour then that would be 230,400 bytes! Quite a different prospect.

 

Note also that if you have a serial connection then it's possible all those bytes have to go down a wire in a fraction of second. For example, if you used the latter (320x240 RGB) and wanted to show moving images you need at least 15fps so that would be 3.29MB/s to shove down some wire !!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Buy a Uno clone and a Uno TFT / Touchscreen shield.   Plug together.   Program an Arduino sketch

 

If you really want to do debugWIRE,  you can either buy an XMINI and solder Arduino header sockets.

Or you buy ATMEL-ICE, PICKKIT-4 or SNAP which will let you use debugWIRE at a reasonable speed on a regular Uno.

 

The cheap "Mcufriend" Shields are 8080-8 parallel.  They use most of the Uno pins.

Any SPI shields e.g. from Adafruit, Waveshare, Seeed are more expensive but obviously use less pins.

 

Yes,  of course you can hand-wire your own hardware.    It is never going to be as mechanically or electrically reliable as ready-made shields.

 

Regarding software.    You should always use the item between your ears.

i.e.  you only draw text or graphics when something changes.   And you only update the minimal area required.

 

I suspect that you may be of a similar vintage to me.    A 300 baud dial-up telephone line to a Unix computer actually worked quite well with libcurses.    libcurses always calculated the minimal amount of modem traffic required to update your local RS232 terminal.    A 1200 baud modem was sheer luxury.

 

David.

 

p.s.  Full colour TFT controllers have their own SRAM and you can address individual pixels.    In fact ancient GLCD controllers like KS0108 also have their own SRAM.   So do monochrome OLED controllers.     The "monochrome" controllers are difficult to address individual pixels.  Hence an image copy is often held in AVR SRAM.

Last Edited: Thu. Jun 6, 2019 - 02:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would think a character LCD and a 3x4 or 4x4 scanned keypad would be much simpler to get going, how fast does your friend need his device, and is it a 1 off or mass production project?

As others have suggested, an UNO or MEGA plus LCD touchpad shield is the quick H/W solution for a prototype.

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Geronimo wrote:
Maybe something where there exists example code somewhere on the internet to start out with?
ILI9341 with source code from Microchip ASF3 or from Adafruit; has an internal QVGA frame buffer RAM so partial updates are available.

Adafruit's ILI9341 is resistive touch which might be a better fit and function match for your requirements (price, operator interface is by their one finger)

PDA's ILI9341 has a bezel and cover glass (easier to install, rugged) with an XMEGA; add custom I/O on a mezzanine PCBA.

 

Is there a sunlight-readable requirement?

If yes then different manufacturers, or, a sunshade might be adequate.

 

Is there a low current requirement?

If yes there's Sharp Memory LCD (monochrome, tens of microamps) though would have a touch screen overlay on it and an LED for night operations (or the operator has a head lamp/torch); Adafruit product and source code.

 

ASF Source Code Documentation - ASF-GFX Graphics Stack

GitHub - adafruit/Adafruit_ILI9341: Library for Adafruit ILI9341 displays

Precision Design Associates - 28xx Series - TM2801

Products - Sharp - Memory LCD

https://github.com/adafruit?utf8=%E2%9C%93&q=Sharp&type=&language= (C++, Python, Eagle)

 

edit : Memory LCD update on pixel rows; regions are stacked display-wide rectangles that are updated as regions (AVR RAM for largest region)

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Jun 6, 2019 - 03:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I go counter to the popular TFT libraries: When I draw characters to the screen, I pass a foreground and background color and draw the background pixels too. This lets me very neatly draw over any text without making flashes and the like. Yea, maybe I should publish my tft libraries somewhere. Too lazy perhaps. Even with SPI touchscreen, the display is moderately fast. Avoid scrolling as this will REALLY highlight your slow update.

 

Oh, yes. This also helps me write text to the display faster. Instead of having to position the pointer every time I write out a pixel, I just set the bounding rectangle for the whole character, then write out the pixels one after another. Much faster drawing.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

Last Edited: Thu. Jun 6, 2019 - 03:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Torby wrote:
Instead of having to position the pointer every time I write out a pixel, I just set the bounding rectangle for the whole character, then write out the pixels one after another. Much faster drawing.
Concur and extended that to multiple characters with or without a border (in total, a region; screen is a stack of regions)

Update of a screen was relatively fast as only the changed regions were written; screen swaps were visibly "slow" as that was a complete VGA rewrite though the speed was adequate.

Screen data fits within the display's frame buffer RAM.

An XMEGA can reasonably do VGA; megaAVR is more than adequate for QVGA.

Some display controllers have an amazing amount of internal frame buffer RAM.

 

edit :

WVGA LCD, super WQVGA LCD is double-buffered, internal 768KB frame buffer RAM, Intel 8080 interface, QFP-176, Epson S1D13L03 :

https://www.mouser.com/ProductDetail/Epson-ICs/S1D13L03F00A100?qs=sGAEpiMZZMviZ1ygyFMr3vhLvEY%252BO3fbaK%2FTlFYLytttnTT1m5zAQA%3D%3D

 

IIRC, some PIC24 have enough internal SRAM for a frame buffer and its PMP has a synchronous interface (pixel clock and pixel data to LCD)

ezLCD-302 - 2.7" Sunlight Readable, Smart LCD | Earth LCD

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Jun 6, 2019 - 04:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you are careful in planning, you can do a "write only" to a display & use no ram in the AVR (assuming the display chip has SRAM).  I did this several years back & it was blazing fast.  I could only go from the to left corner to bottom right...no backtracking or writing to "random" display locations (since in that case you'd need to know what was already there, or possibly in the neighboring locations).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Or you buy ATMEL-ICE, PICKKIT-4 or SNAP which will let you use debugWIRE at a reasonable speed on a regular Uno.
less speed :

debugWIRE via USB UART | AVR Freaks

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since this is for a prototype, and your friend is new to all of this I would recommend this:

 

https://nextion.itead.cc/nextion...

 

I use them a lot as they are a simple USART interface to the AVR, and the software >>while clunky<< once you figure out how to use it is pretty easy to use.  You can load your backgrounds etc on a microSD card and put that in the screen and call them up as needed.

 

They are not too bad priced.  Great for one off/small run devices.

 

Just my two pence

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't need a lot of text nor graphics, I would like to have room to enter a phone number (possibly with country code) and the on-screen keypad (to enter the phone number).

Yes it could all be done with a 2-line character LCD and two or three buttons, but the user interface would be a lot "nicer" and intuitive with a touch screen.

 

Basically what my friend wants is a "dead man's switch" with a timer that is counting down from a chosen value, and if it reaches 0 the device sends a text message to the phone number(s) given (and some extra features).

He has an idea of developing it into a product, if there is a market for the device, which I believe would be a niche product anyway. But this is the reason why I would prefer the touch screen because of the improved user experience (if he wants to demonstrate the prototype to someone else). If he doesn't go ahead and develop it into a product he would at least like to use it for himself and his family and the improved UI would still be a nice thing to have.

 

He didn't give me any kind of power requirements, but he did add that he wanted it to be tamper proof, ie. that the operator cannot stop the timer or change the phone number without a PIN, so I'm thinking at least some kind of battery pack is needed for power outages or in case the operator unplugs the device. I'm thinking as an event on power failure: text message "device on battery/unplugged". No need for extended battery operation or even powering the display in battery since the owner would be notified immediately and can go and check out the situation.

- Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Geronimo wrote:
But this is the reason why I would prefer the touch screen because of the improved user experience
Are you sure this is the best way to approach commercial design? The key thing at the end of the day will be "will anyone buy one". A strong influence in that will be how much you sell it for and that in turn has a strong influence on your bill of materials. When you know the BOM you will know if you can only afford to include a 16x2 and some buttons or whether you can afford the fancy screen. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Are you sure this is the best way to approach commercial design? 

 

No, but for me at least the user interface / experience is very important. Also the touchscreen would actually reduce the number of components in the prototype, so in the end I think the difference in price would not be too much. Maybe I could even use the touchscreen itself as the "dead man's switch" and save yet another component.

- Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Geronimo wrote:
Basically what my friend wants is a "dead man's switch" with a timer that is counting down from a chosen value, and if it reaches 0 the device sends a text message to the phone number(s) given (and some extra features).

Isn't that how most IED's are set off?

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

BTW I was just looking at the kind of screen David suggested. I think he means things like:

 

https://www.amazon.co.uk/QooTec-Screen-Arduino-Socket-Mega2560/dp/B07PLQS8MT/ref=pd_day0_hl_147_12?_encoding=UTF8&pd_rd_i=B07PLQS8MT&pd_rd_r=4d6ab034-8866-11e9-b2ec-2dae480217cb&pd_rd_w=XzADR&pd_rd_wg=mZ6s8&pf_rd_p=92d624bb-a334-423e-8722-8024dd09667f&pf_rd_r=JFA1KGZM5XFTGZK3NA52&psc=1&refRID=JFA1KGZM5XFTGZK3NA52

 

If you look at the similar devices they compare against (ignore the Rpi one):

 

 

Then there's a fairly common theme in those pictures...

 

A PEN!

 

This suggests these are probably resistive touch screens. So the user experience is not going to be like using your Android/iOS smartphone. For that kind of touch experience you would want a screen with "capacative touch". Be very wary about this when shopping around.

 

Resistive touch is all very well. I co-designed this 26 years ago back in 1993:

 

https://en.wikipedia.org/wiki/PenPad

 

 

but it's not really something you can "prod with your fingers" (or rather if you are going to you have to prod pretty hard and eventually the upper plastic film will wear)

 

Some info about resistive vs capacative here:

 

https://www.newhavendisplay.com/app_notes/TPcompare.pdf

https://www.makeuseof.com/tag/differences-capacitive-resistive-touchscreens-si/

 

You do pay a bit for this difference. An Arduino TFT touch shield with resistive sensor seems to be in the £15..£25 range, one with capacitive is more like £40..50+

 

PS "capacative" or "capacitive" ? The latter I think.

 

PPS bottom line - if there's a pen you probably don't want it!

Last Edited: Fri. Jun 7, 2019 - 01:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Geronimo wrote:
Basically what my friend wants is a "dead man's switch" with a timer that is counting down from a chosen value, and if it reaches 0 the device sends a text message to the phone number(s) given (and some extra features).

 

THis is EXACTLY what the Arduino platform shines at.  Text message?  Via network(WiFi or hardwired), or Cellular?  Theres a shield for that.  Screens?  Theres shields for that too.  Battery backup?  No problem.

 

Thee are literally thousands of places on the interwebs - Ebay in particular - that offer these types of things.  Adafruit is another.

 

Get out a P.C. and a stylus >>(Paper Computer) AKA Paper and Pencil<<  And write down what the sprecs are, and then draw a crude line diagram schematic of the components and how they connect to each other.  Then go in search of the parts you need.

 

What your friend is looking to build has been done many times already, so finding the components, and the source code should be pretty straightforward.

 

East Coast Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was suggesting something like this 2.4 inch TFT Touch Shield

 

Yes,  resistive touchscreens are not much good for creating intricate drawings.

They are a bit fiddly for QWERTY keyboards.

 

But they work fine for interactive "buttons" e.g. number pad or menu selection.

Which seems to be what Geronimo wants.

 

Capacitive Touch screens are less common.  And much more expensive.

 

I suggest 2.4 inch because this fits on a Uno nicely.

Forget about battery operation.    You need USB or external 5V power.

 

I am not familiar with RPi.   But a RPi with an RPi shield will be "almost" as robust as a Uno with Uno shield.

 

Yes,  you can hand-wire your own electronics.   Probably cheaper but time consuming.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

At scale - a generic 16x2 LCD is not cheaper than a TFT unless you have to include the cost of a larger battery to run the colour one.

 

A modern chip on glass led backlit colour TFT will be cheaper than an ancient clunky 16x2 with all its PCB and metal sheilds etc.

 

Of course a modern monochrome 16x2 with COG and a flexi pcb connector will be cheaper than the colour one and be low power budget.  But the absolute lowest cost option these days is a 128x64 graphic monochrome.  Or maybe still the old nokia one if they are still available.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

andrewm1973 wrote:
Or maybe still the old nokia one if they are still available.
Graphic LCD 84x48 - Nokia 5110 - LCD-10168 - SparkFun Electronics

Sharp Memory LCD consume an order of magnitude less current than a Nokia 5110 though are approximately twice the price.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
Isn't that how most IED's are set off?

 

I don't know, how intelligent would it be to set of the IED if the operator falls asleep?

 

Anyway, what this will be is a "the nurse who is caring for your child fell asleep-alarm", so worst case it will set off a furious parent, which I guess in it self could be quite dangerous! wink

- Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You might be better off using a $5 rpi zero & lcd...for $10 you can get the rpizeroW with wifi & connect to anywhere

 

https://www.raspberrypi.org/forums/viewtopic.php?t=157618

https://www.ebay.com/itm/Raspberry-Pi-Zero-Screen-2-8-inch-60-fps-Display-Support-640-480-HD-Touch-Screen-/332924562468

 

If you want just a timer & numeric lcd that would be much cheaper than wanting color, touchscreen, and ability to send email!

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't want email, I (my friend) want SMS. I'm sure it could still be done with the rpi, but I'm not at all familiar with it!

I still haven't ordered anything, but so far I think I will be going with the atmega328pb-xmini and a nextion display, it looks quite neat!

- Brian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if you want SMS have a look at SIM900

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't want email, I (my friend) want SMS

Yes, you can use the wifi to send free sms messages 

 

Also, take a careful look at this:

 

https://thepihut.com/blogs/raspberry-pi-tutorials/using-ifttt-with-the-raspberry-pi

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Mon. Jun 10, 2019 - 11:55 PM