SIMULATION FOR I2C T0 LCD 16X2 USING PROTEUS

Trying to simulate i2c to lcd via proteus but it didnt worked out. Theres a backlight and no error but it is just not displayed. The coding was okay as i already try on the hardware/prototype and i think the problem might came from the circuit that i made on the proteus. Can anyone share the exact way on connecting all the components to create i2c for lcd. Below is the connection of the circuit that i made. Please Need a help.

Can anyone share the exact way on connecting all the components to create i2c for lcd.

Why are you asking this crap here? This is NOT the proteous forum. We do NOT even approve of the use of that crap. We prefer the real thing!

That "crap" you refer to, is probably where the first arduino board was designed and developed !

While I agree with compiling, uploading and trying approach, simulating stuff, can at times (most of the time) save you a lot of debugging time, which is why it is a widely used approach in the industry. Everyone is entitled to his opinion. You prefer the hardware approach so be it. No one is saying you are wrong.

It can also help debug when on the move with just your laptop available.

I agree also that this is not a proteus forum, however, jumping on someone who is new like that is not going to make the community grow, or make anyone any favours. A comment like yours will only scare people away.

No one was born a genius. I am also new here, and stumbled upon this post, precisely for the same reason.

The correct way to simulate it btw is to add a PCF 8574 beween your arduino and the LCD. Pins 4,5,6 of the 8574 go to RS, RW, E of the LCD, while P4 to P7 connect to the LCD D4 to D7.

A0, A1, A2 in my case are grounded (this give address 0x20 in sim not in real life)

The I2C address of the 8574 on proteus is 0x20

use : LiquidCrystal_I2C lcd(0x20,16,2); for simulation

and LiquidCrystal_I2C lcd(0x3f,16,2); for real hardware

It took me a while to figure it out so am posting here for anyone who might be struggling with the same issue.

jackall:
I agree also that this is not a proteus forum, however, jumping on someone who is new like that is not going to make the community grow, or make anyone any favours. A comment like yours will only scare people away.

Yes, "scare" them away to the proper forum which is not here.

The question has nothing to do with the Arduino except that it uses one. LOL.

Wow ... What a lovely and welcoming community. Keep scaring people away then, its the best way forward for the community to grow !

I was looking for information about this setting on Google and this link is on top of the list as this forum is popular.

Thanks for the picture, but are there libraries for I2C or only the LCD in 4-bits mode?

THANK YOU Jackall for your help.
arduino to 8574, perfect!

diyanakamarul:
Trying to simulate i2c to lcd via proteus but it didnt worked out. Theres a backlight and no error but it is just not displayed. The coding was okay as i already try on the hardware/prototype and i think the problem might came from the circuit that i made on the proteus. Can anyone share the exact way on connecting all the components to create i2c for lcd. Below is the connection of the circuit that i made. Please Need a help.

Please use PCF8574A instead pcf8574.

PaulS:
Why are you asking this crap here? This is NOT the proteous forum. We do NOT even approve of the use of that crap. We prefer the real thing!

PaulS:
Why are you asking this crap here? This is NOT the proteous forum. We do NOT even approve of the use of that crap. We prefer the real thing!

Crap!?

Checked your posts and as shown below:

PaulS

Posts:
93648 (24.605 per day)

Date Registered:
Oct 28, 2009, 01:42 pm
Local Time:
Mar 30, 2020, 10:32 pm

Signature:
The art of getting good answers lies in asking good questions.

And most are trolling craps!

It seems you have no life elsewhere except here!

And FYI, the question is very much legit and popular if you see the stats on the OP's post image as below:

119.76 KB
downloaded 4422 times

And your signature, does match who you are!

So, ... go...

We all were noobs someday and were helped by good peolpe.

For the greater good and others with same question. Here is a full example.

/*
  Arduino LCD I2C with PCF8574 chip On Proteus Tutorial
  --------------------------------------------------------------------------------------------------
  Datasheet:         http://https//ecee.colorado.edu/~mcclurel/Philips_I2C_IO_Expander_PCF8574_4.pdf  
  Crated by:         ARDULECTRO, April 2020
  Posted on:         https://forum.arduino.cc 
  For this thread:   https://forum.arduino.cc/index.php?topic=507401.0
  --------------------------------------------------------------------------------------------------
  
  Important notes:

  1.  For the I2C chip's address, the default is sometimes 0x27 or 0x3F depending on the setup. So in case it didn't display the writings, 
      change the address to see which one works.
      
  2.  Also depending on the LCD manufacturer, there are LCDs with I2C interface that has pads or pins that can be jumpered to change the address.
  
  3.  The provided jumpers usually are labelled as A0-A1-A2 . You can refer to the table below to chabge the address from a default of 0x27 and/or 0x3F, to any required.
      (1 = Not Jumpered. 0 = Jumpered)

      A0  A1  A2  HEX-Address
      1   1   1   0x27   
      0   1   1   0x26
      1   0   1   0x25
      0   0   1   0x24
      1   1   0   0x23
      0   1   0   0x22
      1   0   0   0x21
      0   0   0   0x20
  
*/

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define LCD_RS 2
#define LCD_RW 1
#define LCD_E  0 // sometimes EN
#define LCD_D4 4
#define LCD_D5 5
#define LCD_D6 6
#define LCD_D7 7
#define LCD_BACKLIGHT 3

// LCD type is the 20x4 
// 20 is cols as the maximum limit of characters from left to right
// 4 is rows as the maximum limit of lines from up to down
#define LCD_COLS 20
#define LCD_ROWS 4

// The 0x20 is the I2C address for PCF8574 in proteus only, 
// Remeber that in real hardware setup, this number must be 0x27 instead
#define LCD_I2C_ADDRESS 0x20

// Create LCD object and map to the assigned pins
LiquidCrystal_I2C lcd(LCD_I2C_ADDRESS , LCD_RS, LCD_RW, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7, LCD_BACKLIGHT, POSITIVE); 

void setup() {

  lcd.begin(LCD_COLS, LCD_ROWS); // (Cols, Rows) as above
 
  lcd.backlight();
    
  // Row 1, Col 5
  lcd.setCursor(5,0); // The Index 0 is Row 1
  lcd.print("Hello");

  delay(500);

  // Row 2, Col 10
  lcd.setCursor(10,1); // The Index 1 is Row 2
  lcd.print("&");

  delay(500);

  // Row 3, Col 10    
  lcd.setCursor(10,2);// The Index 2 is Row 3
  lcd.print("Welcome");
    
  delay(500);

  // Row 4, Col 9     
  lcd.setCursor(9,3);// The Index 3 is Row 4
  lcd.print("to");

  delay(300);

  lcd.clear();

}
void loop() {

  delay(300);

  // Line 1
  lcd.setCursor(0, 0);
  lcd.print("I2C LCD");

  delay(300);

  // Line 2
  lcd.setCursor(0, 1);
  lcd.print("On Proteus");

  delay(300);
  
  // Line 3
  lcd.setCursor(0, 2);
  lcd.print("using PCF8574");

  delay(300);

  // Line 3
  lcd.setCursor(0, 3);
  lcd.print("by ardulectro");
  
  delay(600);

  lcd.clear();
 
}

Master of all, Jack of none.

PaulS:
Why are you asking this crap here? This is NOT the Proteus forum. We do NOT even approve of the use of that crap. We prefer the real thing!

yeah this CrAp will make you save lots of money and don't waste your time on hardware when you trying to focus on programming.
I really disappointed when saw your a "Brattain Member"

ardulectro:
We all were noobs someday and were helped by good peolpe.

For the greater good and others with same question. Here is a full example.

/*

Arduino LCD I2C with PCF8574 chip On Proteus Tutorial
 --------------------------------------------------------------------------------------------------
 Datasheet:         http://https//ecee.colorado.edu/~mcclurel/Philips_I2C_IO_Expander_PCF8574_4.pdf  
 Crated by:         ARDULECTRO, April 2020
 Posted on:         https://forum.arduino.cc
 For this thread:   https://forum.arduino.cc/index.php?topic=507401.0
 --------------------------------------------------------------------------------------------------
 
 Important notes:

1.  For the I2C chip’s address, the default is sometimes 0x27 or 0x3F depending on the setup. So in case it didn’t display the writings,
     change the address to see which one works.
     
 2.  Also depending on the LCD manufacturer, there are LCDs with I2C interface that has pads or pins that can be jumpered to change the address.
 
 3.  The provided jumpers usually are labelled as A0-A1-A2 . You can refer to the table below to chabge the address from a default of 0x27 and/or 0x3F, to any required.
     (1 = Not Jumpered. 0 = Jumpered)

A0  A1  A2  HEX-Address
     1   1   1   0x27  
     0   1   1   0x26
     1   0   1   0x25
     0   0   1   0x24
     1   1   0   0x23
     0   1   0   0x22
     1   0   0   0x21
     0   0   0   0x20
 
*/

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define LCD_RS 2
#define LCD_RW 1
#define LCD_E  0 // sometimes EN
#define LCD_D4 4
#define LCD_D5 5
#define LCD_D6 6
#define LCD_D7 7
#define LCD_BACKLIGHT 3

// LCD type is the 20x4
// 20 is cols as the maximum limit of characters from left to right
// 4 is rows as the maximum limit of lines from up to down
#define LCD_COLS 20
#define LCD_ROWS 4

// The 0x20 is the I2C address for PCF8574 in proteus only,
// Remeber that in real hardware setup, this number must be 0x27 instead
#define LCD_I2C_ADDRESS 0x20

// Create LCD object and map to the assigned pins
LiquidCrystal_I2C lcd(LCD_I2C_ADDRESS , LCD_RS, LCD_RW, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7, LCD_BACKLIGHT, POSITIVE);

void setup() {

lcd.begin(LCD_COLS, LCD_ROWS); // (Cols, Rows) as above

lcd.backlight();
   
 // Row 1, Col 5
 lcd.setCursor(5,0); // The Index 0 is Row 1
 lcd.print(“Hello”);

delay(500);

// Row 2, Col 10
 lcd.setCursor(10,1); // The Index 1 is Row 2
 lcd.print("&");

delay(500);

// Row 3, Col 10    
 lcd.setCursor(10,2);// The Index 2 is Row 3
 lcd.print(“Welcome”);
   
 delay(500);

// Row 4, Col 9    
 lcd.setCursor(9,3);// The Index 3 is Row 4
 lcd.print(“to”);

delay(300);

lcd.clear();

}
void loop() {

delay(300);

// Line 1
 lcd.setCursor(0, 0);
 lcd.print(“I2C LCD”);

delay(300);

// Line 2
 lcd.setCursor(0, 1);
 lcd.print(“On Proteus”);

delay(300);
 
 // Line 3
 lcd.setCursor(0, 2);
 lcd.print(“using PCF8574”);

delay(300);

// Line 3
 lcd.setCursor(0, 3);
 lcd.print(“by ardulectro”);
 
 delay(600);

lcd.clear();

}





Master of all, Jack of none.

ardulectro:
We all were noobs someday and were helped by good peolpe.

For the greater good and others with same question. Here is a full example.

/*

Arduino LCD I2C with PCF8574 chip On Proteus Tutorial
 --------------------------------------------------------------------------------------------------
 Datasheet:         http://https//ecee.colorado.edu/~mcclurel/Philips_I2C_IO_Expander_PCF8574_4.pdf  
 Crated by:         ARDULECTRO, April 2020
 Posted on:         https://forum.arduino.cc
 For this thread:   https://forum.arduino.cc/index.php?topic=507401.0
 --------------------------------------------------------------------------------------------------
 
 Important notes:

1.  For the I2C chip’s address, the default is sometimes 0x27 or 0x3F depending on the setup. So in case it didn’t display the writings,
     change the address to see which one works.
     
 2.  Also depending on the LCD manufacturer, there are LCDs with I2C interface that has pads or pins that can be jumpered to change the address.
 
 3.  The provided jumpers usually are labelled as A0-A1-A2 . You can refer to the table below to chabge the address from a default of 0x27 and/or 0x3F, to any required.
     (1 = Not Jumpered. 0 = Jumpered)

A0  A1  A2  HEX-Address
     1   1   1   0x27  
     0   1   1   0x26
     1   0   1   0x25
     0   0   1   0x24
     1   1   0   0x23
     0   1   0   0x22
     1   0   0   0x21
     0   0   0   0x20
 
*/

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

#define LCD_RS 2
#define LCD_RW 1
#define LCD_E  0 // sometimes EN
#define LCD_D4 4
#define LCD_D5 5
#define LCD_D6 6
#define LCD_D7 7
#define LCD_BACKLIGHT 3

// LCD type is the 20x4
// 20 is cols as the maximum limit of characters from left to right
// 4 is rows as the maximum limit of lines from up to down
#define LCD_COLS 20
#define LCD_ROWS 4

// The 0x20 is the I2C address for PCF8574 in proteus only,
// Remeber that in real hardware setup, this number must be 0x27 instead
#define LCD_I2C_ADDRESS 0x20

// Create LCD object and map to the assigned pins
LiquidCrystal_I2C lcd(LCD_I2C_ADDRESS , LCD_RS, LCD_RW, LCD_E, LCD_D4, LCD_D5, LCD_D6, LCD_D7, LCD_BACKLIGHT, POSITIVE);

void setup() {

lcd.begin(LCD_COLS, LCD_ROWS); // (Cols, Rows) as above

lcd.backlight();
   
 // Row 1, Col 5
 lcd.setCursor(5,0); // The Index 0 is Row 1
 lcd.print(“Hello”);

delay(500);

// Row 2, Col 10
 lcd.setCursor(10,1); // The Index 1 is Row 2
 lcd.print("&");

delay(500);

// Row 3, Col 10    
 lcd.setCursor(10,2);// The Index 2 is Row 3
 lcd.print(“Welcome”);
   
 delay(500);

// Row 4, Col 9    
 lcd.setCursor(9,3);// The Index 3 is Row 4
 lcd.print(“to”);

delay(300);

lcd.clear();

}
void loop() {

delay(300);

// Line 1
 lcd.setCursor(0, 0);
 lcd.print(“I2C LCD”);

delay(300);

// Line 2
 lcd.setCursor(0, 1);
 lcd.print(“On Proteus”);

delay(300);
 
 // Line 3
 lcd.setCursor(0, 2);
 lcd.print(“using PCF8574”);

delay(300);

// Line 3
 lcd.setCursor(0, 3);
 lcd.print(“by ardulectro”);
 
 delay(600);

lcd.clear();

}





Master of all, Jack of none.

Hi Ardulectro,
Thank you for your contribution.
Can you please assist me because I got the error when compiling your sketch:
no matching function for call to ‘LiquidCrystal_I2C::LiquidCrystal_I2C(int, int, int, int, int, int, int, int, int, int)’

Arduino IDE Ver 1.8.5 as well as 1.8.12
I think I am using the wrong LiquidCrystal_I2C.h, in spite of trying three different libraries I found with the same name.
Thanks again.

At Last! after some searching found the matching Library for Ardulectro's sketch.
This post shows what I mentioned as many versions of LiquidCrystal_I2C.h having the same name.

For the benefit of those who are still searchung;
Library download Link:
https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/