WEMOS D1 Mini Pro with LCD2004

Hi, I have a Wemos D1 Mini Pro connected to an LCD2004 Wemos D1 Mini Pro LCD2004

And Ive set it up as follows: https://www.likecircuit.com/lcd-display-i2c-wemos-d1-mini/

Next Ive included the library: LiquidCrystal_I2C.h

Result: These commands work - lcd.setBacklight(LOW); lcd.setBacklight(HIGH);

But I cannot get anything to display on the screen.. not the cursor or any text. Heres the code in the setup().... theres none in the loop().

void setup(){ lcd.begin(4,5); // Columns and Rows or put another way -- width and height lcd.backlight(); lcd.setCursor(2, 0); lcd.print("www.LikeCircuit.com"); lcd.setCursor(3, 1); lcd.print("Status: Connected"); }

I guess the connections are fine because the LCD is receiving the commands lcd.setBacklight(LOW); lcd.setBacklight(HIGH); when I tested them. So why is it not displaying any text ?

Where are you creating the LCD object?

Your code for the LCD looks nothing like the tutorial you linked.

Somewhere you need to specify the size and

lcd.begin(4,5);

does not make sense.

I create the lcd object as:

LiquidCrystal_I2C lcd(0x27,20,4); // Set the I2C address and display size.

and then in setup() init it with

lcd.init(); // initialize the LCD

Works everytime.

Willem

Hi, Sorry I should have put all the code:
// Im using this library https://www.archiduino.com/liquidcrystal_i2c-h-library-arduino-ide-1-6-x/ (LiquidCrystal_I2C.zip)

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

// Set the LCD adress to 0x3F for a 20 characters and 4 line display
LiquidCrystal_I2C lcd(0x3F, 20, 4);

void setup(){
Wire.begin();
Serial.begin(115200);
while (!Serial); // Leonardo: wait for serial monitor
Serial.println("\nI2C Scanner");

lcd.begin(4,5); // Columns and Rows or put another way – width and height
lcd.backlight();
// lcd.noBacklight();
lcd.setCursor(2, 0);
lcd.print(“www.LikeCircuit.com”);
lcd.setCursor(3, 1);
lcd.print(“Status: Connected”);
Serial.println(“SETUP”);
}

void loop(){
Serial.println(“We are here”);
lcd.home(); // set cursor to 0,0 same as lcd.setCursor(0,0);
delay(3000);
lcd.setBacklight(LOW); // Backlight off WORKS
delay(3000);
lcd.setBacklight(HIGH); // Backlight on WORKS
delay(3000);
}

I added lcd.init() but no difference…
The LCD2004 has the red light on at the back and the code in the loop works so its communicating…
But no text comes up on the display (even if I edit out whats in the loop()

Is anybody using the LCD2004 or an alternative LCD?
J

I tried your sketch on a breadboard 328p which I have setup for working on a different project. I use the LCD 20x4 display for debugging etc.

Firstly I had to comment all the serial lines - I have no usb or serial connection to it. Compiled and uploaded (using Arduino as ISP) and it did not work - no text displayed. Turns out I use a different I2C address than you.

Updated the address, compiled, uploaded and it runs with no problem displaying the two lines of text (your text lines are too long to start at 2 and 3 - make that 0 and 1 to fit on a single line). Backlight then pulses at 3 second intervals - all as expected.

I checked my liquidcrystal_i2c library code (which I am sure is the same as the one you use even though I had it for quite a while) and init() actually calls begin(cols,rows), where cols and rows are as specified in the constructor (which should therefore actually be 20,4) - incidentally, it also calls wire.begin() )

My code as uiploaded:

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

// Set the LCD adress to 0x3F for a 20 characters and 4 line display
//LiquidCrystal_I2C lcd(0x3F, 20, 4);
LiquidCrystal_I2C lcd(0x27,20,4);       // Set the I2C address and display size.
 
void setup()  {
  Wire.begin();
//  Serial.begin(115200);
//  while (!Serial);             // Leonardo: wait for serial monitor
//  Serial.println("\nI2C Scanner");

  lcd.init();                    // Columns and Rows or put another way -- width and height
//  lcd.begin(4,5);              // Columns and Rows or put another way -- width and height

  lcd.backlight();
  // lcd.noBacklight();
  lcd.setCursor(0, 0);
  lcd.print("www.LikeCircuit.com");
  lcd.setCursor(1, 1);
  lcd.print("Status: Connected");
//  Serial.println("SETUP");
 }
 
void loop()  {
//   Serial.println("We are here");
   lcd.home(); // set cursor to 0,0 same as lcd.setCursor(0,0);
   delay(3000);
   lcd.setBacklight(LOW);      // Backlight off WORKS
   delay(3000);
   lcd.setBacklight(HIGH);     // Backlight on WORKS
   delay(3000);
}

Hope that helps.

Willem.

Hi Willem, Im beginning to suspect there might be something wrong with the LCD2004 display.

I tried your code (putting in the right I2C address) and the LCD does pulse at 3 second intervals. But nothing displays!

When I compile I do get this message: WARNING: library LiquidCrystal_I2C-master claims to run on (avr) architecture(s) and may be incompatible with your current board which runs on (esp8266) architecture(s).

Ive tried with 4 different LiquidCrystal_I2C libraries to no avail: (1) Frank de Brabander https://www.arduinolibraries.info/libraries/liquid-crystal-i2-c LiquidCrystal_I2C-1.1.2.zip (DOES give the warning message and DOESNT work. No display still lcd.begin(20,4.) (2) https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library Arduino-LiquidCrystal-I2C-library-master.zip (Doesnt give the warning message and still works. No display still. lcd.begin()) (3) https://www.archiduino.com/liquidcrystal_i2c-h-library-arduino-ide-1-6-x/ LiquidCrystal_I2C.zip (Doesnt give the warning message and DOESNT work. No display still lcd.begin(20,4)) (4) johnrickman johnrickman https://github.com/johnrickman/LiquidCrystal_I2C LiquidCrystal_I2C-master.zip

Onward bound.. Thanks J

Well, cant believe it.... just found it.. I adjusted the potentiometer on the back and voila the text showed up!!

Thanks all for your help!

Lol :stuck_out_tongue_closed_eyes: . That one once caught me out, but it is so long ago I completely forgot about the pot.

Glad you got it sorted.

Willem.

Hi Williem, Thanks for your support :)

My pleasure. :-[

Everytime I take part in a thread trying to help someone I learn more about the processors, software and programming. So I actually enjoy doing that.

Willem