Electrical – Connecting ESP8266 with STM32 Nucleo

esp8266stm32

I am trying to use ESP8266 with STM32L476RG Nucleo. The ESP8266 requires up to 300 mA to transmit properly. I tried to connect my ESP to an Arduino Mega, and it responds correctly, but when I brunch the ESP to the STM micro controller, the AT command was sent correctly, but the response message is not correct (if I send 'AT+RST' the response would be 'AT +RST').

I want to ask if the STM32L476 Nucleo can provide 300 mA that the ESP requires.

If it can require that 300 mA, what do you think the issue could be?

Well, I tried to use an external power supply that can provide 3.3 V the ESP8266 is responding this time with garbage characters baudrate = 115,200 and Tx -> Rx , Rx->Tx, CH-PD -> 3.3 V, VCC -> 3.3 V, and Gnd -> Gnd.

I am working with IARWorkbensh and the code is simple:

if (HAL_UART_Receive_IT(&UartHandle, aRxBuffer, RXBUFFERSIZE) != HAL_OK)
{
    Error_Handler();
}

if (HAL_UART_Transmit(&UartHandle, (uint8_t*)aTxBuffer, TXBUFFERSIZE, 5000) != HAL_OK)
{
    while(1);
}

aRxBuffer is a buffer containing the data received.

aTxBuffer is a buffer containing the command transmitted to the ESP8266 (in my case I'm sending an "AT+RST\r\n" command).

Best Answer

You should not power the ESP off of the STM's 3.3 V pin. You probably have a 500 mA fuse on there and if your STM is running full load, maybe a couple of LEDs or other components on the board and the ESP together could exceed that fuses rating.

Get the LM1117 instead; it's a solid 3.3 V regulator. Also put a beefy capacitor parallel to the ESP's supply, so when it starts building up its Wi-Fi network the current peak needed can be easily supplied.

Related Topic