Controlling by smartphone via internet two relays with Blynk and ESP 8266-01 ! "odi#a "his work presents a very simple method o$ #ontrolling two led or two relays with the smartphone tro%gh the internet! "he work is based on the very good t%torial presented on this link& https&''spidyhero!wordpress!#om'201('08'01'esp8266-esp-01-blynk-led-#ontroller-thaiversion' )n addition to this t%torial ) added some modi$i#ations and s%pplementary e*planations!
"he pro+e#t is based on the %se o$ the ,ii internet mod%le ESP 8266-01. /version 01.
ig! 1! eneral view o$ mod%le ESP8266-01
ig! 2! eneral view o$ :SB to ""4-:3;" ""4-:3;" Serial Converter
ig! ! "he pin #on$ig%ration o$ ESP8266-01 and #onne#tion to :SB to ""4:3;" #onverter b%t other versions v ersions #an be %sed as well. /ig! 1! "he mod%le is able to #onne#t to internet and #omm #omm%ni %ni#at #atee with with othe otherr devi devi#e #ess on the the netw networ ork! k! o )P or othe otherr sett settin ings gs are are re%ested! "his devi#e #an work alone. a$ter #harging the #ode. or atta#hed to the 3rd%ino board! )n this pro+e#t we %se the $irst $eat%re. the work witho%t 3rd%ino! "his devi#e #an be programmed dire#tly by the #omp%ter. witho%t 3rd%ino or other boards. the only re%ested re%ested a##essories a##essories being one ""4 adapter. adapter. C570 (9'!9 (9'!9.. :SB to ""4-:3; ""4-:3;" " Serial Converter. /ig! 2!
"he adapter is ne#essarily to ens%re :SB #onne#tion to the #omp%ter and #onvert the
ig! 7! Setting the 3rd%ino pre$eren#es ""4 level signals provided by PC to ! volts. be#a%se ESP8266 s%pport power s%pply and signals with !9 ma*im%m amplit%de! "he pinot o$ the mod%le and the #onne#tion to the :SB to ""4-:3;" adapter are shown in $ig%re ! "his #on$ig%ration will be %sed only $or programming the ESP 8266! "he P)< 0 pin m%st be #onne#ted to =! 3$ter #harging the #ode. this pin will be dis#onne#ted $rom the gro%nd and will be #onne#ted to the $irst led> it be#ome o%tp%t $or this pro+e#t! "he pro+e#t #onsists o$ two mains parts. setting the 3rd%ino to re#ogni?e and #omm%ni#ate with the ESP 8266. and setting the Blynk appli#ation on the smartphone! Part 1! Setting 3rd%ino )=E! 1! =ownload and install the version v ersion 3rd%ino 3rd%ino 1!6!8 $rom the o$$i#ial site! https://www.arduino.cc/en/main/software h ttps://www.arduino.cc/en/main/software .
2! 3dd the in$ormation o$ the board ESP8266 to the 3rd%ino!
ig! ( 7! )nto the pop %p bo* type ESP8266 and press install ! "he window looks like ig! 6!
ig! 6!
(! Setting Setting the ESP8266 ESP8266 board! board! o to men% "ools' Board' Boards anager' !!! Sele#t Generic ESP8266 Module board! "he s#reen displays this& /ig! !
ig! !
ig! 8!
6! )n the pop %p bo* types ESP8266 and then install ! ,e ,e obtain. /ig! 8! ! o to the "ools Board& Boards anager !!! then #hoose Generic ESP8266 Module board. /ig! D!
ig! D!
ig! 10!
8! =ownoload and install Blynk library 0!7!0 $rom http&''www!blynk!##'getting-started' Save into desired $older. %n?ip and add man%ally into Arduino/libraries $older! 3lternatively yo% #an %se the option Add i! library ! "o do this go to 3rd%ino )=E. men% Sket#h )n#l%de 4ibrary 3dd !)P 4ibrary and then sele#t the downloaded $ile. /ig! 10! D! Conne#t the ESP8266 board to the #omp%ter as shown in $ig%re 2! "he P)< 0 pin m%st be #onne#ted at =! 10! :ploading the #ode! o to the ile E*amples Blynk BoardsA,ii BoardsA,ii ESP8266AStandalone. /ig! 11! :pload the #ode ESP8266"Standalone to the ESP board!
ig! 11!
Enter into the #ode yo%r Blynk a%th FG H IJo%r3%th"okenI> IJo%r3%th"okenI> Enter the ,i-i name and password o$ yo%r ro%ter in the #ode line Blynk!begin /a%th . ISS)=I. IPassI> 3lternatively yo% #an %se the #ode #o de below!
"he #ode '''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''' '''''''''''''''''''''''''' '''''''''''''''''''''''''' ''''''''''''''''''''''''' ''''''''''''''''''''''''' ''''''''''''''''''''''' ''''''''''' Kin#l%de LESP8266,ii!h Kin#l%de LBlynkSimpleEsp8266!h '' Jo% Jo% sho%ld get 3%th "oken in the Blynk 3pp! '' o to the Pro+e#t Settings /n%t i#on! #har a%th FG H IJo%r3%th"okenI> void set%p / M Serial!begin /D600 > Blynk!begin /a%th . ISS)=I. IPassI> N void loop / M Blynk!r%n /> N '''''''''''''''''''''''' ''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''''' '''''''''''''''''''''''''' '''''''''''''''''''''''''' ''''''''''''''''''''''''' ''''''''''''''' end o$ #ode! 3$ter #harging the #ode. dis#onne#t the pin P)< 0 $rom the gro%nd and #onne#t it to the $irst led and = tro%gh 220
ig! 12! Conne#tion o$ the led to the ESP mod%le
ig! 1! Conne#ting two relays to ESP board
Part 2! Setting the Blynk appli#ation
;e$eren#es https&''spidyhero!wordpress!#om'201('08'01'esp8266-esp-01-blynk-led-#ontroller-thaiversion' http&''www!blynk!## http&''w ww!blynk!##'getting 'getting-started -started http&''db7lin!blogspot!ro'201('0'esp8266-gpio-http-server!html http&''do#s!blynk!##'Kblynk-$irmware-virt%al-pins-#ontrol
ig! 17