Sunday, December 30, 2018

0.96" I2C 128X64 Blue OLED Display Module

I ordered a 0.96" I2C 128X64 Blue OLED Display Module from eBay for $2.85 (shipping included).   It claims: voltage 3-5V,  power consumption of full lit screen 80mW, SSD1306 driver IC, compatible with Arduino.  When it arrived about three weeks later, the circuit on the back looked a little different from the product pictures on eBay.

Notably there is no regulator IC that would generate 3.3V from 5V.   It also lacks the level shifters  that are on the similar product by adafruit.   I'm a little skeptical that it can run on 5V..  So we'll start with 3.3V supply.  The two I2C signals are pulled up with 10K resistors.

We will test it using esp32-pico-kit with Arduino on Linux.  The CP210x UART Bridge is mapped to /dev/ttyUSB0.  Adafruit SSD1306 library (along with GFX library) claims to be compatible with ESP32.  We will try the example sketch ssd1306_128x64_i2c.   We need to know the default I2C pins.  It took a while to poke around the ESP32 code to find the pin definition: SDA=21 and SCL=22.   We compile and upload the code.  We open the serial monitor (9600 baud) and see some output, but there is nothing on the display.

We'll try a different library, "ESP8266 and ESP32 Oled Driver for SSD1306 display".  After modifying the I2C pins, the example SSD1306SimpleDemo works nicely.  The current for the module is 4 - 12mA as the program runs through different screen drawings.


Sketch uses 166885 bytes (12%) of program storage space. Maximum is 1310720 bytes.
Global variables use 11444 bytes (3%) of dynamic memory, leaving 283468 bytes for local variables. Maximum is 294912 bytes.
esptool.py v2.1
Connecting........__
Chip is unknown ESP32 (revision 1)
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 8192 bytes to 47...

Writing at 0x0000e000... (100 %)
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 7540.8 kbit/s)...
Hash of data verified.
Compressed 14128 bytes to 9213...

Writing at 0x00001000... (100 %)
Wrote 14128 bytes (9213 compressed) at 0x00001000 in 0.1 seconds (effective 818.5 kbit/s)...
Hash of data verified.
Compressed 168032 bytes to 92899...

Writing at 0x00010000... (16 %)
Writing at 0x00014000... (33 %)
Writing at 0x00018000... (50 %)
Writing at 0x0001c000... (66 %)
Writing at 0x00020000... (83 %)
Writing at 0x00024000... (100 %)
Wrote 168032 bytes (92899 compressed) at 0x00010000 in 1.6 seconds (effective 861.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 122...

Writing at 0x00008000... (100 %)
Wrote 3072 bytes (122 compressed) at 0x00008000 in 0.0 seconds (effective 4691.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting...
ets Jun  8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:956
load:0x40078000,len:0
load:0x40078000,len:13076
entry 0x40078ad0




2 comments:

  1. I have the same display but cant make it work can you be more detailed. hardware side what did you connect? also do you have an example code.
    Thanks

    ReplyDelete
  2. I have the same display, but it does not work :-(
    What did you changed to make it work?

    ReplyDelete