Blynk Setup
Download ‘Blynk’ in Playstore or App Store, install it and create a project
Find the auth token of the project and mail it to yourself.
Insert a button, change it to switch and map it to Pin D9.
Run the project and click on play button
You should not receive any “Arduino Uno is offline” message like below (if your arduino uno is running fine with the same auth token. See below)
Now use the button to on/off and see that the LED in Arduino board switches on and off
Connections
Refer the pin diagram below. Attach LED in Pin D9.
Library
Download the blynk library from here and unzip it in Documents/Arduino/Library
Code
In Arduino IDE, use the code below.
This was modified version of (File->Examples->Blynk->Boards & Shields->ESP8266_Shield_HardSer)
//#define BLYNK_DEBUG #define BLYNK_PRINT Serial // Comment this out to disable prints and save space #include <ESP8266_HardSer.h> #include <BlynkSimpleShieldEsp8266_HardSer.h> // Set ESP8266 Serial object #define EspSerial Serial ESP8266 wifi(EspSerial); // You should get Auth Token in the Blynk App. // Go to the Project Settings (nut icon). char auth[] = "3e53e86250884b5c83a9124f1c57b553"; void setup() { // Set console baud rate Serial.begin(9600); delay(10); // Set ESP8266 baud rate EspSerial.begin(115200); delay(10); Blynk.begin(auth, wifi, "SKS Cottage", "kayar123"); } void loop() { Blynk.run(); }