Please help me figure out what i'm doing wrong printing to the LCD

Hey smart peeps!

Please help me figure out what I'm doing wrong here, code below:

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(19, 23, 18, 17, 16, 15);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("circuitschools.");
}

void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}

10k potentiometer
This is the tutorial I followed: Interfacing 16X2 LCD Module with ESP32 with and without I2C – Circuit Schools

More images to follow!

Thanks in advance

Looks like you need to adjust your pot since you have all pixels on.

--- bill

Is RW pin (5) grounded?

Have you tried adjusting the contrast pot?

The correct way to wire the contrast pot is to wire one end of the pot to ground and the wiper to pin 3. This actually makes adjusting contrast easier. The other end of the pot not connected or connected to the wiper. The long standing advice that the pot is wired to ground, Vcc and pin 3 is wrong. It is an error perpetuated over many years that begs correction.

Adjust the potentiometer. It should reveal the letters when you turn it down to minimum i.e. the GND pin.

If you want people to check your wiring, post the wire colours for each signal.

Hi Bill, thanks for the reply this is the image when the potentiometer is turned down

yessir, RW is grounded. its the black cable.

I did adjust the pot and on the lowest the screen is blank(posted a pic below).

Sorry, can you explain a bit more on the pot wiring? currently its connected to the 5v & gnd and connects to the V0/3rd pin from the left on the lcd.

cheers

In the process of turning the pot from showing 2 rows of blocks to no blocks there should be a point where you see text. Adjust the pot slowly.

Just disconnect the wire from the pot to Vcc. The pot is used as a variable resistor to complete a resistor chain, not a potentiometer voltage divider.

Okay cool, yeah i have done that. removed the 5v connection from the pot so its only gnd in and out to V0 this is just before the blocks on the top row disappear:

On the wiring(from left to right)
orange/VSS - Gnd
cream/VDD - 5v
green/V0 - 10kpot
yellow/RS - GPIO D19
black/RW - GND
Blue/E - GPIO D23
Purple/D4 - GPIO D18
cream/D5 - Gpio tx2
yellow/D6 - GPIO rx2
orange/D7 - GPIO D15
Blue/A - 5v
Green/K - Gnd

posted wiring below

Post a photo where we can see the ESP32 connections without parallax.

I am sure that your ESP32 should fit on a single breadboard and still allow cables.

David.

For the photos to have value, they need to, clearly, show the wire going to both ends. Wires that go out of the photo and back in are impossible to, accurately, trace.

Show how the pot is now wired.

I wired a known good 1602 display to my WSP32 DevKit module and loaded the posted code with no changes. My display has a 1K fixed resistor from ground to pin 3 (Vo) of the LCD to provide good contrast. The display shows "circuitschools." on the top row and a 1HZ ish count incrementing on the bottom row.

So it is not the code, must be wiring or a bad display. Out of, maybe, 30 that I have obtained (Ebay and Amazon) 2 were DOA so it is not unheard of.

Hi David,

Incoming with an overhead view, a bit difficult to trace them all but i tried.

Sadly i messed up in buying a cheap breadboard that doesn't allow the esp and space for pins in.

Your wiring "looks" correct.

Your LCD seems to have very "long" pin header strip.
Are the pins fully inserted into the breadboard?
Likewise your male-male Dupont cables.

I would connect the LCD signals all on the large breadboard.
GND, +5V and pot can all fit. With two jumpers from ESP32 VIN, GND.

Wiring breadboards requires meticulous care. Dupont jumpers are fairly reliable. Chinese "thin" male-male jumpers are liable to break.

David.

But should be tested if there is any doubt whatsoever. :+1: