0

I'm working on a home automation project to control my Sommer Base+ garage door opener through Home Assistant.

The project consists of a WeMos D1 Mini with two reed switches (to detect door open/closed) and a 5V relay to control the door opener.

When the door is open the 'top / open' switch is triggered, giving a status of open. Likewise when the door is closed, the 'bottom / closed' switch is triggered, giving a status of closed. When neither switch is triggered (i.e. when the door is in motion), the status is either opening or closing, depending on the previous status.

enter image description here

This works fine unless the WeMos is powered up while either reed switch is closed (so if the door is open or closed).

I know this is because D3 and D8 GPIO pins for the open/close sensors and those can put the device into boot mode (I think that's what it's called).

What I want to know is which pins are the best to use for this project.

Is it possible for me to just change to pins ?? and ?? without needing to update my code? Is it possible that the WeMos D1 Mini isn't a good fit for what I want?

  • 1
    GPIO 4+5 are basically the only universal inputs on the 8266; no side-effects or implementation complications. – dandavis May 16 at 20:12
3

NodeMCU and "Wemos D1 R2 and Mini" esp8266 (esp-12) pins and io overview


Serial

RX io3 RX0

TX io1 TX0


boot config pins with pullup or pulldown on board

D3 io0 PULLUP (LOW for boot to flashing mode)

D4 io2 TX1 PULLUP (Serial1 TX. no RX for Serial1)

D8 io15 PULLDOWN (SS pin if esp8266 is SPI slave); TX if Serial.swap()


untroubled GPIOs with optional function for I2C or SPI bus:

D1 io5 default pin for I2C SCL

D2 io4 default pin for I2C SCA

D5 io14 SPI CLK

D6 io12 SPI MISO

D7 io13 SPI MOSI; RX if Serial.swap()


RTC pin for timed deep sleep wake-up (if connected to reset pin)

D0 io16 - optional internal pulldown, internal pullup not available


not useable: on NodeMcu Sx pins io 6 to io 11 connect QIO SPI flash memory (in a very special setup the SPI bus can be used with other SPI device) (in other very special setup the QIO pins can be used as gpio)

note: most digital IO start as INPUT_PULLUP

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.