« Back

NodeMCU Lolin V3 (ESP8266)

hardware

CPU: Tensilica Xtensa L106 32bit RISC (max. 160 MHz)
RAM: <50 kB

Features: 802.11 b/g/n (WPA/WPA2)
          SDIO 2.0, SPI, UART, I2C, I2S, IRDA, PWM, GPIO
          UART/USB converter

Operating temperature range: -40°C ~ 125°C

pins

| label | description   |    | label | description           |
| ----- | ------------- |    | ----- | --------------------- |
| A0    | ADC0 / TOUT   |    | D0    | gpio16 / user / wake  |
| G     | ground        |    | D1    | gpio5                 |
| VU    | USB power out |    | D2    | gpio4                 |
| S3    | gpio10 / SDD3 |    | D3    | gpio0 / flash         |
| S2    | gpio9 / SDD2  |    | D4    | gpio2 / TXD1          |
| S1    | MOSI / SDD1   |    | 3V    | 3,3 volt              |
| SC    | CS / SDCMD    |    | G     | ground                |
| SO    | MISO / SDD0   |    | D5    | gpio14 / HSCLK        |
| SK    | SCLK / SDCLK  |    | D6    | gpio12 / HMISO        |
| G     | ground        |    | D7    | gpio13 / RXD2 / HMOSI |
| 3V    | 3,3 volt      |    | D8    | gpio15 / TXD2 / HCS   |
| EN    |               |    | RX    | gpio3 / RXD0          |
| RST   |               |    | TX    | gpio1 / TXD0          |
| G     | ground        |    | G     | ground                |
| VIN   | 5 volt in     |    | 3V    | 3,3 volt              |

don't power the NodeMCU at VIN while connecting USB people say there is no protection and it may damage your USB chip.

serial console

The NodeMCU contains a UART/USB converter that should be available as /dev/ttyUSB0.

$ dmesg | grep ttyUSB
[18253.344433] usb 1-3.2.2: FTDI USB Serial Device converter now attached to ttyUSB0
[27933.293963] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[185007.815737] usb 1-1.2.2: ch341-uart converter now attached to ttyUSB0
[185020.515937] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[185026.051659] usb 1-1.2.2: ch341-uart converter now attached to ttyUSB0

After identifying the proper serial device we can open a console with 115200 baudrate.

screen /dev/ttyUSB0 115200

At least the default firmware sends a unknown bytestream while initializing the board. As soon as the board is initialized it will print ready

toolchain

install the esptool to communicate with the ROM bootloader of ESP8266

# pacman -S esptool

MQ-2 Gas Sensor

pins

| label | description |
| ----- | ----------- |
| A0    | analog out  |
| D0    | digital out |
| GND   | ground      |
| VCC   | 5 volt      |

digital out will print 0 until threshold value is exceeded threshold can be configured via potentiometer