Introduction: Control Arduino Uno Using ESP8266 WiFi Module and Blynk App
This project enables you to control the Arduino pins using ESP8266-01 WiFi module and Blynk App. Blynk App is very easy to use and is great way to begin learning about IoT.
This Tutorial is For Windows PC
Step 1: Gather Everything:
Esp8266-01 WiFi Module
USB to TTL serial
3.3v voltage regulator
Breadboard and Wires.
These are the things that you need. Make sure you have everything in a folder beforehand
1) Arduino IDE : https://www.arduino.cc/en/Main/Software
2) Blynk Libraries (latest version): https://github.com/blynkkk/blynk-library/releases...
3) ESP8266 flasher tool: https://github.com/blynkkk/blynk-library/releases...
Step 2: Installing Arduino IDE and Libraries
Install the latest version of Arduino IDE.
Open Arduino IDE and go to file-> preferences-> in additional board manager URL type - http://arduino.esp8266.com/stable/package_esp8266...
Go to tools -> boards -> Board Manager --> and install the esp8266 package found at last. (optional)
Extract the blynk library zip file and copy the contents inside library folder in the zip file into -
user documents--> Arduino --> Libraries
Step 3: Flashing ESP8266 Firmware
You need to make the circuit shown in order to flash the firmware onto the ESP8266:
In many forums I have read that the esp8266 can be flashed without using FTDI usb to ttl converter. Instead many people have used Arduino UNO to flash the esp8266. However from my personal experience it is better to buy a FTDI USB to TTL converter/Cable as the arduino thing didn't work for me( may be because of power issue).
Extract the esp_flasher.zip and run the application XTCOM_UTIL.
Connect the Esp8266-01 to the computer through the circuit. You need to know the right COM port which is used for communication. go to device manager and Click on ports(COM & LPT). Then note down the COM port used by the ESP8266-01.
In XTCOM_UTIL go to tools-->Config Device and select the right com port and baud rate as 9600. Click on Open. Then if the operation is Successful click on Connect. then Esp8266 will be Connected. If you encounter an error then unplug the cable and insert it again.
Inside the esp_flasher.zip file, you will find a readme.txt file containing the addresses to which each of the .bin files to be flashed. go to API Test-->flash Image download. browse the correct.bin file and enter the address corresponding the bin file and click on download.
for example: boot_v1.1.bin---------------->0x00000
after the operation is successful close the XTCOM_UTIL and also unplug ESP8266( this must be done in between the flashing of each.bin file). Again reopen XTCOM_UTIL and plug Esp8266 and repeat the above steps to flash all the 4 bin files at their correct address. (remember to ground the GPIO0 at all time during flashing)
For detailed instruction, please refer to this: https://os.mbed.com/users/sschocke/code/WiFiLamp/...
Step 4: Blynk App Setup
Download the Blynk App from Play Store and Sign In.
To Create a New Project Press + icon on the top. Give You Project Name. Choose Device as Arduino UNO Connection Type as WiFi and press Create. As soon as you Create an Auth Token will be sent to your Registered e-Mail. You Can Also send it Later in you Project Setting Page(nut Symbol)--> Devices.
To add a button press + and select Button. Press on the newly created button to edit it. Give it a name and set pin to digital D13. Toggle the mode to SWITCH. This will turn ON/OFF the IN-Built LED on the Arduino.
To control other Pins, Select the Required Pin(D3, D4... etc) in Edit Menu.
Step 5: Programming
Open Arduino IDE.
Select board to Arduino Uno and select the right port.
DOWNLOAD THE CODE AND PASTE THE CODE IN Adruino IDE.
It is the modification of Esp8266_Shield Example Program.
Replace yourAUTH with the Auth token sent to your Mail. Replace youSSID with your WiFi name and replace YourPassword with WiFi Password. Hardware serial part is commented as we are using Arduino UNO.
**In the programI have Commented Software Serial(if using Arduino Uno). I recommend you to comment the Software Serial as its unstable.
Upload the above program to the Arduino Uno board.
After its Uploaded unplug the arduino from Computer.
Now you need to connect the ESP8266 to Arduino UNO.
Step 6: Circuit Setup and FInish!
TX -------------> Rx
Rx ------------> Tx
Gnd ------------> Gnd
Vcc -------------> 3.3v
CH_PD --------------> 3.3v
After the connection is complete, plug the Arduino into the computer. Open the Serial Monitor and set baud rate to 115200.
If Everything is Correct, in the Serial Monitor you will see something like the Image Shown.
In the Blynk App, select your project and click the play button.
Press the button to switch ON/OFF the LED.
Now with this the project is finished.
Hope you enjoyed the tutorial. If you have any questions/ suggestions pls leave it in the comment section below. Thank you!