Professional Documents
Culture Documents
Table of Contents
Real-time room temperature on your Website (no javascript or server side coding) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Intro: Real-time room temperature on your Website (no javascript or server side coding) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
http://www.instructables.com/id/Real-time-room-temperature-on-your-Website-no-jav/
Intro: Real-time room temperature on your Website (no javascript or server side coding)
This is how to push high resolution real-time data from Arduino-based temperature sensor to your web page without any server-side coding.
Arduino is a great device for collecting, storing and transferring data from various sensors but there are times you need to make your data accessible from any place over
the internet, like I did for room temperature in my study.
That’s when this solution may come handy.
The solution utilises a cloud-based real time web publishing tool Partcl.com that allows you to publish any data with about 0.1 second latency.
First you will need:
Image Notes
1. Arduino n the box
2. Power cable 9V DC
3. Ethernet Cable
4. TMP102
5. website feed
http://www.instructables.com/id/Real-time-room-temperature-on-your-Website-no-jav/
Step 1: Connect the sensor as shown on the picture.
Connect the sensor as shown on the picture.
http://www.instructables.com/id/Real-time-room-temperature-on-your-Website-no-jav/
Step 2: Register on Partcl.com
Register on Partcl.com.
After registration you will get a publishing key and a web key . You will need them for the next steps.
#include <SPI.h>
#include <Ethernet.h>
#include <Wire.h>
void setup() {
// start the Ethernet connection:
Ethernet.begin(mac, ip);
// start the serial library:
Serial.begin(9600);
SPI.begin();
Wire.begin();
void loop()
{
Wire.requestFrom(tmp102Address,2);
byte MSB = Wire.receive();
byte LSB = Wire.receive();
int TemperatureSum = ((MSB << 8) | LSB) >> 4; //it's a 12bit int,
using two's compliment for negative
float celsius = TemperatureSum*0.0625;
Serial.println(celsius,2);
if (client.connect()) {
client.print("GET
/publish?publish_key=ENTER_YOUR_PUBLISHING_KEY_HERE &d=temp_test&alue=");
client.print(celsius, 2);
client.print(" HTTP/1.1\r\n");
client.print("Host: partcl.com\r\n");
http://www.instructables.com/id/Real-time-room-temperature-on-your-Website-no-jav/
client.print("User-Agent: Arduino For Teh Win!\r\n");
client.print("Accept: text/html\r\n");
client.println("Connection: close\r\n");
client.println();
delay(300);
}
client.stop();
}
Image Notes
1. MAC Address of your device
-----------------------------------------------------------
DO NOT FORGET to substitute "ENTER_YOUR_WEB_KEY_HERE" with a real WEB KEY from your partcl.com home page.
Later, instead of cell_id="temp_test" you may want to use any other name, just make sure you substituted the cell id in your controller code as well (it is located after the
publishing key).
Both <partcl> and <pchart> tags have plenty of properties for "fine tuning". Please do not hesitate to ask if you are interested.
A number of functions, properties and methods in partcl API is growing so rapidly, that we just have no time to update the documentation in time ))
Instead of Arduino you may use a different connection technology. The main trick is to create a sensor system that will send HTTP GET requests to partcl.com.
Enjoy!
http://www.instructables.com/id/Real-time-room-temperature-on-your-Website-no-jav/
Related Instructables
Temperature
Wand by
Hacking IR Temperature iRover: msuzuki777
Automotive Controller for Remotely USB
Ultrasonic SMD Skillet Temperature controlled Indoor/Outdoor
Sensors by Reflow by and Humidity iRobot Create Thermometer
jimk3038 jimk3038 Datalogger + (or Roomba) by (or, 'My first
Webserver by techgeek75 USB device') by
javacasm ian
http://www.instructables.com/id/Real-time-room-temperature-on-your-Website-no-jav/