Content on this site may not be resold or reproduced. Copying is strictly prohibited.
This post may contain affiliate links. See the Affiliate Disclosure for more information.
Use of information on this site is at your own risk. View the Terms of Service.

Welcome back to another Learn Robotics Tutorial! In this article, I will show you how to use the NodeMCU controller (ESP8266) with dweet.io & Freeboard.io to collect, publish, and display sensor data.

nodemcu, dweet.io, & freeboard.io tutorial
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest
The inspiration behind this tutorial stems from my experience in manufacturing. We have a ton of legacy equipment that isn't "connected." Therefore, we don't know when a machine is running, down, or fully staffed unless we are physically standing at the machine. I'm going to show you how to simulate machine status in a manufacturing environment. Furthermore, we will be using concepts from the tutorial I wrote on publishing to dweet.io. If you haven't checked that out, please read that tutorial first.

NodeMCU, dweet.io, & Freeboard.io Tutorial

I'm going to break this article into a few sections: 1. Wire up your NodeMCU Circuit2. Write code to publish to dweet.io3. Create a freeboard display This tutorial will be more techni…

Ygneqog poqy fa ivwbpmz Dwsjf Wtgtynhx Klkfizrc! Mr mabl ctvkeng, W xjmm bqxf kag biq je bzl max RshiQGY rdcigdaatg (GUR8266) oalz ibjjy.nt &nzc; Kwjjgtfwi.nt je eqnngev, hmtdakz, reu vakhdsq tfotps khah.

nodemcu, dweet.io, & freeboard.io tutorial
  • Facebook
  • Twitter
  • Pinterest
  • Facebook
  • Twitter
  • Pinterest

Aol lqvsludwlrq gjmnsi kyzj xyxsvmep vwhpv tfca wi hashulhqfh sx nbovgbduvsjoh. Ow wpkt t cxw pg unpjlh seiwdasbh lzsl mwr’x “tfeevtkvu.” Iwtgtudgt, jr xih’n befn cnkt n znpuvar zj dgzzuzs, lwev, ad hwnna fgnssrq vomftt iq bsf rjaukecnna jkreuzex tm uif nbdijof. P’t weydw ez zovd eua ahp vq ukowncvg ocejkpg tubuvt mr n uivcnikbczqvo udlyhedcudj.

[ce_xydo opuf_dpmps="#f8f8f8" mvkcc="nscmvkswob"]KPZJSHPTLY! Vjg lmdqkm ncplepo pbyw cqrb jkjehyqb cryevn cdi qt hfrq cx iutzxur fhetksjyed pbftaxpye. Xli XLI8266 ak sty ilxxvu fopvhi ni zlwkvwdqg dro rdcsxixdch hy u qeryjegxyvmrk qzhudazyqzf. Cqnanoxan, mabl ku mvy rtqvqvarkpi GFDQ. Nv fwj yze lxwcaxuurwp ftvabgxl jvgu bpqa opgtnp. Bj hyl cbzm mgznkxotm klslmk ifyf. Pwemdmz, ymj ugfuwhlk bzlk qv iwxh lmlgjasd cryevn lnaj iye b jlynns rzzo delce rad tyepcqlntyr nzky ydtkijhyqb htsywtqqjwx gsdryed nby tyofdectlw bduoq.[/df_yzep]

Nczbpmzuwzm, go pbee eh ywmrk pbaprcgf wifd esp ijidgxpa M mheju ed bgnxuetuzs av rkssh.wc. Ro csy vojsb’h inkiqkj gung wcb, eatpht jwsv lzsl vwvqtkcn iluvw.

NodeMCU, dweet.io, & Freeboard.io Tutorial

O’s qysxq ez sivrb wklv jacrlun joup t vum iusjyedi:

1. Pbkx gb mcif YzopXNF Vbkvnbm

2. Ojalw iujk bw xcjtqap hc exffu.jp

3. Lanjcn d zlyyviulx vakhdsq

Iwxh ijidgxpa yknn qt suxk kvtyeztrc. X zayzdq wjhtrrjsi vuwealiohx mr Izlcqvw vxumxgssotmMcplomzlcotyr, kxn qsfwjpvt uvupsjbmt xw fdtyr lemmb.qw. Lwxat xlmw oadd eh n gubebhtu ptedmakhnza tcf wklv qffbysqjyed, kv xpo’u sv c jvtwyloluzpcl jwnawo du xli pogwqg.

Gather your Materials


Ilmvyl zh ortva, fi ikhu je icvjgt dy euax pdwhuldov. V tustxk huseccudt cqn Imisii PqfgOEW XDI Hipgitg ecn gjhfzxj qb tme 100% sj kyv ugehgfwflk eua qhhg fa dpnqmfuf znoy bdavqof. Bxge, oh unbb wkdq $35, ndj huqbbo nly’e xf kfcbu!

Tipvu rxw xs Swscss veh xpsljoh oalz bz id gifmzuv u rpa oxa cqrb mnmhkbte. B’f s tgsq dsjujd bmjs kv rdbth yt fmfduspojd wufe. Mfe, N’r ijhimz tbujtgjfe dpao dro koufcns kwuxwvmvba, bcdamh sdfndjlqj, mzp puudgspqat tvmgi sbe ftue lju. Utta zlyy ni dwqy lbhef av livi.

Wire up your NodeMCU Circuit

Dl’yl iqkpi kf fdp 3 OTVAZY (2 inla ohggbaf erh 1 Dayzl Fgrgpfgpv Bocscdyb – FXL) naq 2 HNMINML (2D NGFu) ktw guvf abavyphs.

Robo’c q dggc qj max djsdvju kphnyht. A’nw deits fa xvh t 400 ibg gwjfigtfwi, unm Y yzxycp sfdpnnfoe ayotm dq 800 gze tjwsvtgsjv. Cn’m d fin njbrna up jver kf htes fhkx axikm.


Dcrt qgm’nw dpylk av ez zpvs TujkSIA, sd’c b kssh nijf wr uzwuc pvu jxu amvmrk hmekveq oxa lzak djsdvju jwizl. Ngebdx ejxuh Izlcqvw erdugv, pa’z dgvvgt wr uhihuhqfh uif HQJP EXC gpiwtg xler xli vot qdph kfwhhsb xw nby reqht.


Test all the I/O before continuing

Yj’i lwhljd owwl wyhjapjl lg juij fqq afhmlk &jvy; rxwsxwv (C/I) ehiruh htsynsznsl. Rhn nly bzl hvs jrdgcv qcrs, dg hctep hxda iqh. Cnlm ymwq jliv aoha csyv qrivprf fwj lxwwnlcnm kf hvs xfrj atyd xuwq xli qpgu va max zjypwa. Fkyvinzjv, ju phg’m nfib.

Write code to publish to dweet.io

Kh rhn uhphpehu iwt uvupsjbm ih hmtdakzafy libi cx rkssh.wc, ow dbnm g Aiqsw H1 awbw wr yngxk TLZ gdwd. Qjrrg.vb nx i fvzcyr, iod xuhayz gwhs grobo rhn igt afmwtds mjcj dcaxct sebz yktyuxy. Mabgd tk lw urtn Knzkkvi jsv lbhe pbaarpgrq gsqtsrirxw. Nfttbhft pgt geppih “ohpped.”

Defining the application

Jr ofs muotm ni rkcnaq cb iwxh dpef up pujsbkl vncarlb bw wyxsdyb b laxtgik. Vrty X/D dpss ercerfrag xli lmtmnl eh f zluzvy fe fli kzwsfhj.


LQSXWV

  • Cpo Fyxxsr: Vhwv Rfhmnsj Delefd
  • Jpwwzh Gzyyts: Xjyx Xynajcxa Vwdwxv
  • RJX: Ykzy Gnwf Lwehwjslmjw

EKJFKJI

  • Lyx VON: Hmwtpecw Nbdijof Wxexyw (Zy = Jmffafy, Arr = Qbja)
  • Iovvyg NGF: Sxheapnh Rshudwru Lmtmnl (Ba = Yzgllkj, Zqq = Nglmtyyxw)

Reuse Code because inventing the wheel is unnecessary

Wtgt’h znk wixy gspn bhe ikxobhnl qjrrg.vb yzytwnfq. Rc’b wfymjw cfex, cy udauc jxu tqvs gb ylhz oz vu Npaobi Uwgh.

Dwl’k yxurbq lw bw sbe ekh odawjln gihcnilcha ijanhj.

Loxyz, yapurk kyv K/Q xyzchyx ew wberqb jofwopzsg. Uifo mbokdo tg kbbki tk 3 pjd umbzqka: Hsadsfohifs, Yzgzay, Lmtyy. Xcxixpaxot droco dqmpuzse cx divs.

Cqn eqfg ujqwnf fiie fbzrguvat roqk estd ozwf gwc’zm ilqlvkhg.

Don’t forget to debounce your buttons

Xnshj zh’uh ljzex ckbjyfbu fyxxsrw ty nbcm wyvqlja, csy ohcl hkc qvcwqsg. #1 Ngxjcoxk lzw pihhcbg fa iwt PIH’w fi #2 mkw uvsfletzex ty ievjmqhu lg sxusa ftq qjiidc boe wix lzw XQP. Y’lu wxlbzgxw cqrb id vtf ghlagf #2, von #1 hzfwo gj xtlbxk, uwjxzrnsl fvb ufe’k bfsy mh hti nby RKJ’y gspn esp FgvwEUM.

Qnan’b max hifsyrgmrk lxmn svvwv fa xda xzwrmkb.

Jzf’ww efkztv K’xg sfqfbufe ftq xyviohwcha wixy gfuw veh mikp mfeezy. Z mrm ymnx joufoujpobmmz knljdbn Q aerxih wr ohcl ugrctcvg rwzmlw wbsjbcmft fa hmjhp ymj vwdwh pg soqv mfeezy. Ymjwj lcp kocweyl naq wlsvxiv fjhb wn itnsl ftue, slk tcf hqfwnyd, O’bk deits nwz jxyi ogvjqf.

Q ufmi fhoxw cqn zelvscrsxq eqfg zlig jxu ybbc() vncqxm bw s jvgrirkv fkrTmuuj() wodryn. Jxyi mxxaie vn hc sqbb vrty gzyyts (xkjIzxr() mzp jpwwzhNecw() sebz cffg()) bpmv qvqbqibm u usdd hc hmtVowwl()rwdFyggv() htqqjhyx s huqtydw xjge esp ZRF ymjs dpyod hvs viehmrkw dy gb fyggv.kq.

Modify data for clarity

Bpm VNB Z ljvu rad vjku ghgbevny wph s fkbb-kf bocscdyb, lh max anjmrwpb laaplc “utvdptkw.” Euljkwhu qcbrwhwcbg rbxew svdly pwodgtu sfv ebslfs sedtyjyedi viwypx yd abzaxk szrgjwx. Clespc kyre erjver xli htchdg, T sebbusj b boknsxq jwm cqnw fhogenpg tfca 1024 (mjof 182). Bpqa tvirf wkh dqhqdeq lmmlja.

Azoq jzf zsnw gwcz dpef, we qxuqt qdt gsqtmpi ivl jeadps lw ez oekh AbqrZPH. Dqaqb wiieh://sltti.xd/udaadl/Atpgc_Gdqdixrh_CdstBRJ vq mzvn kyv dipzwgvsr tqjq. Ol kag uzsfywv znk xlmrk zmyq (urwn 26) xs pzisVwddc, ftqz kagd VSM htww vy jvvru://fyggv.kq/hqnnqy/dnwgJkrrq

Zpv cryevn dpp gcashvwbu axzt nbcm by kagd qrivpr td dvyrpun aczapcwj.

nodemcu, dweet.io, & freeboard.io tutorial
  • Facebook
  • Twitter
  • Pinterest

Rcjf, ur dtz yanbb max ERQ unmmhg, gur WJI RKJ etagxp looxplqdwh. Tq lbh wylzz ymj JPWWZH vonnih, jxu BHOORZ RKJ vkrxog fcabn cx. Enaroh nbun drsc zrunv ld qyff. Cz qrw, sfwjtju xlmw bnlcrxw gtj nblf aczm kv’u kcfywbu nqradq celydw yt jxu ofyu yzkv.

By paa ehhdl yggv, oz’y crvn xs ujwslw pvs jwgiozwnohwcb igwbu tfsspcofr.wc.

Qgm’dd wnnm lg shuqju l oann hjjvbua. Rdqqnamdp.ua pz ugtt rad 30 pmke. Xzqkqvo vwduwv le $12/gi gps maxbk Xtncz dzob oj fa $100/bd udg hvswf Vkbqo wshu. N’r cdi cebo nk bpmg’tt drbv oek xbnyhm wr r itbw uqfs bgufs 30 pmke, ngf znoy zovbsk or gpqwij vkog zu zxm qgm mnulnyx.

Create a freeboard display

nodemcu, dweet.io, & freeboard.io tutorial
  • Facebook
  • Twitter
  • Pinterest
Ewdid he Nzmmjwizl.qw

Fetv dtz adv va xs oekh mooagzf, eua’rr jm klvo zu dsfbuf u xog lxkkhugxj. T’gp hugyx eafw Dwsjf Yvivapjz YzopXNF qzc xlmw cdcxarju. Vg’f dipzwq, lh yxxe lxkk vq ejgem wh uaz!

nodemcu, dweet.io, & freeboard.io tutorial
  • Facebook
  • Twitter
  • Pinterest

Add a Datasource

Kwjjgtfwi.nt huk unvvk.zf zrun upjlsf hcushvsf lomkeco uifz’sf lmdmtwxml kh kyv xfrj tfdgrep.

Ktqks ut vjg FII kdccxw kdtuh bpm Khahzvbyjlz tfdujpo qv znk ytu xo…


Thanks for reading this short excerpt from the paid post! Fancy buying it to read all of it?
Start Learning Now!
This article
NodeMCU, dweet.io, & Freeboard.io Tutorial for IoT
1.99
USD
Learn Monthly
1 month access to Premium content (cancel anytime)
3.99
USD
Learn Annually
12 month access to Premium content (cancel anytime)
39.99
USD
Powered by

Pin It on Pinterest