2018-06-01 18:10:00 +02:00
NodeMCU ESP8266
===============
2018-11-14 22:12:27 +01:00
.. seo ::
2019-02-16 23:25:23 +01:00
:description: Instructions for using nodemcu ESP8266 boards in ESPHome together with a description of their pins and uses.
2018-11-14 22:12:27 +01:00
:image: nodemcu_esp8266.jpg
:keywords: NodeMCU, ESP8266
2019-02-16 23:25:23 +01:00
The NodeMCU board is fully supported by ESPHome. Simply select `` ESP8266 `` when
the ESPHome wizard asks you for your platform and |nodemcuv2|_ as the board type.
2018-06-01 18:10:00 +02:00
.. note ::
2019-10-18 09:22:48 +02:00
Most NodeMCU that can be purchased now are version 2 or upwards. If you're using an
2018-06-01 18:10:00 +02:00
original v1 board, set the board type to |nodemcu|_.
.. |nodemcuv2| replace :: `` nodemcuv2 ``
.. _nodemcuv2: http://docs.platformio.org/en/latest/platforms/espressif8266.html#nodemcu
.. |nodemcu| replace :: `` nodemcu ``
.. _nodemcu: http://docs.platformio.org/en/latest/platforms/espressif8266.html#nodemcu
2018-11-19 18:32:16 +01:00
.. code-block :: yaml
2018-06-01 18:10:00 +02:00
# Example configuration entry
2019-02-16 23:25:23 +01:00
esphome:
2018-06-01 18:10:00 +02:00
name: livingroom
platform: ESP8266
board: nodemcuv2
The NodeMCU's pin numbering as seen on the board (the `` D0 `` etc pins) is different from
2020-10-05 18:58:00 +02:00
the internal pin numbering. For example, the `` D3 `` pin number maps to the internal
2019-02-16 23:25:23 +01:00
`` GPIO0 `` pin. Fortunately ESPHome knows the mapping from the on-board pin numbers
2019-10-18 09:22:48 +02:00
to the internal pin numbering, but you need to prefix the pin numbers with `` D `` as in
the image below in order for this automatic mapping to occur.
2018-06-01 18:10:00 +02:00
In general, it is best to just use the `` D0 `` , `` D1 `` , ... pin numbering to avoid confusion
.. figure :: images/nodemcu_esp8266-full.jpg
:align: center
Pins on the NodeMCU ESP8266 development board.
Note that in certain conditions you *can* use the pins marked as `` INTERNAL `` in above image.
2019-02-07 13:54:45 +01:00
- `` D0 `` also can be used to wake the device up from :doc: `deep sleep </components/deep_sleep>` if
2018-06-01 18:10:00 +02:00
the pin is connected to the `` RESET `` pin. `` D0 `` is additionally connected to the LED
next to the UART chip, but in an inverted mode.
- `` D3 `` , `` D4 `` and `` D8 `` are used on startup to determine the boot mode, therefore these pins should
not be pulled low on startup. You can, however, still use them as output pins.
- `` A0 `` : This pin can be used as a normal GPIO pin (like `` D1 `` etc) but additionally can measure
2019-02-07 13:54:45 +01:00
voltages from 0 to 1.0V using the :doc: `/components/sensor/adc` .
2020-05-29 00:27:37 +02:00
- `` VIN `` : This board can be powered by an external power supply by using this pin. Supply a voltage depends on the board you use. Some boards support up to 12V, some up to 5V.
2018-06-01 18:10:00 +02:00
- `` ENABLE `` /`` RESET `` : When these pins are triggered, the board resets. The difference between the pins
2019-10-18 09:22:48 +02:00
is how they can handle voltages above 3.3V.
2018-06-01 18:10:00 +02:00
2018-11-19 18:32:16 +01:00
.. code-block :: yaml
2018-06-01 18:10:00 +02:00
# Example configuration entry
2019-02-16 23:25:23 +01:00
esphome:
2018-06-01 18:10:00 +02:00
name: livingroom
platform: ESP8266
board: nodemcuv2
binary_sensor:
- platform: gpio
name: "Pin D0"
pin: D0
See Also
2018-08-24 22:44:01 +02:00
--------
2018-06-01 18:10:00 +02:00
- :doc: `esp8266`
- :doc: `nodemcu_esp32`
2019-02-07 13:54:45 +01:00
- :ghedit: `Edit`