Arduino Dual 20x4 Display

Published

Introduction: Arduino Dual 20x4 Display

About: Dr James Moxham is a general medical practitioner in Blackwood, Australia. His interests include general family medicine, medical politics, microcontrollers and tending a rose garden. He lives on a property ...

This project shows how to drive two 20x4 LCD displays on the I2C bus on an arduino. Each display has an 80 character buffer and works as a scrolling terminal. Print a string, and it will display at the bottom of the screen and when that line is full, all the lines scroll up.

Step 1: Modify the Address of One of the I2C Boards

You can buy displays with these I2C adapters soldered on the back (or buy the adapter separately for about a dollar). Old displays were at address 0x27 but the ones available in the last few years are at address 0x3F. If the address is not correct, the display won't work at all, which can be confusing if you have downloaded some code and expect it to work out of the box.

Also the displays need the pot turned to the correct contrast - the default when you buy them is nothing displayed and zero contrast. Set it so the background just starts to appear.

On the back are three little pads you can bridge, labelled A0, A1 and A2, and these allow up to 8 displays with addresses 0x38 to 0x3F. By soldering the pad on A0 the address changes from 3F to 3E.

The arduino board I have has 4 pins for the I2C bus, and SDA and SCL are also replicated on the top socket. You could build a 'daisy chain' I2C adaptor, or just use the available pins as shown in the photo.

Code is attached and using this is as simple as printLCD("Hello World",1); where the number indicates display 1 or 2. It would be possible to add more displays if needed as the only code overhead for each display is the 80 byte display buffer.

Share

    Recommendations

    • Planter Challenge

      Planter Challenge
    • Casting Contest

      Casting Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    2 Comments

    I have a couple of pro minis, using the same LCD one runs at 0x3Fon one mini and the other at 0X27. I think it's prudent to run the i2c scanner to verify the addresses.

    Everytime I do these LCD I follow the directions to the letter,wire for wire,code for code then nothing,I learned how to find address 0x3F,put it in code,still nothing,then I try another one without I2C different code and that works,why?