My long term plan is to show temperature and humidity on screen, add the ability to turn my fan on via infrared LEDs, and connect it all up to Home Assistant.

In the short term, I want to get the basics working, being able to upload code, with a temperature display if I can.

The device

The device I have was from an AliExpress listing. I thought the screen would be great for quick feedback, and I think that is definitely true here.

Bare board

Bare board

Boxed device

Boxed device

I bought a few of these boards from AliExpress. I have several others but this seemed like a great starting point.

Difficulties and solving them!

  1. Where the hell do I get the info about this random AliExpress board?
  2. What are the pinouts, and how can I put stuff on screen?
  3. How can I connect the temperature monitor and use it?

Well, long story short, I managed to find the AliExpress listing. This contained a lot of vital information:

SpecDetailNotes
Memory (RAM)128KB
Storage4MB
SRAM64KB
Clock speed80MHz

And some really important pinout info (ESP8266 -> OLED), combined with ESP8266 info that I managed to glean:

ESP8266 PinOLED PinNotes
VCC (3.3v)VCC
GNDGND
D6 (GPIO12)Screen ClockIn ESPHome, this is mapped to the i2c sda line
D5 (GPIO14)Screen Data LineIn ESPHome, this is mapped to the i2c scl line

I also managed to find some other valuable information:

  • Don’t connect anything external to D5. This makes the device not boot properly (probably because the screen is on that line)
  • Don’t connect anything permanently to D8. My device wouldn’t boot when I connected it up. I believe from reading online that this is because D8 can be used to select SD Card on bootup on the ESP8266.

Other pinouts that I manage to find and document.

Board markingPinGPIOSPII2CUARTPowerSystemSD Card
D0GPIO16GPIO16----WAKE-
D1GPIO5GPIO5-SCL----
D2GPIO4GPIO4-SDA----
D3GPIO0GPIO0----FLASH-
D4GPIO2GPIO2----TXD1-
D5GPIO14GPIO14HSCLK-----
D6GPIO12GPIO12HMISO-----
D7GPIO13GPIO13HMOSI-----
D8GPIO15GPIO15HCS-----
D9GPIO3GPIO3--RXD0---
D10GPIO1GPIO1--TXD0---
A0ADC0ADC0------
-VIN----VIN--
-GND----GND--
-3.3V----3.3V--
-EN-----EN-
-RST-----RST (Reset)-
CLKGPIO6GPIO6SCLK-----
SDDGPIO7GPIO7MISO-----
SD1GPIO8GPIO8MOSI-----
SD2GPIO9GPIO9-----SDD2
SD3GPIO10GPIO10-----SDD3
CMDGPIO11GPIO11-----SDCMD
-CH_PD-----CH_PD-
RSV (Do not use!)--------

My setup

I installed ESP Home through Home Assistant. I have my HA and my IoT networks on separate networks so I am using static IPs for now - I know there are ways to use mDNS to make discovery work properly, but I haven’t worked it out yet in my router.

And here is my setup:

esphome:
  name: test-esp8266-ideaspark
  friendly_name: test_esp8266_ideaspark

esp8266:
  board: esp01_1m

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: fakekey

ota:
  password: fakepassword

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  manual_ip:
    static_ip: 192.168.107.231
    gateway: 192.168.107.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test-Esp8266-Ideaspark"
    password: fakepassword

captive_portal:

# Here are the important bits for a test
i2c:
  sda: GPIO12
  scl: GPIO14

font:
  - file: "gfonts://Ubuntu+Mono"
    id: ubuntu_font
    size: "16"

sensor:
  - platform: dht
    pin: GPIO5
    temperature:
      name: "Temperature"
      id: "temp"
    humidity:
      name: "Humidity"
      id: "humidity"
    update_interval: 60s

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    reset_pin: GPIO0
    address: 0x3C
    lambda: |-
      it.printf(0, 18, id(ubuntu_font), "%s", String(id(temp).state).c_str());
      it.printf(0, 40, id(ubuntu_font), "%s", String(id(humidity).state).c_str());

And here is how it looks in all it’s glory:

Example working

Example working

References

Lots of ESPHome documentation

Temperature sensor

Random other ones