0% found this document useful (0 votes)
505 views9 pages

IoT-Unit5-Part4-Xively Cloud For IoT

Iot Lecture notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
505 views9 pages

IoT-Unit5-Part4-Xively Cloud For IoT

Iot Lecture notes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Xively Cloud for IoT

Xively
• Xively (formerly known as Cosm and Pachube)
is an Internet of Things (IoT) platform owned
by Google. Xively offers product companies a
way to connect products, manage connected
devices and the data they produce, and
integrate that data into other systems
Xively Cloud Services

• A Platform as a Service built for the IoT. According


to their website, this includes directory services,
data services, a trust engine for security, and
web-based management application. Xively’s
messaging is built on a publish-subscribe protocol
called MQTT. The API supports REST, WebSockets,
and MQTT.
Main services
• Stores data from devices, sensors, buildings
and environments all over the word.
• Serve data to other entities in other parts of
the world
Input and Output
• Inputs of Xively are data retrieved from a
sensor network:
– Temperature
– Current consumption
– Location data o
• Outputs of Xively are:
– Dynamic real-time graphs
– Monitoring and analysis API
– Triggered events
Xively Cloud for IoT
• Decide which cloud service you want to use
and check if they support Arduino.
• Create an account, get the API keys.
• Install an OS, connect the sensors.
• Connect the Arduino to the internet.
• Browse for samples on the cloud service
you’re using.
• Execute the script/program on your IDE.
Temperature reading Program
• // These constants won't change. They're used to give names
• // to the pins used:
• const int analogInPin = A0; // Analog input pin that the
potentiometer is attached to

• float sensorValue = 0.0; // value read from the pot

• void setup() {
• // initialize serial communications at 9600 bps:
• Serial.begin(9600);
• analogReference(EXTERNAL);

• }
• void loop() {
• // read the analog in value:

• sensorValue = readTemp();
• float millivolts = (sensorValue * 3300.0) / 1024.0;
• float temperature = (millivolts - 500.0) / 10.0;

• // print the results to the serial monitor:


• //Serial.print("sensor = " );
• //Serial.println(sensorValue);
• //Serial.print("millivolts = " );
• //Serial.println(millivolts, 2);
• //Serial.print("temperature = " );
• Serial.println(temperature, 2);

• // wait 2 seconds before the next loop


• // for the analog-to-digital converter to settle
• // after the last reading:
• delay(2000);
• }
• float readTemp(){
• int tempValue = 0;
• for (int i=0;i<30;i++){
• tempValue+=analogRead(analogInPin);
• delay(10);
• }
• float averagedValue = tempValue / 30.0;
• return averagedValue;
• }

You might also like