Caae Studies Illustrating loT
how sophisticated applications.
loT design
is the Raspberry
Lighting
A design of a smart horne automation system was described in Chapter-5 uxing the loT
A concrete
The system includes auto and manual modes In auto mode, the system measures the
light in a roum and switches on the light whcn it gets dark. In manuai mo4e,
the.system provides the option of manually and remotely switching i›nfoff the light.
Pigure 9. 1 shows the dcploymoflt Oexign of the home automation system. As ezplain0d
in Chapter-5, the system hue two REST services (mode and state) and a controller native
service. Figures 9.2 and 9.3 show specifications of the mode and state REST services of
the home automation sysiem. The Mode .service is a RESTful web service thal sets
modn to
Figutu 9.2: Survicc specification for home automation loT system - mode service
Cœe Studiœ Illustradng IoT Daslgri
264 Case Studies IlluStratlng îoT Design
Bahga 6 Madiselti. @ zols
Figu • 9.9: Information mr›del of the home intrusion detection IoT system
contmller service that nine on the device and rea4s the PIR and door sensors apd •»l!•
the RliST services for updating the state of rooms and dmrs in the databam. Figures
9,10. Figures 9.1 I and 9.12 show specifications of ihe web services and the controller
service.
Figure 9.10: Service specification for the hrwne intrusion detection IoT system - door
service
Figure 9. ì i: Service sp¢cißcatioa for the home iolzusiœ detection IoT system - room
gWiCe
Figure 9.12: Controller serving fif the home inlnision detection IoT
sysłrm
loT
Figure 9.13: Deployment design for tfie home intrusion detection IoT
system
The syskm u.see Django framework for web application and REST service. Tbe
Django web application is bacLed by a MySQL database. The loT device used for this
example is with the PIR and drier sensors. Figure 9 IS shows a schematic diagram
ip detection system and Figure 9.16 shows how
pui'p iiit;. '.
SGt us non lool ! theimplementation of the web application and service for
the:syxtcra,
Box 9.7 shows the model fieÌds for the rmm and door REST service. After
Case Studies Illustrating loT
Figure 9.17: Home intrusion deteéticrn wib application screenshot
is updated iIyp d9lxbase.
rites .I s •• a• s a• m<• !
includes u physical cntily for the parking
Internetof Thlngs - A Hands-Ou Approach
282 Case Studies Illustrating IoT Design
Figure 9.22: Service specification for the smart parking IoT system - star service
Box9l5 for REST services and
(Stie smart arc included in
the
Bahga 8 Madtsehl, 20I5
Pigum 9.24’.S°hòmaäc diagnm of łțiø. amen parÎáng.
device atid ultraænic-sensòr
Internet of Thlnps - A Harda On Approach
Figure 9.28: Controller service øf the w'cather
IoT
and 1ighl seasons. În
Box 9.26 shows Iżic
cwntzuÌŁcr service
Caae illustrating ÏoT
IoT
application is :i d for viaualizing tfie date
Figure 9.33 shore a xhcmaiic diagram ôf air pollution
.ode incluôcs a Raspt›crfy Pi mini-computer, MICS-2710 N
Weather Update at: 2014/06/25 13:28:49 -
Temperature:28 C, Humidité: 55 %.
Pressure: 95959 5 Pa, 9ht: 95o0 lux
Box 9.27 Aows thc imple itadon of tltc native o^troller P°'“
the sonsot readiegs ever 10 m >-
ss Si. 4iAR Illustrating loT Design
higurc 9.33: Schcmaiie diagram of air pollution monitoring end-node showing the device
and xensorx
nude. Figure 9.35 shows a séherttatic'diagrm
Boxes 9.2fi and -9.29 show thé imj
end nude and Coordinator node !
Internet of Thlngs - A Haods-On Approach
Fi mini-compu
w'ater thruuth the irrigtition pipe. When the m0isiure level goex below a tlueshi›id, the valvé
ix opened to re1e*se water. Box 9.30 shows the Python cO4e for the controller native mrvice
t'or the smari irrigation system.
Figure 9.36: Schematic :l': *i•m of ^ smurt irri8a!i°n *¥s*em
and sensor
Box 9:3 I shows the code for the service that runs on the m
to: the printer.
Desit;n and implement a fire •1srm loT systnm, using a itaxpberry Pi dcyice, te0s'peralure, '
t Define the process specification of the system. The system sfrmikl collect and
- anttlyz< the svnsor dutn and mud email aierts wiun a fire is detected.
e . ne a =••rn m
• Deline service spec ificalionr.
« Design a deployment of the syatem. The system can be u level- I UT system.
• kfirre M funcnonăi and operotionai view spociticatinnx.
• lmplezrienl die wcb services and crir mller service.
For the tire aI«rm loT syitem in exercise-l, identify the configuration end staie dus
D•6 • a YANG •n••J»!• fur g+c system.
3. Rework ihe hnrru•. .•.'i•=m tnn case study to m ke it a level-2 IoT sysl¢m.
4. F•*•.n‹T the functionality of the home intrusion detection luT system to send emnil
ñJe£Ls whea ao incusiañ is d€tocted.
F.•'••^ ft+c ftinctionality nf Itic home iotnrsiutt detection !oT *yslem fry
interfacing c webcam. Implement a fi ne" n. in the contmller to cgplur¢ an image frum
be webcam aod '"••t8 ii as uzi •'*-8•••-• io II+z "''.•'I alert wbe-n uo intr"•i 'r! is dc
ec\od.
6. Box 9.25 sbown llio code for a dunuoy analytics comp¢›ocnt of weather
mbnitoring system. Implement the anaJyticr compon¢n\ to cnmpu\c rh¢ hourly
mukioium end minimum values of femperalure xrid huaudity.
7. Implement rhc air polJuLicin roonitoriag syrtem using th< Web5ocket approach.
h. Implement the onoJyticr component far the fozest fire detection. system.
Part III
ADVANCED TOPICS
Cloud
|mernet of Tfiinps - A Hands-On Approach
338 Data Analytics for IoT
Figure 10.3: Schematic diagram of forest tire detncúon end node showing Raspberry Pi
device and sensors
Bahga & Madiserti. @ 20ï5