Internet Of Things Design Of Sample Project

Posted Under: Electrical Engineering

Ask A Question
Viewed 16
1. The objective of this project is to afford you the opportunity to synthesis knowledge acquired from the Internet of Things on a problem from start to a finished product or solution. You are required to demonstrate mastery of important IoT concepts. 2. Follow the instructions under each of the project tasks in Parts A, B & C. Please refer to the attached document for the requirement of each Part. Preferably and esp32 should be used as the NodeMCU microcontroller of choice.

This order does not have tags, yet.

Part A AFarm alongaGracetown Roadhasasmallfrontofficeanda(water) well about250mfrom thefrontoffice.There isastoragefacility forgrainslocatedrightbehindthefrontoffice(<7m).Their green houseand nursery are located just 20mand 30m respectively from the front office. Their head office which has internet connectivity is located it the Capital city. The front office has LAN for their officemachinesis alsoconnectedto the Internet. The farm manager who sits in the office at the Capital city would like to monitor the depth of water in the well, the temperature andsoil moisture in thegreenhouse,thehumidity of the storedproduceaswell as the amountof light in thenursery. Useappropriate numberofNodeMCUmicrocontrollers for connectingappropriate sensors.Youare however,required todecidethesuitable locationofthemicrocontroller(s) andsensors,andprovide alternative meansof power supply where necessary. MQTT is to be employed as the application transport protocol.ARaspberry Pi situated in thefront officeis setupasasubscriber to receive the various sensor values which it displays usinga liquid crystal display, flashinga red LED when the temperature in the greenhouseis aboveaset threshold. a. Designacompletesystemtohelpthefarmmanagertoperformhismonitoring tasks,assuming that thedepthmeasurementvalues ofthewell are analogin nature. b. Briefly justify all choicesmade in your design,including (but not limited to) power supply, topology,connectivity options, cost-effectiveness. c. Draw the circuitry andshowtheconnectionsyouwill maketo thesensors. Do include an annotated diagram that shows the topology of the IoT network, and all components,technologies,et cetera needed. d. What level of IoT service is beingprovided in this scenarioandhowcanit be improved? GradingCriteria i. Asketchshowingtopologyofthe network a. [4] 4subcircuits eachwith anMCU, b. [3] eachwith sensors c. [3] Communicationlinks from the4subunits to thefront office. d. [2] MQTTor other communicationprotocol. e. [2] actuator functionsof theLCDdisplay unit f. [2] frequencyofdatacollection g. [6] backendincluding cloudservices & DB, dashboard,analytics, et cetera. ii. Justification ofchoices– a. [2] Sensor types b. [2] Communicationlink types c. [2] Backend services (databases, web,mobile,SMS,etc.) d. [2] Power supplyoptions e. [2]Topology iii. Overall Circuitry: lookout for: a. Sensor connectionto appropriate ports e.g.,water level sensorconnectedto analog b. Indicate which pin connectstowhat.Useofpull up/downresistors where necessary. Provide sufficientdetail toenableanotherpersontoconstruct (if needed). c. Specification ofpart numbersandvalues needed. Part B Deploya local mqttserver onyour ownmachine.Publish data to it usingthepythonscript provided.Let thescript run till it prints “Finished pumpingdata.”. Datawill bepublishedfor 7sensorsin ahydroponics farmunder thefollowing topics: MQTT_PATH1="IoTClass/devices/temp1" MQTT_PATH2="IoTClass/devices/temp2" MQTT_PATH3="IoTClass/devices/ldr" MQTT_PATH4="IoTClass/devices/heater" MQTT_PATH5="IoTClass/devices/humidity1" MQTT_PATH6="IoTClass/devices/humidity2" MQTT_PATH7="IoTClass/devices/pump" Write your own script tosubscribeto that mqttserver andsave theposteddata into adatabaseof your choice(e.g.your ownmysqldatabase). Retrieve data fromthedatabaseyouhave created asa jsonor csvfile. Theobjective is to determine what LDR values shouldbe,given all theother conditions.Usingpandas,create a RandomForest modelofthe datausingsomeof the rows of the data.Validate the datausinga subsetofyour data.Evaluate yourMeanAverageError (MAE). Predict what LDR should beexpectedgiven X values of [temp1=40,temp2=20,heater is off, humidity1=60,humidity2=90, andpump=on] Submit • adumpofyour database(as an SQLscript) or asacsvfile • azipofscripts (python or phpor other scripting tool) • your Jupyter scripts • your MAE, andpredictedLDR values shouldbeprinted clearly in your jupyter notebook (it is also possibleto bypassuseofa database,but thedatamustbesaved somewhere) GradingCriteria **raw datawill beneeded** [10] structured data,data,time, (DB, CSV). Implies successwith mqtt, [5] handlingofdata –null, text,integer,etc. [5] graphing [5] suitable “description” ofdata,suitableMAE [10] suitablemodelcreation& validationforLDR. →, split,validate [5] predict givenvalues. [5] scripts used– (for dataextraction,jupyter notebook/colab/github,mqttclient etc.) Part C By usingaPython datavisualization library (e.g.Seaborn), comeupwith very interestingand informative visualizations that accomplishthe following: •Displays the captureddata •Displays theaveragetemperature andhumidity perminuteandshowstheir trend GradingCriteria [5] scripts [5] visualization of data [5] trend data import paho .mqtt .publish as publish #line:1 import time #line:2 import random #line:3 import threading #line:4 MQTT_SERVER ="localhost"#line:9 MQTT_PATH1 ="IoTClass/devices/temp1"#line:10 MQTT_PATH2 ="IoTClass/devices/temp2"#line:11 MQTT_PATH3 ="IoTClass/devices/ldr"#line:12 MQTT_PATH4 ="IoTClass/devices/heater"#line:13 MQTT_PATH5 ="IoTClass/devices/humidity1"#line:14 MQTT_PATH6 ="IoTClass/devices/humidity2"#line:15 MQTT_PATH7 ="IoTClass/devices/pump"#line:16 temp =0 #line:18 tempStatus =0 #line:19 def mqttHandler_thread1 (O000O00OO0OOOO0OO ):#line:22 print ("thread1 started- temperature1")#line:23 while True :#line:25 global tempStatus #line:26 tempStatus =random .randint (30 ,40 )#line:27 publish .single (MQTT_PATH1 ,payload =tempStatus ,retain =True )#line:28 time .sleep (1 )#line:31 def mqttHandler_thread2 (O00OOOOO00O000OO0 ):#line:34 print ("thread2 started - temperature2")#line:35 OO00OOO0O0OO0O000 =0 #line:36 while True :#line:37 OOO0OOOOOOOO00000 =random .randint (20 ,30 )#line:38 publish .single (MQTT_PATH2 ,payload =OOO0OOOOOOOO00000 ,retain =True )#line:39 time .sleep (1 )#line:42 def mqttHandler_thread3 (OO0O0000O0000O00O ):#line:45 print ("thread3 started - LDR")#line:46 O00OO0OOO000OO0O0 =0 #line:47 while True :#line:48 if tempStatus <35 :#line:49 O0OO0O0O0O0000OOO =random .randint (10 ,400 )#line:50 else :#line:51 O0OO0O0O0O0000OOO =random .randint (600 ,999 )#line:52 publish .single (MQTT_PATH3 ,payload =O0OO0O0O0O0000OOO ,retain =True )#line:53 time .sleep (3 )#line:56 def mqttHandler_thread4 (OO00O0OO0000O0OOO ):#line:59 print ("thread4 started - heater")#line:60 OOO0000OOOO0O0000 =0 #line:61 while True :#line:62 OO00000OO0OOO0O00 =random .randint (0 ,1 )#line:63 if OO00000OO0OOO0O00 ==0 :#line:64 O000O0OO0O00OOO00 ="OFF"#line:65 else :#line:66 O000O0OO0O00OOO00 ="ON"#line:67 publish .single (MQTT_PATH4 ,payload =O000O0OO0O00OOO00 ,retain =True )#line:68 time .sleep (5 )#line:71 def mqttHandler_thread5 (O0OOO0O00OOO0O000 ):#line:74 print ("thread5 started - humidity1")#line:75 OOO0OO000OO0OO000 =0 #line:76 while True :#line:77 O0OOO0OO0OOOO0OO0 =random .randint (5 ,60 )#line:78 publish .single (MQTT_PATH5 ,payload =O0OOO0OO0OOOO0OO0 ,retain =True )#line:79 time .sleep (1 )#line:82 def mqttHandler_thread6 (O00O000000O00OOOO ):#line:85 print ("thread6 started - humidity2")#line:86 O000000O000000OO0 =0 #line:87 while True :#line:88 O0OOOOOO0O00O000O =random .randint (40 ,100 )#line:89 publish .single (MQTT_PATH6 ,payload =O0OOOOOO0O00O000O ,retain =True )#line:90 time .sleep (1 )#line:93 def mqttHandler_thread7 (OOOO00OO0O0OO0O00 ):#line:96 print ("thread1 started - pump")#line:97 O00OO0OOO0O0O00O0 =0 #line:98 while True :#line:99 OOO0O00O0OOOO0000 =random .randint (0 ,1 )#line:100 if OOO0O00O0OOOO0000 ==0 :#line:101 O000OOO000OOOOOO0 ="OFF"#line:102 else :#line:103 O000OOO000OOOOOO0 ="ON"#line:104 publish .single (MQTT_PATH7 ,payload =O000OOO000OOOOOO0 ,retain =True )#line:105 time .sleep (5 )#line:108 print ("\n\nIt will be best to start your clients FIRST , so you do not lose data\n\n")#line:113 print ("\n\n This will ran for 45mins \n\n Let it run in the background")#line:114 x1 =threading .Thread (target =mqttHandler_thread1 ,args =(1 ,),daemon =True )#line:116 x1 .start ()#line:117 x2 =threading .Thread (target =mqttHandler_thread2 ,args =(2 ,),daemon =True )#line:118 x2 .start ()#line:119 x3 =threading .Thread (target =mqttHandler_thread3 ,args =(3 ,),daemon =True )#line:120 x3 .start ()#line:121 x4 =threading .Thread (target =mqttHandler_thread4 ,args =(4 ,),daemon =True )#line:122 x4 .start ()#line:123 x5 =threading .Thread (target =mqttHandler_thread5 ,args =(5 ,),daemon =True )#line:124 x5 .start ()#line:125 x6 =threading .Thread (target =mqttHandler_thread6 ,args =(6 ,),daemon =True )#line:126 x6 .start ()#line:127 x7 =threading .Thread (target =mqttHandler_thread7 ,args =(7 ,),daemon =True )#line:128 x7 .start ()#line:129 time .sleep (45 *60 );#line:137 print ("\n\n\nFinished pumping data.\n\n")#line:138
Explanations and Answers 0

No answers posted

Post your Answer - free or at a fee

Login to your tutor account to post an answer

Posting a free answer earns you +20 points.


NB: Post a homework question for free and get answers - free or paid homework help.

Get answers to: Internet Of Things Design Of Sample Project or similar questions only at Tutlance.

Related Questions