IoT House (Quarky)

Extension Description
Connect with the world & automate.

Introduction

The IoT House kit is perfect for those looking to explore the Internet of Things world. With 15+ activities, this kit will guide you through the basics of IoT and help you better understand how these systems work.

The Quarky IoT House kit has the following sensors/actuators:

  1. Motor with Fan
  2. Flame Sensor
  3. Infrared Distance Sensor
  4. Gas Sensor
  5. Humidity and Temperature Sensor
  6. Light Sensor
  7. Soil Moisture Sensor
  8. Motion Sensor
  9. RFID Sensor
  10. Servo Motor for Door Operation
  11. Relay module

Links for Assembly Instructions

You can follow the tutorials to assemble the IoT house and drip irrigation:

  1. IoT House – Assembly Guide: This tutorial will guide us through assembling the IoT House for Quarky.
  2. 1 Plant Drip Irrigation Assembly: This tutorial will show you how to put together the Quarky IoT House Addon kit to make a 1 plant drip irrigation system.
  3. 2 Plants Drip Irrigation Assembly: In this tutorial, you will be provided with instructions on how to use the Quarky IoT House Addon kit to assemble a drip irrigation system for two plants.

Python Object Declaration for Stage Mode

Stage mode is one of the two modes you can write your programs in Pictoblox. In this mode, you can write scripts for the sprite and boards to interact with sprites in real time. If you disconnect the board with Pictoblox, you cannot interact with the board anymore. In this mode, you can make games and animations interacting with Quarky.

You can toggle between the upload mode and stage mode using the button on the top right side of Pictoblox.

Note:  You have to upload the firmware into the device before interacting with it. Please refer to this doc: https://ai.thestempedia.com/docs/updating-quarky-firmaware-with-pictoblox/

In Python Coding Environment, use the following object declaration to use Python functions in Stage Mode:

iothouse = IoTHouse()

Upload Mode

Upload mode is one of the two modes you can write your programs in Pictoblox. This mode allows you to write scripts and upload them to the board so that you can use them even when it is not connected to your computer, for example, you need to upload a script for making moving robots.

In this case, Quarky will run offline according to the program and it can not interact with the stage.

In Python Coding Environment, use the following object declaration to use Python functions in Upload Mode:

import iothouse

Python Functions

The function set the state of the relay connected to the selected pin to High or Low. A high state means that the pin will have 3.3V and for Low, the pin will be 0 V.
Syntax: setrelay(state = 1, pin = “D3”)
The function reports the state of the PIR sensor connected to the selected pin. The function returns 1 when it is HIGH (or 3.3V) or 0 when it is LOW (or 0V).
Syntax: pirstatus(pin = “D3”)
The function reports the state of the flame sensor connected to the selected pin. The function returns 1 when it is HIGH (or 3.3V) or 0 when it is LOW (or 0V).
Syntax: flamestatus(pin = “D3”)
The function reports the state of the IR sensor connected to the selected pin. The function returns 1 when it is HIGH (or 3.3V) or 0 when it is LOW (or 0V).
Syntax: irstatus(pin = “D3”)
The function reports the temperature or humidity from the DHT sensor connected to the selected pin.
Syntax: dhtmeasure(parameter = “temperature”, pin = “D3”)
The function reports the state of the LDR (Light) sensor connected to the selected pin. The block returns 1 when the analog reading of the sensor is greater than the threshold value set by the user. Else it reports 0.
Syntax: ldrstatus(pin = “A1”)
The function reports the analog reading of the LDR (Light) sensor connected to the selected pin. The value will vary between 0 to 4095.
Syntax: ldrvalue(pin = “A1”)
The function sets the threshold for the LDR (Light) sensor connected to the selected pin. Threshold helps users decide whether the sensor is active or not. If the sensor value is greater than the threshold value, the sensor is active, or else it is inactive.
Syntax: setldrthreshold(threshold_value = 1500)
The function reports the state of the Gas sensor connected to the selected pin. The block returns 1 when the analog reading of the sensor is greater than the threshold value set by the user. Else it reports 0.
Syntax: gassensorstatus(pin = “A1”)
The function reports the analog reading of the Gas sensor connected to the selected pin. The value will vary between 0 to 4095.
Syntax: gassensorvalue(pin = “A1”)
The function sets the threshold for the gas sensor. Threshold helps users decide whether the sensor is active or not. If the sensor value is greater than the threshold value, the sensor is active, or else it is inactive.
Syntax: setgasthreshold(threshold_value = 1500)
The function connects the soil moisture sensor to the specified pin. Once initialized, other moisture sensor-related functions can be used.
Syntax: setmoisturepin(pin = “A1”)
The function reports the moisture reading from the sensor. The value varies from 0 to 100%.
Syntax: readmoisture()
The function initializes the RFID sensor. The function is important to run at the start to use other functions of the RFID sensors.
Syntax: initialiserfid()
The function activates the RFID sensor to read any nearby RFID tags for the specified time. Once identified, the value of the reading is stored in the local system which can be used from the other functions. The function also reports whether the operation is completed or not. If any RFID tag is scanned the block returns 1, else it returns 0.
Syntax: readrfid(duration = 5)
The function reports the data stored from the last RFID scan.
Syntax: readscanneddata()
The function writes the message to the RFID tag. It will wait for the specified time to scan an RFID tag and write the value on it. The function also reports whether the operation is completed or not. If the write is complete the block returns 1, else it returns 0.
Syntax: writetorfid(data = “Hello!”, duration = 5)
The function sets the last scanned RFID tag to the master RFID tag. This can be used for authentication.
Syntax: setmaster()
The function reports if the last RFID tag scanned is a master tag or not. If it is the master RFID tag, then it returns 1, else 0.
Syntax: ismaster()
The function reports the master RFID tag ID.
Syntax: getmastertag()
The function reports the last scanned RFID tag ID.
Syntax: gettag()
All articles loaded
No more articles to load

Python Coding Examples

All articles loaded
No more articles to load

PictoBlox Blocks

The block set the state of the relay connected to the selected pin to High or Low. A high state means that the pin will have 3.3V and for Low, the pin will be 0 V. This triggers the state of the relay.
The block activates the sprite under this hat block when the sensor connected to the selected pin becomes HIGH (or 3.3V). The block is used for digital sensors like PIR Sensor, Flame Sensor, or the IR Sensor.
The block reports the state of the sensor connected to the selected pin. The block returns true when it is HIGH (or 3.3V) or false when it is LOW (or 0V). The block is used for digital sensors like PIR Sensor, Flame Sensor, or the IR Sensor.
The block reports the temperature or humidity from the DHT sensor connected to the selected pin.
The block activates the sprite under this hat block when the analog sensor value connected to the selected pin becomes greater than the threshold set for the sensor. The block is used for analog sensors like Light Sensor and Gas Sensor.
The block reports the state of the analog sensor connected to the selected pin. The block returns true when the analog reading of the sensor is greater than the threshold value set by the user. Else it reports false.
The block reports the analog reading of the sensor connected to the selected pin. The value will vary between 0 to 4095.
The block sets the threshold for the sensor connected to the selected pin. Threshold helps users decide whether the sensor is active or not. If the sensor value is greater than the threshold value, the sensor is active, or else it is inactive.
The block connects the soil moisture sensor to the specified pin. Once initialized, other moisture sensor-related blocks can be used.
The block activates the script under this hat block when the moisture reading from the sensor is greater than the specified value. 
The block reports the moisture reading from the sensor. The value varies from 0 to 100%.
The block initializes the RFID sensor. The block is important to run at the start to user other blocks of the RFID sensors.
The block activates the RFID sensor to read any nearby RFID tags for the specified time. Once identified, the value of the reading is stored in the local system which can be used from the other blocks. The block also reports whether the operation is completed or not. If any RFID tag is scanned the block returns 1, else it returns 0.
The block reports the data stored from the last RFID scan.
The block writes the message to the RFID tag. It will wait for the specified time to scan an RFID tag and write the value on it. The block also reports whether the operation is completed or not. If the write is complete the block returns 1, else it returns 0.
The block set the last scanned RFID tag to the master RFID tag. This can be used for authentication.
The block reports if the last RFID tag scanned is a master tag or not. If it is the master RFID tag, then it returns true, else false.
The block reports the master or the current RFID tag ID.
All articles loaded
No more articles to load

Block Coding Examples

All articles loaded
No more articles to load
Table of Contents