I’ve also based my config heavily off of what @MallocArray made, however what worked for my setup is to wire my PM sensor directly to the hardware UART pins (RX/TX), and I got the idea from this github comment.
I would then modify the logger component to use the other, TX-only UART of the esp8266:
logger:
level: DEBUG
# baud_rate: 0
hardware_uart: UART1
logs:
pmsx003: INFO
Then use the hardware UART pins for the PM sensor:
uart:
# https://esphome.io/components/uart.html#uart
- rx_pin: D4
tx_pin: D3
baud_rate: 9600
id: senseair_s8_uart
- rx_pin: GPIO3 # previously D5
tx_pin: GPIO1 # previously D6
baud_rate: 9600
id: pms5003_uart
Then solder the wires. PM sensor’s TX should be on RX, then RX should be on TX.
Checking the logs would confirm that hardware serial is being used instead:
[02:32:03][C][uart.arduino_esp8266:102]: UART Bus:
[02:32:03][C][uart.arduino_esp8266:103]: TX Pin: GPIO1
[02:32:03][C][uart.arduino_esp8266:104]: RX Pin: GPIO3
[02:32:03][C][uart.arduino_esp8266:106]: RX Buffer Size: 256
[02:32:03][C][uart.arduino_esp8266:108]: Baud Rate: 9600 baud
[02:32:03][C][uart.arduino_esp8266:109]: Data Bits: 8
[02:32:03][C][uart.arduino_esp8266:110]: Parity: NONE
[02:32:03][C][uart.arduino_esp8266:111]: Stop bits: 1
[02:32:03][C][uart.arduino_esp8266:113]: Using hardware serial interface.
This let my monitors run for days, with the PM sensor polling continuously, where previously I’d be lucky to see it last for 8 hours. But I don’t actually know much of the downsides doing this, so let me know if there are any.
Edit: I also did try a different wemos mini, the S2. Based on the limited time I had to test, it did run fine for days as well, although I tested it with only a PMSA003, HC8 co2 sensor (also on UART), and the .66 oled.