element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Arduino I2C display
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 22 replies
  • Answers 1 answer
  • Subscribers 405 subscribers
  • Views 4489 views
  • Users 0 members are here
  • lcd
  • i2c
  • help
  • 20x4
  • arduino
  • module
Related

Arduino I2C display

danyboy
danyboy over 12 years ago

Hello:

I'm a hobbist electronics student and I have been experimenting with arduino for a while. I have worked with character and graphic LCD without any serious problems. I wanted to save wires, so I bought an I2C LCD 20x4 module from ebay. However I have not been able to get it working. I have downloaded the most recent I2C library and I have followed all the instructions but my LCD simply won't work. Instead it lights up like this. The supplier told me that the address of my display is 0x27, but when I use this address nothing happens. After trying different addresses, I dicovered that if I use 0x20 as an address some characters blink randomly with the example code running. the chip on the board is the pcf8574 from Phillips.

Attachments:
image
image
  • Sign in to reply
  • Cancel

Top Replies

  • Workshopshed
    Workshopshed over 12 years ago in reply to billabott +2
    The problem seems to be that pcf8574 is just an I/O expander so it can be wired up differently. The device I chose luckily had a ST7032 LCD controller chip so I did not have that issue but I still had…
  • mcb1
    mcb1 over 12 years ago in reply to danyboy +1
    Daniel You might need to clarify some items here. 1. Your sketch allocates the backlight on D13, but your display is a I2C version and the backlight pins are LCD 16 and 15 (as shown on top left of your…
  • billabott
    billabott over 12 years ago +1 suggested
    #include <Wire.h> #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd2 = LiquidCrystal_I2C(0x27,20,4); // Set the LCD address, # columns and # rows // Create a set of new characters const uint8_t charBitmap…
Parents
  • billabott
    0 billabott over 12 years ago

    @ALL concerned about Serial LCD

     

    Please see this post on the Arduino Playground: http://playground.arduino.cc/Learning/SparkFunSerLCD

     

    It reinforces some things I first learned about the Serial LCD interface:

    1. Character (byte) driven.

    2. Can be treated like the Serial Monitor (within IDE).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 12 years ago in reply to billabott

    Daniel

     

    The connections seem right.

    I had a look at Terry Kings site (yourduino.com) and found this relating to that version of display, that he also sells.

    http://arduino-info.wikispaces.com/LCD-Blue-I2C#v2

     

    The pin definitions may explain some of the issues.

     

    BTW it is definately an I2C display and the library you have is set for the newer version of IDE.

     

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • billabott
    0 billabott over 12 years ago in reply to mcb1

    Extract from TerryK's notebook:

     

    //---(Following are the PCF8574 pin assignments to LCD connections )----

    // This are different than earlier/different I2C LCD displays

    #define BACKLIGHT_PIN  3

    #define En_pin  2

    #define Rw_pin  1

    #define Rs_pin  0

    #define D4_pin  4

    #define D5_pin  5

    #define D6_pin  6

    #define D7_pin  7

     

    #define  LED_OFF  1

    #define  LED_ON  0

     

    /*-----( Declare objects )-----*/ 

    LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


    The above expanded library interface makes clear to me that the vendors could have wired the 4 serial control and 4 data pins of the LCD any old way (actually 8! = 40,320 ways) they choose to onto the PCF8574's output pins.  So, why is it that the vendors don't provide that info to make their devices understandable and useable to the open source community?  Everyone, who has bought one of these I2C LCD units should contact the vendors and demand on behalf of the OS community that the interface between the PCF8574 output and LCD control/data lines be PUBLISHED on the web, IMHO.  

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Reply
  • billabott
    0 billabott over 12 years ago in reply to mcb1

    Extract from TerryK's notebook:

     

    //---(Following are the PCF8574 pin assignments to LCD connections )----

    // This are different than earlier/different I2C LCD displays

    #define BACKLIGHT_PIN  3

    #define En_pin  2

    #define Rw_pin  1

    #define Rs_pin  0

    #define D4_pin  4

    #define D5_pin  5

    #define D6_pin  6

    #define D7_pin  7

     

    #define  LED_OFF  1

    #define  LED_ON  0

     

    /*-----( Declare objects )-----*/ 

    LiquidCrystal_I2C  lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


    The above expanded library interface makes clear to me that the vendors could have wired the 4 serial control and 4 data pins of the LCD any old way (actually 8! = 40,320 ways) they choose to onto the PCF8574's output pins.  So, why is it that the vendors don't provide that info to make their devices understandable and useable to the open source community?  Everyone, who has bought one of these I2C LCD units should contact the vendors and demand on behalf of the OS community that the interface between the PCF8574 output and LCD control/data lines be PUBLISHED on the web, IMHO.  

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
Children
  • Workshopshed
    0 Workshopshed over 12 years ago in reply to billabott

    The problem seems to be that pcf8574 is just an I/O expander so it can be wired up differently. The device I chose luckily had a ST7032 LCD controller chip so I did not have that issue but I still had an issue with the I2C address. I'm guessing that the backpacks take the expander approach because there is already a controller chip on the parallel LCD?

     

    http://www.workshopshed.com/2012/07/a-little-venture-with-electronics-lcd.html

     

    Since doing that I notice that on the Arduino site there is a I2C scanner which can obviously help with unknown devices.

     

    http://playground.arduino.cc/Main/I2cScanner

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to billabott

    Guys,

    I checked the library, the library seems to be okay and working if we using Arduino 0022/0023 but not on Arduino 1.0.3.

    Checked arduino forums, i2c (Wire) library is broken, the earlier i2c programs dont work in the new one.

     

    Suggest, using ur own i2c functions or modding the library, i checked couple of different i2c chips which i had in hand, 24c04 (serial eeprom), ended up writing my own functions

     

    cheers

    sid

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • mcb1
    0 mcb1 over 12 years ago in reply to Former Member

    Strange

    I've had mine working, and if you check it handles both versions.

     

    The issue with the OP is the setup to pass the data.

     

    Mark

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Workshopshed
    0 Workshopshed over 12 years ago in reply to mcb1

    I've also had no issues with different versions if the wire library, compiles ok with 1.0.3 -> 1.0.5.

    I found with some very early examples I needed to change #include "WProgram.h" to be #include "Arduino.h" but otherwise no changes.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to Workshopshed

    andy,

    thanks for the correction, i am using arduino 1.0.1, it compiles with 1.0.3

     

    cheers

    sid

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • danyboy
    0 danyboy over 12 years ago in reply to billabott

    Billabot:

    Thank you so much for all your help. I discovered that the enable and rs pins were inverted in my module. After several frustrating hours of library modificaion, I was finally able to get my display going.

    image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • billabott
    0 billabott over 12 years ago in reply to danyboy

    Hooray!  Good job everyone.

     

    Dan, you may, if you wish, select others to be rewarded with the Helpful Answer points recognition.  Please give credit where credit is due.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • jose_santos
    0 jose_santos over 10 years ago in reply to danyboy

    you resolve your problem ????????

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube