Arduino Nano with SSD1306 I2C OLED Analog Display with

My OLED display has GND VDD SCK SDA pins, and it's not working with Arduino Nano, Someone please guide me on this.

General OLED comes with pins GND VCC SCL SDA, but mine is GND VDD SCK SDA pins.

I had attached my connection diagram.

I think it is just a pin labelling error.

Run the i²c scanner sketch from the examples menu to check what address the oled has on the bus.

Your circuit layout is not clear from the photograh. Please post a schematic of the circuit, hand-drawn is ok. How are those resistors connected, it does not look right?

SCK = SCL in this case. Run the I2C scanner as suggested to make sure that the display is detected first.

Here is the circuit diagram for correct connections, I hope this will help.

Have a look at how to wire up a potential divider as what you have does not convert 5V to 3V.

Is your OLED a 3.3V device? You will need bidirectional level shifters on the I2C lines if it is.

That OLED's Vcc supply should be directly connected with 5V of NANO. That is how I have operated OLED with UNO.

I have tested the following sketch with NANO and the OLED is working well. Connections are direct: 5V to Vcc, GND to GND, A4 to SDA, A5 to SCL/SCK.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//#include <Adafruit_BME280.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels

#define OLED_RESET     -1 // Reset pin # (or -1 if sharing Arduino reset pin)
#define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

void setup()
{
  Serial.begin(9600);

  // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
  if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) 
  {
    Serial.println(F("SSD1306 allocation failed"));
    for (;;); // Don't proceed, loop forever
  }
  // Show initial display buffer contents on the screen --
  // the library initializes this with an Adafruit splash screen.
  display.display();
  delay(2000); // Pause for 2 seconds

  // Clear the buffer
  display.clearDisplay();

  // Draw a single pixel in white
  display.drawPixel(10, 10, SSD1306_WHITE);

  // Show the display buffer on the screen. You MUST call display() after
  // drawing commands to make them visible on screen!
  display.display();
  delay(2000);
  testdrawstyles();    // Draw 'stylized' characters
}

void loop() 
{
}

void testdrawstyles(void) 
{
  display.clearDisplay();
  display.setTextSize(1);             // Normal 1:1 pixel scale
  display.setTextColor(SSD1306_WHITE);        // Draw white text
  display.setCursor(0, 0);            // Start at top-left corner
  display.println(F("Hello, world!"));

  display.setTextColor(SSD1306_WHITE);
  //(SSD1306_BLACK, SSD1306_WHITE); // Draw 'inverse' text
  display.println(3.141592, 6); //6-digit after decimal point

  display.setTextSize(2);             // Draw 2X-scale text
  display.setTextColor(SSD1306_WHITE);
  display.print(F("0x")); display.println(0xDEADBEEF, HEX);

  display.display();
  delay(2000);
}

The problem is My OLED doesn't have a VCC pin, it has VDD.
I tried your connections and code, but it's not working.

I am not sure, but I think it is a 3.3V OLED.

If you have 3.3V-ESP8266//ESP32 Board, then try your OLED here.

or

Use 5V/3.3V level shifter and re-try with NANO/UNO; but, I am afraid if the 3.3V-OLED has already been fried!

This is my OLED having marks for GND, VCC, SCL, SDA
oledPicx

It's important to know this parameter. Can you find out from where you bought it from?

You could err on the side of caution and start with a 3.3V supply and level shifters as shown above. If the display works, then stick with that setup.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.