lcd module rcf8574 factory

A regular LCD requires a lot of wires (parallel interface) to be connected with a Microcontroller.The Serial LCD  backpack built on PCF8574 IC uses the I2C bus to convert  the parallel interface to a serial one.This needs only2 wires SDA & SCL , apart from the power connections.

The blue preset is to adjust the contrast of the LCD. The black jumper on the left is to enable the Backlight of LCD. The I2C device has a HEX address by which a microcontroller can communicate with it.This is set by the 3 bits A0,A1 ,A2 .If no jumper is present , it is HIGH &  a jumper means LOW. By default all the 3 jumpers are open . ie., A0,A1 A2 all are 1s.

lcd.setBacklightPin(HIGH);  makes the P3 pin go High, which turns on the NPN transistor.This provides GND to the LED pin of LCD As the other LED pin is already connected to Vcc through the jumper , the LCD backlight glows.

lcd module rcf8574 factory

16×2 LCD is an alphanumeric display that can show up to 32 characters on a single screen. You can display more characters by scrolling the texts one by one. We have already seen how to connect LCD Display directly with the Arduino using 4bit and 8bit modes in our previous tutorial. But those two modes will utilize many numbers of GPIO Pins of our Arduino and we would have to end up with less number of pins for other sensors and actuators.

To overcome this problem we use LCD I2C backpack with our LCD. This I2C Backpack uses PCF8574 Remote 8 bit I/O Expander. It translates the data received from the I2C Bus into Parallel data that is needed for the LCD Display.

Inter-integrated Circuit (in short I2C) is a two-wire short distance communication protocol. You can use multiple slave devices in the same two wires with one or more master controllers. You may wonder how does the master identifies which slave does the data to be sent. In I2C the external devices have an I2C address for different external devices like LCD Backpack, OLED Display, etc. By using the address the data is sent to the specific device connected on the same I2C Bus.

There are totally 16 pins in an LCD Display. You can use directly all the pins in 8-bit mode with Arduino or 12 pins using 4-bit mode. In this tutorial, we use the I2C module for LCD and multiplex it into just 4 pins. This pin details might not be useful while using I2C Method but this is the actual pin details of all the pins in LCD Display.

RS – Register select. Specify what we are sending Command or Data. Sets to 0 for Command mode like setCursor, LCD Clear, TurnOFF LCD. Set 1 for data mode like sending Data/Characters.

First, we need to find the address of our I2C LCD Backpack. For that, we will be using I2C Scanner code to display the address in the serial monitor. Upload the following code, then note down the I2C address from the serial monitor.#include

Now the LCD I2C library is installed. We need to define and initialize the library using its associated functions. The steps is as follows. Or you can copy the code given below to print Hello World example.

Set the address that we copied from I2C Scanner code. The address I got is 0x27 so I replaced it to 0x27 in the following lineLiquidCrystal_I2C lcd(0x27, 16, 2);

In the above code, we have created an LCD object for ‘LiquidCrystal_I2C’. So you can use directly use the regular LCD functions to work with I2C like lcd.begin(), lcd.print(“”), etc.

To print a string we use lcd.print() function with string in its parameters. This prints ‘Factory’ string in the 1st row and ‘Forward’ in the 2nd row.

This function sets the cursor on 7th column and 2nd row. Printing the string will gets displayed from this location on LCD.lcd.setCursor(6,1); // Sets cursor column and row position

By Using lcd.blink() function we can make the cursor blinking on LCD. To turn off the blinking cursor we use lcd.noBlink() function.lcd.blink(); //Blinking cursor

Use lcd.cursor() function for printing an underscore symbol. It is also used for notifying users to enter some values.lcd.cursor(); // Prints an underscore symbol

lcd module rcf8574 factory

This PCF8574 based module is a versatile I/O port expansion module. It is basically a I2C based port enpansion module which can convert any 8 bit data from I2C serial to 8-bit parallel. LCD if used with this module will require only 2 GPIO lines that will save a lot of hardware resources.

lcd module rcf8574 factory

Using LCD modules with your Arduino is popular, however the amount of wiring requires time and patience to wire it up correctly – and also uses a lot of digital output pins. That’s why we love these serial backpack modules – they’re fitted to the back of your LCD module and allows connection to your Arduino (or other development board) with only four wires – power, GND, data and clock.

The backpack can also be used with 20 x 4 LCDs. The key is that your LCD must have the interface pads in a single row of sixteen, so it matches the pins on the backpack – for example:

Now let’s get started. First you need to solder the backpack to your LCD module. While your soldering iron is warming up, check that the backpack pins are straight and fit in the LCD module, for example:

Once you’ve finished trimming the header pins, get four male to female jumper wires and connect the LCD module to your Arduino as shown in the following image and table. Then connect your Arduino to the computer via USB:

The next step is to download and install the Arduino I2C LCD library for use with the backpack. First of all, rename the “LiquidCrystal” library folder in your Arduino libraries folder. We do this just to keep it as a backup.

Now restart the Arduino IDE if it was already running – or open it now. To test the module we have a demonstration sketch prepared, simply copy and upload the following sketch:

As opposed to using the LCD module without the backpack, there’s a few extra lines of code to include in your sketches. To review these, open the example sketch mentioned earlier.

You will need the libraries as shown in lines 3, 4 and 5 – and initialise the module as shown in line 7. Note that the default I2C bus address is 0x27 – and the first parameter in the LiquidCrystal_I2C function.

Finally the three lines used in void setup() are also required to initialise the LCD. If you’re using a 20×4 LCD module, change the parameters in the lcd.begin()function.

From this point you can use all the standard LiquidCrystal functions such as lcd.setCursor() to move the cursor and lcd.write() to display text or variables as normal. The backlight can also be turned on and off with lcd.setBacklight(HIGH) or lcd.setBacklight(LOW).

If you want to use more than one module, or have another device on the I2C bus with address 0x27 then you’ll need to change the address used on the module. There are eight options to choose from, and these are selected by soldering over one or more of the following spots:

There are eight possible combinations, and these are described in Table 4 of the PCF8574 data sheet which can be downloaded from the NXP website. If you’re unsure about the bus address used by the module, simply connect it to your Arduino as described earlier and run the I2C scanner sketch from the Arduino playground.

lcd module rcf8574 factory

This LCD I2C interface adapter can be added to a 16 x 2 or 20 x 4 character LCD display with a standard parallel interface to make it I2C compatible.  It can also be repurposed for other I2C to parallel tasks.

By default, the industry standard HD44780 compatible 16 x 2 and 20 x 4 character LCD displays require 4 or 8 parallel data lines to drive them along with a couple of pins for chip select and chip enable.  This consumes a lot of pins on the MCU.  This adapter board reduces the data pin requirements to only 2 pins which can also be shared with other I2C devices.

The backlight can be controlled ON/OFF, but the intensity is not directly controllable though the I2C interface.  Some modules have a jumper on the board that supplies Vcc power to the backlight.  That jumper can be removed and a voltage applied to the header pin nearest the ‘LED’ markings on the board to provide power to the backlight separately.  Note:  Some modules do not have this header / jumper installed, instead the solder pads have a trace connecting them.  It is possible to cut the trace between the pads and add header pins if desired.

The PCF8574 is a generic I2C to 8-bit I/O device and the module can be repurposed for other uses besides driving LCD modules.  Max I2C clock frequency is 100kHz which makes it most suited to lower speed applications.

VCC =  Connect to 5V.  This can come from the MCU or be a separate power supply.  Some LCD may operate at 3.3V and this module can also operate at 3.3V

The pin-out of the header which is soldered to the LCD follows for reference, but in general you don’t need to worry about it as the I2C interface board and software library takes care of this interface unless you are adapting the module for another use.  These pins are listed starting at the I2C header end of the board.

To use the adapter with an LCD, you will need to insert the 16-pin header into the 16 solder pad holes on the back of the LCD and solder them in place on the front side.  The pins are long and can be cut off before or after soldering.

Soldering the module on is easy to do, but if you already have other pins in those holes, they will need to be removed first before this board can be added.  The picture below shows the adapter mounted to the back of an LCD2004 4 x 20 character LCD.

This is the same module used on our I2C compatible LCD displays we sell and is well supported using the LiquidCrystal_I2C.h and similar libraries.  For using the board with software, you can check out one of the LCDs below that already have this module installed.

The PCF8574 itself is a general purpose 8-bit I/O expander for the I2C bus.  The reverse engineered schematics are provided here mainly for those who may want to adapt the module to other applications.  The I2C bus on this module is limited to a 100kHz clock frequency.