Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
424 views

Programming ESP8266 - ESP-201 Stand Alone With Arduino IDE - 6 Steps

Programación de los módulos Wi-Fi con Arduino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
424 views

Programming ESP8266 - ESP-201 Stand Alone With Arduino IDE - 6 Steps

Programación de los módulos Wi-Fi con Arduino
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

(/) let's make Explore(/tag/typeid/) Login(/account/login/) | SignUp(/account/gopro)

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/)

Download h(/id/ProgrammingESP8266ESP201standalonewithArdui/) 6Steps .

Collection IMadeit! Favorite Share

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

D6equj5(/member/D6equj5) 11daysago Reply

Hi,

arewesupposedtodoanythingwiththeCHP_EN/CHP_EKpin?
Also,whenyousayconnectGPIO0togrounddoyoumeanD0orthepin
marked100?

Manythanks

D6

D6equj5(/member/D6equj5) 4monthsago Reply

Hi,

thanksforyourinstructablemostuseful.

However,whatdoyoumeanby:
3.ConnectTXtotheRXviathebidirectionallogiclevelconverterboard.ESP
201TXshouldgotothe3.3Vside.?
4.ConnectRXtotheTXviathebidirectionallogiclevelconverterboard.ESP
201RXshouldgotothe3.3Vside.?

Whatside?Thesideofwhat?

Thanks
D6

X nataku(/member/nataku)(author) . D6equj5(/member/D6equj5) Reply


8
3monthsago
HiD6,thesoderefertotheterminalsorpinsdedicatedfor
3.3vlogiclevel.Whenyoulookatalogiclevelconverterboardyouwillget
onesetofterminalsforall5vandtheoppositewillbeterminalsfor3.3v.
TheESPTXandRXshouldgotothe3.3vlogicterminalsnotthe5.5v
terminals.

D6equj5(/member/D6equj5) . nataku(/member/nataku) 3monthsago Reply

Ah.....asclearasmud,thankyou.

CountMerlock(/member/CountMerlock)madeit! ayearago Reply

Hellosir

Ionlysigneduptosay,youarealifesaver.itgotmegoing.
justanoteforeveryone.youneedtoconnectRSTandDISconnectitwhile
uploading
that'llgetitinFlashmode.

(https://cdn.instructables.com/F8V/LFWD/IKA2EFAH/F8VLFWDIKA2EFAH.LARGE.jpg)

ideal_izzet(/member/ideal_izzet) ayearago Reply

icantseeimagethat

underHookupyourESP8266(fritzingimage)
ihaveaproblemwithvoltagedivider

X AkinYildiz(/member/AkinYildiz) 2yearsago Reply


|
8 greatstuff,thanksforincludingblynkaswell:)

FEATURED CHANNELS

Woodworking Paper KitchenHacks Puzzles LaserCutting Space Homesteading 3DPrinting Sewing


(/tag/type (/tag/type (/tag/type (/tag/type (/tag/type (/tag/type (/tag/type (/tag/type (/tag/type
id/category id/category id/keyword id/category id/category id/keyword id/category id/category id/category
workshop/channelcraft/channel kitchen%20hacks/?play/channel workshop/channel astronomy/? home/channel technology/channel
craft/channel
woodworking/) paper/) sort=FAVORITES) puzzles/) lasercutting/) sort=FAVORITES)homesteading/) 3DPrinting/) sewing/)
Newsletter AboutUs
Letyourinboxhelpyoudiscover WhoWeAre(/about/)
ourbestprojects,classes,and Advertise(/advertise/)
contests.Instructableswillhelp Contact(/about/contact.jsp)
youlearnhowtomakeanything! Jobs(/community/PositionsavailableatInstructables/)

enteremail I'min! Help(/id/howtowriteagreatinstructable/)

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.

You might also like