Zum Inhalt springen

WSAL17009 – 2.23inch OLED HAT/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

Technical guide for the Waveshare 2.23inch OLED HAT with an SSD1305 controller: SPI/I2C interfaces, pinout, enabling interfaces on Raspberry Pi and demo runtimes (BCM2835, WiringPi, lgpio, Python), plus Arduino wiring.

Related products at JW Tech

Technical overview

  • Display: 128×32 pixels, 2.23 inch, white monochrome OLED; SSD1305 controller (internal GDDRAM 132×64).
  • SPI is the default mode; soldering jumpers (BS1/BS2/DIN/CLK/CS/DC) switches to I2C.
  • Operating voltage 3.3 V; temperature range −40 to 70 °C.
  • Pinout: VCC (3.3 V/5 V), GND, DIN (data), CLK (clock), CS (chip select, active-low), DC (register/data selection in SPI), RST (reset, active-low).
  • Raspberry Pi: enable SPI via `raspi-config` → Interfacing Options → SPI, then reboot; `dtparam=spi=on` appears in `/boot/config.txt`.
  • Raspberry Pi: enable I2C analogously via `raspi-config` → Interfacing Options → I2C, then reboot.
  • Libraries: BCM2835 (compile from source), WiringPi (`apt-get install wiringpi` or .deb or Git build), lgpio (Git + make install), Python (spidev, smbus, python3-pil, python3-numpy).
  • Download and extract the demo code package, then compile/run per runtime (make / sudo ./oled, or python3 stats.py).
  • Arduino: UNO PLUS as reference board; I2C: DIN→SDA(D14), SCL→D15; SPI: DIN→MOSI(D11), CLK→SCK(D13), CS→D10, DC→D8, RST→D9.
  • Image generation: Image2Lcd with data type *c, horizontal scan, monochrome, max size 128×32.

Commands and examples – verify before use: 

sudo raspi-config
sudo reboot
ls /dev/spi*
sudo wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
sudo tar zxvf bcm2835-1.71.tar.gz
cd bcm2835-1.71/
sudo ./configure && sudo make && sudo make check && sudo make install
sudo apt-get install wiringpi
wget https://files.waveshare.com/wiki/common/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
gpio -v
sudo git clone https://github.com/WiringPi/WiringPi
cd WiringPi
sudo ./build
sudo su
wget https://github.com/joan2937/lg/archive/master.zip
unzip master.zip
cd lg-master
sudo make install
sudo apt-get update

Notes and version constraints

  • Version-sensitive: On Bookworm only the lgpio library is available; bcm2835 and wiringPi cannot be installed or used there.
  • Conflict warning: If the BCM2835 library is loaded first, the WiringPi and Python demos fail; a system reboot is required.
  • The exact jumper configuration for I2C must be verified before use; the source only shows a figure without a complete pin-mapping table.
  • The demo URLs (files.waveshare.com) are external links; availability is not guaranteed.
  • No warranty, certification, or safety-test information is present in the source – do not infer any.
  • The Arduino wiring uses D8–D15; other boards require adapted pin mappings.

Source and revision record