16 x 2 LCD half side not working, 8 out of 16 blocks nearly dead

I don’t know what I have done, but suddenly my LCD is not working properly. Everything connections seems fine as I am using an i2c lcd module. I have tested the i2c module on a different LCD and it’s working, so I don’t think it’s i2c problem. I think issue is with the HD44780.

Video Link:

Video 1: https://res.cloudinary.com/dfoeia451/video/upload/v1753130329/20250722_015601_nhy3zq.mp4

Video 2: https://res.cloudinary.com/dfoeia451/video/upload/v1753167641/20250722_122811_cvx5oz.mp4

Code :

import smbus
import time


I2C_ADDR = 0x27
LCD_WIDTH = 16   


LCD_CHR = 1  
LCD_CMD = 0  

# LCD_LINE_1 = 0x80  
# LCD_LINE_2 = 0xC0  

LCD_BACKLIGHT = 0x08  

ENABLE = 0b00000100


E_PULSE = 0.0005
E_DELAY = 0.0005

bus = smbus.SMBus(1)  

def lcd_init():
    lcd_write(0x33, 0)  
    lcd_write(0x32, 0)  
    lcd_write(0x06, 0)  
    lcd_write(0x0C, 0)  
    lcd_write(0x28, 0)  
    lcd_write(0x01, 0)  
    time.sleep(0.005)

def lcd_write(cmd, mode):
    backlight = 0x08
    high = mode | (cmd & 0xF0) | backlight
    low = mode | ((cmd << 4) & 0xF0) | backlight
    bus.write_byte(I2C_ADDR, high)
    bus.write_byte(I2C_ADDR, high | 0x04)
    time.sleep(0.0005)
    bus.write_byte(I2C_ADDR, high & ~0x04)
    bus.write_byte(I2C_ADDR, low)
    bus.write_byte(I2C_ADDR, low | 0x04)
    time.sleep(0.0005)
    bus.write_byte(I2C_ADDR, low & ~0x04)

def lcd_message(text, line):
    addr = 0x80 if line == 1 else 0xC0
    lcd_write(addr, 0)
    for char in text.ljust(LCD_WIDTH):
        lcd_write(ord(char), 1)

if __name__ == '__main__':
    lcd_init()
    lcd_message("  Hello World!  ", 1) # with space : Probelm with the display
    time.sleep(1)
    lcd_message("..Hello World!..", 1) # without space : Some pixels (not cells) are barely visible
    time.sleep(2)
    #-----------------All Character Test-----------------#
    chars = "abcdefghijklmnopqrstuvwABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_=+-[]{}|;:',.<>?/~`"
    # chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    while True:
        for c in chars:
            lcd_init()
            time.sleep(0.5)
            lcd_message(c * LCD_WIDTH, 1)  
            lcd_message(c * LCD_WIDTH, 2)  
            time.sleep(0.5)
    # n = 1
    # while True:
    #     lcd_message(str(n), 2)
    #     time.sleep(1)
    #     n += 1

No idea what that 2nd pic is trying to show. The I2C screens have 4 male pins at one end that the dupont females are connected to. G, 5VDC, SDA, SCL.

Your video shows all cells working. Post the code you are using.

The video may simply be suffering from the frame rate being out of synch with the LCD refresh rate, and therefore rather meaningless.

The glass screen is electrically connected to the PCB by conductive rubber blocks, and the assembly is held together by compression (often by twisted metal clamps).

If the assembly is loosened or damaged by water, parts of the display will malfunction.

In the former case it might be possible to repair it. But they are cheap to replace, and working displays can also be salvaged from recycled or discarded printers and other equipment.

Hey, I have updated the Post.

Oh! I am trying to show that the solder points are good. But I have updated the picture with actual problem.

I don’t think there is any problem with the Video. Because the video is showing what I actually see.

Your other topic on the same subject deleted.

Please do not duplicate your questions as doing so wastes the time and effort of the volunteers trying to help you as they are then answering the same thing in different places.

Please create one topic only for your question and choose the forum category carefully. If you have multiple questions about the same project then please ask your questions in the one topic as the answers to one question provide useful context for the others, and also you won’t have to keep explaining your project repeatedly.

Repeated duplicate posting could result in a temporary or permanent ban from the forum.

Could you take a few moments to Learn How To Use The Forum

It will help you get the best out of the forum in the future.

Thank you.

import smbus
import time


I2C_ADDR = 0x27
LCD_WIDTH = 16   


LCD_CHR = 1  
LCD_CMD = 0  

# LCD_LINE_1 = 0x80  
# LCD_LINE_2 = 0xC0  

LCD_BACKLIGHT = 0x08  

ENABLE = 0b00000100


E_PULSE = 0.0005
E_DELAY = 0.0005

bus = smbus.SMBus(1)  

def lcd_init():
    lcd_write(0x33, 0)  
    lcd_write(0x32, 0)  
    lcd_write(0x06, 0)  
    lcd_write(0x0C, 0)  
    lcd_write(0x28, 0)  
    lcd_write(0x01, 0)  
    time.sleep(0.005)

def lcd_write(cmd, mode):
    backlight = 0x08
    high = mode | (cmd & 0xF0) | backlight
    low = mode | ((cmd << 4) & 0xF0) | backlight
    bus.write_byte(I2C_ADDR, high)
    bus.write_byte(I2C_ADDR, high | 0x04)
    time.sleep(0.0005)
    bus.write_byte(I2C_ADDR, high & ~0x04)
    bus.write_byte(I2C_ADDR, low)
    bus.write_byte(I2C_ADDR, low | 0x04)
    time.sleep(0.0005)
    bus.write_byte(I2C_ADDR, low & ~0x04)

def lcd_message(text, line):
    addr = 0x80 if line == 1 else 0xC0
    lcd_write(addr, 0)
    for char in text.ljust(LCD_WIDTH):
        lcd_write(ord(char), 1)

if __name__ == '__main__':
    lcd_init()
    lcd_message("  Hello World!  ", 1) # with space : Probelm with the display
    time.sleep(1)
    lcd_message("..Hello World!..", 1) # without space : Some pixels (not cells) are barely visible
    time.sleep(2)
    #-----------------All Character Test-----------------#
    chars = "abcdefghijklmnopqrstuvwABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_=+-[]{}|;:',.<>?/~`"
    # chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
    while True:
        for c in chars:
            lcd_init()
            time.sleep(0.5)
            lcd_message(c * LCD_WIDTH, 1)  
            lcd_message(c * LCD_WIDTH, 2)  
            time.sleep(0.5)
    # n = 1
    # while True:
    #     lcd_message(str(n), 2)
    #     time.sleep(1)
    #     n += 1



How long is this? 1ms or 1sec.
Maybe you updating the display to fast.

The second picture you posted here shows the word "Hello" very dim but I can (barely) read it. If you play a bit with the contrast trimmer you can see it.

So if it isn't a matter of some too fast screen write (a full and compilable test code would be appreciated, avoid posting just sections of it) it looks like kinda LCD contrast issue of some kind, and I'm sorry to say IMO the most probable cause is a hardware defect (like a faulty controller chip, or one or moer board traces has been damaged).

It's 1 sec.

0.1 sec is 1 ms in python.

That's what I am thinking. I think I have to buy another.

Yes, that's the problem. I think the main controller board is damaged causing such problem.

But in your video all the blocks work , depending what you write.
If your code loops thru the writing add a small 500msec delay after every message update.

Do you use the Arduino IDE? try one of the examples.

Are you sure about that ?

Just search Python reference to see "sleep(1)" is 1 second delay. So he isn't updating too fast, the problem resides in the display contrast for the first half (but I don't know why, and how to fix it...).

Put a delay between.

lcd_init()

and

lcd_message("  Hello World!  ", 1)

Yes, I agree all cells were visible. Perhaps a voltage problem exists: (1) weak solder joints, (2) solder joints/wires touching, (3) weak power supply, (4) too much power.

@soubhagyajit should make the simplest sketch to test python and LCD: Simple test — Adafruit SSD1306 Library 1.0 documentation