rhea mwenyu
Published

Project

In detail description of project

IntermediateFull instructions provided3 hours129
Project

Things used in this project

Hardware components

Mini RFID Unit RC522 Module Sensor
M5Stack Mini RFID Unit RC522 Module Sensor
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
Grove - Light Sensor
Seeed Studio Grove - Light Sensor
×1
M5Stack env ii sensor
×1
ESP32 Basic Core IoT Development Kit
M5Stack ESP32 Basic Core IoT Development Kit
×1

Software apps and online services

Webduino Blockly
Webduino Blockly

Story

Read more

Code

Project.m5f

JSON
{"components":[{"id":"____screen","createTime":1737890243121,"name":"screen","x":0,"y":0,"width":320,"height":240,"backgroundColor":"#222222","backgroundImage":"","type":"screen"},{"id":"____buttonA","createTime":1737890243121,"name":"ButtonA","buttonIndex":0,"x":35,"y":216,"width":64,"height":24,"text":"ButtonA","visibility":false,"type":"button"},{"id":"____buttonB","createTime":1737890243121,"name":"ButtonB","buttonIndex":1,"x":125,"y":216,"width":64,"height":24,"text":"ButtonB","visibility":false,"type":"button"},{"id":"____buttonC","createTime":1737890243121,"name":"ButtonC","buttonIndex":2,"x":215,"y":216,"width":64,"height":24,"text":"ButtonC","visibility":false,"type":"button"},{"id":"iPqGI@=+41+9L+Gz","createTime":1737950300967,"isCoreTwo":false,"isPaper":false,"name":"label0","x":21,"y":20,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu24","rotation":0,"type":"label","layer":5},{"id":"l43KEmMvPI2N^hol","createTime":1737951778356,"isCoreTwo":false,"isPaper":false,"name":"label1","x":21,"y":64,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":8},{"id":"GFgcj&egy**FkflH","createTime":1737953430965,"isCoreTwo":false,"isPaper":false,"name":"label2","x":21,"y":100,"color":"#FFFFFF","text":"Text","font":"lcd.FONT_DejaVu18","rotation":0,"type":"label","layer":9},{"id":"3^^#Vm5vxgzMA9WD","createTime":1739167844034,"isCoreTwo":false,"isCoreInk":false,"isPaper":false,"name":"image0","x":110,"y":129,"imagePath":"default.jpg","visibility":true,"imageInvert":false,"imageThreshold":128,"type":"image","layer":15}],"type":"fire","versions":"Beta","units":[{"id":"&B7J&2^Oq9cvuby3","createTime":1739168510091,"type":"rfid","name":"rfid_0","port":"PAHUB","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"0","user_port":["21","22"],"icon":"rfid.png"},{"id":"d%wN*WY*nHwZ*FdV","createTime":1739168510091,"hidden":false,"type":"env2","name":"env2_0","port":"PAHUB","default":["A","E","PAHUB","Custom"],"pb_port":[0,1,2,3,4,5],"new_pb_port":"1","user_port":["21","22"],"icon":"env2.png"},{"id":"AecLrrBvL*UZhQxP","createTime":1739168510091,"stickType":"stick","type":"light","name":"light_0","port":"B","default":["A","B","D","Custom"],"user_port":["21","22"],"icon":"light.png"}],"hats":[],"blockly":"<variables><variable id=\"VJdJgN$;:W]z:;O=#L1j\">lightbrightness</variable><variable id=\"Jt}%F?^r:`mA!mm-PeA}\">d53bf12e31</variable><variable id=\"vyC${]aDfodjTiguq9QY\">authorizedcard</variable></variables><block type=\"button_callback\" id=\"?H42Qsj5K`ElWZJv^;,L\" x=\"-410\" y=\"170\"><field name=\"BUTTON\">A</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"label_set_text\" id=\"|8_@T(3r09+b=dU.`m]Q\"><field name=\"COMPONENT\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\"m4/1LE=D,k(0X0EN`e0/\"><field name=\"TEXT\">Temperature sensor</field></shadow></value><next><block type=\"label_set_text\" id=\"-JlHs$Y[1HMGT{{._r4h\"><field name=\"COMPONENT\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"{fbyWF!S$Re6m%v!R#,r\"><field name=\"TEXT\">Current temperature:</field></shadow></value><next><block type=\"label_set_text\" id=\"LqljR(!tg;jQ;}L_SFz4\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"HUt3CU3DGG987%ksk8i1\"><field name=\"TEXT\">Hello M5</field></shadow><block type=\"dht12_get_temperature\" id=\"L}/#!Drdvv6.|6_6f3A2\"><field name=\"VARNAME\">env2_0</field></block></value><next><block type=\"controls_if\" id=\"Bp9D^`T2[*`*E_)FuMGY\"><mutation elseif=\"1\" else=\"1\"></mutation><value name=\"IF0\"><block type=\"logic_compare\" id=\"/D;%Vfc]srUNQ%Sz)uoy\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"dht12_get_temperature\" id=\"e#c}W_coMg.$}z(jCfA:\"><field name=\"VARNAME\">env2_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"0QH#.0o{|{aUw7Z3o=J~\"><field name=\"NUM\">30</field></block></value></block></value><statement name=\"DO0\"><block type=\"image_set_image\" id=\"O{?G.J9qo{,P={|XlhM1\"><field name=\"COMPONENT\">image0</field><field name=\"IMAGE\">Hightemp.png</field><next><block type=\"image_show\" id=\"Zd(#bidEc%c.=fMY~f*p\"><field name=\"COMPONENT\">image0</field><next><block type=\"rgb_set_all\" id=\"H}NI4s+{!D(L]z5V{l)|\"><field name=\"COLOR\">#ff0000</field><next><block type=\"speaker_tone\" id=\"_Zwp;r]:W#$uMO5RNTaw\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"fM)*-P*o@X0oRB?VE)4a\"><field name=\"NUM\">1800</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"bBxccoC?^}0XN34ORvuN\"><field name=\"NUM\">200</field></shadow></value></block></next></block></next></block></next></block></statement><value name=\"IF1\"><block type=\"logic_compare\" id=\"7)s5/NMnUsVfiC0G//k+\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"dht12_get_temperature\" id=\"rc3H^Z0+5V!}n=A3kf!E\"><field name=\"VARNAME\">env2_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"{Yj_l(pc,ctAHG%t_k6G\"><field name=\"NUM\">25</field></block></value></block></value><statement name=\"DO1\"><block type=\"image_set_image\" id=\"1DYy4y6Y|Id15cJi=)6|\"><field name=\"COMPONENT\">image0</field><field name=\"IMAGE\">R.png</field><next><block type=\"image_show\" id=\"5ZK@`Ro+SNh[y_-jGghe\"><field name=\"COMPONENT\">image0</field><next><block type=\"rgb_set_all\" id=\"PmhdHy,;:=;,P1Or]d#K\"><field name=\"COLOR\">#3333ff</field></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"image_set_image\" id=\",b_V(aLskpS!CYOtIso4\"><field name=\"COMPONENT\">image0</field><field name=\"IMAGE\">coolTemp.png</field><next><block type=\"rgb_set_all\" id=\"BZfp!VWX1B*:juUQb.2|\"><field name=\"COLOR\">#33cc00</field></block></next></block></statement></block></next></block></next></block></next></block></statement></block><block type=\"button_callback\" id=\"5DcfroHcmqALYJ9CRA;+\" x=\"70\" y=\"190\"><field name=\"BUTTON\">B</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"label_set_text\" id=\"$rL7[T0Zkr;5WcRCciQA\"><field name=\"COMPONENT\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\"1jb`bMNcC*:5-StcuiDl\"><field name=\"TEXT\">Smart Locker System</field></shadow></value><next><block type=\"label_set_text\" id=\"VmWu:LX[ePzT0BP$*!/=\"><field name=\"COMPONENT\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"T6fN!*K]=40*;%.YT=Mn\"><field name=\"TEXT\">Placed ur card at RFID sensor</field></shadow></value><next><block type=\"pwm\" id=\")!|$VV3{0[xLM-R4DnlM\"><field name=\"PWM\">PWM0</field><field name=\"TIME\">0</field><value name=\"pin\"><shadow type=\"math_number\" id=\"5/V#dQZ~/W;4dzK$pC`J\"><field name=\"NUM\">26</field></shadow></value><value name=\"freg\"><shadow type=\"math_number\" id=\"vh(vw?7w[xr8pqudk2*C\"><field name=\"NUM\">50</field></shadow></value><value name=\"duty\"><shadow type=\"math_number\" id=\"]Z-`K3[pJ/ZE{SR(8/;g\"><field name=\"NUM\">2.5</field></shadow></value><next><block type=\"image_hide\" id=\"tnv)t#JWV4}9=Om-pRjc\"><field name=\"COMPONENT\">image0</field><next><block type=\"basic_on_loop\" id=\"q87}IoJvXN#7i[?S)#}b\"><statement name=\"LOOP\"><block type=\"controls_whileUntil\" id=\"x`Bvy34|KwGuFYtJ[y|p\"><field name=\"MODE\">WHILE</field><value name=\"BOOL\"><block type=\"rfid_cardOn\" id=\"m#wjQHj#gFtI:DfClYjV\"><field name=\"RFID\">rfid_0</field></block></value><statement name=\"DO\"><block type=\"controls_ifelse\" id=\"C78YDdz7#_^v%FXFvT0a\"><value name=\"IF0\"><block type=\"rfid_cardOn\" id=\"s}jyn.:MHn+Y-:WmomEh\"><field name=\"RFID\">rfid_0</field></block></value><statement name=\"DO0\"><block type=\"variables_set\" id=\"~eS%RFTtSe=$Wi{8Y+8R\"><field name=\"VAR\" id=\"Jt}%F?^r:`mA!mm-PeA}\">d53bf12e31</field><value name=\"VALUE\"><block type=\"variables_get\" id=\"?`alt3o!rM+kVT=yGp![\"><field name=\"VAR\" id=\"vyC${]aDfodjTiguq9QY\">authorizedcard</field></block></value><next><block type=\"label_set_text\" id=\"4)BpULp?4d98M27=eCZ#\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"JO_mBhee-:2YL.H`LPx%\"><field name=\"TEXT\">Locker unlock</field></shadow></value><next><block type=\"pwm\" id=\"$QNs6*pfGig?+JPc?NRo\"><field name=\"PWM\">PWM0</field><field name=\"TIME\">0</field><value name=\"pin\"><shadow type=\"math_number\" id=\"hPqG2-K^L};lZ.!9ax#:\"><field name=\"NUM\">26</field></shadow></value><value name=\"freg\"><shadow type=\"math_number\" id=\"W8xC~j?^*lQXK$}x0]r7\"><field name=\"NUM\">50</field></shadow></value><value name=\"duty\"><shadow type=\"math_number\" id=\"U5e~-D(KwvDY.u#IB(/?\"><field name=\"NUM\">12.5</field></shadow></value><next><block type=\"rgb_set_all\" id=\"K${p^Dg%*m8P%!LP}nWr\"><field name=\"COLOR\">#33cc00</field></block></next></block></next></block></next></block></statement><statement name=\"ELSE\"><block type=\"controls_if\" id=\"B)-^Kd!cOwj~@8Csr*My\"><value name=\"IF0\"><block type=\"logic_negate\" id=\"tz0ctb(wbv(FaX^];iFb\"><value name=\"BOOL\"><block type=\"variables_get\" id=\"`l~0cV}`d.^K5T!Q+();\"><field name=\"VAR\" id=\"vyC${]aDfodjTiguq9QY\">authorizedcard</field></block></value></block></value><statement name=\"DO0\"><block type=\"label_set_text\" id=\"D1D4@gOd/X/L.#ZhT.5t\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"g!d+}OLZml_JFDv4@(e_\"><field name=\"TEXT\">Locker unable to unlock</field></shadow></value><next><block type=\"rgb_set_all\" id=\";L@*_T!}VUq/;8287[wU\"><field name=\"COLOR\">#ff0000</field><next><block type=\"speaker_tone\" id=\"=(9xxQ~Ez+k:Ie#*OWj~\"><value name=\"FREQ\"><shadow type=\"math_number\" id=\"rD7{48Gs.;WtyU%1/0_%\"><field name=\"NUM\">1800</field></shadow></value><value name=\"TIMEOUT\"><shadow type=\"math_number\" id=\"y1MTxB=}%]NAGF^,L5c$\"><field name=\"NUM\">200</field></shadow></value></block></next></block></next></block></statement></block></statement></block></statement></block></statement></block></next></block></next></block></next></block></next></block></statement></block><block type=\"basic_on_setup\" id=\"setup_block\" deletable=\"false\" x=\"-90\" y=\"730\"></block><block type=\"button_callback\" id=\"je!6.bSPoUGM_B8xX]88\" x=\"-390\" y=\"790\"><field name=\"BUTTON\">C</field><field name=\"EVENT\">wasPressed</field><statement name=\"FUNC\"><block type=\"variables_set\" id=\"MQ=@QNPG80+Gw/y$bs]t\"><field name=\"VAR\" id=\"VJdJgN$;:W]z:;O=#L1j\">lightbrightness</field><value name=\"VALUE\"><block type=\"light_a_read\" id=\"HJEa5?RM)x6pM//mYJk=\"><field name=\"VARNAME\">light_0</field></block></value><next><block type=\"image_hide\" id=\"JY80Lk|6tZGzk|[K^`Rx\"><field name=\"COMPONENT\">image0</field><next><block type=\"label_set_text\" id=\"vzdcv+^JQdx]j|yDWq@u\"><field name=\"COMPONENT\">label0</field><value name=\"TEXT\"><shadow type=\"text\" id=\"3m9F]}2`rT0b(O2r|n4h\"><field name=\"TEXT\">Light Sensor</field></shadow></value><next><block type=\"label_set_text\" id=\"ZF(GBfRi2paUV9(X.v4_\"><field name=\"COMPONENT\">label1</field><value name=\"TEXT\"><shadow type=\"text\" id=\"IJeDt^aB+ETd=+/E+VIm\"><field name=\"TEXT\">Current light value:</field></shadow></value><next><block type=\"label_set_text\" id=\"U)SLwUCjl]_(pG8i_u2U\"><field name=\"COMPONENT\">label2</field><value name=\"TEXT\"><shadow type=\"text\" id=\"GP+bS`VFOPG-d/Pn_Lw#\"><field name=\"TEXT\">Temperature sensor</field></shadow><block type=\"light_a_read\" id=\",adM(vXY!xhY0g}|%$l~\"><field name=\"VARNAME\">light_0</field></block></value><next><block type=\"controls_ifelse\" id=\"F};0hAc)%hpT.@%6LQ^]\"><value name=\"IF0\"><block type=\"logic_compare\" id=\",ay9ERvw,GY`|Y`qSY|~\"><field name=\"OP\">GT</field><value name=\"A\"><block type=\"light_a_read\" id=\"+_1:u@}4Z~%:)FEPLA!j\"><field name=\"VARNAME\">light_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"UQ=1JN,{jwsaRP9!dwhX\"><field name=\"NUM\">700</field></block></value></block></value><statement name=\"DO0\"><block type=\"math_change\" id=\",bl{S_%30zk!r?AycX,Y\"><field name=\"VAR\" id=\"VJdJgN$;:W]z:;O=#L1j\">lightbrightness</field><value name=\"DELTA\"><shadow type=\"math_number\" id=\"$cWbtZ-8Pd0A%O@r:MOY\"><field name=\"NUM\">1</field></shadow><block type=\"math_arithmetic\" id=\"K6qCR`Ih~vNPce5zs;G{\"><field name=\"OP\">MINUS</field><value name=\"A\"><block type=\"variables_get\" id=\"*/0Bo^tJcDDZgK5=mh=v\"><field name=\"VAR\" id=\"VJdJgN$;:W]z:;O=#L1j\">lightbrightness</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"]Wq`sD{KuuSVP,h09g8Z\"><field name=\"NUM\">50</field></block></value></block></value></block></statement><statement name=\"ELSE\"><block type=\"controls_if\" id=\"=VZ8})PcBAu`W;e/h8Q[\"><value name=\"IF0\"><block type=\"logic_compare\" id=\"k+b!p5eUj0B+^{?}~,$1\"><field name=\"OP\">LT</field><value name=\"A\"><block type=\"light_a_read\" id=\"j~M,Jr;gEt/=JVC.i1OB\"><field name=\"VARNAME\">light_0</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"om}J?c.3jsnz^ju=-e1g\"><field name=\"NUM\">500</field></block></value></block></value><statement name=\"DO0\"><block type=\"math_change\" id=\"?EIIEwCYUjdTiAjBxz(9\"><field name=\"VAR\" id=\"VJdJgN$;:W]z:;O=#L1j\">lightbrightness</field><value name=\"DELTA\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow><block type=\"math_arithmetic\" id=\"CVr0f*u-fE!a?AO*F3W+\"><field name=\"OP\">ADD</field><value name=\"A\"><block type=\"variables_get\" id=\"||[Dj]@V/1I_yt$/_tBg\"><field name=\"VAR\" id=\"VJdJgN$;:W]z:;O=#L1j\">lightbrightness</field></block></value><value name=\"B\"><block type=\"math_number\" id=\"1rsLs%43R@b*[z8bkwf|\"><field name=\"NUM\">50</field></block></value></block></value></block></statement></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block>","Blockly.Remotes":[],"Blockly.RemotePlus":[{"id":"__title","blockId":"","createTime":1739168510091,"name":"M5Remote","dragAndDrop":false,"resizable":false,"options":{"minWidth":1,"minHeight":1,"maxWidth":6,"maxHeight":10,"defaultWidth":2,"defaultHeight":1},"w":2,"h":1,"bgColor":"#0080FF","color":"#fff","fontsize":"M","label":"M5Remote","interval":3000,"code":"","event":"","dataSource":"none","ezdataToken":"","topic":"","needShadow":false,"type":"title","x":0,"y":0}],"modules":["rgb","machine"],"cbIdList_":[],"eventCBIdList_":[]}

Credits

rhea m
1 project • 0 followers
wenyu
1 project • 0 followers

Comments