OLED display, no sign of life (Arduino ESP32, SPI)

Hi!

I'm trying to make my display show anything but it just completely dark (sometimes after briefly flickering at startup).

I'm using Arduino Nano ESP32 with example code from library Adafruit SSD1306 (ssd1306_128x64_spi.ino). Tried using hardware and software SPI.

Should I see any sign of life from only having the display powered? Any ideas are appreciated!

OLED display: https://www.electrokit.com/produkt/lcd-oled-2-42-12x64px-spi-i2c/
Library: GitHub - adafruit/Adafruit_SSD1306: Arduino library for SSD1306 monochrome 128x64 and 128x32 OLEDs

Connections:
CS - D7
DC - D6
RES - D8
SDA - D12
SCL - D13
VCC - VBUS
GND - GND

Init part of code (the rest can be found here: https://github.com/adafruit/Adafruit_SSD1306/blob/master/examples/ssd1306_128x64_spi/ssd1306_128x64_spi.ino):

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

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

#define OLED_DC     6
#define OLED_CS     7
#define OLED_RESET  8
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  &SPI, OLED_DC, OLED_RESET, OLED_CS);

It appears you have SDA hooked up to MISO rather than MOSI.

1 Like

Wow. That helped.

But now new errors are showing. Sometimes after sketch upload, nothing happens and sometimes it works. Some example sketches can't draw the whole screen and sometimes it only shows random static. Also, when I touch the wires the image goes crazy.

Dupont cables can do that. Quite often the pins that go into the solderless breadboard are, umm, well pretty lousy at their job. There's no way to sugarcoat that. I avoid them like the plague and use 22-24 gauge solid hookup wire.

1 Like

Thanks, I replaced with solid wire and then there was some improvement of the displayed media but still didn't display correct. After uploading another sketch it went black again, now black with whichever program I try.

I just found that the display works with 3.3V on VCC pin instead of 5V as it's labeled. It also works completely without voltage on VCC pin (!) although a bit more dim. As soon as I put 5V on it again it dies.

Strange?

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