Ethernet Arduino I2C LCD Conflict

Dear All,

Using http://arduino.cc/en/Main/ArduinoBoardEthernet board enabled with Ethernet and SD card.

Have connected a normal I2C (16 char X 2 Lines) LCD to the board....

Using "LiquidCrystal_I2C.h" library to write simple code for the LCD

----Code------

    void setup()
    {
       Serial.begin(9600);

         lcd.init();                      // initialize the lcd 

      // Print a message to the LCD.
      lcd.backlight();
      lcd.print("Hello, world!");
    
        Serial.println ("LCD init OK");

        Ethernet.begin(mac);

       Serial.println("Eth. OK!");
    } 

    void loop()
{
  //Main code
}

-----Code end--------

It never prints "Eth. Ok!" there is a problem over there...

I see in the library of LCD there is Wire.begin () (I guess this is the master mode) ? Is that a problem

The ethernet is on the board... please check link

Thanks

Bump.

Moderator edit. Name-check removed.

You need to set the I2C address of the I2C LCD with something like this before void setup: LiquidCrystal_I2C lcd(0x27,16,2); You should find the I2C address in the datasheet of your LCD.

I have used an I2C display and ethernet shield without problems with an Arduino Duemilanove and Uno... Here is a sketch with 2 I2C devices, SD card, temp sensors and an ethernet shield: http://www.bajdi.com/syncing-ds1307-rtc-with-timeserver/

Does it print "Hello World" on the LCD, and "LCD init OK" in the serial monitor? What makes you think the problem with the Ethernet initialization has anything to do with the LCD? And what libraries are you including (you seem to have left that out of your code)?

danb35:
Does it print “Hello World” on the LCD, and “LCD init OK” in the serial monitor? What makes you think the problem with the Ethernet initialization has anything to do with the LCD? And what libraries are you including (you seem to have left that out of your code)?

Thanks for the reply

It Prints “Hello World” on the LCD and “LCD init OK” in the serial monitor

If i disable the LCD then it works fine…

Libraries for LCD

  #include <Wire.h> 
  #include <LiquidCrystal_I2C.h>
  
  LiquidCrystal_I2C lcd(0x27,16,2);  // set the LCD address to 0x27 for a 16 chars and 2 line display

Libraries for Ethernet

#include <Ethernet.h>			//Ethernet

#include <SPI.h>

Using http://arduino.cc/en/Main/ArduinoBoardEthernet board enabled with Ethernet and SD card.

Do you have a memory card in the microSD slot? Are you using IDE v1.0.1? How is the LCD display connected to the Arduino? What pins are you using?

Bajdi: You need to set the I2C address of the I2C LCD with something like this before void setup: LiquidCrystal_I2C lcd(0x27,16,2); You should find the I2C address in the datasheet of your LCD.

I have used an I2C display and ethernet shield without problems with an Arduino Duemilanove and Uno... Here is a sketch with 2 I2C devices, SD card, temp sensors and an ethernet shield: http://www.bajdi.com/syncing-ds1307-rtc-with-timeserver/

Those Parameters are included.

Looking at your example only thing missing is i don't use Wire?

SurferTim:

Using http://arduino.cc/en/Main/ArduinoBoardEthernet board enabled with Ethernet and SD card.

Do you have a memory card in the microSD slot?
Are you using IDE v1.0.1?
How is the LCD display connected to the Arduino? What pins are you using?

No memory card in SD card slot

Yes, IDE 1.0.1

LCD is connected via I2C

Project.ino----Full project code is attached… It stops executing After printing "Eth. Init " and nothing works after that : Ethernet.begin() where it stops

On the contrary i made a simple example only consisting of LCD and Ethernet and that works…… “Hello World _with Ethernet”…

I can’t spot whats wrong … please help.

Project.ino (19.6 KB)

HelloWorld__with_ethernet.ino (1.31 KB)

Bump.

Moderator edit. Namecheck removed.

Stop bumping this thread every hour or so. If you keep doing so I will delete the thread and your account.

  • Moderator

Hello! All,

Still having issues… with the code… have modified a bit…

The code stops functioning on Ethernet.begin(), If LCD (I2C) code is removed it works fine…

Please find attached copy of the new code.

Regards,
jainvikas8

Project.ino (20 KB)

I have a trouble like this. I'm using UnoR3 with Ethernet Shield R3 and a LCD 4x20 lines connected in I2C.

If I write a simple sketch to print something on the display and connect onyl UNO and LCD, it works fine.

When I add the ethernet shield with the same code, LCD doesn't work. Is it possible that the Pin4 used by the SSD card reader interfer with I2C ?!