OLED Display Detected on Raspberry Pi 4, But Not Displaying Anything - Need Help!

Subscribe to the forum to receive notifications about new posts.
Post Reply
Mithilesh
Posts: 8
Joined: Tue Jul 09, 2024 3:24 pm

Hi everyone,

I’m trying to get my "0.96 Inch I2C/IIC 4pin OLED Display Module BLUE" to work with my Raspberry Pi 4, but I’m stuck. The display shows up when I scan for it on I2C (address 0x3C), but I can’t get anything to actually display on the screen.

Here’s what my setup looks like:

Setup Connections:

VCC to 3.3V (also tried 5V, no change)
GND to GND
SCL and SDA are wired to the correct I2C pins
Libraries: I’ve installed Adafruit_SSD1306, Adafruit_GFX, and tried luma.oled as well.

Code: My code initializes the display and attempts to print "Hello, World!" Here’s a simple version of it:

Python code:

import board
import busio
from adafruit_ssd1306 import SSD1306_I2C
from PIL import Image, ImageDraw, ImageFont

# I2C setup
i2c = busio.I2C(board.SCL, board.SDA)
oled_width = 128
oled_height = 64

# Initialize display
oled = SSD1306_I2C(oled_width, oled_height, i2c)

# Clear the display
oled.fill(0)
oled.show()

# Create a blank image for drawing
image = Image.new("1", (oled_width, oled_height))
draw = ImageDraw.Draw(image)

# Draw some text
font = ImageFont.load_default()
draw.text((0, 0), "Hello, OLED!", font=font, fill=255)

# Display image
oled.image(image)
oled.show()



What I’ve Tried
Double-checked Connections: All connections are solid and matched to the I2C pins.
Address Check: The I2C scan confirms the display is detected at 0x3C.
Power Supply: Tried both 3.3V and 5V—no difference.
Library Switching: I’ve tried multiple libraries to see if compatibility was an issue, but no luck.
Display Command: Ensured I’m calling display.display() to update the screen buffer.
Mansi
Posts: 62
Joined: Mon Jun 10, 2024 11:57 am

Hello there,

I haven't encountered the issue you're facing, but you can try installing the libraries listed below.

sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install adafruit-circuitpython-ssd1306
sudo apt-get install python3-pillow


Rather than this there is one more library for OLED that is luma.oled

sudo pip3 install luma.oled


Hope this will help you!
User avatar
Shraddha
Posts: 116
Joined: Fri Jun 14, 2024 3:54 pm

Mansi wrote: Tue Nov 26, 2024 9:13 am Hello there,

I haven't encountered the issue you're facing, but you can try installing the libraries listed below.

sudo apt-get update
sudo apt-get install python3-pip
sudo pip3 install adafruit-circuitpython-ssd1306
sudo apt-get install python3-pillow


Rather than this there is one more library for OLED that is luma.oled

sudo pip3 install luma.oled


Hope this will help you!
Hello there,

Thanks for the suggestions! Before I proceed, could you clarify if these steps are compatible with the latest version of Ubuntu? Also, are there any specific configurations needed for the luma.oled library to work seamlessly with my OLED display?
Post Reply