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 interfaces, making it versatile and easy to integrate 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
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
STM32F103C8T6 and ESP8266-Based Real-Time Crop Health Monitoring System with Wi-Fi Connectivity
Image of crop: A project utilizing SH1106 in a practical application
This circuit is a real-time crop health monitoring system that uses an STM32F103C8T6 microcontroller to read data from an NPK soil sensor, a soil moisture sensor, and a humidity and temperature sensor. The collected data is then transmitted wirelessly via an ESP8266 module to a dashboard or mobile app for farmers to monitor crop health.
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 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
Image of crop: A project utilizing SH1106 in a practical application
STM32F103C8T6 and ESP8266-Based Real-Time Crop Health Monitoring System with Wi-Fi Connectivity
This circuit is a real-time crop health monitoring system that uses an STM32F103C8T6 microcontroller to read data from an NPK soil sensor, a soil moisture sensor, and a humidity and temperature sensor. The collected data is then transmitted wirelessly via an ESP8266 module to a dashboard or mobile app for farmers to monitor crop health.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Wearable devices
  • IoT dashboards and displays
  • Portable electronics
  • Industrial control panels
  • Hobbyist and DIY projects

Technical Specifications

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

Parameter Value
Display Resolution 128x64 pixels
Communication Interface I2C or SPI
Operating Voltage 2.4V to 3.6V
Logic Voltage 3.3V (compatible with 5V logic via level shifter)
Operating Temperature -40°C to +85°C
Current Consumption ~20mA (typical, depends on display usage)
Pixel Color Monochrome (white, blue, or yellow depending on OLED panel)

Pin Configuration and Descriptions

The SH1106 OLED module typically has the following pinout:

I2C Interface Pinout

Pin Name Pin Number Description
GND 1 Ground (0V reference)
VCC 2 Power supply (2.4V to 3.6V)
SCL 3 Serial Clock Line for I2C communication
SDA 4 Serial Data Line for I2C communication

SPI Interface Pinout

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

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. Interface Selection: Choose between I2C or SPI based on your application. For I2C, connect SCL and SDA to the corresponding pins on your microcontroller. For SPI, connect SCK, MOSI, RES, DC, and CS as required.
  3. Pull-Up Resistors: If using I2C, ensure pull-up resistors (typically 4.7kΩ) are connected to the SCL and SDA lines.
  4. Initialization: Use a compatible library (e.g., Adafruit SH1106 library) to initialize and control the display.

Important Considerations and Best Practices

  • Voltage Compatibility: If your microcontroller operates at 5V logic, use a level shifter to avoid damaging the SH1106.
  • Capacitors: Add decoupling capacitors (e.g., 0.1µF) near the power pins to stabilize the power supply.
  • Library Support: Use well-documented libraries like Adafruit GFX and SH1106 libraries for easier integration.
  • Contrast Adjustment: Adjust the display contrast in software to optimize visibility and power consumption.

Example Code for Arduino UNO (I2C)

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

// Define the I2C address for the SH1106 display
#define OLED_I2C_ADDRESS 0x3C

// Create an instance of the SH1106 display
Adafruit_SH1106 display(-1); // -1 indicates no reset pin is used

void setup() {
  // Initialize the display
  if (!display.begin(SH1106_I2C_ADDRESS, OLED_I2C_ADDRESS)) {
    Serial.println(F("SH1106 initialization failed!"));
    while (1); // Halt execution if initialization fails
  }

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

  // Display a welcome message
  display.setTextSize(1); // Set text size to 1 (smallest)
  display.setTextColor(WHITE); // Set text color to white
  display.setCursor(0, 0); // Set cursor to top-left corner
  display.println(F("Hello, SH1106!")); // Print message
  display.display(); // Update the display with the buffer content
}

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

Troubleshooting and FAQs

Common Issues and Solutions

  1. Display Not Turning On:

    • Ensure the VCC and GND pins are properly connected.
    • Verify the power supply voltage is within the specified range (2.4V to 3.6V).
    • Check for loose or incorrect wiring.
  2. No Output on Display:

    • Confirm the I2C or SPI connections are correct.
    • Verify the I2C address (default is 0x3C) matches the one in your code.
    • Ensure the required libraries are installed and properly included in your code.
  3. Flickering or Artifacts:

    • Add decoupling capacitors near the power pins to stabilize the voltage.
    • Check for noise or interference on the communication lines.
  4. Partial Display or Missing Pixels:

    • Inspect the OLED panel for physical damage.
    • Ensure the initialization sequence in your code matches the SH1106 datasheet.

FAQs

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

Q: What is the maximum refresh rate of the SH1106?
A: The refresh rate depends on the communication speed and the size of the data being updated. Typically, it can achieve up to 60Hz with optimized code.

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 integration.

Q: How do I adjust the brightness of the display?
A: Brightness can be adjusted in software by modifying the contrast register using the appropriate library functions.

This concludes the SH1106 documentation.