Menu
  • Use Cases
  • Stacks
  • Stackbuilder
  • MyStacks
  • Support
  • About Us
  • Contact
  • Use Cases
  • Stacks
  • Stackbuilder
  • MyStacks
  • Support
  • About Us
  • Contact
  • View Cart

PTC Thingworx and Interstacks (pdf)

Download the pdf document that describes how to use Interstacks with PTC’s Thingworx IoT cloud platform.
“Thingworx Starter Kit”

Read More

Enviro Sensor Starter Pack

The Enviro Sensor Starter Pack includes the following hardware blocks: Superbase, Serial, I/O Expander, USB Keyboard/Mouse, and Wifi. It also includes: a CO2 gas level sensor with temperature and relative humidity (from CO2 meter), a dust sensor (large and small particulates), and a two line by sixteen character LCD display. The CO2 sensor and LCD display are connected to the UART interface on the Serial hardware block. The dust sensor is connected to screw terminals interface 7 and 8 on the I/O Expander hardware block.

There is an example project named “Enviro Sensor Starter” in Stackbuilder in the “Projects” tab, in the “Demo Projects” category. Click once on the “Demo Projects” category to expand it. You can then double click on the Enviro Sensor project to open it in Stackbuilder. It is an example of a project that uses the included accessories. The project displays all sensor values on the LCD display. You can make a copy of this project using the “Action” menu in the “Projects” tab and then make any modifications you want. To modify existing software blocks in the project, you will need to select the existing block, then select the Copy icon to make a copy of it. You must then connect the channels to your copy, then delete the original.

If you want to create a new project from scratch using the accessories, you will need to set some hardware block properties in Stackbuilder. To set properties in Stackbuilder: Select the block by clicking on it once. Click in the “Property Editor” in the bottom right, in the first row, in the “Property” column. Type the property name (without quotes). Click in its corresponding “Default Value” column and type the value to set (if a character or string, use quotes).

To use the dust sensor, set property 7 and property 8 of the I/O Expander hardware block to 8 (digital input, accumulate duty cycle). Set properties R7 and R8 to 10000.

The CO2 level, with temperature and relative humidity is sent out of the Serial block “UART Receive Str” output terminal in the following format: a string with “H value T value Z value”. The accumulated dust sensor readings are sent out of the I/O Expander hardware block “Out 7” and “Out 8” output terminals. It can also be useful to set property “C” to 0 (zero) for the Serial block.

Example Python programming for a software block to parse the CO2 sensor data:

# parse CO2 sensor with humidity, temp, and CO2 level
x = message.split()  # separate single string into a 6 entry list
if len(x) >= 6 and x[0] == 'H' and x[2] == 'T' and x[4] == 'Z':
  G.humid = int(x[1])  # humidity
  G.temp = (int(x[3])-1000)  # temperature in celsius
  G.co2 = int(x[5])  # CO2 level

The easiest way to use the two line LCD display in your own projects is to use the built-in software block “LCD NHD0216” in your project blueprint. This can be found in the “Software” tab in Stackbuilder. Connect the output terminal (“ToLCD2x16”) to the “UART Send” input terminal of the Serial hardware block. Send the “Command” input terminal of the software block a list [2, ‘hello’] to send ‘hello’ to the LCD. Send [0] to clear the LCD. Send [1, [1,6] ] to position the display cursor on the second line, seventh character position.

You can also refer to the support documents for the individual hardware blocks.


Example Blueprint for Enviro Sensing

Enviro Starter, running average software block

Refer to documentation on many other topics at interstacks.com/knowledge-base.
Please email info@interstacks.com with any questions.

Read More

IoT Starter Pack

The IoT Starter Pack includes the following hardware blocks: Superbase, Serial, I/O Expander, USB Keyboard/Mouse, Audio, and Wifi. It also ships with a light level sensor (TSL2561), a eight RGB LED strip (Neopixel), and a push button. The light level sensor is connected to the I2C interface on the Serial hardware block. The RGB LED strip is connected to the SPI interface on the Serial hardware block. The push button is connected to the first input interface screw terminal on the I/O Expander hardware block.

There is an example project in the “Projects” Tab of Stackbuilder, in the “Demo Projects” category. Click once on the “Demo Projects” category name to expand it. You can then double click on any project to open it. The “Light Sensor to LEDs” project is a good starter project. It changes the RGB LED strip based on the light level sensor. You can make a copy of this project using the “Action” menu in the “Projects” tab and then make any modifications you want. To modify existing software blocks in the project, you will need to select the existing block, then select the Copy icon to make a copy of it. You must then connect the channels to your copy, then delete the original.

If you want to create a new project from scratch using the accessories, you will need to set some hardware block properties in Stackbuilder. To set properties in Stackbuilder: Select the block by clicking on it once. Click in the “Property Editor” in the bottom right, in the first row, in the “Property” column. Type the property name (without quotes). Click in its corresponding “Default Value” column and type the value to set (if a character or string, use quotes).

To use the RGB LEDs, set the “L” property in the Serial block to 2. After doing this, you can simply send character strings to the SPI Send input terminal of the Serial block to set the colors of the RGB LEDs in the chain. For example, ‘rrrrrrrr’, to set 8 LEDs to all red. Each character is interpreted as a color: r-red o-orange y-yellow g-green b-blue m-magenta p-purple c-cyan z-brown w-white x-clear (off). There should be a color for each LED position in the chain (8 total). Characters can be upper or lower case.

Light level sensor values will be sent out of the “I2C Auto Receive” output terminal when any message is sent to the “I2C Auto Request” input terminal.

For the pushbutton, set property 1 of the I/O Expander block to the value 3 (digital input, send on change). As the button is pressed and released, the characters “0” and “1” will be sent out of the “Out 1” output terminal.

You can also refer to the support documents for the individual hardware blocks.


Example Blueprint to change RGB LEDs based on light sensor

Software block – PY Light LEDs


Refer to documentation on many other topics at interstacks.com/knowledge-base.
Please email info@interstacks.com with any questions.

Read More

Popular Articles

  • MyStacks Cloud Dashboard
  • Internet communication with HTTP block
  • Download and install Stackbuilder

Contact Us

Contact us with any questions or help with deploying your IoT projects.

CONTACT US

Connect

  • Facebook
  • Twitter
  • LinkedIn
  • Email

Sign up for the latest Interstacks news.

Join Our Newsletter
  Thank you for Signing Up
  Please correct the marked field(s) below.
1,false,1,First Name,2
Email:
1,true,6,Subscriber Email,2
Name:
1,false,1,Last Name,2

Copyright © 2023 Interstacks. All rights reserved. Privacy Policy | Terms and Conditions

Site by Imagebox