Ic2 Display only showing backlight and blocks

Hi guys,

Sorry to post this problem (i know its fairly common but i think ive tried everything that has been suggested in other answers on other posts), but im relatively new to all this and am really struggling to get my LCD to display anything but the blocks on the top line.

Ive reinstalled audrino IDE three times now and deleted all my libraries to make sure i was starting fresh (ive been trying various libraries and following the suggestions to other posts on the subject with no success)

Im using a Pro Mini i got off amazon

had a fair bit of trouble with it until i read one of the comments on amazon saying it was actually a 3.3v 8Mhz board and when i tried that it recognised it on COM3 and started letting me upload sketches. I am running 5v into it - when i run 3.3v into it (by changing the flip over on my USB to Serial Converter) i loose the blocks along the top and ive checked the voltage going to the LCD and its sitting at 4.8v

here is my serial converter;

*as im a new user i can only include 2 links in a post so the serial converter im using is the Yizhet 2x FT232RL USB to TTL Serial Converter Adapter 3.3V 5.5V Module Mini Port for Arduino from amazon

Im using this LCD (ive tried both and having the same problem with each of them - ive also checked the chip as per the notes in the description and can confirm its the PCF8574T chip with 0x27 Default address.

i was running the scanner before i noticed this as i thought i may have been a strange default address causing the problem and all i got repeating on the serial monitor when i uploaded the scanner sketch was ⸮⸮ǧ⸮G⸮⸮D%⸮⸮⸮⸮⸮⸮⸮C over and over although the LCD did not change.

Have installed Bill Perrys hd44780 library and uploaded the following sketch which is doing something (the light on the pro is now flashing three times every second) but nothing on the LCD bar the blocks and backlight.

/* YourDuino.com Example Software Sketch
 *  _2_Line_I2C_Display_TestV2.ino
 *   16 character 2 line I2C Display
 *   Uses Bill Perry's HD44780 Library, which can be installed from the Arduino Library Manager
 *   See Bills documentation: https://github.com/duinoWitchery/hd44780
 *   See the "API Summary" section.  Use "lcd" in front like lcdbegin(cols, rows)
 *   
 *   LCD Display Blue or Yellow: I2C/TWI "Backpack" Interface
 questions??  terry@yourduino.com 
  
 */
 // ----------------------------------------------------------------------------
/*LiquidCrystal compability:
Since this hd44780 library is LiquidCrystal API compatible, most existing LiquidCrystal
sketches should work with hd44780 hd44780_I2Cexp i/o class once the
includes are changed to use hd44780 and the lcd object constructor is
changed to use the hd44780_I2Cexp i/o class.
*/

/*-----( Import needed libraries )-----*/
#include <Wire.h>
#include <hd44780.h>                       // main hd44780 header
#include <hd44780ioClass/hd44780_I2Cexp.h> // i2c expander i/o class header


/*-----( Declare Constants )-----*/
// LCD geometry
const int LCD_COLS = 16;
const int LCD_ROWS = 2;

/*-----( Declare objects )-----*/
hd44780_I2Cexp lcd; // declare lcd object: auto locate & auto config expander chip  
/*-----( Declare Variables )-----*/
int status;

void setup()   /*----( SETUP: RUNS ONCE )----*/
{
  status = lcd.begin(LCD_COLS, LCD_ROWS);
  if(status) // non zero status means it was unsuccesful
  {
    // hd44780 has a fatalError() routine that blinks an led if possible
    // begin() failed so blink error code using the onboard LED if possible
    hd44780::fatalError(status); // does not return
  }  
  Serial.begin(9600);

  // Print a message to the LCD.
  lcd.setCursor(0, 0);
  lcd.print("2-Line DISPLAY");
  delay(1500);
  lcd.setCursor(0, 1);
  lcd.print("YourDuino: HI!");  
  
  delay(5000);
  lcd.setCursor(0, 0);
  lcd.print("Now YOU Type    ");  
  lcd.setCursor(0, 1);
  lcd.print("On SerialMonitor");    
}/*--(end setup )---*/


void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/
{
  {
    // when characters arrive over the serial port...
    if (Serial.available()) {
      // wait a bit for the entire message to arrive
      delay(100);
      // clear the screen
      lcd.clear();
      // read all the available characters
      while (Serial.available() > 0) {
        // display each character to the LCD
        lcd.write(Serial.read());
      }
    }
  }

}/* --(end main loop )-- */

/*-----( Declare User-written Functions )-----*/


/* ( THE END ) */

Any suggestions would be greatly appreciated. happy to upload any pictures which would help you.

Thanks
Kenalda

What baud rate do you have the serial monitor set to when you run the program?

just the default 9600 (im assuming you mean in the serial monitor?)

When you get the serial monitor problem fixed, load and run the diagnostic sketch (I2CexpDiag.ino) that comes with Bill's hd44780 library and post the results, please.

b⸮⸮
⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮b⸮⸮⸮D⸮⸮⸮⸮b⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮b⸮⸮⸮⸮⸮⸮ĥD⸮焆䄅⸮⸮儆⸮⸮ą⸮⸮b⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮:⸮⸮⸮⸮⸮⸮⸮⸮b⸮⸮ńƅ⸮⸮⸮焧⸮b⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮b⸮䅄⸮⸮⸮$⸮⸮⸮⸮LJF#

this was the output...

This would indicate a baud-rate mismatch.
Try monitor at other baud rates nothing will be damaged! :nerd_face:

changed baud to 19200 and this immediately popped up

Serial Initialized

I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool

hd44780 lib version: 1.3.2

Reported Arduino Revision: 1.8.19
CPU ARCH: AVR - F_CPU: 8000000

SDA digital pin: 18 A4
SCL digital pin: 19 A5

Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - NO
Checking for I2C pins shorted together - Not Shorted


WARNING: I2C requires external pullups for proper operation
It may appear to work without them, but may be unreliable and slower
Do not be surprised if it fails to work correctly
Install external pullup resistors to ensure proper I2C operation



Scanning i2c bus for devices..
Total I2C devices found: 0
No I2C devices found

there is a problem here then , add a 4.7k-10k resistor from vcc 5v to pin A5/19 and run the sketch again. :persevere:

only had a 10k and it killed the power to the LCD


Serial Initialized

I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool

hd44780 lib version: 1.3.2

Reported Arduino Revision: 1.8.19
CPU ARCH: AVR - F_CPU: 8000000

SDA digital pin: 18 A4
SCL digital pin: 19 A5

Checking for required external I2C pull-up on SDA - STUCK LOW
Checking for required external I2C pull-up on SCL - NO


ERROR: SDA or SCL stuck pin


I2C bus not usable

am a muppet. ignore that.
gimme a tick

sooooo... im getting very close to showing you how little i know about this.
i rammed a 10k resistor into the dupont connector (the wee metal bit showing) on A5 and the same bit of metal showing on the dupont in the VCC on the pro mini. should i have put it on the vcc on the LCD or would that make no difference seeing they are the same cable.. its half 1 in the morning and my brain is fried.

good news is the LCD is back on. bad news is the monitor output is still the same


Serial Initialized

I2CexpDiag - i2c LCD i/o expander backpack diagnostic tool

hd44780 lib version: 1.3.2

Reported Arduino Revision: 1.8.19
CPU ARCH: AVR - F_CPU: 8000000

SDA digital pin: 18 A4
SCL digital pin: 19 A5

Checking for required external I2C pull-up on SDA - YES
Checking for required external I2C pull-up on SCL - NO
Checking for I2C pins shorted together - Not Shorted


WARNING: I2C requires external pullups for proper operation
It may appear to work without them, but may be unreliable and slower
Do not be surprised if it fails to work correctly
Install external pullup resistors to ensure proper I2C operation



Scanning i2c bus for devices..
Total I2C devices found: 0
No I2C devices found

I'd check the cable /wire on the clock pin A5/19 for continuity before you hit the deck and resurrect your brain. :expressionless:

What board and processor are you selecting in the tools menu pulldown in the IDE window?

The baud rate in the I2CexpDiag.ino sketch is 9600 so I wonder why 19200 works.

Can you post photos of the LCD so we can see the wiring and solder joints? And how it is wired to the Arduino.

The "Dupont" wires from China are known to be faulty on occasion.

The I²C backpack already has the pull-up resistors on it. The sketch is clearly and unambiguously telling you that the SCL connection to A5 is missing. If you think there is a wire connected to it, that wire is broken.

If not, the Pro Mini is defective (or a resistor is missing from the backpack - inspect it).

Well, that was sorted some time back. Whatever the baudrate, the serial monitor is now working.

have you chosen the right board, the right processor @ the correct frequency?

Serial MUST work at the given speed in the sketch

Hi!

So, checked the dupont continuity and it was fine.
Had a look at the LCD and the pre-soldered i2c board was at an angle, so much so that the SCL leg was touching the R5 solder of the LCD board so bent it back up. what didnt make sense is the other LCD is completely flat (as it should be and it was throwing out the same response. i put the flat one back in anyway and kept the bent one as a spare.

I had a look at my Pro and the A5 connection and also noticed that the male connector i had used looked like it has sunk through the board! (see photo). so removed that and put in new connectors.

put it all back together again and boom! we have a working LCD.

Thanks so much for all your help and suggestions guys. im sure you will be hearing more from me :grimacing: now ive actually got the 'easy' hardware working and im moving onto the 'complicated' software part... buckle in.

You need to resolve the baud rate issue.
The baud rate used for I2CexpDiag is 9600.
If you are having to use 19200 in the serial monitor then the Arduino clock is something different than what you told the IDE it was.
You told the IDE the clock was 8Mhz
If the clock is actually 16Mhz but the core code was told it was 8Mhz from the IDE,
then I think all the divisors it calculates for the baud rate will be half of what they should be so you end up with twice the baud rate.

I'm guessing that the board is actually running at 16Mhz not 8Mhz.

There are are many timing delays in the hd44780 library and the I2CexpDiag sketch.
If the actual board clock rate is different than what the IDE is told, there are likely to be issues since critical timing delays will not be correct.

--- bill

thanks bill. i think you are right cause the LCD timer which counts up on your sketch was counting seconds twice as fast as it should have been.
ill try to get it to recognise the audrino with the 5v 16mhz processor selected in the IDE but up to now, the port selection is greyed out every time i use anything but the 3.3v 8mhz selection.

Problem sorted. Computer now recognises the 5v 16mhz board (previously saying the device malfunctioned and would sit as an unknown USB device if this selection was used and would grey out COM3 port select).

Ran the serial monitor again and was garbage coming out cause the baud was still set to 19200 changed it back to 9600 and everything has tested perfectly and the output passed all the test in the sketch and serial monitor. Clock on LCD is now counting in seconds as opposed to twice the speed.

Thanks again for the help.