From ba83275d886a49952e90595d334065558450cd98 Mon Sep 17 00:00:00 2001 From: MangaValk Date: Mon, 2 Nov 2026 18:19:24 +0100 Subject: [PATCH] Docs: WEMOS D1 R1 (ESP8266) instead of ESP32 The reference build now uses a D1 R1. The example config targets esp8266/d1 and sends on GPIO2 (header pin D9, UART1 TX), which leaves UART0 free for the USB logger. The README wiring and signal-level notes are updated to match. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 2 +- README.md | 35 +++++++++++++++++++++++++---------- examples/samsung-vfd.yaml | 17 ++++++++--------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 6d96ec2..c1f4e03 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -48,7 +48,7 @@ server, so `type: git` with a URL, not `github://`). The layout must stay to line 2 and from the end of line 2 back home, and nothing scrolls. The buffered text API depends on this; the scroll modes are only for raw writes. - The RXD input is RS-232. The reference build uses a MAX3232 (no inversion - in config); a directly wired ESP32 pin needs `inverted: true` on the UART TX + in config); a directly wired ESP8266 pin needs `inverted: true` on the UART TX pin. Baud rate and parity come from the board's jumpers, so they are not validated by the component. - User characters: up to 4, codes 0x20–0x7E. Each is 5 column bytes, bit 6 = diff --git a/README.md b/README.md index a3511af..6127126 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ external_components: uart: id: uart_vfd - tx_pin: GPIO17 + tx_pin: GPIO2 # D1 R1 pin D9 (UART1 TX on the ESP8266) baud_rate: 9600 # match the display's jumpers (factory default: 9600, no parity) time: # required by the component (used by samsung_vfd.printf) @@ -54,6 +54,10 @@ samsung_vfd: uart_id: uart_vfd ``` +The `uart:` block above uses the pin from the reference build, a WEMOS D1 R1 +(ESP8266); see [Hardware](#hardware). Any ESPHome board with a free TX pin +works. + For a complete device, copy [examples/samsung-vfd.yaml](examples/samsung-vfd.yaml) into your ESPHome config folder. Add the keys from [examples/secrets.yaml.example](examples/secrets.yaml.example) to your @@ -65,13 +69,16 @@ The board in the photos is a 20L203DA5 (rev A). The included [datasheet](docs/20L203DA12-datasheet.pdf) is for the 20L203DA12, a variant with the same command set. +The reference build drives it from a WEMOS D1 R1, an UNO-sized ESP8266 board, +through a MAX3232. The [desk case](case/README.md) is made for that board. + ### Connector (3-pin Molex 5046-03A) | Pin | Signal | Connect to | |-----|--------|------------| | 1 | VCC | 5–24 V DC supply | -| 2 | RXD | MAX3232 T1OUT (T1IN ← ESP32 GPIO17), see below | -| 3 | GND | supply GND, MAX3232 GND **and** ESP32 GND | +| 2 | RXD | MAX3232 T1OUT (T1IN ← D1 R1 GPIO2), see below | +| 3 | GND | supply GND, MAX3232 GND **and** D1 R1 GND | ### Power @@ -83,21 +90,21 @@ for example 12 V at 1 A, and connect the grounds together. ### Signal levels The RXD input goes through an RS-232 receiver: it expects ±3 to ±15 V and -idles at the negative level (mark). It tolerates ±30 V, so a 3.3 V ESP32 pin +idles at the negative level (mark). It tolerates ±30 V, so a 3.3 V ESP8266 pin can't damage it. There are two ways to connect it: - **Through a MAX3232 (recommended, and how the original build is wired).** - Power the MAX3232 from the ESP32's 3.3 V, then wire GPIO17 → T1IN and + Power the MAX3232 from the D1's 3.3 V, then wire GPIO2 → T1IN and T1OUT → display RXD. The MAX3232 produces real RS-232 levels and does the - inversion itself, so use the plain `tx_pin: GPIO17`. -- **Direct from the ESP32.** A plain TTL signal arrives inverted, so wire - GPIO17 straight to RXD and invert the pin in the UART config: + inversion itself, so use the plain `tx_pin: GPIO2`. +- **Direct from the ESP8266.** A plain TTL signal arrives inverted, so wire + GPIO2 straight to RXD and invert the pin in the UART config: ```yaml uart: id: uart_vfd tx_pin: - number: GPIO17 + number: GPIO2 inverted: true baud_rate: 9600 ``` @@ -109,6 +116,14 @@ can't damage it. There are two ways to connect it: If the display shows garbage or nothing at all, the inversion setting is the first thing to check: off with a MAX3232, on without one. +### Why GPIO2 + +The ESP8266 has two hardware UARTs. UART0 (GPIO1/GPIO3) is the USB serial +port that ESPHome's logger uses. UART1 can only transmit, and only on GPIO2, +which is all this display needs. On the D1 R1, GPIO2 is the pin labelled D9. +GPIO2 must be high at boot; the MAX3232's input doesn't pull it low, so that +is fine. + ### Jumpers The 2×8 pin header on the board selects the following. Jumpers are read only @@ -209,7 +224,7 @@ table, character set and user characters. It sends them again after | `samsung_vfd.set_blink` | `interval:` (templatable time): on for that long, off for that long, in 13 ms steps up to 3.3 s. `0ms` stops blinking. | | `samsung_vfd.turn_off` / `turn_on` | Blanks the screen and brings it back without losing its contents. | | `samsung_vfd.set_annunciator` | `column:` 1–20, or 0 for all; `state:` true/false (both templatable). Switches the triangle under that column. | -| `samsung_vfd.reinit` | Resets the display, re-applies all settings and redraws the screen. Use it when the display was power-cycled without the ESP. | +| `samsung_vfd.reinit` | Resets the display, re-applies all settings and redraws the screen. Use it when the display was power-cycled without the ESP8266. | | `samsung_vfd.self_test` | Runs the built-in self-test (about 20 s), then restores settings and the screen. | ### Raw control diff --git a/examples/samsung-vfd.yaml b/examples/samsung-vfd.yaml index 5680b98..c3e5e92 100644 --- a/examples/samsung-vfd.yaml +++ b/examples/samsung-vfd.yaml @@ -4,11 +4,11 @@ # your secrets.yaml), or use it as a reference for your own device config. # # Wiring (3-pin connector on the display, 9600 8N1): -# pin 1 VCC <- 5-24V supply, up to 1.2A at 5V (not the ESP32 regulator) -# pin 2 RXD <- MAX3232 T1OUT <- T1IN <- ESP32 GPIO17 (TX) -# pin 3 GND <-> supply GND, MAX3232 GND and ESP32 GND +# pin 1 VCC <- 5-24V supply, up to 1.2A at 5V (not the D1's regulator) +# pin 2 RXD <- MAX3232 T1OUT <- T1IN <- WEMOS D1 R1 GPIO2 / D9 (UART1 TX) +# pin 3 GND <-> supply GND, MAX3232 GND and D1 GND # -# RXD is an RS-232 input. Without a MAX3232, wire GPIO17 straight to RXD and +# RXD is an RS-232 input. Without a MAX3232, wire GPIO2 straight to RXD and # set `inverted: true` under uart. esphome: @@ -42,10 +42,9 @@ external_components: # type: local # path: ../components -esp32: - board: esp32dev - framework: - type: arduino +# WEMOS D1 R1 (UNO-sized ESP8266 board). +esp8266: + board: d1 logger: level: INFO @@ -85,7 +84,7 @@ time: uart: id: uart_vfd tx_pin: - number: GPIO17 + number: GPIO2 # UART1, TX-only; UART0 stays free for the USB logger inverted: false # true when wired directly, without a MAX3232 baud_rate: 9600 parity: NONE