Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use sh1106: Examples, Pinouts, and Specs

Image of sh1106
Cirkit Designer LogoDesign with sh1106 in Cirkit Designer

Introduction

The SH1106 is a monochrome OLED display driver designed to control OLED panels with a resolution of 128x64 pixels. It is widely used in embedded systems for displaying text, graphics, and simple animations. The SH1106 supports both I2C and SPI communication protocols, making it versatile and compatible with a variety of microcontrollers, including Arduino, Raspberry Pi, and other development boards.

Explore Projects Built with sh1106

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M
Image of women safety: A project utilizing sh1106 in a practical application
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
Image of Copy of CanSet v1: A project utilizing sh1106 in a practical application
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Powered Wi-Fi Controlled Robotic Car with OLED Display and Ultrasonic Sensor
Image of playbot: A project utilizing sh1106 in a practical application
This circuit is a battery-powered system featuring an ESP32 microcontroller that controls an OLED display, a motor driver for two hobby motors, an ultrasonic sensor for distance measurement, and a DFPlayer Mini for audio output through a loudspeaker. The TP4056 module manages battery charging, and a step-up boost converter provides a stable 5V supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Battery-Powered Multi-Sensor System
Image of Dive sense: A project utilizing sh1106 in a practical application
This circuit consists of a TP4056 module connected to a 3.7V LiPo battery, providing a charging interface for the battery. The TP4056 manages the charging process by connecting its B+ and B- pins to the battery's positive and ground terminals, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with sh1106

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of women safety: A project utilizing sh1106 in a practical application
Battery-Powered Emergency Alert System with NUCLEO-F072RB, SIM800L, and GPS NEO 6M
This circuit is an emergency alert system that uses a NUCLEO-F072RB microcontroller to send SMS alerts and make calls via a SIM800L GSM module, while obtaining location data from a GPS NEO 6M module. The system is powered by a Li-ion battery and includes a TP4056 module for battery charging and protection, with a rocker switch to control power to the microcontroller.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Copy of CanSet v1: A project utilizing sh1106 in a practical application
Battery-Powered Raspberry Pi Pico GPS Tracker with Sensor Integration
This circuit is a data acquisition and communication system powered by a LiPoly battery and managed by a Raspberry Pi Pico. It includes sensors (BMP280, MPU9250) for environmental data, a GPS module for location tracking, an SD card for data storage, and a WLR089-CanSAT for wireless communication. The TP4056 module handles battery charging, and a toggle switch controls power distribution.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of playbot: A project utilizing sh1106 in a practical application
ESP32-Powered Wi-Fi Controlled Robotic Car with OLED Display and Ultrasonic Sensor
This circuit is a battery-powered system featuring an ESP32 microcontroller that controls an OLED display, a motor driver for two hobby motors, an ultrasonic sensor for distance measurement, and a DFPlayer Mini for audio output through a loudspeaker. The TP4056 module manages battery charging, and a step-up boost converter provides a stable 5V supply to the components.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Dive sense: A project utilizing sh1106 in a practical application
ESP32-Based Battery-Powered Multi-Sensor System
This circuit consists of a TP4056 module connected to a 3.7V LiPo battery, providing a charging interface for the battery. The TP4056 manages the charging process by connecting its B+ and B- pins to the battery's positive and ground terminals, respectively.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Display modules for IoT devices
  • User interfaces for embedded systems
  • Wearable devices
  • Industrial control panels
  • Educational and hobbyist projects

Technical Specifications

The SH1106 is a highly efficient display driver with the following key specifications:

General Specifications

Parameter Value
Display Resolution 128x64 pixels
Communication Protocol I2C or SPI
Operating Voltage 2.4V to 3.6V
Logic Voltage Levels 3.3V (compatible with 5V logic via level shifter)
Operating Temperature -40°C to +85°C
Power Consumption Low power consumption

Pin Configuration (I2C Mode)

Pin Name Pin Number Description
GND 1 Ground
VCC 2 Power supply (2.4V to 3.6V)
SCL 3 Serial clock input for I2C
SDA 4 Serial data input/output for I2C
RES 5 Reset pin (active low)
DC 6 Data/Command control pin
CS 7 Chip select (used in SPI mode, tie to GND for I2C)

Pin Configuration (SPI Mode)

Pin Name Pin Number Description
GND 1 Ground
VCC 2 Power supply (2.4V to 3.6V)
SCK 3 Serial clock input for SPI
MOSI 4 Master Out Slave In (data input)
RES 5 Reset pin (active low)
DC 6 Data/Command control pin
CS 7 Chip select (active low)

Usage Instructions

How to Use the SH1106 in a Circuit

  1. Power Supply: Connect the VCC pin to a 3.3V power source and the GND pin to ground.
  2. Communication Interface:
    • For I2C: Connect the SCL and SDA pins to the corresponding I2C pins on your microcontroller.
    • For SPI: Connect the SCK, MOSI, and CS pins to the corresponding SPI pins on your microcontroller.
  3. Reset Pin: Connect the RES pin to a GPIO pin on your microcontroller for resetting the display.
  4. Data/Command Pin: Use the DC pin to toggle between sending data and commands to the display.

Important Considerations and Best Practices

  • Use pull-up resistors (typically 4.7kΩ to 10kΩ) on the SDA and SCL lines for I2C communication.
  • Ensure the logic voltage levels of your microcontroller match the SH1106. If using a 5V microcontroller, use a level shifter.
  • Avoid leaving the RES pin floating; connect it to a GPIO pin or tie it to VCC with a pull-up resistor.
  • For optimal performance, ensure proper decoupling capacitors are placed near the VCC and GND pins.

Example Code for Arduino UNO (I2C Mode)

Below is an example of how to use the SH1106 with an Arduino UNO using the popular Adafruit_SH1106 library.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SH1106.h>

// Define the reset pin for the SH1106 display
#define OLED_RESET 4

// Initialize the SH1106 display object
Adafruit_SH1106 display(OLED_RESET);

void setup() {
  // Initialize the display
  if (!display.begin(SSD1306_I2C_ADDRESS, OLED_RESET)) {
    // Display initialization failed
    Serial.println(F("SH1106 initialization failed!"));
    for (;;); // Halt execution
  }

  // Clear the display buffer
  display.clearDisplay();

  // Set text size and color
  display.setTextSize(1); // Small text size
  display.setTextColor(WHITE);

  // Display a message
  display.setCursor(0, 0); // Set cursor to top-left corner
  display.println(F("Hello, SH1106!"));
  display.display(); // Update the display with the buffer content
}

void loop() {
  // Add your main code here
}

Notes on the Code

  • The Adafruit_SH1106 library must be installed in your Arduino IDE. You can install it via the Library Manager.
  • The SSD1306_I2C_ADDRESS is typically 0x3C or 0x3D. Check your display's datasheet or documentation for the correct address.

Troubleshooting and FAQs

Common Issues and Solutions

  1. Display Not Turning On:

    • Verify the power connections (VCC and GND).
    • Ensure the RES pin is properly connected or tied high.
  2. No Output on the Display:

    • Check the communication protocol (I2C or SPI) and ensure the wiring matches the selected mode.
    • Verify the I2C address or SPI configuration in your code.
  3. Flickering or Corrupted Display:

    • Ensure proper pull-up resistors are used for I2C lines.
    • Check for loose or poor-quality connections.
  4. Library Errors:

    • Ensure the correct library (Adafruit_SH1106) is installed and included in your project.
    • Update the library to the latest version if issues persist.

FAQs

Q: Can the SH1106 work with 5V microcontrollers?
A: Yes, but you need to use a level shifter to convert the 5V logic signals to 3.3V.

Q: What is the difference between SH1106 and SSD1306?
A: Both are OLED display drivers, but the SH1106 has a slightly different memory mapping and supports larger displays. Ensure your library supports the SH1106 specifically.

Q: How do I identify the I2C address of my SH1106 display?
A: Use an I2C scanner sketch to detect the address. It is typically 0x3C or 0x3D.

Q: Can I use the SH1106 with Raspberry Pi?
A: Yes, the SH1106 is compatible with Raspberry Pi via I2C or SPI. Use libraries like luma.oled for Python development.

By following this documentation, you should be able to successfully integrate and use the SH1106 in your projects!