ESP8266 Wi Fi Module Explain and Connection

719,730

305

115

About: Hi, I'm Matej and I'm a student of Electrical Engineering. I have been working with electronics for more than 7 years and have lots of knowledge, projects and lots to share along my path, so this page is jus...

Hi.

I am Matej and in this instructable I'm going to show you how to use the ESP8266 Wi-fi module. I know that there is a lot of videos and forums telling how to use this device, but none of them were colorfull or easy enaugh to understand. I also didn't manage to make the device work by following other's people steps. I hope that you will find this tutorial usefull.

I also apologize for any misspelling.

*A little update. As promised, I made another instructable. This is about much easier wireless comunication, the Bluetooth. I Combine Bluetooth AND ULTRASONIC SENSOR. I also used this in my car for a school project. Make sure to check that one out :) *

*UPDATE*

MAKE SURE YOU WATCH MY NEW INSTRUCTABLE ON AN ARDUINO WEATHER STATION WITH BLUETOOTH THAT WILL SOON CONTAIN ESP8266 AS I PROMISED I WILL DO A PROJECT WITH IT AND A WEATHER SERVER SOUNDS FANTASTIC.:

https://www.instructables.com/id/DIY-Weather-Statio...

Step 1: THE ESP8266

To make everything work, you need to understand what each part does and what is the pinout for that part.

I'll start with the ESP8266. As shown in the picture, ESP8266 has 8 pins, 4 in the row of 2. The first pin on the top left is GND. The two pins right from the GND are GPIO 2 and 0. I'm not going to use these pins, as they are not impirtant for the operation. The pin on the top right side is the RX pin and the pin on the lower left is TX. These are the pins for comunication. The middle pins on the bottom are CH_PD(chip power-down) and RST(reset).

The main thing to remember is, that this device works with 3.3V;even the RX and TX pins. Arduino or many USB to serial converters work with 5V. The solution for this project is in the next step.

Step 2: THE FTDI232R

For this project I used this FTDI232R module. I bought it from ebay to have a reliable USB to serial converter. I didn't noticed it when I bought this part, but when I got it I saw, that it has a jumper to switch the operation from 5V to 3.3V. This makes everything easy, as we can connect the two parts together as it will be shown in the later picture.

I also soldered an extra connector for the 3.3V power to make connecting easy.

If your device doesn't have this option, than I will tell you how to work with 5v devices in the next few steps.

(I bought this ft232r and came in a nice package http://www.ebay.com/itm/400800529480?ru=http%3A%2F%2Fwww.ebay.com%2Fsch%2Fm.html%3F_ssn%3Dsseariver2009%26_armrs%3D1%26_from%3DR40%26_sacat%3D0%26_nkw%3D400800529480%26_rdc%3D1 )

Step 3: CONNECTING THE PARTS TOGETHER

The picture shows how to connect the two parts together.

The CH_PD and the RST pins must be high(connected to 3.3V) to have a normal operation.

If you have any questions about the connections or that your part isn't working, write in the comments :)

Step 4: A Little Bit of Hardware

As you have already noticed, those 8 pins of the ESP8266 are not breadboard friendly. So that's why I made an adapter with female and male headers. I hope that the pictures describe it well.

Step 5: Connecting to the Computer

The pictures are showing the final resault. if you connected everything right, like I sowed you before, you're good to go.

To connect the FTDI232R to the computer, I used this USB mini cable. Than I installed the drivers and connected power to the ESP8266.

Step 6: Talking to the ESP8266

To comunicate with the ESP8266, I used Arduino IDE( http://arduino.cc/en/main/software ) and don't be confused of the version 1.5.8. I have Arduino DUE, so I need that version.

So, when you open the IDE, choose the correct serial port for your FTDI and click on the Serial monitor.

Once you have opened the Serial monitor, you must set the first option to NL & CR and the baud rate. When it comes to baud rate you have 2 choises. I bought this esp8266 around 3 weeks ago. Therefore, it has firmware 902 apart from older esp8266 that have firmware 900. For this newer model, the default baud rate is 9600, for the older is 115200.

Once you set that, type in the box AT and it sould return OK. This device comunicates via AT comments( http://www.electrodragon.com/w/Wi07c )

(every command step is a separate picture)

To check firmware type AT+GMR

To set the module to accept connections type AT+CWMODE=3(my was already in this mode, as shown in the picture)

To search Wi fi networks around type AT+CWLAP
It will display Wi fi networks around you

To connect to a network type AT+CWJAP="Wifi SSID","password"

To find your IP adress type AT+CIFSR

After every command it returns you OK

You can also see it transmiting Wi fi signal on the last picture.

Step 7: COMMUNICATION WITH 5 VOLT DEVICES

So, if you have a communicator like ftdi, that doesn't have an option to set the logic voltage, do the following.

Almost every USB to serial converter has built-in voltage regulator for 3.3 volts(the chip operates with that). So, you can find that pin or a pad and connect it to the pins like normal. FOr the communication is a liitle bit trickier.

The signal from the esp8266 from TX pin is 3.3V which is enaugh for the communicator. But the 5v from the TX of the communicator can kill the esp8266!!!!!! Therefore you must build a voltage devider. If you don't know what that is; it's a simple construction made of resistor. In our case, we will use 1k and 2k resistor. We connect these two in series with TX pin of the communicator to 1k resistor and GND to the 2k resistor. The junction between the resistor is connected to the RX of the ESP8266.

The picture describes this perfect.

Step 8: OTHER

You can also watch this guy who also explained how to update the firmware for older models. He did all the same, but I showed it much slower and colorfull. Credits to him as well. ( https://www.youtube.com/watch?v=9QZkCQSHnko )

Now I'm working with connecting ESP8266 to Arduino(Uno or Due) for email notifier and making use of a little ethernet board, to make wifi spot.

If you have any questions you can write down in the comments. I will respond to as much as I can.

Thank you for watching :)

3 People Made This Project!

Recommendations

  • Arduino Contest 2019

    Arduino Contest 2019
  • Trash to Treasure

    Trash to Treasure
  • Tape Contest

    Tape Contest

115 Discussions

0
None
Maorgorelik123

2 months ago on Step 8

Hi,
I have a related issue and I hoped you could help me with it. I got a new esp8266 01 and it wasn't responding to my AT's so I tried flashing esp8266 01 using Arduino uno wifi.
I connected the circuit just like pretty much every manual says (but without FTDI or resistors only using the esp, Arduino, and standard cables. I tried using a few flasher programs I found online but I kept getting "connecting...... Failed to connect" and I can't seem to Know the problem. For this project I can only use resistors so if you have a solution for me that would be great. Thx for the help!

1 reply
0
None
Matej BlagšičMaorgorelik123

Reply 2 months ago

Hi,
First of all make sure, that you have good power supply. ESP8266 or i'll just call it esp, is quite a power hungry device. Make sure that your 3v3 line is strong enough to sustain at least 100mA continuous power. Also a big capacitor like 470uF or 1000uF is really preferable on the output of the regulator. Maybe a 100nF with a 10uF near the esp. This is because of its wifi radio, that drains power with spikes up to 300mA. Then make sure that your arduino is 3v3 logic as the esp, if not, you can risk damaging it. When using arduino to talk to esp over serial, you are actually using onboard usb-serial converter to talk to esp over Rx and Tx line. Make sure that arduino is in reset, so put a jumper from RST to ground to put it in reset so it wont try to interfere on the lines. Make sure that you have all the proper resistors for CH_PD and reset on the esp side. Apart from these few things, there is nothing else to suggest. Hope it works for you.

0
None
sonimoniameet

Question 6 months ago on Step 1

i am using aurdino uno directly with esp8266.

connected rst, ch_pd=3.3v

gnd-gnd

vcc-3.3,

rx-rx, tx-tx

i am getting error

espcomm_sync failed.espcom_open failed.

why so?

and wat about the reset pin of aurdino uno?

pls tell me the correcet connection of aurdino uno with esp8266 directly

1 answer
0
None
JoshuaT137

Question 7 months ago on Introduction

I have done your step good sir exactly as you interpreted it, but doing all that I have no progression, I can't establish serial communication with the module, all connections were connected as you've shown, GPIO/0 and GPIO/2 have no connections, all pins were in the same state as yours, im also using an FTDI board, also used the Arduino IDE, bought 2 more module just to troubleshoot if my first one was defective, its not, jumper wires and the breadboard have no such fault, what am I doing wrong? did I ordered a defective wifi module? how to troubleshoot this kind of situations, cause I've spent months trying every tutorial videos, schematic diagrams, checked the data sheet, and out of all that I "CAN NOT" establish a SIMPLE serial communication. It's infuriating, so with desperation, and little hope left, can you help me? if it's no bother can we have a private message? Facebook? Skype?

Hope to hear from you soon :)

0
None
satyensingh021

1 year ago

if I don't have any router/modem then esp8266 will work with android directly or not???

(ESP8266 ==> android)

<==

0
None
BenaL

1 year ago

Can it be hooked with lily tiny/ twinkle ?

1 reply
0
None
Matej BlagšičBenaL

Reply 1 year ago

Yes you can. I would implement a SoftwareSerial library and connect it to esp8266 and talk to it and get data via serial. There are other ways but this is one that i could think for. But that means to sacrifise 2 pins!

0
None
JHolland181

1 year ago

Good afternoon,

Thank you for the write up/tutorial! Is the only bit of coding in step 6?

0
None
MihirD7

1 year ago

Hi,
I am struggling with ESP8266 for past 2 weeks.

I have made all the connections as you and several other tutorials have mentioned. I am using an external power source for the ESP.

I am not getting any response for AT. The serial monitor just remains blank. I have tried with different baud rates(9600 & 115200). I have noticed that whenever I connect CH_PD pin to 3.3V, my onboard red LED of ESP goes off. When I remove the CH_PD pin from 3.3V, the LED turns back on. All the tutorials have mentioned that the CH_PD pin must be kept at 3.3V. But on making this connection my LED goes off and the voltage between GND&VCC and also GND&CH_PD drops to about 0.8V when measured with a multimeter. Can you please suggest what needs to be done to get the ESP8266 working.

5 replies
0
None
Matej BlagšičMihirD7

Reply 1 year ago

I would think that from your description of the problem that your esp8266 board is faulty as it shorts something inside and therefore yor input voltage drops. I would suggest to check for shots, wiring and if nothing works, then you can start blaming the board. Faulty esp chips are not rare. At my university, a third of them died from "improper soldering" and a lot of them died because of too many flashes. That way the board bricks itself. Keep me updated.

0
None
MihirD7Matej Blagšič

Reply 1 year ago

Hi,
To check the possibility of esp8266 burning out, i bought a new esp module today. However, exact same problem persists. Following are the connections that I have done:

ESP GND -> external GND
ESP Vcc -> external 3.3V
ESP RST -> external 3.3V
ESP CH_PD -> external 3.3V

My external source is a 5V power source with 2A current rating. I have used three 1k resistors to get 3.3V. I had also checked the voltages with multimeter before connecting to the esp module. All tge voltages were between 3.27V to 3.3V. I am really stuck at this and I'm not understanding what am I doing wrong. Please any help would be greatly appreciated!

0
None
Matej BlagšičMihirD7

Reply 1 year ago

Hi. I see. You can never, well for the most of time and only for really small current devices, use resistor dividers as power source. You can use them to step down signal voltages like between esp and 5v arduino but not for huge and fast signals as resistor dividers are slow. You should allways use fet signal switching for loads of data at high speed.
To get back to your problem, as esp uses A LOT of powerr, as for 70-80mA the resistor divider colapses and therefore your output voltage drops. Use a proper 3.3V regulator from your 5v power source or a dedicated 3.3v power supply that can handle at least 200mA

0
None
Deepak10

1 year ago

Is it possible to connect arduino board and wifi ESP8266 module without additional FTD1232R?

1 reply
0
None
Utpals19Deepak10

Reply 1 year ago

Yes you can connect ESP8266 with arduino board without FTD1232R.. You need to connect the ESP8266's VCC, CH_PD and RST with 3.3 volt arduino's supply. Even you can directly connect serial UART pin of both devices. It will work but better use any voltage level converter to avoid any damage to ESP8266.

0
None
Syed HamzaN

1 year ago

Hey. I used arduino to upload the code to my esp8266. Following is the error I am getting. Can you kindly help me with this?

error.PNG
1 reply
0
None
Otniel96Syed HamzaN

Reply 1 year ago

check out ur usb connections is that correct? that problem can be from the board, sory for my english language

0
None
Join TechH

1 year ago

You have successfully connect FDTI 232 R with esp 8266, but how to connect arduino with esp 8266 ?