Programming ESP8266 - ESP-201 Stand Alone With Arduino IDE - 6 Steps
Programming ESP8266 - ESP-201 Stand Alone With Arduino IDE - 6 Steps
Contests(/contest/) Classes(/classes/)
Publish(/about/create.jsp)
(http://www.autodesk.com/)
Featured: MakerspaceContest(/contest/makerspace2017/?utm_source=featurebar/)
InternetofThingsClass(/class/InternetofThingsClass/?utm_source=featurebar/) Father'sDay(/howto/Father's+Day/)
ProgrammingESP8266ESP201StandAloneWithArduinoIDE by
nataku(/member/nataku/)inarduino(/tag/typeid/categorytechnology/channelarduino/)
AboutThisInstructable
License:
8 40,576 views
55 favorites
nataku
(/member/nataku/)
Follow 14
(/member/nataku/)
Morebynataku:
(/id/Notebook
CoolingPadWithAdjustable
(/file/FJVKZDDIHAWAZI0/)
TemperatureS/)
IwanttoprovideabetterdocumentationforhowyoucanuseESP201(avariant
ofESP8266)asstandaloneboardandhowtohookuptheGPIOinorderto (/id/ProgrammingESP8266ESP201
programitwiththeArduinoIDE. standalonewithArdui/)
IwasstrugglingonhowtogetthesketchfromArduinoIDEdownloadedintothe
ESP8266soIwantedtosharewhatIfoundiftherearefolksouttherethatuse
(/id/Arduino
ESP201asstandaloneESP8266withArduinoIDE.
InthisexampleIamusingESP201IboughtfromEbay.ItistheAithinker
versionbutIdon'tthinkitmatters. controlledplantwateringsystemand
custo/)
TheotherprogramIuseistheBLYNKprogram.
http://docs.blynk.cc/#downloadsblynkappsforiosorandroid
http://docs.blynk.cc/#downloadsblynklibrary(http://docs.blynk.cc/#downloads Related
blynklibrary)
ESP8266ESP
IwillletyoureadabitmoreaboutBLYNKfromtheirwebsite. 12(Standalone)+Blynk101
(/id/ESP8266ESP
IamusingArduinoIDE1.6.4. 12StandaloneBlynk101/)
(/id/ESP8266 byRahul27(/member/Rahul27/)
ESP826612blynkwireless
Step1:SetupYourArduinoIDE temperatureLM35sensor
(/id/ESP826612blynk
wirelesstemperatureLM35
Iamusingversion1.6.4, (/id/ESP8266 sensor/)
ESP826612standaloneblynk
YouneedtogotothePreferenceandaddthefollowingtotheURLsforBoards controloutletswireless433
Manager mhz(/id/ESP826612
standaloneblynkcontrol
http://arduino.esp8266.com/stable/package_esp8266c... (/id/ESP8266 outletswirele/)
ESP826612blynkwireless
(http://arduino.esp8266.com/stable/package_esp8266com_index.json)inorder
temperature,humidityDHT
toaddtheESP8266board. 11sensor(/id/ESP826612
blynkwirelesstemperaturee
advertisement (/id/ESP8266 humidityD/)
ESP826612blynkwireless
simplevirtualled
Step2:SelecttheBoard (/id/ESP826612blynk
wirelesssimplevirtualled/)
(/id/ESP8266 bycatoplepa
(/file/FGE3FMGIHAWAZJP/)
SelecttheGenericESP8266board.(ThisistheoneIamusing,butperhapsif
youusetheotherESP8266firmwareyoushouldtrytheotherone).Ididn'tput
anynewfirmwareinmine.IjustuseitasitcamefromEbay.
Therestsofthesetupundertheboardareleftasdefault.Idon'tthinkthey
mattermuch,atleastinmycaseIdidn'thavetochangeanything.
Step3:HookUpYourESP8266.
(/file/FF8A55KIH2BOWAJ/)
Okaynowitistimetogetyourbreadboardready.Youneedtohave3.3Vsupply
availableandalsoaseparate5Vsupply.YourFT232RLbreakoutboardmay
havea5Vsourceyoucanuse.IuseFT232RLfromSparkfun.
Youwillalsoneedtogetyourlevelconverter,Iusethebidirectionalversionfrom
Adafruit.
Okay,nowfortheESP12connection
1.Connect3.3Vsourcetothefollowingpins:3.3V,CHP_Enable
2.ConnectGndsourcetothefollowingpins:Gnd,GPIO00,GPIO15.
3.ConnectTXtotheRXviathebidirectionallogiclevelconverterboard.ESP
201TXshouldgotothe3.3Vside.
4.ConnectRXtotheTXviathebidirectionallogiclevelconverterboard.ESP
201RXshouldgotothe3.3Vside.
5.Don'tforgettoconnectthe3.3VsourcetopowertheLVsideofthe
bidirectionallogiclevelconverter.
6.Lastlyconnectthegroundfromyour3.3Vsupplytothegroundonthe
bidirectionallogiclevelconverter.
ThenfromyourFT232RL,usethe5VsourceontheboardtopowertheHVside
ofthebidirectionallogiclevelconverterboard,andtakethecorrespondinghigh
sideoftheESP201TXtotheRXanddothesamefortheESP201RXintothe
TXoftheFT232RL.Andofcourse,don'tforgetthegroundfromFT232RLbreak
outboardtothelogiclevelconverterboard.
YoushouldgototheBLYNKwebsiteanddownloadtheirArduinoLibrarythen
loadtheirESP8266standaloneexample.Fillouttheauthtokenandyourwifiid
andpassword.YouwillgettheauthtokenbymakingapageonyourBLYNK
App.Letusjustputasimplepushbutton,withtheoutputsettoGP14(referto
GPIO14inESP201).
Youdon'thavetowriteanycodetoprogramapushbuttonintheArduinosketch
forthisfirsteasyexample.
OkayBEFOREYouHITDOWNLOAD....dothis
1.Powerdownthe3.3Vsourceandturnitbackon,andconnecttheRSTpinof
theESP201tothegroundsourcemomentarily(ie.pulse).ThisIthinkputthe
ESP12intobootmode.
2.ThenHITtheCOMPILEandDOWNLOAD.
Ifyoukeepgettingthemessagesayingespsyncnotresponding,likethis
warning:espcomm_syncfailederror:espcomm_openfailed
itmeansyoudidnotgettheESP8266intobootmodeandrecheckyourGPIO
andthewiringsetupandmakesureyouseemynoteonCyclingthepower,and
hittingtheRSTpinmomentarily.Thisisthemissingpartfromalotoftheother
instructions.
Anyway,ifeverythinggoeswell,youshouldseethenotesayinguploading
bla...bla...bla....andabunchofdots.....andfinallyitwillsayDoneUploading.
Step4:BlynkApp/pageSetup
(/file/FMTBDOBIH2BOZ2F/)
(/file/FFVI9E5IH2BOZ41/)
(/file/F1NTN03IH2BOZ3Y/)
(/file/FVM3MSSIH2BOZ44/)
(/file/FSQBDF4IH2BOZ42/) (/file/FZBG7O8IH2BOZ43/)
ShowAllItems
Well,IwasgoingtowriteabitmoredetailhereonhowtodesigntheBlynkPage
forgoingabitfurtherthanjustapushbuttonbutmaybeI'llwaituntilIwritethe
nextstepandsee.
SotheBlynkpagesetupherestartedwithasimplepushbuttonthatturnon/off
anLED.
ThenItrytoshowhowyoucanreadDHT11andTMP36dataanddisplayiton
theBLYNKpage.
IalsousedtheGauge,ValuesandGraphwidget.Theyarereallynice.
IalsoautomaticallytoggleanLEDWidgetontheBlynkPagetoturnonandoff
every2second.
ThereisalsoanLCDthatyoucandisplayprettymuchanythingbutIjustwrite
somesimpleifandthenfunctiontodisplaypresettextbasedonthe
temperature.
Step5:RunningtheSketchintheESP8266ESP201
Onceyoufinishuploadingthesketch,youshouldbeabletogotoyour
tablet/phonewhereyouhaveyourBLYNKpage/controllersetupandhittheLED
buttonandturnontheLED.
IfoundthatonceyoudownloadtheIDE,thesketchwillrunandyoucanuse
serialmonitortocheckifyouareconnectingtotheBlynkserver.
However,ifyouturnoffthepowerandturnitbackon,itwon'tconnecttoyour
wifiasifyoursketchisnotrunning.
Soyouneedtodothese.
1.MakesurethatGPIO00isnolongerconnectedtoground.
2.KeepGPIO15connectedtoground.
3.CyclethepoweragainontheESP201andwatchyourserialmonitor.It
shouldindicateyouareconnectingtoyourwifiSSID.Thenyoushouldconnect
rightawaytoyourwifiandeventuallytotheBLYNKserver.
Step6:GoingFurther
SoletstryaddingafewfunctionstolearnhowtheGPIOnumbersrelatesor
usedbytheBLYNKlibrary.
SimpleGPIOon/offcontroller
AsfarasIcantelltheGPIOprintedontheESP201areexactlytheBLYNK
modulesuses.SoforexampleifyouareprogrammingorcreatingaBLYNK
MODULEwithapushbuttoncontrolledbyGPIO14,thisisreferredtoIO14in
theESP201.YoucanthenwireanLEDorrelaycontrolonthepin.
SimpleDigitaldatareadfromsensor
Letstakeanotherexample,letssayyouaregoingtowireinaDHT11sensor
intoGPIO04/IO04.Youwillreferthisaspin#4inyoursketch/program.Alittle
noteonusingtheDHT11,IamusingDHT.hlibraryfromAdafruit.Ifyoulookat
theirwonderfulwebsite,theyindicatetopassathirdparameterwhenusing
DHTxxtypesensorwithESP8266becauseitisafasterCPU.Sodon'tforget
that.(forexampleDHTdht(DHTPIN,DHTTYPE,11))
Thenumber11Idon'tthinkrelatetothetypeofDHTbutnottoosuresoifyou
useDHT22,youcanstillusethenumber11.
SimpleAnalogRead
HowaboutTMP36,wellthisisabittrickybutifyousearchtheinternet,youwill
findlotsofpeoplealreadytrythis.TheimportantpartistheADC(Analogto
Digitalinput)isreferredtoasPin17.Itisalways17ifyouareusingESP8266.
ThisiscodedinoneofthelibraryfileforESP8266.Idon'trememberwhichone.
Andtheotherthingtorememberisthereferencevoltageisaround1.10Volt.
AndthereisamaximumvoltagelimittothisADCpin.Sodon'tjustlet3.3Vgo
allthewayin.Useavoltagedividerandadjustyourconversationtableor
formulainyourcodeaccordinglywiththisvoltagedivider.Inmysketchexample,
IuseequalvalueofR1andR2sothemathissimple(afactorof2).
SimpleTimer
IthinkanotherimportantonehereisusageofBLYNKSimpleTimerlibrary.They
recommendusingthisasawaytodootherfunctionsothereisnousageof
"delay()"functioninsidetheloop()asthiscandisconnectyourconnection.Itis
prettyeasytouse,essentiallyjustdefinetheperiodoftimeyouwantthe
functiontobedonelikereadsensorortoggleled,etc.inyoursetup().Thenyou
writethereadsensorfunctionasanothercallfunctionoutsidetheloop.
TherearemoreinformationontheBLYNKwebsite.
Hopefullythishelpsyouout.
MyESP8266_Standalon
Download(https://cdn.instructables.com/ORIG/FV8/OTLJ/IH2BOPOG/FV8OTLJIH2BOPOG.ino)
(https://cdn.instructables.com/ORIG/FV8/OTLJ/IH2BOPOG/FV8OTLJIH2BOPOG.ino)
Wehaveabenicecommentpolicy.
Pleasebepositiveandconstructive. wIMadeit! AddImages PostComment
Hi,
arewesupposedtodoanythingwiththeCHP_EN/CHP_EKpin?
Also,whenyousayconnectGPIO0togrounddoyoumeanD0orthepin
marked100?
Manythanks
D6
Hi,
thanksforyourinstructablemostuseful.
However,whatdoyoumeanby:
3.ConnectTXtotheRXviathebidirectionallogiclevelconverterboard.ESP
201TXshouldgotothe3.3Vside.?
4.ConnectRXtotheTXviathebidirectionallogiclevelconverterboard.ESP
201RXshouldgotothe3.3Vside.?
Whatside?Thesideofwhat?
Thanks
D6
Ah.....asclearasmud,thankyou.
Hellosir
Ionlysigneduptosay,youarealifesaver.itgotmegoing.
justanoteforeveryone.youneedtoconnectRSTandDISconnectitwhile
uploading
that'llgetitinFlashmode.
(https://cdn.instructables.com/F8V/LFWD/IKA2EFAH/F8VLFWDIKA2EFAH.LARGE.jpg)
icantseeimagethat
underHookupyourESP8266(fritzingimage)
ihaveaproblemwithvoltagedivider
FEATURED CHANNELS
FindUs Resources
Facebook(http://www.facebook.com/instructables) ForTeachers(/teachers/)
Youtube(http://www.youtube.com/user/instructablestv) ResidencyProgram(/pier9residency)
Twitter(http://www.twitter.com/instructables) GiftPremiumAccount(/account/give?sourcea=footer)
Forums(/community/)
Pinterest(http://www.pinterest.com/instructables)
Answers(/tag/typequestion/?sort=RECENT)
Google+(https://plus.google.com/+instructables)
Sitemap(/sitemap/)
TermsofService(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21959721) |
PrivacyStatement(http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=21292079) |
LegalNotices&Trademarks(http://usa.autodesk.com/legalnoticestrademarks/) | MobileSite(https://www.instructables.com)
(http://usa.autodesk.com/adsk/servlet/pc/index?id=20781545&siteID=123112)
2016Autodesk,Inc.