Arduino UNO + ESP8266 WiFi Module
Intro: Arduino UNO + ESP8266 WiFi Module
This instructable will show you how to connect an ESP8266 WiFi Module to an Arduino UNO.
EDIT: For info on how to install the ESP8266 library, see here.
STEP 1: Wiring
Wire the ESP8266 Module, the Arduino UNO, and the breadboard as seen in the image.
When complete the pins should be connected as follows (ESP8266 pin-out is shown for reference):
- ESP8266 TX --> Arduino UNO TX
- ESP8266 GND --> Breadboard GND
- ESP8266 CH-PD --> Breadboard 3.3V
- ESP8266 GPIO2 --> Breadboard LED
- ESP8266 RST --> Breadboard RST button --> Arduino UNO GND
- ESP8266 GPIO0 --> Breadboard 3.3V/Breadboard FLASH button --> Arduino UNO GND
- ESP8266 VCC --> Breadboard 3.3V
- ESP8266 RX --> Arduino UNO RX
STEP 2: Flashing
- To flash your ESP8266 module, first check that the GPIO0 pin on the ESP8266 is connected to the FLASH button on the breadboard.
- If there is a program currently running on your Arduino, upload an empty project file to the Arduino to avoid interference while flashing WiFi module.
- Open the attached Arduino project and replace the SSID and PASSWORD at the top with your WiFi-network info
- Open your serial monitor (ctrl+shift+m), set the baud rate to 115200, and the line formatting option to "Both NL & CR"
- Press the RST button while holding down the FLASH button on the breadboard - you should see a blue light on the Wi-Fi module and the TX led on the Arduino will light up. You must upload code while the TX led is lit.
- Now, compile and upload code (see video for procedure and expected results).
- Record the IP printed in the serial monitor for use in step 3. If the flash fails try the above steps again. If the serial monitor is printing "." repeatedly, you have entered your WiFi information incorrectly.
Note: the RST button connects the RST pin on the Wi-Fi module to ground. The FLASH button connects the GPIO0 pin on the Wi-Fi module to ground.
STEP 3: Usage
Now, for normal operation, connect GPIO0 to the 3.3V rail on the breadboard. This can be done by moving the wire connecting GPIO0 to the button over to the positive rail of the breadboard.
To connect to your ESP8266 module, ensure you are connected to the same network as it is, and go to the IP address from step 2 in your browser. Alternatively, connect directly to the ESP8266's WiFi network on your laptop and navigate to IP 192.168.4.1 in your browser (in my experience this is far less reliable, using a shared network is preferred).
20 Comments
Shuvagata 6 years ago
Where can I find the ESP8266WIFI library? Could you give a link to .zip file for the library?
carlsandra2005 6 months ago
https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/
JerryE4 10 months ago
GRhfxt 3 years ago
PeterAC 4 years ago
I do not understand step 5 of the flashing :
Press the RST button while holding down the FLASH button on the
breadboard - you should see a blue light on the Wi-Fi module and the TX
led on the Arduino will light up. You must upload code while the TX led
is lit.
Is this the right sequence: ?
press and hold flash button (On)
then press the reset button (On)
Release the Restet button (Off)
wait for the Arduino to program over USBasp and to finish the programming and verification.
Then release the flash button (Off).
I have had a working led on/ led of html page and UNO, but I do not know how It happend and why. After loading Blink to the ardunio UNO the WiFi dit not work on the Serial monitor nor on the wifi html page.
I like to know how to make the UNO send a lightintencity value from de ADC A0 to the ESP8266 over WiFi to a phone with P2P wifi connection each 1ms.
Can someone please share this knowledge here? Or maybe you know a place to look for further information about this kind of topics.
Thanks in advance.
Peter
BinY2 4 years ago
JaiS45 4 years ago
BinY2 4 years ago
hkathait1 4 years ago
AkshayaS13 4 years ago
JaiS45 4 years ago
ChrissyP11 4 years ago
SharadD3 4 years ago
Arduino: 1.8.9 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), ck, 26 MHz, 40MHz, DOUT (compatible), 512K (no SPIFFS), 2, nonos-sdk 2.2.1 (legacy), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
Sketch uses 274872 bytes (55%) of program storage space. Maximum is 499696 bytes.
Global variables use 27184 bytes (33%) of dynamic memory, leaving 54736 bytes for local variables. Maximum is 81920 bytes.
esptool.py v2.6
2.6
esptool.py v2.6
Serial port COM5
Connecting........_____....._____....._____....._____....._____....._____.....____Traceback (most recent call last):
File "C:\Users\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.1/tools/upload.py", line 25, in
esptool.main(fakeargs)
File "C:/Users/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 2653, in main
esp.connect(args.before)
File "C:/Users/AppData/Local/Arduino15/packages/esp8266/hardware/esp8266/2.5.1/tools/esptool\esptool.py", line 468, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
_
the selected serial port _
does not exist or your board is not connected
Invalid library found in C:\Users\Documents\Arduino\libraries\Arduino-master: no headers files (.h) found in C:\Users\Documents\Arduino\libraries\Arduino-master
Invalid library found in C:\Users\Documents\Arduino\libraries\Arduino-master: no headers files (.h) found in C:\Users\Documents\Arduino\libraries\Arduino-master
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
JaiS45 4 years ago
Rutuja95 5 years ago
JaiS45 4 years ago
bivekgris 5 years ago
AliebiL 5 years ago
Hi there, I've problem, when I try to upload sketch to board, it showing error compiling? how to solve it? thanks a lot for help.
tpaulraj 5 years ago
Nice project.successfully done uploading
Swansong 6 years ago
Thanks for sharing :)