Arduino UNO R3 + PCF8574P + HD44780

Hello,

sorry for my english. I use Google translation.

To my problem:
Arduino UNO R3 and LCD H44780 still works well.
Now I want to use a PCF8574P. It is no text, just a black screen.


I use this circuit.
http://www.abload.de/img/schematic_diagramk8pgf.jpg]

DISPLAYTECH 162C BCBC Datasheet

Code from http://hmario.home.xs4all.nl/arduino/LiquidCrystal_I2C/

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x20,16,2);  // set the LCD address to 0x20 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("ARDUINO+PCF8574P");
  lcd.setCursor(0,1);
  lcd.print("+HD44780=I2C-LCD");
}

void loop()
{
}
  1. Your pnp is wired backwards;
  2. Adjust backlight to show either the text or at least some black boxes;
  3. No clue about the liquidlcd library, but make sure your had the i2c address right;
  4. Put some pull up resistors there.

It is not likely that your LCD library reads data from the LCD module and it therefore may not attempt to control the LCD R/W line (pin 5). If the corrections in the previous post don't fix your problem then try disconnecting the wire from pin 10 of the PCF8574 and connect it to GND instead.

Don

Hi the other thing that you can do is to give the LCD library (New LiquidCrystal library) here a shot. It looks like it is not initializing the LCD correctly:

#include <LiquidCrystal_I2C.h>

//   LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs, 
//                     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7 );

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3 );

void setup()
{
  lcd.begin( 16,2 );                      // initialize the lcd 
 
  // Print a message to the LCD.
  lcd.setCursor(0,0);
  lcd.print("ARDUINO+PCF8574P");
  lcd.setCursor(0,1);
  lcd.print("+HD44780=I2C-LCD");
}

void loop()
{
}

or, with backlight control

// Constructor with backlight control
//   LiquidCrystal_I2C(uint8_t lcd_Addr, uint8_t En, uint8_t Rw, uint8_t Rs, 
//                     uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7,
//                     uint8_t backlighPin, t_backlighPol pol);

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE );

void setup()
{
  lcd.begin( 16,2 );                      // initialize the lcd 
 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("ARDUINO+PCF8574P");
  lcd.setCursor(0,1);
  lcd.print("+HD44780=I2C-LCD");
}

void loop()
{
}

That transistor looks a bit fishy too.

If you have the PCF8574 use Address 0x20 if you have the PCF8574A use I2C addres 0x38.

Hello,

It still does not work. See No text. Both KS0070B (LCD 16x2) and HD44780 (LCD 40x4).

2 comes with 40x4 LCD cursor, the blinking cursor right.

Pull-ups resistors is 4.7 K.
I use PCF8574P. A0, A1 and A2 to GND as shown in the diagram. 0x20

EA W404B-NLW LCD 40x4 (HD44780)

It still does not work.

You probably want to better inform your readers what "it" you were referring to. Having the latest code + schematic would be helpful.

It looks like your lcd is not initialized properly. I would focus on that.

As to the i2c address, given that it is 7-bit, different systems have a different way of representing it. Some would for example write the address as 0x40 (to simply OR or AND the i2c_read / i2c_write bit). Others use 0x20 and then left shift 1 bit first. You may want to read your lcd library to see which notation they use.

I discovered there are two different libraries available for the I2C LCD with a PCF8574.

The first is the one Mario H. uses as well and looks like this:

The second is used by DFRobot and other suppliers:

The lower and higher nibble are swapped on the display pins...

The lower and higher nibble are swapped on the display pins...

That's why a statement such as this is used. You have to use your pin numbers, in the proper order, inside the parentheses.

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE );

This would be easier to do if there were appropriate comments preceding and following the statement.

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

Don

Edit: I hope they both have fixed their backlight circuits by now.

I hope they both have fixed their backlight circuits by now.

It actually will work for switching purposes. It just isn't optimal.

Won't it work even better with the transistor wired in correctly?

Don

Won't it work even better with the transistor wired in correctly?

It would have worked considerably better for linear applications.

It also works better for switching applications but not terribly much.

Wonderzoek:
I discovered there are two different libraries available for the I2C LCD with a PCF8574.

The second is used by DFRobot and other suppliers:

The lower and higher nibble are swapped on the display pins...

I use this and it works!

I still have problems with that transistor.

Don

floresta:
I still have problems with that transistor.

Don

+1

floresta:
I still have problems with that transistor.

Don

I use PNP Transistor BC557. 10 Ohm between Emitter (BC557) and LED+. 1K between P3 (PCF8574P) and Base (BC557).

For Arduino and LCD (without PCF8574P), i use NPN Transistor BC547.

Which lead is the emitter and what is it connected to?

Don

floresta:
That's why a statement such as this is used. You have to use your pin numbers, in the proper order, inside the parentheses.

myLCD LiquidCrystal_I2C ( 0x20, 4, 5, 6, 0, 1, 2, 3, 7, POSITIVE );

[/quote]
Which library do you use? The libraries of Mario H. and DFRobot don't provide the ablitiy to provide specific IO pins for the outputs.

This is the declaration of the .begin statement.

void begin(uint8_t cols, uint8_t rows, uint8_t charsize = LCD_5x8DOTS );

@floresta: Google is your best friend

@Wonderzoek

@floresta: Google is your best friend

Are you serious?

Don

Google??? Doesn't everyone use 'Archie'?

Don

floresta:
@Wonderzoek

@floresta: Google is your best friend

Are you serious?

Don

I think he meant well! :smiley: