Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Arduino with i2c lcd

Status
Not open for further replies.

ravi.2k17

Advanced Member level 4
Joined
Sep 30, 2019
Messages
111
Helped
0
Reputation
0
Reaction score
1
Trophy points
18
Activity points
874
hi all,

I have connected my Arduino with my 16x2 lcd via 12c module. after loading code it shows only bright green screen with two blank lines.
on the other hand when i see the lcd from side, it shows some absurd characters moving fast from left to right.
what could be the problem here? is lcd faulty?

lcd used

i2c interface to connect lcd with Arduino uno



schematic is attached herewith.


Code:
// Include the libraries:
// LiquidCrystal_I2C.h: [URL]https://github.com/johnrickman/LiquidCrystal_I2C[/URL]
#include <Wire.h> // Library for I2C communication
#include <LiquidCrystal_I2C.h> // Library for LCD

// Wiring: SDA pin is connected to A4 and SCL pin to A5.
// Connect to LCD via I2C, default address 0x27 (A0-A2 not jumpered)
LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2);

void setup() {
  // Initiate the LCD:
  lcd.init();
  lcd.backlight();
}

void loop() {
  // Print 'Hello World!' on the first line of the LCD:
  lcd.setCursor(0, 0); // Set the cursor on the first column and first row.
  lcd.print("Hello World!"); // Print the string "Hello World!"
}
 

Attachments

  • I2C-LCD-with-Arduino-Wiring-Diagram-Schematic-Pinout.jpg
    I2C-LCD-with-Arduino-Wiring-Diagram-Schematic-Pinout.jpg
    25.6 KB · Views: 306
Last edited by a moderator:

Your loop is running far too fast. Add a delay, I suggest 0.5S, after the 'lcd.print("Hello World!");' line and you will then see what is happening.

I use the same LCD and I2C expander here very successfully.

Brian.
 

Your loop is running far too fast. Add a delay, I suggest 0.5S, after the 'lcd.print("Hello World!");' line and you will then see what is happening.

I use the same LCD and I2C expander here very successfully.

Brian.

now i see junk char moving from left to write slowly. can there be pin soldering issue also ... i solder i2c adapter to lcd my self ...it did not come manufactured.
 

I From the schematic, seems like you missed the pull-up resistors on the I2C bus.
 

I From the schematic, seems like you missed the pull-up resistors on the I2C bus.
i think pull-up register would have been handled in the i2c break board i am using. otherwise it would have been shown in the schematics which i am referring to. please correct if i am wrong.

1604897681765.png
 

Attachments

  • 1604897347997.png
    1604897347997.png
    200.8 KB · Views: 299

I just checked the same PCB here and it does appear to have 4K7 resistors between SCL & SDA to the VCC pin. No very clever design if used in a multi-board environment but it does make this application simpler.

Brian.
 

I just checked the same PCB here and it does appear to have 4K7 resistors between SCL & SDA to the VCC pin. No very clever design if used in a multi-board environment but it does make this application simpler.

Brian.

i readjusted the pins between I2c and lcd and later observed that char are seen only when you tilt the screen then i adjusted the brightness and now every thing seems to be ok.
 

One problem with the approach is update rate of LCD as you see, the delay helps,
but you can still get artifacts when writing display repeatedly with same info.

One approach, very effective, is to create a buffer in ram, same form factor as display,
in this case array 2 x 16. When you go to write you compare, character for character,
the new info versus the array.l If different you update array, only characters that change,
followed by display update, onlky characters that change.

If no differences NOP. That will cut out a lot of display artifacts.


Regards, Dana.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top