The Greenhouse Tutorials

Overview

In this section we provide a series of self-contained tutorials that put various TQL constructs into real use. Each of the tutorial is self-contained, however together they constitute a real-world, cohesive Smart Greenhouse application, which is described in the last of the series Tutorial 13.

It is highly recommended that you go over the Tutorials/Introduction Section before any of the tutorials here.

Hardware requirement

Please note the hardware required in the following curriculum. If you plan to follow each project with your own set up (recommended), it is better that you procure the hardware ahead of time. In Tutorial 1 and 2, you have the options of choosing the Auduino-Pi or Libelium hardware setup. Based on your hardware choice, the sensors are also different. We recommend the Arduino-Pi option for students (it is lower cost) and the Libelium option for enterprise engineers. The latter is more practical for real deployment in the field.

Regardless of which hardware option and setup you choose, the TQL models you would write are the same (remember this is one of the benefits of using an IoT platform).  

Tutorials and and Hardware

NumberProjectDescriptionHardware used
IntroductionIntroductionOverview of key concepts 
Tutorial-1Serial Temperature Sensor

Single serial sensor, two variations of hardware setups:

1. Arduino with Raspberry Pi

Raspberry Pi 2

Arduino UNO Board - Arduino UNO R3 ATmega328P

Sensor Expansion Shield for Arduino - Gikfun Sensor Shield Digital Analog Module V4 for Arduino Duemilanove UNO Mega2560 EK2138

Temperature sensor - SunFounder NTC Thermistor Sensor Module for Arduino and Raspberry Pi

OR 2. Libelium Micro Controller with laptop

Agriculture Kit - Waspmote Agriculture Sensors Kit:

  • Waspmote Agriculture Sensor Board
  • Digital Temperature & Humidity Sensor
  • Soil Moisture Sensor
  • Atmospheric Pressure Sensor

ZigBee Starter Kit - Waspmote Starter Kit:

  • Waspmote 802.15.4 PCB Antenna
  • Waspmote Gateway 802.15.4 PCB Antenna
  • 2300 mAh LiPo Battery
  • miniUSB Cable

ZigBee Mesh Chips - XBee 2mW Wire Antenna - Series 2 (ZigBee Mesh)

Tutorial-2Multiple sensors - humidity, moisture, ambient1. Arduino with Raspberry Pi

Humidity Sensor - DHT11 Digital Humidity Temperature Sensor /Arudino 

 Soil Moisture Sensor - Davis Instruments 6440 : Soil Moisture Sensor

 Ambient Sensor - Arduino compatible Light Sensor

  OR 2. Libellium Micro Controller with laptop Ambient Sensor - LDR Sensor
Tutorial-3Phidget servo motor actuatorThe first introduction on actuation on devices

Servo Motor - 3000_1 - Hitec HS-422 Deluxe Servo 

 Motor Controller - 1061_1 - PhidgetAdvancedServo 8-Motor

Tutorial-4Irrigation nozzle with flow control actuator 

Flow Controller - Plastic Water Solenoid Valve - 12V - 1/2" Nominal

Flow Meter - Liquid Flow Meter - Plastic 1/2" NPS Threaded

Tutorial-5USB camera USB Camera - ELP 2.1mm Lens 1080p HD Free Driver USB Camera Module for Linux ELP-USBFHD01M-L21 
Tutorial-6Other IP based devices - light Light - Philips 426353 Hue White and Color Personal Wireless Lighting, Starter Pack 
Tutorial-7Weather cloud serviceUtilizing data from cloud services 
Tutorial-8Simulating sensors, actuators, and devicesScale up your application in the lab and test 
Tutorial-9Combing Things with DataManaging application logic and data with various devices 
Tutorial-10Consuming TQL queries in UIs  
Tutorial-11Gateways, Cloud - Edge ComputingTQL applications from gateways to cloud, creating a coherent system 
Tutorial-12Bulk initialization of Things and Data  
Tutorial-13Smart greenhouse - a real-world IoT application at scaleBringing it all together 

 

TQL101 Class Schedule

WeekContentTutorialsMain Concepts CoveredClass Agenda
0IntroductionIntroduction

Architecture and overview

Queries

 
1

Serial temperature sensor

#1

ThingModel, ThingFacet, Attribute, Action;

Protocol handlers (serial)

Instantiation, Subscription

Closer look at SimpleModel. (Model, Export, Deploy Locally flow) - 20 minutes

Work on Temperature Sensor Modeling - 20 minutes

Deploy and Test Temperature Sensor Model - 15 minutes

2

Actuator (USB camera);

Cloud services (weather)

#5, #7

Protocol handlers (UCam, HTTP)

Custom types

Intro to Macros & Using Pipeline Macros

Queries - Save, Update

ThingFacet for Actuator (USBCamera) - 20 minutes

Deploy & Test USBCamera - 10 minutes

ThingFacet to Connect with Cloud Services - 20 minutes

Deploy and Test Cloud Service Model - 10 min

Q&A - 10 min

3

Combing things with data;

 

#9, #10

Data Model; References

User defined types

TQLEngine Anatomy, Model Life Cycle - 25 minutes

Things + Data; Storage - 20 minutes

4

Multiple sensors

#2

Macros; FacetScript; Model to model queries;

Model to model subscriptions

Quick Recap - 10 minutes

Introduction to Pipelines with example to execute TQL Code in Repeated Sequence - 20 minutes

Temporary Storage Types, Multi Sensor Design Pattern - 20 minutes

Deploy and Test Multiple Sensors Model - 15 minutes

Q&A - 10 minutes

5

Review of Pipeline Macros

(Multiple Sensors)

Consume TQL queries to build UI app

#2, #10

Macros; FacetScript; Model to Model Queries

Building UI with queries

Quick Review of Pipelines, Temporary Storage Types, Multi Sensor Design Pattern - 20 minutes

Building UIs with TQL Queries - 20 minutes

Integrate Multiple Sensors within UI (JS App) - 15 minutes

Q&A - 10 minutes

6

Simulation

#8IoT Applications & importance of Simulation

IoT Simulation - 20 minutes

TQL System IoT Simulation Frameworks - 20 minutes

Greenhouse Simulation - 20 minutes

Q&A - 15 minutes

7

"Edge is the inital step of Internet of Things" -

Edge computing – gateways, cloud

Bulk initialization of things and data

#11, #12

Distributed application; Clusters

Large numbers of devices; Device management

TQL and IoT Applications Topology - 20 minutes

Greenhouse Gateway Setup - 20 minutes

Bulk Initialization - 20 minutes

Q&A - 15 minutes

8

The Smart Greenhouse

#13Review and look at Greenhouse application at Scale

Review of Greenhouse Application at Scale - 20 minutes

Setup and Run Greenhouse Gateway - 20 minutes

Q & A - 30 minutes