ESP01 and OLED 0.96 I2c

Hello,
I try to use the following configuration;

  1. ESP8266 Serial WIFI Module ESP-01 (blue Version)
  2. USB-to-ESP8266 01 Serial Wireless Wifi Module für ESP-01 for programming
  3. an OLED 0.96 display
    When I program it to write or draw something on the display then nothing will be happen.
    The power has taken from the programmer module (=USB-to-ESP8266 01)
    The SCL and SDA I get from the ESP8266 Serial WIFI Module ESP-01
    What could be the problem?
    Thanks a lot in advance.
    Kurt

Congratulations.

Need to see a proper schematic and your code !

Hello ham. Y,
thank you for your answer.
I made a schematic using fritzing
How can i insert this to the topic?
The code I will add this afternoon.

A Fritzing schematic is no good .
Have a quick read of guides for drawing schematics , draw one ( pencil ) , photograph it and upload into your post

I find the open source TinyCAD useful for creating schematics

Hello to all you answered
sorry for my late replay!
Thanks a lot for your answers.
Here some about my work:

  1. I made the a code for WiFi connection and output on an OLED (JMD0.96C) see code below
  2. This works very good as long as I use a NODEMCU
  3. When I connect the OLED to an ESP01 (blue version) nothing happens at all.
  4. When I connect the pin CH_PD to 3.3V then I can see the ESP01 on my wireless network but nothing happends on the OLED
  5. For uploading the programm I use an USB-Adapter modified for upload.

This is the wiring:

  1. a 3.3 V source to pin VCC and CH_PD on ESP01
  2. a 3.3 v source to VCC on OLED
  3. the ground to ground on ESP01 and OLED
  4. the SCL to GPIO0 on ESP01 and OLED
  5. the SDA to GPIO2 on ESP01 and OLED

Thanks.
This is a simple code which works on a NODEMCU


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

const char* WIFI_SSID     = "ABC";
const char* WIFI_PASSWORD = "0987654321";
String HostName = "WiFi Tester";

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // 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);
  delay(5000);
  Serial.println("**************");
  Serial.println("* Start hier *");
  Serial.println("**************");
  //
  // Setup WIFI
  // ==========

  WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
  WiFi.setHostname(HostName.c_str());
  while (WiFi.status() != WL_CONNECTED) {
    delay(100);
  }

  Serial.println("WiFi connected.");
  for (byte i = 0; i < 10; i++) {
    Serial.println(WiFi.localIP());
    delay(2000);
  }
  //
  // Setup SSD1306
  // =============


  // 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();

  delay(1000);

}

void loop() {
}

Hi to all experts!
Does anybody have an idea what's wrong with my project?
Thanks a lot in advance.
Kurt

https://simple-circuit.com/esp-01-esp8266-ssd1306-oled-i2c-mode/

Hi ZX80!
thanks a lot for your hint.
A line
Wire.begin(2,0);
was missing in my code.
Now it works perfect.
Kurt

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