Full stack IOT Platform Powered by AI: (from device implementation to data analytics) Interim Design Report Contents Section 1: Refined Project Description : ............................................................................... 2 1.1. The problem addressed specifically in this project: ....................................... 2 1.2. Project scope and expected outcome: ........................................................... 3 Section 2: Refined Project Plan: ........................................................................................ 4 2.1. Detailed schedule and milestones: ................................................................ 4 2.2. Team structure and detailed roles/responsibilities of each member ............. 6 2.3. Contingency and risk mitigation plan ............................................................ 8 Section 3: System Requirements: ....................................................................................... 8 3.1. Requirements Elicitation Process: .................................................................. 8 3.1.1 Description of the processes that were actually used for: ....................... 8 3.1.2 List and categorization of system stakeholders, users, and clients: ...... 10 3.1.3 Challenges encountered [and lessons learned] during the requirements gathering, analysis, and prioritization phases: ................................................... 11 3.1.4 Lessons learning ( Researching Design ) ............................................... 11 3.1.5 Requirement periodization phase: ......................................................... 12 3.2. System Requirements List: .......................................................................... 12 3.2.1 Functional requirements: ...................................................................... 12 3.2.2 Non-functional requirements ................................................................. 13 Section 4: System Design ................................................................................................ 13 4.1. High level system architecture .................................................................... 13 4.2. Context Diagram: ......................................................................................... 14 4.3. Data Flow Diagram: ..................................................................................... 14 4.4. User interfaces: ............................................................................................ 16 Section 5: System Implementation ................................................................................... 19 5.1. Hardware and software platforms: ............................................................... 19 5.2. Hardware and software development tools, languages ............................... 21 5.3. Recommended Hardware & software requirements .................................... 22 5.4. Hardware and softw00are development tools : ........................................... 22 Section 6: Other Relevant Issues and Challenges ................................................................ 24 6.1. Technical challenges: ................................................................................... 24 6.2. Non-Technical challenges: ........................................................................... 24 1 Section 1: Refined Project Description : 1.1. The problem addressed specifically in this project: Integrating parts of IoT systems is complex , time and money consuming process ,statistics from “business insider “says that 15 % of any IoT system cost goes to integration,37 % of costs goes to mobile & web apps , 35% for hardware costs,7% for data storage ,3% for connectivity ,3 % for security [1] Benoit Lheureux, research vice president at Gartner, says “Through 2018, half the cost of implementing IOT solutions will be spent integrating various IoT components with each other and back-end systems. It is vital to understand integration is a crucial IoT competency.” [2] it’s hard for non tech users to implement their own IOT systems because of difficulties and complexity of current IOT platforms which targets developers and expert users. 1.2. Project scope and expected outcome: The main objective of this project is to create a user-friendly full stack IOT platform that facilitate to users implementing their own IOT systems without needing for any technical knowledge , and to solve the problems related to the complexity of IOT integration . It is expected by the end of the project to achieve several objectives: Make all IOT services available for almost any user that only knows how to use smart phones . Reduce complexity of integration between sensors/actuators and (machine learning models, data storage,android app) . making a standard integration technique that works for any IOT system Fully functional android app that enables users to create and deploy any system in the platform. Real time communication for all systems in the platform . Make implementation of (agriculture , weather, medical shield ) IOT systems Make different ML models in each system . Implement drivers for basic sensors/actuators that should exist in each system any other system could be added easily to the platform by the team to meet different user’s needs enable user to plug& play sensors (to a new system or to extend existing ) without any complexity by just following some steps that works for any sensor/actuator 2 1.3. List and explanation of any changes/adjustments made relative to the abstract report : There is no modifications made on the abstract report, in this section clarification of some points related to feedback of abstract submission . In the abstract we not stated any thing about the integration standard which is the main aim of the project ,because we was unsure if our integration technique will work as standard for any system in the platform , in this report the explanation of our integration technique . Not stated details about development environment , as this details wasn’t needed to explain our idea in the abstract, the development environment is offline by creating virtual servers and running flask on our machines and connect all component using LAN (by router or switch) . The Gant chart has many details about our study for college,so it removed and replaced with the integration tasks and modify duration of some tasks, but no changes is made on our plan for the project . Section 2: Refined Project Plan: 2.1. Detailed schedule and milestones: Milestone 1: Getting started making intensive searching and reading papers related to our idea ,studying tutorials and nano degrees related to the project . Milestone 2: Weather System (Hardware+ML +android) by the end of this milestone ,we made implementation of weather system(weather ML models , AVR drivers for sensors ,android App design and weather section in the app) Milestone 3: implementing integration technique Now we have finished milestone (3) we have implemented the weather system as separate parts(hardware drivers+ML+android ) then implemented our integration technique , we tested it on weather model and it works perfectly in this stage we have completed 45% of our project. Milestone 4: Agriculture System (Hardware +ML+android) as we have implemented the agriculture model as separate parts(hardware drivers+ML+android ) then apply our standard integration technique , we add more features like periodic farm status in the android app and control signals from from fuzzy-controlle r through the php and MQTT to control actuators in the farm . Milestone 5: Medical System (Hardware +ML+android) the most important task in this stage is to implement our plug & play methodology ,then implementing drivers for the medical system and ML models , medical section in the App 3 then apply our standard integration technique ,make the sensor reads sent to the app simultaneously Semester 1 Timeline Timeline Semester 2 : 4 2.2. Team structure and detailed roles/responsibilities of each member 2.3. Contingency and risk mitigation plan 5 Anticipated risks Contingency Plan Inaccurate output of any ML model in our platform Try different data set and different different algorithms to implement these models. Delay in getting response from ML models Try different methods that guarantee real time communication and try to optimize the response time of the ML model During development of the platform some hardware not available in our country We Use hardware simulation software ex :Ros for simulating drone ex : Proteus The platform Got hacked We creating daily backup files of all database and also backup of all scripts on servers ,so we can get the platform back to it’s full functionality in a minutes . Power cut off or connection lost The platform notifies the user that the connection is lost with his system and notify him when it back to work . Section 3: System Requirements: 3.1. Requirements Elicitation Process: 3.1.1 Description of the processes that were actually used for: o requirements elicitation: brain storming sessions with team members and project supervisor surveys for students and doctors in our college asking them about our platform and how to make it better meetings with doctors in faculty of science and agriculture engineering in our university asking them about basics of planting and it’s growth phases . Communication with the Egyptian Meteorological Authority – EMA asking them about characteristics that should be available in a weather station . Communication doctors in faculty of medicine and asking how our medical system could help them in the illness diagnosis . Reading papers related to our project idea . o Prioritization: We make prioritization of the system requirement based on different factors which are : Data-sets availability easy to implement Modifiable usefulness for the targeted user economic and technical impact o Analysis: Study the selected requirements in terms of Identify customer's needs. Evaluate system for feasibility Create system definitions. Establish schedule and constraints 6 Allocate functions to system elements 3.1.2 List and categorization of system stakeholders, users, and clients: Our platform has many application scenarios that may lead to commercialization activities beyond this project. For example : Major type of real Stakeholder in our project is: o Egyptian Meteorological Authority – EMA o Medical Centers, private & public hospitals. o Football stadiums . o Hydroponic farming . Main users of the platform is : doctors who want an AI based system to help them in illness diagnosis process any individual that needs to build his own weather station for notification of weather in deployment location or as a sub system any individual that wants to automate his small garden generally any user that wants to implement any IOT system can do it in easy and well defined steps by our platform . 3.1.3 Challenges encountered [and lessons learned] during the requirements gathering, analysis, and prioritization phases: There are many lessons learned and challenges in the phases of system’s requirements : doing brain storming session and thinking as a team . Improvement in team members communication skills. learning how to write formal emails for Government agencies asking for information and data sets . We learned how to explain our project in layman's term for our potential users. 7 the professionalism and formality when communication with doctors Challenges : is to arrange meeting’s with doctors due to their busy schedules . Brain storming sessions taking long times . 3.2. System Requirements List: 3.2.1 Functional requirements: The use case diagram [3] shown in figure (Number) illustrates the functional requirement,operations, and activities of the user and development team ,the user first step in our platform is to sign up then choose the desired system ,then selects the needed sensors in that system based on user’s needs ,then select needed machine learning models , through the (Android app ) the system guides user to connect the selected sensor with the micro controller and raspberry pi , now the systems is deployed in our platform , when the user login again can view the notification from the deployed system or use machine learning models to see prediction and analysis based on reads from sensors . 3.2.2 Non-functional requirements Communication: the app connected to the internet through mobile data or Wi-Fi the micro controller connected to raspberry 8 though Wi-Fi or wired connection it depends on the system and user needs . System Accuracy: the reading of data should be correct , transmitted without any change and ML models should accurate and give trusted results . Performance: for agriculture and medical system communication must be real time Operational: This platform work automatically and it is connected to mobile application so user must download the application on their mobile to control deploy and use their systems . Cost: the cost of this system must not too expensive because we only sell software service the user buy hardware on his own and it’s available with different qualities it depends on his budget . 9 Section 4: System Design 4.1. High level system architecture High level structure of our platform [4] 4.2. Context Diagram: 10 4.3. Data Flow Diagram Level(0,1): 11 12 Flow Chart Diagram of the platform software : 13 4.4. User interfaces : To be added 14 Section 5: System Implementation 5.1. Hardware and software platforms: a) Hardware platforms : Avr micro controller on Arduino kit : AVR is a family of micro controllers ,we used it to collect reads of sensors or control actuators that is connected to it [5] raspberry pi : T he Raspberry Pi is a low cost, credit-card sized computer that plugs into a computer monitor or TV, and uses a standard keyboard and mouse. It is a capable little device that enables people of all ages to explore computing, and to learn how to program in languages like Scratch and Python [6] b) Software Platforms : Android studio : is the official integrated development environment for Google's Android operating system we used it to create the android app that connects users to our platform . code blocks IDE: Is a free, open-source cross-platform IDE we use it to write and compile Avr drivers for sensors . Anaconda : is a free and open-source distribution of the Python and R programming languages for scientific computing , we used it to write python code and build our machine learning models Floyd hub : is a zero setup Deep Learning platform for productive data science teams , we used it to train our models MQTT : is a machine-to-machine (M2M)/IOT connectivity protocol we used it to connect arduino to broker installed on raspberry pi. 5.2. Hardware and software development tools, languages a) Hardware Tools : Component name Usage Arduino Uno R3 controlling and connecting sensors/actuators Raspberry pi Used as broker server and also included in our methodology of plug & play of devices. 15 body temperature sensor Measure the body temperature . Blood Pressure Sensor Measure systolic pressure (high), diastolic pressure (low) and heart rate Heart Rate (Pulse) Sensor Measure the heart rate Brain Signal Sensor (Neurosky Mindwave EEG) measures and transfers the power spectrum ECG Electrode with Cable (Pair) connectors for use with Disposable ECG Electrodes Precision Digital Temperature & Humidity Sensor Module (DHT11,DHT22) Measures the humidity and temperature of the air Soil Moisture Sensor Measures the amount of moisture present in the soil surrounding it small_liquid_pump Used for pumping the water to the agriculture ground temperature sensor Measures the temperature ECG-EMG Arduino Shield (Bio-feedback Sensor) allow Arduino like boards to capture both Electrocardiography and Electromiography signals Anemometer for Weather Monitor or Wizard measuring the speed and direction of airflow WiFi Shield CC3000 Attached to micro controller to connect to raspberry pi or to internet directly Smoke sensor Module MQ2 device that senses smoke PIR Motion Sensor for Lamp Sense the motion surrounding it Standard Servo Motor Used for controlling (on/off) the roof of the Farm Raspberry Pi Camera Module V2-8 Megapixel,1080p Used to capture high quality images in weather and medical systems a) Software Tools : Anaconda Navigator: It’s the environment that contains libraries and IDE’s Used for developing python code for machine learning algorithms. Photo shop: TO Design user interface of the android application. PHP MY ADMIN: is a free software tool written in PHP, intended to handle the administration of MySQL over the Web APACHE server: To run the PHP scripts . 16 MOSQUITO MQTT broker: is a lightweight publish/subscribe messaging protocol. It is useful for use with low power sensors, but is applicable to many scenarios [7] Flask: Flask is a micro web framework written in Python we used it for deploying , connecting machine learning models with the web Python: Is an interpreted, high-level, general-purpose programming language used for coding the machine learning models C language: C is a general-purpose, imperative computer programming language , supporting structured programming ,used to write Avr drivers Retrofit: is a type-safe HTTP client for Android and Java we used it to send my Sql queries to database engine and get replies from database to the android app . 5.3. Modules/components acquired from external sources Our project is totally funded by the Egyptian Academy Of Scientific Research & Technology(ASRT) ,so we buy all needed hardware and Floyd hub subscription based on the budget that we proposed and accepted by ASRT . Section 6: Other Relevant Issues and Challenges 6.1. Technical challenges: finding good data sets for training models is very difficult especially for agriculture and medical system not all needed sensor for the systems is available Real time performance of the system . Creating an easy app that user interact without any complexity to create the system that is needed burning drivers by raspberry pi to the micro controller when the user select the sensors on the app. 17 6.2. Non-Technical challenges: creating diagrams that users should follow to connect sensors (as the user may use different shapes and types of breed board or different Arduino kits kit so we need to cover all available choices and also make it less complex). To use or buy a drone it must to get a security permission from the Egyptian government so we used simulation on ros instead . We not knowing much about plant and phases of growth of each plant in order to implement the fuzzy algorithm we had to go to faculty of agricultural engineering in our university to make discussion and get information about suitable cases for plants like (tomato , potatoes ,and corn ) References : [1] IOT Integration Challenges . https://www.gartner.com/smarterwithgartner/five-steps-to-address-iot-integration- challenges/ [2] How Much Does it Cost to Build IoT Solution . https://r-stylelab.com/company/blog/iot/internet-of-things-how-much-does-it-cost-to-build- iot-solution [3] online website to draw use case diagrams https://online.visual-paradigm.com/ [4] online website to draw high level structure of the platform https://app.moqups.com/ [5] some information about raspberry pi https://www.raspberrypi.org/help/what-%20is-a-raspberry-pi/ 18 [6] AVR micro controllers on arduino kits https://startingelectronics.org/articles/arduino/arduino-atmega328-difference/ [7] Mosquito MQTT https://mosquitto.org/man/mqtt-7.html [8] 19