Hi yes this is perfectly possible
You need a PCF8574 available from Texas instruments
RS, CPC . Arrow electronics components or similar will supply this then use the LCD in 4 bit mode only
You cant use the full 8 bit capability of the aforementioned IC since you need lines RS , EN and back light amounting to 7 bits
You can how ever use this with LCD in 4 Bit Mode
Interfacing PCF8574 with Arduino
Since the job of the PCF8574 Module is to expand the IO capabilities of a microcontroller, we can use it with our Arduino UNO board to increase the digital IO count to 21. The IO Port pins of the Module can be used as either input or output
The following is a simple block diagram of interfacing PCF8574 with a microcontroller where two of the IO Port pins are configured as inputs, one pin is to drive an LED and the remaining pins acts as control pins (outputs) for several external peripherals.
First, we have to figure out the I2C bus slave address of the PCF8574 Module. Use the following code to calculate the address of the Module This is done through A0 , A1 and A2 by grounding pins to select your address
PCF8574 example with Arduino
- Code:
#include <Wire.h>
void setup()
{
Wire.begin();
Serial.begin(9600);
while (!Serial);
}
void loop()
{
byte error, address;
int I2CDevices;
Serial.println(“Scanning for I2C Devices…”);
I2CDevices = 0;
for (address = 1; address < 127; address++ )
{
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
Serial.print(“I2C device found at address 0x”);
if (address < 16)
Serial.print(“0″);
Serial.print(address, HEX);
Serial.println(” !”);
I2CDevices++;
}
else if (error == 4)
{
Serial.print(“Unknown error at address 0x”);
if (address < 16)
Serial.print(“0”);
Serial.println(address, HEX);
}
}
if (I2CDevices == 0)
Serial.println(“No I2C devices found\n”);
else
Serial.println(“****\n”);
delay(5000);
}
Next you need to write to ports of the PCF8574
This would be your approach to this solution and then you need to go and obviously look at your commands for the arduino and substitue into your I2C commands for in your code
See below for example code
- Code:
#include <Wire.h>
void setup()
{
Wire.begin();
}
void loop()
{
Wire.beginTransmission(0x20);
Wire.write(0xAA);
Wire.endTransmission();
delay(1000);
Wire.beginTransmission(PCF8574_ADDR);
Wire.write(0x55);
Wire.endTransmission();
delay(1000);
}
Images for basic interface
I trust that answers your question