Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to read 16x2 display signals and display it in Qt Gui screen using raspberry pi



  • Hello all, Am trying to customize a old key pad based coffee vending machine to a touch screen based machine .Am using Raspberry pi for hardware connectivity. Kindly please guide me how to read signals of 16x2 display and display it in Qt Gui screen. Thanks in advance


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    That's a way to broad of a question and outside the scope of Qt.

    How are you connecting these display to your RPi ?
    How are you connecting tot them ?
    What protocol do they use ?
    Are they really readable ?
    What do these display show ?



  • @San.4368 said in How to read 16x2 display signals and display it in Qt Gui screen using raspberry pi:

    Hello all, Am trying to customize a old key pad based coffee vending machine to a touch screen based machine .Am using Raspberry pi for hardware connectivity. Kindly please guide me how to read signals of 16x2 display and display it in Qt Gui screen. Thanks in advance

    Usually 16x2 or 20x4 LCD display you do not read, you write characters on it.

    Which display are you using?
    In most displays the interface is I2C for communication, example in your case RaspberryPI and Display 16x2


    Cleiton Bueno

    Blog | Linkedin | B2Open



  • @SGaist hi,

    1. I have connected the Qt and Rpi's GPIO pins using Wiring pi library.
    2. There is no specific protocol. the 16x2 LCD has Three comment lines and 8-bit data lines.

  • Lifetime Qt Champion

    As @Cleiton-Bueno wrote, you usually don't read from displays.

    From what you describe you essentially have to use the WiringPi library trough your application to show something on these displays. The first thing you have to do is to make that part work before doing your GUI.



  • @San.4368 There is always a specific protocol how the coffee machine controls the LCD, whether you know it or not, but it is not something that is designed for reading by an application. If the idea is to read the LCD for figuring out the state of the machine & repeating the info on the GUI, you probably need to find another way for that.

    Or: of course you could attach a camera to the Pi and OCR the text on the display! That could actually be simpler than writing code for interpreting the hardware signals.



  • @mvuori said in How to read 16x2 display signals and display it in Qt Gui screen using raspberry pi:

    If the idea is to read the LCD for figuring out the state of the machine & repeating the info on the GUI, you probably need to find another way for that.

    Maybe it isn't such a bad idea after all. Assuming that the LCD is connected via IC2 and remembering IC2 is a bus, the Raspberry could read the same strings sent to the LCD (think of it acting as a second LCD). Then such strings/states should be used to drive/paint the new graphical display using Qt from the Rapsberry Pi itself.
    This way all the input and processing logic will remain in the current buttons/processing unit in the coffee machine and any "text" sent to the LCD will output in the new display as well.


  • Lifetime Qt Champion

    hi @San-4368 ,

    your description reminds me of this LCD controller: https://en.m.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller which I have used in some products too.

    reverse engineering the data from the lines sounds indeed like a nice project and absolutely doable once you understood the protocol.


Log in to reply