Zum Inhalt springen

WSAL10451 – 1.3inch OLED (B)/en

Aus JW Tech Wiki

Documentation notice: This technical documentation was independently rewritten from an archived supplier source. Check technical details and commands against the product version and manufacturer documentation before use.

Summary

Concise technical guide for the Waveshare 1.3inch OLED (B): specifications, pinout, interface configuration and usage with Raspberry Pi, STM32 or Arduino.

Related products at JW Tech

Technical overview

  • Resolution 128×64 pixels; driver chip SH1106; display size approx. 14.7 mm (H) × 29.42 mm (V); pixel pitch 0.21 mm; module dimensions 40.5 × 37.5 mm.
  • Operating voltage 3.3 V / 5 V; operating temperature −30…+70 °C, storage −30…+80 °C; viewing angle >160°; display color blue.
  • Interfaces: 3-wire SPI, 4-wire SPI and I²C; selected via two resistors BS0/BS1 on the back of the module.
  • Factory default: 4-wire SPI (BS0=0, BS1=0). For 3-wire SPI: BS0=1, BS1=0. For I²C: BS0=0, BS1=1.
  • I²C address: with DC tied to GND, the 7-bit address is 0x3C.
  • Raspberry Pi wiring: VCC→3.3 V, GND→GND, DIN→SPI MOSI / I²C SDA (BCM D2), CLK→SPI SCLK / I²C SCL (BCM D3), CS→CE0 (D8), D/C→GPIO.6 (D25), RES→GPIO.2 (D27).
  • Enabling SPI/I²C on Raspberry Pi: run sudo raspi-config → Interfacing Options → enable SPI or I²C, then reboot.
  • On Bookworm only the lgpio library is available; bcm2835 and WiringPi cannot be installed there.
  • C demo invocation: cd c && sudo make clean && sudo make -j 8, then sudo ./main 1.3 for this module.
  • Python demo: cd python/example && sudo python3 OLED_1in3_test.py (or python2).

Commands and examples – verify before use: 

sudo raspi-config
sudo reboot
sudo apt-get install wiringpi
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
sudo apt-get update
sudo apt-get install python3-pip
sudo apt-get install python3-pil
sudo apt-get install python3-numpy
sudo pip3 install spidev
sudo apt-get install python3-smbus
sudo apt-get install p7zip-full
sudo wget https://files.waveshare.com/upload/2/2c/OLED_Module_Code.7z
7z x OLED_Module_Code.7z
cd OLED_Module_Code/RaspberryPi
cd c
sudo make clean
sudo make -j 8

Notes and version constraints

  • The exact BS0/BS1 resistor soldering pattern must be verified against the datasheet before soldering.
  • The program defaults to SPI mode; switching to I²C requires editing DEV_Config.h – a version-sensitive step.
  • With STM32, the I²C demo uses bit-banged (analog) I²C; adjust the wiring accordingly.
  • Reverse-connecting the power supply can damage the module; verify polarity before powering on.
  • Displaying the same image for extended periods causes burn-in and damages the OLED; rotate displayed content.
  • If the screen stays dark after power-on, program control is required; without software commands the display will not light up.

Source and revision record

  • 1.3inch OLED (B) - Waveshare Wiki
  • Source revision: 110135
  • Captured: 2026-08-29T10:03:04+00:00
  • SHA-256: 4cd94394b25150dbec4aca976f2a27c14965e092b399937b50ad192bd7343500