Problem to connect an LCD sreen Without I2C to a Wemos D1 mini

Hello, I am looking to connect a 16x2 LCD screen without I2C to a Wemos D1 mini.
The screen is perfectly functional (I tested it with an arduino uno) and the Wemos D1 mini too (I tested the basic blink code and it worked).
However, when I connect the LCD and the wemos and send a code, the code is uploaded but nothing is displayed on the screen, even when changing the contrast using the potentiometer.

Here my code :

#include <LiquidCrystal.h>

const int rs = D8, en = D7, d4 = D6, d5 = D4, d6 = D3, d7 = D2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

void setup() {
  lcd.begin(16, 2);
  lcd.print("hello, world!");
}

void loop() {
}


Remember the WeMos is a 3.3 V device, so I strongly recommend you to buy and use an I2C backpack: I connected many I2C LCDs with WeMos D1 boards, it works fine (ignore the compatibility warning when compiling).

IMO that's the quickest and best way to avoid troubles and headaches.

Topic moved. Please do not post in "Uncategorized"; see the sticky topics in Uncategorized - Arduino Forum.

Chances are high your esp doesn't even boot. D3 and D4 have pullups and boot fails if pulled low. D8 has pulldown and boot fails if pulled high.

Prefer D1/2/5/6/7

As @docdoc suggests get a LCD with a backpack or add the backpack. Run the display at 5V (most will not work with 3V3) and use something in the 3.5K range as pull ups to the 3V3 power. If the backpack has 10K pull up resistors just ignore them unless you are going to very low power.

from I2C requirements:

  • In most I2C buses, the low and high input voltage level thresholds of SDA and SCL must depend on Vcc. E.g. an SDA voltage level of 1.1 V will be interpreted as low in an I2C bus with Vcc = 5 V and as high in an I2C bus with Vcc = 1.2 V.
    Requirements For Devices - I2C Bus

Thank you for you answer.
But it is really impossible to connect a lcd with a wemos without I2C ?

No you can use SPI. Direct connect if there is not enough I/O pins available it will not work.

Thank you for your response.
Have-you an example of code with wiring of a LCD 16x2 conncet to a Wemos with SPI ?

Out of curiosity, why?

Because my LCD sreen havent I2C and buy an I2C adaptator cost money.
If you want to know the global project : I want put a online meter on a screen.

Ah, well then SPI is out too, because you'd have to buy an adapter for that as well.

But I2C backpack adapters are dirt cheap (like $2 USD with shipping on eBay) if you're not in a hurry. Even cheaper than buying a bare PCF8574 (which is the IC on the adapter) and wiring it up yourself.

A 74HC595 would also do the job, and every Arduino starter kit under the sun seems to have at least one of those.

There is no common ground between your Wemos and the breadboard.

By the way, why is the Wemos not plugged into the breadboard? It is breadboard compatible!

No, and in fact your original sketch worked just fine with an LCD modified for 3.3V operation (3.3V doesn't provide enough voltage differential for the display's contrast to work well, or sometimes at all, without the additional circuitry to supply a negative voltage for the contrast).

With, of course, a common ground between the D1 and LCD as @PaulRB mentioned. WIthout that you don't have a circuit and naturally, nothing works.

1 Like

I've finally found the root of the problem. It's quite silly: to connect the Wemos to the Breadboard, I was using connector strips. This creates lots of false contacts. Wiring individual wires to each Wemos pin works perfectly.
Thanks for your help along this post.