Menu

Twine Cloud Shield

Buy Cloud Shield

Buy Twine

Buy Arduino

Twine library for Arduino

Download version 0.1

Guide

The Twine Cloud Shield allows an Arduino to connect to a Wi-Fi network and trigger services such as email, HTTP URLs, SMS and more using the Twine library and a physical Twine.

  • Built-in capacitive sensors
  • Normal operation only needs exclusive access to pin 9
  • LED shows pin 9's output
  • Twine library for Arduino to read capacitive sensors and trigger Twine actions
  • Requires an Arduino and Twine

Connecting the Cloud Shield

To use the shield, first, remove power (usb cable also provides power) from your Arduino, align the shield as is shown in the image below, and then press down firmly. A good trick to aligning the shield properly is to make sure the bottommost pins on the cloud are connected to the ports for Vin and pin 8.

After connecting the shield to the Arduino you can use the Twine sensor cable to connect the Twine to your Cloud shield.

Connecting to the WiFi Network

If you already have a Twine that you've set up, then you're ready to go. If you have a new Twine, then twinesetup.com will walk you through this process.

Hello Twine

This sketch (also provided as an example in the Twine library) is all you need to have your Arduino talk to your Twine. It will signal the Twine once when the Arduino starts up.

#include 

// HelloTwine Example

Twine cloud;

void setup()                    
{
   // trigger your Twine action once
   cloud.trigger();
}

void loop()
{
   delay(500);
}
			

Using the Cloud Shield's capacitive sensors

The Cloud Shield being triggered by the capacitive pads:

Pin 9, designated in red, is always used. The pins designated in green (8, 10, 11, 12) are only used if you want to use the capacitive sensors.

There are two built-in capacitive sensors. These sensors use capacitance to detect when they are touched. You can also use aligator clips to connect other conductive objects, like bananas. There is also a larger area of exposed metal on topmost edge of the cloud, which is ground. Typically, the sensors are calibrated so that you only need to touch one, but if you're having trouble getting the capacitive sensors to detect your touch, then touch ground at the same time you touch a sensor.

The best way to get started with the provided sensors is to use the example provided in the Twine library.

#include 

// TwineCapacitiveSensor Example

Twine cloud;

void setup()                    
{
   cloud.calibrateCapacitiveSensors();
}

void loop()
{
    if(cloud.lowerCapacitiveSensorTouched() || cloud.upperCapacitiveSensorTouched())
    {
      cloud.trigger();
    }
}
			

When you call the calibrateCapacitiveSensors() function you are telling the Twine library to take control of pins 8, 10, 11, and 12. In addition you are telling it to calibrate to the current capacitance on the pads. It is similar to turning on a scale and zeroing out the weight.

Note: Currently the Due does not support the capacitive sensors.

Tell Twine how to react

Twine, by default, will see and hear the Cloud Shield. To get it to then report that it's been triggered, add an action to your Twine rule. First use Twine's web interface to make sure Twine sees the shield. Put the Twine in RT mode and then trigger the Twine with your Arduino sketch. You will see this:

Then set up a rule to respond to the signal and you're done!

Passing Values

Currently, the Cloud Shield passes a "triggered" or "off" signal to Twine. A future software update will add the ability to pass values from your Arduino sketch to your Twine. The future is awesome.

Using the Cloud Shield with other shields

The Twine Cloud Shield plays nicely with other shields. For normal operation it only needs pin 9. If you are using the capacitive sensors then you also need pins 8, 10, 11, and 12.

There are 1M-ohm resistors (R1, R2) between pins 8-10 and 11-12. These normally shouldn't affect the behavior of other shields. However, if you are concerned and you don't want to use the capacitive sensors then removing the resistors won't affect the normal functionality of the shield.