LCD Screen Remains Blank on BeagleBone Black with HC-SR04 Ultrasonic Sensor

hello guys, based on my previous question on developing an obstacle detection system using a BeagleBone Black running Embedded Linux using HC-SR04 ultrasonic sensor to measure distances and displays the measurements on a 16x2 LCD screen. am encoutering a situation where the LCD screen remains blank and does not display any readings, and i have verified the lcd is powered correctly, i have also checked lcd initialization
python
lcd = CharLCD(pin_rs=LCD_RS, pin_e=LCD_E, pins_data=[LCD_D4, LCD_D5, LCD_D6, LCD_D7], numbering_mode=GPIO.BOARD)
python
lcd = CharLCD(pin_rs=LCD_RS, pin_e=LCD_E, pins_data=[LCD_D4, LCD_D5, LCD_D6, LCD_D7], numbering_mode=GPIO.BOARD)
but still my lcd screen remains blank
5 Replies
RED HAT
RED HAT2mo ago
@Boss lady re-check all your connections to ensure the RS, E, and data pins (D4-D7) are correctly connected to the BeagleBone Black GPIO pins. Make sure that the contrast pin (often labeled V0) is correctly set. Sometimes the contrast needs to be adjusted to see anything on the LCD, also ensure the LCD initialization sequence is correct. Sometimes small mistakes in initialization can cause the display to remain blank, try testing the LCD Use to test print hello world on LCD screen
import Adafruit_BBIO.GPIO as GPIO
from RPLCD.gpio import CharLCD
import time

LCD_RS = "P8_11"
LCD_E = "P8_12"
LCD_D4 = "P8_13"
LCD_D5 = "P8_14"
LCD_D6 = "P8_15"
LCD_D7 = "P8_16"

lcd = CharLCD(pin_rs=LCD_RS, pin_e=LCD_E, pins_data=[LCD_D4, LCD_D5, LCD_D6, LCD_D7], numbering_mode=GPIO.BOARD)

lcd.clear()
lcd.write_string("Hello, World!")
time.sleep(5)
lcd.clear()
import Adafruit_BBIO.GPIO as GPIO
from RPLCD.gpio import CharLCD
import time

LCD_RS = "P8_11"
LCD_E = "P8_12"
LCD_D4 = "P8_13"
LCD_D5 = "P8_14"
LCD_D6 = "P8_15"
LCD_D7 = "P8_16"

lcd = CharLCD(pin_rs=LCD_RS, pin_e=LCD_E, pins_data=[LCD_D4, LCD_D5, LCD_D6, LCD_D7], numbering_mode=GPIO.BOARD)

lcd.clear()
lcd.write_string("Hello, World!")
time.sleep(5)
lcd.clear()
Boss lady
Boss lady2mo ago
Hello @RED HAT ahv tried this but thr LCD screen still remains blank
Enthernet Code
Enthernet Code2mo ago
@Boss lady then this might be an eletric issue or wrong connection
Enthernet Code
Enthernet Code2mo ago
check if the LCD is getting a stable 5V power supply and check the potentiometer connections and settings. Sometimes incorrect settings can cause the display to remain blank.
RED HAT
RED HAT2mo ago
@Boss lady make sure there is enough delay during the initialization process. LCD's sometimes need a bit more time to initialize properly. Try adding a delay before writing to the LCD:
import Adafruit_BBIO.GPIO as GPIO
from RPLCD.gpio import CharLCD
import time

LCD_RS = "P8_11"
LCD_E = "P8_12"
LCD_D4 = "P8_13"
LCD_D5 = "P8_14"
LCD_D6 = "P8_15"
LCD_D7 = "P8_16"

lcd = CharLCD(pin_rs=LCD_RS, pin_e=LCD_E, pins_data=[LCD_D4, LCD_D5, LCD_D6, LCD_D7], numbering_mode=GPIO.BOARD)

time.sleep(1)
lcd.clear()
lcd.write_string("Hello, World!")
time.sleep(5)
lcd.clear()
import Adafruit_BBIO.GPIO as GPIO
from RPLCD.gpio import CharLCD
import time

LCD_RS = "P8_11"
LCD_E = "P8_12"
LCD_D4 = "P8_13"
LCD_D5 = "P8_14"
LCD_D6 = "P8_15"
LCD_D7 = "P8_16"

lcd = CharLCD(pin_rs=LCD_RS, pin_e=LCD_E, pins_data=[LCD_D4, LCD_D5, LCD_D6, LCD_D7], numbering_mode=GPIO.BOARD)

time.sleep(1)
lcd.clear()
lcd.write_string("Hello, World!")
time.sleep(5)
lcd.clear()
Want results from more Discord servers?
Add your server