In this tutorial we will show how to connect ESP8266 WiFi module and 5V Arduino. Since ESP8266 is not 5V tolerant we need some kind of voltage level shifter.
ESP8266 module is not 5V tolerant. It works on 3.3V power suplay. Most Arduinos works on 5V. If we want connect both components we need to adapt voltage levels between. If you are using 3.3V Arduino, then read ESP8266 WiFi and 3.3V Arduino connection.
First we need 3.3V power supply for ESP8266. Good choice for regulator is AMS1117 3.3V. Simple circuit is shown below. Be sure to use big enough capacitor.
ESP8266 VCC and CH_PHD are connected to 3.3V power supply.
AMS1117 3.3V power supply.
Next we need shift voltage levels on data lines. To convert 5V output to 3.3V input level we can use simple resistor divider. In this circuit we use 20K and 10K resistors. With this level shifter we can connect Arduino TX to ESP8266 RX and Arduino digital pin and ESP8266 reset pin.
Arduino TX -> ESP8266 RX
Arduino DO pin -> ESP8266 reset
To connect Arduino RX and ESP8266 TX you may try without level shifter. 3.3V should be enough for logical one in 5V Arduino. Just connect Arduino RX and ESP TX pin. If that doesn't work use level shifter.
For level shifter we need active component. In circuit below we use NPN transistor 2N2222 and two resistors. This level shifter is suitable to connect Arduino RX and ESP8266 TX pin.
Arduino Mega 2560 with TFT shield and ESP8266 module. Arduino Mega 2560 is 5V and ESP8266 is 3.3V.
See more tutorials at http://iot-playground.com/build
To support this site and EasyIoT framework development please buy in our store.