For the HW-364A, which is an ESP8266 development board with an integrated 0.96" OLED display, the internal connections between the ESP8266 chip and the display are pre-wired. Unlike a standalone OLED module that typically uses default pins (D1/D2), this board uses a specific pinout that must be declared in your code. The Attached I2C Port Scanner Sketch will test and check for the correct SDA , SCL common pairs like GPIO 4/5 (D2/D1) or 12/14 (swapped D5/D6). Zip File ( Port scanner & read instruction txt file )![]()
Read First HW-364A, ESP8266 I2C Port Scanner Sketch.txt (2.6 KB)
INTERNAL PIN MAPPING
The integrated display is connected to the following GPIOs:
OLED Pin ESP8266 GPIO NodeMCU Pin Label
SDA (Data) GPIO 14 D6
SCL (Clock) GPIO 12 D5
Software Configuration
To use this display with common libraries like the Adafruit SSD1306 or the ThingPulse OLED SSD1306 driver, you must manually specify these pins in your setup() or For Arduino Wire Library:
c++
Wire.begin(14, 12); // Wire.begin(SDA, SCL)
For ThingPulse SSD1306Wire:
c++
SSD1306Wire display(0x3c, 14, 12); // (Address, SDA, SCL)
Key Technical Details
I2C Address: Typically 0x3C.
Resolution: 128x64 pixels.
Driver IC: SSD1306.
Power: The display is powered internally via the board's 3.3V rail.
Important Note: Documentation from some sellers may incorrectly claim the SDA/SCL pins are swapped (12 for SDA, 14 for SCL). If the display doesn't respond, try reversing the pins to Wire.begin(12, 14)
To verify the exact pins for your HW-364A board, you can use an I2C Port Scanner sketch. While a standard I2C scanner only checks for device addresses on the default pins, the specialized version below scans multiple GPIO combinations specifically for the ESP8266 to find exactly where the integrated OLED is mapped
I2C Port Scanner Sketch
Copy & Paste (ie) from the (First Tab) then upload this code to your board. It will cycle through the most common pin pairs used on these development boards and report which ones successfully detect the OLED
How to use this sketch:
Open Serial Monitor (Top Right Mag Glass Symbol): -> Set the baud rate to 115200.
Upload the Code: Select "Generic ESP8266 Module" as your board usually (ESP8266->NodeMCU1.0(ESP-12EModule)
Read the Output:
If it reports a device at 0x3C (the standard OLED address) when testing SDA: GPIO 14 and SCL: GPIO 12, then those are your confirmed pins.
If it finds nothing, it will test other common pairs like GPIO 4/5 (D2/D1) or 12/14 (swapped D5/D6)
Troubleshooting
No devices found: Ensure your board is getting enough power via USB; some integrated displays fail to initialize if the voltage is slightly low.
Garbage text in Serial: Ensure your Serial Monitor baud rate matches the Serial.begin(115200) in the code.
"D" Labels vs GPIO: Remember that NodeMCU labels like D5 and D6 correspond to GPIO 14 and GPIO 12 respectively.
I2C_Port_Scanner_Sketch.ino (905 Bytes)
#include <Wire.h>
// Common pin pairs for ESP8266 boards with integrated OLEDs
int sda_pins[] = {14, 12, 4, 2}, scl_pins[] = {12, 14, 5, 0};
void setup() {
Serial.begin(115200);
delay(2000);
Serial.println("\n--- HW-364A Pin Discovery Scan ---");
}
void loop() {
for (int i = 0; i < 4; i++) {
int sda = sda_pins[i], scl = scl_pins[i];
Serial.printf("Testing SDA: GPIO %d, SCL: GPIO %d... ", sda, scl);
Wire.begin(sda, scl);
byte count = 0;
for (byte address = 1; address < 127; address++) {
Wire.beginTransmission(address);
if (Wire.endTransmission() == 0) {
Serial.printf("FOUND device at 0x%02X!\n", address);
count++;
}
}
if (count == 0) Serial.println("No devices.");
delay(500);
}
Serial.println("Scan complete. Restarting in 10s...\n");
delay(10000);
}



