• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

LCD_I2C ESP32 random jibberish

Q&A Forum › Category: ESP32 › LCD_I2C ESP32 random jibberish
0 Vote Up Vote Down
Robert asked 2 years ago

I was trying out the code :

Learn ESP32 with Arduino IDE V1_4 > Module 7 -ESP32 with MQTT > ESP32_Client_2_LCD_PUSHBUTTON

The Raspberry Pi mosquittoe is running ( & ESP#1 ).

On the ESP#2 LCD I see the temperature displayed, so I know that is working.

The problem is the LCD Displays fine, then adds random characters, then returns to normal.

I am using a 20×4 LCD and changed the code for the 20×4 display.

const int lcdColumns = 20;
const int lcdRows = 4;

I tested the hardware and connections with a working Arduino Uno display code and the static display worked fine on the ESP32.

I ran the RandomNerd scrolling text code, and that worked fine.

I changed the MQTT messageTemp to a fixed string and that had random display too.

I am at a loss unless there is a different LiquidCrystal_I2C.h?

Question Tags: ESP32, lcd_i2c
12 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi Robert.
We use the same LCD I2C library in all projects. So, the library shouldn’t be the issue.
When you print the message on the serial monitor, does it have jibberish? Or it’s only on the LCD display?
In which part of the LCD are you getting those random characters? How are you powering your display?
Regards,
Sara
 

0 Vote Up Vote Down
Robert answered 2 years ago

NO, the serial monitor looks good and the messages.
I see the temperature on the serial monitor.
ONLY THE LCD has issues and just with this program ?
The display usually looks good with the only the first 2 rows used.
I added a setup lcd.print on all 4 rows which always looks good.
Then the entire display shows random characters along with a random mix of the sent characters.
Then it comes back after awhile and repeats the cycle.

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi Robert.

So this happens when you write to the 4 rows?
I’ve read some similar issues and didn’t find a clear answer. It can be for example:

  • some loose connections: which doesn’t seem the case;
  • writing to the LCD too fast: you may try adding a small delay between printings;
  • not enough power supply. The display needs 5V. But I’m not sure if trying to write to the 4 rows will required you to have a separated supply for the display. For example, if you’re powering it through a USB port from your computer, it may not have enough power – I haven’t experimented with that display (20×4).

Let me know if this helps.
Regards,
Sara

0 Vote Up Vote Down
Robert answered 2 years ago

Added the delay 100mS & 1000mS after each lcd.print .
No improvement?
Here is the LCD jibberish:
https://snipboard.io/TeG032.jpg
Here is a good display:
https://snipboard.io/0J8Xi5.jpg
Here is the Serial Monitor :
https://snipboard.io/M35ouI.jpg

0 Vote Up Vote Down
Robert answered 2 years ago

Added the delay 100mS & 1000mS after each lcd.print .
No improvement?
Here is the LCD jibberish:
https://snipboard.io/TeG032.jpg
Here is a good display:
https://snipboard.io/0J8Xi5.jpg
Here is the Serial Monitor :
https://snipboard.io/M35ouI.jpg

0 Vote Up Vote Down
Sara Santos Staff answered 2 years ago

Hi Robert.
Thank you for sending those images.
I’ve searched on many forums for similar issues and I still haven’t found a clear answer.
What everyone says is something about the speed you write to the display or interference with I2C communication.
I’m out of ideas on how to solve this :/ I’m sorry that I can’t help much.
Do you have another LCD to experiment?
Regards,
Sar

0 Vote Up Vote Down
merkelck answered 1 year ago

Hello, I came here looking to solve the identical issue. During the MQTT lessons everything works as described above and I get the same issues. Several cycles will be great, then turns to jibbersih and then repeats. I have also tried the 20X4 display and two different 16×2 units with the same issues.  I do get a warning during the compilation to the effect that the “library claims to function with this device” etc. I have not tried any other libraries because I don’t know which one would be better. I also reversed the two  NodeMcu 32S devices with the same results. 
Moving on
KentM

0 Vote Up Vote Down
Sara Santos Staff answered 1 year ago

Hi.
I’m sorry you’re getting that issue. Honestly, I don’t know how to solve that.
If that issue crashes your project completely, maybe it is a good idea to use another type of display like an I2C OLED display.
I’m sorry that I can’t help much.
Regards,
Sara

0 Vote Up Vote Down
Steve Fisch answered 12 months ago

This (random jibberesh ) is working perfectly now with another brand of LCD.  I purchased it from ebay.  The link is:
https://www.ebay.com/itm/2-Pack-1602-LCD-16×2-HD44780-Character-I2C-Serial-Interface-Module-Blue-USA/391683768799?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
Hope this helps everyone having the same problem.

 

After a few hours, even using the lcd module I recommended above, the random jibberish appeared again.  By using RUI’s example from his “Home Automation Using 8266, Project 6, Unit 4 (which uses an ESP8266 instead of ESP32, I no longer get jibberish.

Steve

0 Vote Up Vote Down
Sara Santos Staff answered 12 months ago

Hi Steve.
Thanks for sharing that.
The issue can be a certain brand of LCD, you’re right.
I’ll keep that in mind when someone comes across the same problem.
Regards,
Sara

0 Vote Up Vote Down
Brian Hugo answered 8 months ago

I have been struggling for days with the same issue. what did help me getting rid of the “random gibberish” is to put 10k pullup resistors to VCC on both the data and clock lines
The gibberish is now gone, but ever so often some of the temperature digits would not display

Also create a sketch that uses the 10K pullups using the same libraries, LCD and sensor with MQTT, in other words  just reading the temperature and displaying it to the LCD and then it works.

Not sure if there are timing issues using MQTT

0 Vote Up Vote Down
Sara Santos Staff answered 8 months ago

Hi Brian.
Until now, I still don’t know what might be causing the issue.
Thanks for sharing that solution with us. I’ll keep that in mind.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Download Build Web Servers with ESP32 and ESP8266 (version 2.1) April 14, 2021
  • [eBook Updated] Download Build Web Servers with ESP32 and ESP8266 (2nd Edition) February 8, 2021

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2021 · RandomNerdTutorials.com · All Rights Reserved