Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Cant get I2C LCD working

Cant get I2C LCD working

Scheduled Pinned Locked Moved General Discussion
11 Posts 4 Posters 4.8k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • y4CdW42Ol8Y Offline
    y4CdW42Ol8Y Offline
    y4CdW42Ol8
    wrote on last edited by
    #2

    @y4CdW42Ol8
    Let me be more specific. I have the 20x4 line LCD connected to a Arduino DUE using 5v, GND, A4 > SDA, and A5 > SCL. The back light come on when power is ON, and that's it. I have successfully compiled the Blinking Cursor and Hello World examples in the MySensory I2C libary (changing: LiquidCrystal_I2C lcd(0x20, 20, 4); because my LCD A0-A2 not jumpered). But nothing happens on the LCD. The LED on the small I2C board is ON. The DUE is working, since I have run other sketches.

    What could I be doing wrong? A bad LCD? Bad PINS on the DUE? How do I change the PIN numbers on the DUE.

    Some other Examples in the LiquidCrystal_I2C library use the following:

    #define BACKLIGHT_PIN 13
    LiquidCrystal_I2C lcd(0x38); // Set the LCD I2C address

    OR
    //LiquidCrystal_I2C lcd(0x38, BACKLIGHT_PIN, POSITIVE); // Set the LCD I2C address

    What does Backlight_PIN 13 do?

    Also, what does the potentiometer on the small I2C board?

    Hope someone can help...

    1 Reply Last reply
    0
    • N Offline
      N Offline
      NotTooTechy
      wrote on last edited by
      #3

      Just a similar issue some new LCD s arrived and swapped them into an existing working Sketch and got nothing

      I was using "0x27" so tried "0x3F" and I got back light, good start. Then turned the little pot (Contrast) on the back a bongo, text. All good.

      LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address
      LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address

      1 Reply Last reply
      1
      • y4CdW42Ol8Y Offline
        y4CdW42Ol8Y Offline
        y4CdW42Ol8
        wrote on last edited by
        #4

        @NotTooTechy said:

        LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address

        What do I declare POSITIVE as?

        y4CdW42Ol8Y 1 Reply Last reply
        0
        • y4CdW42Ol8Y y4CdW42Ol8

          @NotTooTechy said:

          LiquidCrystal_I2C lcd(0x27,2,1,0,4,5,6,7,3,POSITIVE); // Set the LCD I2C address

          What do I declare POSITIVE as?

          y4CdW42Ol8Y Offline
          y4CdW42Ol8Y Offline
          y4CdW42Ol8
          wrote on last edited by
          #5

          @y4CdW42Ol8

          Your suggestions did not work. I ran the YourDuino address scanner, and got:
          I2C scanner. Scanning ...
          Done.
          **Found 0 device(s).
          **

          N 1 Reply Last reply
          0
          • y4CdW42Ol8Y y4CdW42Ol8

            @y4CdW42Ol8

            Your suggestions did not work. I ran the YourDuino address scanner, and got:
            I2C scanner. Scanning ...
            Done.
            **Found 0 device(s).
            **

            N Offline
            N Offline
            NotTooTechy
            wrote on last edited by NotTooTechy
            #6

            **Found 0 device(s).

            Are you sure you have it all wired correctly?
            SDA goes to ANALOG pin 4
            SCL goes to ANALOG pin 5

            Also, looking at your first Post I don't think 0x20 is a valid address for LCD. Try the two I posted above one-at-a-time and don't forget the Contrast pot on the back, the little blue block.

            I will try YourDuino and see what I get.

            p.s.
            POSITIVE being in all caps suggests it is a Global predefined Constant so just use it EXACTLY as I provided above. Copy, paste and try one at a time.

            1 Reply Last reply
            0
            • y4CdW42Ol8Y Offline
              y4CdW42Ol8Y Offline
              y4CdW42Ol8
              wrote on last edited by
              #7

              100% sure it's wired correctly. Tried your addresses, and cut/paste your line - nothing works.
              I'm pretty sure the LCD is dead or pin A4 or A5 on the DUE is dead.
              Thanks.

              N 1 Reply Last reply
              0
              • y4CdW42Ol8Y y4CdW42Ol8

                100% sure it's wired correctly. Tried your addresses, and cut/paste your line - nothing works.
                I'm pretty sure the LCD is dead or pin A4 or A5 on the DUE is dead.
                Thanks.

                N Offline
                N Offline
                NotTooTechy
                wrote on last edited by
                #8

                Is there a jumper on the two pins at the other end of the serial board on the back? My most recent ones came withOUT those and I get no back-light or red-LED on the serial board until I put a jumper on them.

                1 Reply Last reply
                0
                • dbemowskD Offline
                  dbemowskD Offline
                  dbemowsk
                  wrote on last edited by
                  #9

                  @y4CdW42Ol8 said:

                  Also, what does the potentiometer on the small I2C board?

                  Most if not all of these LCD modules are based off of the older parallel 44780 based LCDs. This is probably a clone or very similar. I am guessing that the potentiometer is the contrast control. double check that in the documentation for the I2C board that is on the back, but if it is, you may need to turn that up or down to get your unit to display. If there is no documentation, look at the I2C board on the back. It should connect to a 16 pin header connector. For the 44780 LCDs it was pin 3 that was the contrast pin. The pot just created a voltage divider that went from 0(GND) to +5V. If you can trace the pins on the pot, you should see one going to GND or pin 1 on the header, 1 to +5V or pin 2 on the header, and the other one to the contrast pin 3 of the header. If that all checks, then that is for sure your contrast control.
                  http://www.learningaboutelectronics.com/Articles/Arduino-HD44780-circuit.php

                  Vera Plus running UI7 with MySensors, Sonoffs and 1-Wire devices
                  Visit my website for more Bits, Bytes and Ramblings from me: http://dan.bemowski.info/

                  1 Reply Last reply
                  0
                  • y4CdW42Ol8Y Offline
                    y4CdW42Ol8Y Offline
                    y4CdW42Ol8
                    wrote on last edited by
                    #10

                    Hello All,
                    Everything is working… The problem was that the Arduino DUE puts out SCL and SDA on pins 21 & 20, respectively.
                    Thank you.

                    GertSandersG 1 Reply Last reply
                    1
                    • y4CdW42Ol8Y y4CdW42Ol8

                      Hello All,
                      Everything is working… The problem was that the Arduino DUE puts out SCL and SDA on pins 21 & 20, respectively.
                      Thank you.

                      GertSandersG Offline
                      GertSandersG Offline
                      GertSanders
                      Hardware Contributor
                      wrote on last edited by
                      #11

                      @y4CdW42Ol8
                      Try compiling with SDA instead of A4 and SCL instrad of A5 in the pinmode function. This should make the sketch board independant. And then use the correct pins on each board.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      19

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular