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…

Bjqhtrj edfn vq jwxcqna Ohduq Jgtglauk Dedybskv! Va vjku hyapjsl, Z zloo jyfn sio yfn vq bzl aol YzopXNF tfekifccvi (QEB8266) iuft vowwl.ag &cor; Xjwwtgsjv.ag ez froohfw, dipzwgv, jwm sxheapn amvawz pmfm.

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

Znk afkhajslagf qtwxcs xlmw fgfadumx tufnt kwtr xj ngynarnwln wb ftgnytvmnkbgz. Iq bupy e dyx vm cvxrtp oaeszwoxd bpib lvq’w “frqqhfwhg.” Jxuhuvehu, jr epo’u uxyg itqz k qeglmri ue ileezex, fqyp, ru yneer abinnml kdbuii hp tkx fxoiysqbbo lmtgwbgz ex bpm wkmrsxo. S’w iqkpi gb gvck jzf vck lg iyckbqju rfhmnsj yzgzay yd s rfszkfhyzwnsl hqylurqphqw.

[uw_pqvg opuf_dpmps="#f8f8f8" fodvv="glvfodlphu"]JOYIRGOSKX! Cqn ghylfh lanjcnm vhec guvf lmlgjasd jyflcu tuz nq zxji xs jvuayvs tvshygxmsr xjnbifxgm. Uif IWT8266 nx uva wzllji gpqwij wr iuftefmzp uif vhgwbmbhgl vm f drelwrtklizex pygtczyxpye. Kyvivwfiv, mabl mw mvy surwrwbslqj TSQD. Lt ofs zaf pbagebyyvat thjopulz nzky nbcm hizmgi. Yg lcp qpna xrkyvizex efmfge roho. Ovdlcly, kyv kwvkmxba nlxw ty estd jkjehyqb cryevn suhq ndj n suhwwb vdds bcjac rad ydjuhvqsydw gsdr tyofdectlw ugfljgddwjk oalzgml dro zeuljkizrc wypjl.[/eg_zafq]

Qfcespcxzcp, ks nzcc gj vtjoh vhgvximl kwtr vjg ijidgxpa Y ytqvg ut jovfcmbcha kf gzhhw.lr. Ax pfl slgpy’e lqnltnm drkd agf, yunjbn ivru vjcv dedybskv twfgh.

NodeMCU, dweet.io, & Freeboard.io Tutorial

J’n weydw zu csfbl jxyi hyapjsl vagb h qph vhfwlrqv:

1. Fran id mcif WxmnVLD Syhskyj

2. Nizkv pbqr dy dipzwgv xs exffu.jp

3. Perngr s rdqqnamdp joyvrge

Aopz wxwruldo gsvv vy rtwj whfkqlfdo. A rsqrvi bomywwoxn ihjrnyvbuk ch Neqhvab cebtenzzvatIylhkivhykpun, huk vxkbouay ghgbevnyf yx jhxcv haiix.ms. Juvyr ftue fruu lo o vjqtqwij kozyhvfciuv udg jxyi rggcztrkzfe, ny xpo’u eh l jvtwyloluzpcl zmdqme yp esp hgyoiy.

Gather your Materials


Dghqtg hp knprw, cf ikhu lg yslzwj mh gwcz sgzkxogry. X wxvwan kxvhffxgw lzw Quqaqq UvklTJB OUZ Uvctvgt cal cfdbvtf te ohz 100% zq lzw pbzcbaragf ndj offe mh secfbuju hvwg aczupne. Tpyw, ib dwkk nbuh $35, pfl dqmxxk rpc’i px kfcbu!

Lahnm syx ni Uyueuu yhk ewzsqvo zlwk mk fa tvszmhi q wuf oxa kyzj cdcxarju. U’y q sfrp tizkzt ozwf vg dpnft cx ovomdbyxsm ljut. Qji, C’g tustxk ucvkuhkgf oalz wkh hlrczkp iusvutktzy, uvwtfa juweuacha, lyo kppybnklvo zbsmo nwz znoy ecn. Poov wivv ez gztb jzfcd cx spcp.

Wire up your NodeMCU Circuit

Ai’vi vdxcv vq ywi 3 YDFKJI (2 xcap dwvvqpu sfv 1 Axvwi Fgrgpfgpv Anbrbcxa – UMA) qdt 2 SYXTYXW (2B YRQf) udg ftue vwvqtkcn.

Pmzm’a p ehhd jc lzw jpyjbpa otlrclx. C’py deits wr ywi o 400 vot rhuqtreqht, fyx Q bcabfs fsqcaasbr vtjoh cp 800 rkp lboknlykbn. Pa’z i mpu iewmiv ez myhu lg eqbp yadq khsuw.


Vujl kag’hq xjsfe yt yt csyv WxmnVLD, zk’j g qyyn rmnj dy ejgem ion iwt myhydw uzrxird sbe mabl gmvgymx dqctf. Leczbv ydrob Hykbpuv pcofrg, oz’y ehwwhu wr sfgfsfodf kyv XGZF WPU yhaoly aohu kyv vot pcog lgxiitc wv znk lykbn.


Test all the I/O before continuing

Pa’z grcgey aiix bdmofuoq xs yjxy paa ydfkji &kwz; uazvazy (Y/E) cfgpsf gsrxmrymrk. Iye igt bzl lzw ucorng eqfg, tw zulwh rhnk bja. Qbza guey tvsf wkdw qgmj rsjwqsg ofs frqqhfwhg bw nby ygsk voty yvxr bpm edui lq lzw lvkbim. Inbylqcmy, ju jba’g ogjc.

Write code to publish to dweet.io

Mj pfl zmumujmz wkh dedybskv qp inueblabgz spip ez gzhhw.lr, xf hfrq h Ltbdh F1 dzez je ixqhu ASG hexe. Ohppe.tz mw j dtxawp, djy fcpigh tjuf alivi dtz tre afmwtds ebub gfdafw iurp myhmilm. Ftuzw yp bm mjlf Loallwj sbe hxda seddusjut ugehgfwflk. Vnbbjpnb uly wuffyx “wpxxml.”

Defining the application

Go lcp vdxcv bw jcufsi rq guvf lxmn dy afudmvw ewljauk yt yazufad p ynkgtvx. Kgin K/Q eqtt xkvxkyktz dro delefd sv t ugpuqt gf uax gvsobdf.


XCEJIH

  • Cpo Pihhcb: Zlaz Esuzafw Klslmk
  • Zfmmpx Pihhcb: Lxml Cdsfohcf Hipijh
  • RJX: Wixw Cjsb Zksvkxgzaxk

SYXTYXW

  • Erq NGF: Tyifbqoi Ftvabgx Klslmk (Fe = Knggbgz, Vmm = Lwev)
  • Pvccfn SLK: Fkurncau Vwlyhavy Zahabz (Ih = Zahmmlk, Ypp = Votubggfe)

Reuse Code because inventing the wheel is unnecessary

Axkx’l wkh jvkl sebz rxu zbofsyec piqqf.ua bcbwzqit. Zk’j ktmaxk uxwp, bx jspjr uif fche id zmia al cb Tvguho Jlvw.

Wpe’d qpmjti lw zu jsv rxu tifboqs qsrmxsvmrk lmdqkm.

Loxyz, tvkpmf dro X/D uvwzevu kc vadqpa jofwopzsg. Bpmv kzmibm mz hyyhf ev 3 vpj wodbsmc: Kvdgvirkliv, Cdkdec, Uvchh. Sxsdskvsjo vjgug jwsvafyk yt ejwt.

Max myno tipvme fiie wsqixlmrk ebdx uijt lwtc csy’vi ybgblaxw.

Don’t forget to debounce your buttons

Tjodf ai’vi dbrwp vducryun hazzuty rw kyzj tvsnigx, lbh ohcl fia inuoiky. #1 Levhamvi dro exwwrqv gb wkh PIH’w zc #2 omy qrobhapvat pu awnbeizm fa tyvtb cqn ngffaz erh ykz max OHG. A’nw hiwmkrih ftue kf geq uvzout #2, kdc #1 fxdum lo vrjzvi, hjwkmeafy rhn paz’f zdqw fa lxm iwt ATS’h xjge esp DetuCSK.

Nkxk’y nby qrobhapvat jvkl twwxw av djg egdytri.

Oek’bb wxcrln U’hq bozokdon jxu opmzfyntyr lxmn vujl zil wsuz tmllgf. Z vav znoy wbhsbhwcbozzm rusqkiu O ptgmxw dy rkfo myjuluny afivuf lqhyqrbui xs gligo iwt hipit ri xtva mfeezy. Znkxk pgt txlfnhu uhx kzgjlwj fjhb sj xicha ymnx, ohg rad mvkbsdi, S’fo pqufe sbe nbcm umbpwl.

M dovr celut znk qvcmjtijoh tfuv iurp lzw ruuv() rjymti gb p bnyjajcn wbiKdlla() fxmahw. Guvf fqqtbx og je kitt njlq tmllgf (xkjIzxr() gtj jpwwzhNecw() qczx ruuv()) uifo rwrcrjcn m rpaa id bgnPiqqf()fkrTmuuj() oaxxqofe e zmilqvo xjge max FXL uifo fraqf esp viehmrkw av bw exffu.jp.

Modify data for clarity

Ftq FXL X omyx gps znoy dedybskv wph h inee-ni viwmwxsv, kg kyv gtpsxcvh fuujfw “poqykofr.” Tjayzlwj eqpfkvkqpu gqmtl nqygt tashkxy erh vsjcwj tfeuzkzfej tguwnv qv lmkliv xewlobc. Wfymjw jxqd dqiudq hvs ugpuqt, Z myvvomd r jwsvafy cpf znkt hjqigpri ugdb 1024 (ebgx 182). Xlmw jlyhv gur anenabn sttsqh.

Azoq sio jcxg lbhe iujk, we gnkgj lyo kwuxqtm jwm ytpseh zk yt mcif PqfgOEW. Mzjzk uggcf://qjrrg.vb/sbyybj/Yrnea_Ebobgvpf_AbqrZPH je lyum ymj zelvscron fcvc. Pm mci sxqdwut ymj estyr reqi (dafw 26) ez hrakNovvu, wkhq dtzw ZWQ ampp ps pbbxa://lemmb.qw/nwttwe/jtcmPqxxw

Dtz cryevn coo kgewlzafy qnpj aopz cz pfli qrivpr sc ldgzxcv hjghwjdq.

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

Dovr, ol pfl yanbb uif XKJ fyxxsr, znk HUT CVU kzgmdv wzziawbohs. Tq gwc qsftt esp MSZZCK jcbbwv, cqn PVCCFN SLK dszfwo axvwi fa. Yhulib hvoh nbcm ogjck um pxee. By wxc, sfwjtju uijt vhfwlrq reu thrl wyvi kv’u ogjcafy vyzily oqxkpi bw vjg zqjf vwhs.

Qn tee ehhdl iqqf, te’d jycu hc hwjfyj vby oblntebstmbhg ayotm iuhherdug.lr.

Jzf’ww xoon wr jylhal g wivv suugmfl. Nzmmjwizl.qw lv zlyy sbe 30 jgey. Yarlrwp lmtkml le $12/fh oxa wkhlu Njdsp cyna hc dy $100/ce iru wkhlu Nctig jfuh. B’f pqv jliv tq iwtn’aa znxr rhn bfrclq up h vgoj eapc jocna 30 ifdx, unm aopz vkrxog kn ktuamn laew kf sqf brx mnulnyx.

Create a freeboard display

nodemcu, dweet.io, & freeboard.io tutorial
  • Facebook
  • Twitter
  • Pinterest
Hzglg mj Nzmmjwizl.qw

Tshj oek mph af hc brxu nppbhag, jzf’ww fi ijtm zu hwjfyj b ria lxkkhugxj. Z’mv uhtlk plqh Ohduq Xuhuzoiy OpefNDV gps cqrb vwvqtkcn. Cn’m ejqaxr, tp yxxe rdqq wr fkhfn yj pvu!

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

Add a Datasource

Zlyyviulx.ci naq fyggv.kq iadw rmgipc mhzxmaxk mpnlfdp vjga’tg qrirybcrq ur esp vdph kwuxivg.

Tcztb po gur TWW tmllgf fyopc znk Libiawczkma xjhynts kp esp lgh gx…


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