Reading info from a LCD display

Ok, so I’ve quite recently stepped in to the world od Arduino, and I seem to get the “overall” view of it :slight_smile:

But I have a long way to go before I’m putting “Expert” on my card… :confused:

So to my project;

I have a heater in the basement (For “house heating”, not “water heating”).
I would like to read some of the information on the heaters display;
- Priority 1: A “Go to” value processed by the heater, based on the outdoor temperature + a grafical curve that can be moved by two different settings in the heater.
- Priority 2: Collecting and logging other info just for monitory view (Not that important)
This “Go to” value will then be used to monitor a electric valve for an additional heating source

I’ve seen a tutorial online on how to do this “in general”, and I know it can be done.
I need some help with how to proceed with this “codewise”.

I have:

  • Arduino Nano hooked up to the 16 pins of the heaters display (Nano’s digital pins used + some analog pins set to digital)
  • The displays data sheet (attached as file)
  • The displaycontroller data sheet (attached as file)

My problem:

  • The tutorial I looked at don’t have the same type of display as the one I want to monitor, so I’m not quite sure on how to proceed.
    I guess page 12 and 20 in the Samsung file can be of help?

Questions:
a) What code do I need to implement in order to see the signals sent to the display?

Any help to get me started is VERY appreciated!

SamsungKS0066U.pdf (380 KB)

SC1602H1ULB-DSAUD0042295.pdf (116 KB)

Displays are made for showing data coming from somewhere. I've never heard of jacking into an existing system and read from a display.

Get a separate temperature sensor and work from that.

I looked at it yesterday, and it appears to be based on (a clone of) the HD44780 so it should be qute possible to intercept and decode the data.

You never know - Bill may even know something about this! :grinning:

Paul__B:
You never know - Bill may even know something about this! :grinning:

This has come up a few times over the years.
There are some lengthy threads on this that could probably be found by searching. I have commented on the topic in all of them.

The short summary is that depending on how the host talks to the LCD, snooping on the signals with something like an Arduino, is either not that bad or totally impossible.
It depends on timing of the signals which depends on how the hosts communicates with the LCD.
In the worst case, the host is controlling the signals in a way that a processor polling the pins simply can't see the transitions if trying to do in just s/w.
i.e. there are some signals can transition or be stable for as little as 10ns.

Before proceeding, I would advise using a logic analyzer to look at the LCD signals to see what the timing is.
That will determine the approach that can be used.
Depending on the timing, it may require adding external latching h/w to give the snooping processor time to read the signals before they change or go unstable.

--- bill

Well, I daresay if you really want to do it, a 74HC165 is a small price to pay!

But I have a long way to go before I'm putting "Expert" on my card... :confused:

This is an "Expert" level project. It would not be an easy project even for an expert.

What information is shown on the display? Why do you need the Arduino to have this information? What will be done with the information? If there are other ways to achieve the same things without reading the display data, that may be much easier.

Your post is what we call an "X-Y" problem. You want to solve problem Y, which is monitoring or controlling the heater. But you are asking about problem X which is about reading the display. There may be other ways to solve Y where solving X is not necessary.

bperrybap:
This has come up a few times over the years.
There are some lengthy threads on this that could probably be found by searching. I have commented on the topic in all of them.

I’ve found some threads about this, but never really found a thread with a “solution” on how to do it with the Nano.
I’ve found some code that could be useful as a start, but since it will be depending on the timing that you mention below, I’ll start there. One problem at a time… :slight_smile:

bperrybap:
Before proceeding, I would advise using a logic analyzer to look at the LCD signals to see what the timing is.
That will determine the approach that can be used.
Depending on the timing, it may require adding external latching h/w to give the snooping processor time to read the signals before they change or go unstable.

EDIT: There was no problem verifying the code once I selected the correct file for the Arduino:
I’m trying to use the logic-analyzer code from GitHub - aster94/logic-analyzer: Logic Analyzer, for Arduino, AVR, ESP8266 and STM32 with a very nice working processing interface, you could run it also on any Android device. but I don’t seem to be having all of the files I need for the IDE software to verify the code correctly.
Could it be a library or someting missing that I haven’t downloaded, or is it a much simpler problem?
I can’t find the file on my Raspberry at all, so it’s definitly “missing”.

"#include <c_types.h>" --> ESP8266.ino:8:21: fatal error: c_types.h missing file

PaulRB:
What information is shown on the display? Why do you need the Arduino to have this information? What will be done with the information? If there are other ways to achieve the same things without reading the display data, that may be much easier.

I’ve added some clarification in the main post (bold), and I do have thought about other solutions.
But I’ve come up with that monitoring the exact shown info from the display would be the best and most accurate solution.
For instance I’ve tried OCR reading the display, but the readings are to insecure to use.
But I’m pretty impressed what the OCR-functionality could do.

Ok, well, I guess the next step should be to work out what signals are being sent to the display from the controller board. Are they separate boards connected by a ribbon cable? What voltage are the signals? Is the R/W pin of the display chip connected to the controller or is it just connected to +V or ground? (Hopefully the latter.) Are the DB0-3 pins connected to the controller board or not (indicating whether 4-bit or 8-bit mode is used). Some pictures of the board(s) would be useful, close-up, well lit and well focused, showing any text near pins or cables associated with the display.

Ok, so i finally got the GitHub - aster94/logic-analyzer: Logic Analyzer, for Arduino, AVR, ESP8266 and STM32 with a very nice working processing interface, you could run it also on any Android device. working and I got some signals of electrical pulses showing.

Though the code to send the electrical signals is written for a Arduino Uno, and I am using a Nano.
And there is also only the possibillity to read 6 inputs at this time.

According to the code its the input of uno’s pin 8-13 that can be connected.

void init_board() {
  
  PORTC = (0 << 0); DDRC |= (1 << 0); // led A0
  DDRB |= 0x00;     // pin 8-13 input
  PORTB |= 0x3F;    // pull-up
  
}

So for some questions:

  1. Should I simply connect the pins on my Nano to the corresponding pins for the Uno? (See image)
  2. Since only 6 inputs can be measured, is there any specific grouping of signals I should measure?
    I guess I need to do multiple readings with different pins?

  1. Yes. Nano and Uno are almost the same, they are based on the same chip.
  2. No idea. It could be that as few as 5 pins are needed, but it could be more. It would help if you could answer the questions in my previous post.

PaulRB:
Ok, well, I guess the next step should be to work out what signals are being sent to the display from the controller board.
Are they separate boards connected by a ribbon cable?
What voltage are the signals?
Is the R/W pin of the display chip connected to the controller or is it just connected to +V or ground? (Hopefully the latter.)
Are the DB0-3 pins connected to the controller board or not (indicating whether 4-bit or 8-bit mode is used).
Some pictures of the board(s) would be useful, close-up, well lit and well focused, showing any text near pins or cables associated with the display.

I'll try to answer these questions as good as I can :slight_smile:

  1. Unfortunately not connected by cable, the unit looks like the picture attached.
  2. Measuring the signals on DB0 to DB7 on the display i get 0v on some and 2.64v on others.
  3. I'll see if I can get a view of this tomorrow
  4. I'll see if I can get a view of this tomorrow
  5. I can get pictures tomorrow. I need to run the heater tonight to get some energy in to the radiators :slight_smile:

PaulRB:
This is an "Expert" level project. It would not be an easy project even for an expert.

What information is shown on the display? Why do you need the Arduino to have this information? What will be done with the information? If there are other ways to achieve the same things without reading the display data, that may be much easier.

Your post is what we call an "X-Y" problem. You want to solve problem Y, which is monitoring or controlling the heater. But you are asking about problem X which is about reading the display. There may be other ways to solve Y where solving X is not necessary.

I totally concur.
The few times this I saw this came up on the past, it was eventually abandoned as being too difficult.
The most intense effort I saw was done by crossroads, who I definitely believe had the technical skills to pull it off.
It sounds simple, but in reality, it tends to get complicated quite quickly.

--- bill

p-solver:
Ok, so i finally got the GitHub - aster94/logic-analyzer: Logic Analyzer, for Arduino, AVR, ESP8266 and STM32 with a very nice working processing interface, you could run it also on any Android device. working and I got some signals of electrical pulses showing.

I'm not sure that a simple s/w based logic analyzer like that will be able to provide the information needed.
The code uses s/w and ISRs to read the pins.
The resolutions will be at best a few hundred ns or even 1 us.
Then there will be jitter in the readings due to s/w processing variations.

You might be able to see enough to see if the host is super slow at controlling the LCD.
i.e. slow enough to allow snooping the pins directly in s/w.

But if there are tight real time timing requirements in the sub 200ns range (which is definitely possible), then that sort of s/w based logic analyzer will not be able show the timing you have to deal with.

--- bill

Paul__B:
Well, I daresay if you really want to do it, a 74HC165 is a small price to pay!

It might work if the host is slow about updating between LCD instructions but the host messes with the data and control signals immediately after dropping E.
i.e. it is being used to extend tAH

But if the timing is already so tight that you can't directly read the pins, I'm not sure how you could ever expect to serially shift in the pin data fast enough, since that is many more i/o operations than just reading the pins directly.

--- bill

So this morning I’ve come up with some more info.
Unfortunately, it’s not really easy to see anything between the display and the curcuit board.
But let me know if there is anythin specific I should look up.

Images of the complete circuit board:

Imgur
Imgur

I’ve also done som tests with the logic analyzer.
And my question is if the images below gives us any information that might be valid in terms of time etc.

  • Reading pin (7) RS0 to (10) RS3 I get either “no signal” or a signal equal to pin (5)R/W
    Does this mean it might be 4 bits we’re talking about here?

bperrybap:
It might work if the host is slow about updating between LCD instructions but the host messes with the data and control signals immediately after dropping E.
i.e. it is being used to extend tAH

But if the timing is already so tight that you can't directly read the pins, I'm not sure how you could ever expect to serially shift in the pin data fast enough, since that is many more i/o operations than just reading the pins directly.

--- bill

How about using an edge detector circuit to generate a short low pulse when E falls. The pulse is fed to the SH/LD of the 74hc165 and causes it to capture the inputs at that time. The pulse is also connected to an interrupt pin on the Arduino. The ISR uses SPI at max speed (8MHz) to clock in the data from the '165 and store it in a buffer.


Images of the complete circuit board:

Can you post those as attachments please?

I think this indicates that DB0-3 and R/W are grounded, so it's 4-bit Comms.


From the attachment in the original post:

PaulRB:
I think this indicates that DB0-3 and R/W are grounded, so it's 4-bit Comms.

I can confirm that pin no. 16, 1, 5, 7, 8, 9, 10 on the display are connected to ground.