problem with PCF8574

I have a problem, I use the PCF8574.Last night, every think was ok.
But today I can't connect my keypad the connections are ok can I check if I
have connection between arduino and PCF8574 with serial, for example.

can I check if I
have connection between arduino and PCF8574 with serial

No.
Use an I2C scanner sketch like this one:-
http://todbot.com/blog/2009/11/29/i2cscanner-pde-arduino-as-i2c-bus-scanner/

I try this code .The ledPin is ok the serial no.

(the code )

/**
 * I2CScanner.pde -- I2C bus scanner for Arduino
 *
 * 2009, Tod E. Kurt, http://todbot.com/blog/
 *
 */

#include "Wire.h"
extern "C" { 
#include "utility/twi.h"  // from Wire library, so we can do bus scanning
}

// Scan the I2C bus between addresses from_addr and to_addr.
// On each address, call the callback function with the address and result.
// If result==0, address was found, otherwise, address wasn't found
// (can use result to potentially get other status on the I2C bus, see twi.c)
// Assumes Wire.begin() has already been called
void scanI2CBus(byte from_addr, byte to_addr, 
                void(*callback)(byte address, byte result) ) 
{
  byte rc;
  byte data = 0; // not used, just an address to feed to twi_writeTo()
  for( byte addr = from_addr; addr <= to_addr; addr++ ) {
    rc = twi_writeTo(addr, &data, 0, 1);
    callback( addr, rc );
  }
}

// Called when address is found in scanI2CBus()
// Feel free to change this as needed
// (like adding I2C comm code to figure out what kind of I2C device is there)
void scanFunc( byte addr, byte result ) {
  Serial.print("addr: ");
  Serial.print(addr,DEC);
  Serial.print( (result==0) ? " found!":"       ");
  Serial.print( (addr%4) ? "\t":"\n");
}


byte start_address = 1;
byte end_address = 100;

// standard Arduino setup()
void setup()
{
    Wire.begin();

    Serial.begin(19200);
    Serial.println("\nI2CScanner ready!");

    Serial.print("starting scanning of I2C bus from ");
    Serial.print(start_address,DEC);
    Serial.print(" to ");
    Serial.print(end_address,DEC);
    Serial.println("...");

    // start the scan, will call "scanFunc()" on result from each address
    scanI2CBus( start_address, end_address, scanFunc );

    Serial.println("\ndone");
}

// standard Arduino loop()
void loop() 
{
    // Nothing to do here, so we'll just blink the built-in LED
    digitalWrite(13,HIGH);
    delay(300);
    digitalWrite(13,LOW);
    delay(300);
}

the serial

C¡ä????
?¤Ä½¤?çæ?§D?¤¤¤½??äD?çG??å???D¤¤??????O¤??D?¤a??????åD????¤??????å¤???D?Ä??????MÄ??D?¤a???D?¤???D?¤
¤???d?ä?¤??D?¤????D?¤???D?¤a¤??d?¤a¤???D?¤?J????¤?Ä???D¬¤????d¬¤????D?Í?¥???D?¤?¥???D?Í????d?¤?????D?Í?¥??D?Ì?¥??D?Ä?Å???d?¤?Å??D?¤???D?¤?Z????¤?E???d?¤?%???D¬¤????D?¤?????D?Ì?¥??d?Ä?¥??D?¤
Å??D?¤Å??D?¤???d?¤a?????¤?K???D?¤a¤??D?¤a?????¤?t???D¬¤?¤??D?¤?d????¤?D???d?¤?Ä??DBÍ??????¤?D???D?¤?$????¤?\????¤?B???¤??????¤?h¤???¤?|????¤?D????¤?T????¤?E???d¬¤????D¬¤?¥??D?Í?¥??D?Ì????d?Í????D?Í?¥???D?¤?¥??D?Í?Å??d?Ì?Å??D?Ì????D?Ä????D?Ì?¥???d?¤¥??D?¤???D?¤???D?¤?¥??d?¤¥??D?¤?1?B?¤?]????¤?N????¤?F????¤?J????¤?F????¤?n????¤?~????¤?n????¤?&???D¬¤?Æ??d?Í?Æ??D?¤????D?ä????D?¤a¦???d?¤?¦???D?¤????D¤¤????D¤¤?¦??d?Ì?¦??D?¤?Æ??D?¤?Æ???D?¤????cä¿b

At the bottom of the serial window is a drop down menu, change this to select the correct speed, which in this case is 19200 baud.

ok this is the serial the adress is the 63 ?

addr: 17       	addr: 18       	addr: 19       	addr: 20  
I2CScanner ready!
starting scanning of I2C bus from 1 to 100...
addr: 1       	addr: 2       	addr: 3       	addr: 4       
addr: 5       	addr: 6       	addr: 7       	addr: 8       
addr: 9       	addr: 10       	addr: 11       	addr: 12       
addr: 13       	addr: 14       	addr: 15       	addr: 16       
addr: 17       	addr: 18       	addr: 19       	addr: 20       
addr: 21       	addr: 22       	addr: 23       	addr: 24       
addr: 25       	addr: 26       	addr: 27       	addr: 28       
addr: 29       	addr: 30       	addr: 31       	addr: 32       
addr: 33       	addr: 34       	addr: 35       	addr: 36       
addr: 37       	addr: 38       	addr: 39       	addr: 40       
addr: 41       	addr: 42       	addr: 43       	addr: 44       
addr: 45       	addr: 46       	addr: 47       	addr: 48       
addr: 49       	addr: 50       	addr: 51       	addr: 52       
addr: 53       	addr: 54       	addr: 55       	addr: 56       
addr: 57       	addr: 58       	addr: 59       	addr: 60       
addr: 61       	addr: 62       	addr: 63 found!	addr: 64       
addr: 65       	addr: 66       	addr: 67       	addr: 68       
addr: 69       	addr: 70       	addr: 71       	addr: 72       
addr: 73       	addr: 74       	addr: 75       	addr: 76       
addr: 77       	addr: 78       	addr: 79       	addr: 80       
addr: 81       	addr: 82       	addr: 83       	addr: 84       
addr: 85       	addr: 86       	addr: 87       	addr: 88       
addr: 89       	addr: 90       	addr: 91       	addr: 92       
addr: 93       	addr: 94       	addr: 95       	addr: 96       
addr: 97       	addr: 98       	addr: 99       	addr: 100       

done

Yes there is a device at address 63, so your PCF8574 looks like it is working.
Is this the address you expected it to be at? It could be tat some of the external address select pins are not wired up like they were.

last night i use address 38
I try my keypad .It can't conection than the address is wrong

It looks like last night you had a PCF8575 and someone has swapped it for a PCF8574c or of course your device is broken.
If you change the address in your sketch does it still work?

I run it now the address is 62 i don't change the chip

I run it now the address is 62

Sorry no idea what you are trying to say.

I disconnect the usb connected again and it change the address

This is a valid address for a PCF8574a not a PCF8574 with all the external address lines set at high.
So what happens when you use this address with your sketch.
It sounds like your wiring is bad, are you using solderless breadboard? These are bad things because they make bad wiring sometimes.

yes I use breadboard i try to fix it
is it common to it change address

is it common to it change address

No.
I can't see how you had it working with that first address of 38 but the address you are getting now looks right.

I ask my brother and he change the chip yesterday morning

I can't understand what happened. I use this diagram PCFCrystal
Every connections are ok i checked it with my multimeter
i use this example

/*
PCFCrystal Library - Hello World

Demonstrates the use a 16x2 LCD display using the I2C capabilities of Arduino.
This library is a porting of the original LiquidCrystal library, prepared to
control the LCD display via one or two PCF8574.
The LiquidCrystal and PCFLiquidCrystal
libraries work with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD
and shows the time and the time consumed to print a single character

The circuit (4 bits interface):
* LCD RS pin to PCF8574 output 5 (pin 10)
* LCD Enable pin to PCF8574 output 4 (pin 9)
* LCD D4 pin to PCF8574 output 0 (pin 4)
* LCD D5 pin to PCF8574 output 1 (pin 5)
* LCD D6 pin to PCF8574 output 2 (pin 6)
* LCD D7 pin to PCF8574 output 3 (pin 7)
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library PCFCrystal created on June 2010
http://ardugonic.blogspot.com

Liquid Crystal:
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 25 July 2009
by David A. Mellis


http://www.arduino.cc/en/Tutorial/LiquidCrystal
 */

// include the library code:
#include <Wire.h>
#include <PCFCrystal.h>

byte buffer = 0;
byte data = 0;
// initialize the library with the numbers of the interface pins
// rs, en, d0, d1, d2, d3, address, buffer
// 4 bits
PCFCrystal lcd(B00100000, B00010000, B00000001, B00000010, B00000100, B00001000, 0x63, &buffer);
// 8 bits
//PCFCrystal lcd(B00100000, B00010000, B10000000, B01000000, B00100000, B00010000, B00000001, B00000010, B00000100, B00001000, 0x21, 0x20, &data, &buffer);

void setup() {
  Wire.begin();
  
  // set up the LCD's number of rows and columns: 
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("scnds:loop:micrs");
}

long counter = 0;
int led = HIGH;

void loop() {
  counter++;

  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  // print the number of seconds since reset:
  lcd.print(millis()/1000);
  // print the number of loops since reset
  lcd.print(":");
  lcd.print(counter);
  // print the time to print 1 char
  long mics = micros();
  lcd.print(":");
  lcd.print(micros() - mics );
  
  if (counter % 27 == 0) {
    if (led == LOW) {
      buffer = buffer | B01000000;
      led = HIGH;
    }
    else {
      buffer = buffer & ~B01000000;
      led = LOW;
    }

    Wire.beginTransmission(0x20);
    Wire.send(buffer);
    Wire.endTransmission();
  }
}

the serial test is

I2CScanner ready!
starting scanning of I2C bus from 1 to 100...
addr: 1       	addr: 2       	addr: 3       	addr: 4       
addr: 5       	addr: 6       	addr: 7       	addr: 8       
addr: 9       	addr: 10       	addr: 11       	addr: 12       
addr: 13       	addr: 14       	addr: 15       	addr: 16       
addr: 17       	addr: 18       	addr: 19       	addr: 20       
addr: 21       	addr: 22       	addr: 23       	addr: 24       
addr: 25       	addr: 26       	addr: 27       	addr: 28       
addr: 29       	addr: 30       	addr: 31       	addr: 32       
addr: 33       	addr: 34       	addr: 35       	addr: 36       
addr: 37       	addr: 38       	addr: 39       	addr: 40       
addr: 41       	addr: 42       	addr: 43       	addr: 44       
addr: 45       	addr: 46       	addr: 47       	addr: 48       
addr: 49       	addr: 50       	addr: 51       	addr: 52       
addr: 53       	addr: 54       	addr: 55       	addr: 56       
addr: 57       	addr: 58       	addr: 59       	addr: 60       
addr: 61       	addr: 62       	addr: 63 found!	addr: 64       
addr: 65       	addr: 66       	addr: 67       	addr: 68       
addr: 69       	addr: 70       	addr: 71       	addr: 72       
addr: 73       	addr: 74       	addr: 75       	addr: 76       
addr: 77       	addr: 78       	addr: 79       	addr: 80       
addr: 81       	addr: 82       	addr: 83       	addr: 84       
addr: 85       	addr: 86       	addr: 87       	addr: 88       
addr: 89       	addr: 90       	addr: 91       	addr: 92       
addr: 93       	addr: 94       	addr: 95       	addr: 96       
addr: 97       	addr: 98       	addr: 99       	addr: 100       

done

And did it work before with the other chip, before your brother changed it.

Yes this chip is brand new. I cheated and with other chip but nothing
the connection with arduino and PCF8574 is correct?

I have the PCF8574AP please help me

I use this code

#include <Wire.h>

#define expander B01000000

void setup() {
  Wire.begin();
  Serial.begin(9600);
}

void loop() {
  Serial.println("Writing B11111111.");
  expanderWrite(B11111111);
  Serial.print("Read: ");
  Serial.println(expanderRead(), BIN);
  delay(1000);
  Serial.println("Writing B00000000.");
  expanderWrite(B00000000);
  Serial.print("Read: ");
  Serial.println(expanderRead(), BIN);
  delay(1000);
}


void expanderWrite(byte _data ) {
  Wire.beginTransmission(expander);

  Wire.endTransmission();
}

byte expanderRead() {
  byte _data;
  Wire.requestFrom(expander, 1);
  if(Wire.available()) {

  }
  return _data;
}

And i take

Writing B11111111.
Read: 0
Writing B00000000.
Read: 0
Writing B11111111.
Read: 0
Writing B00000000.
Read: 0
Writing B11111111.
Read: 0
Writing B00000000.
Read: 0
Writing B11111111.
Read: 0
Writing B00000000.
Read: 0
Writing B11111111.
Read: 0
Writing B00000000.
Read: 0
Writing B11111111.
Read: 0