Instructables

Real-time room temperature on your Website (no javascript or server side coding)

Featured
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:

- Temperature sensor TMP102 on sparkfun breakout board
 Arduino Ethernet (which is in fact is Arduino + Ethernet Shield)
- wires
- ethernet cable
-power adaptor for Arduino
- Free account on Partcl.com (when registered you will get your publishing and web keys which you will put into Arduino code and in http code on your website)
 
Remove these adsRemove these ads by Signing Up

Step 1: Connect the sensor as shown on the picture.

Picture of Connect the sensor as shown on the picture.
Connect the sensor as shown on the picture.

Image is taken from incredibly good blog http://bildr.org

I often use it as a reference

Step 2: Register on Partcl.com

Picture of 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.
ndaniel57 months ago

Helloo can u please do this for an arduino wifi shield ? thank u

rex1324q1 year ago
Can you change this to accommodate multiple sensors? That would be ideal for my reptiles
jbeck121 year ago
OLD
Serial.println(celsius,2);
if (client.connect()) {
client.print("GET
/publish?publish_key=ENTER_YOUR_PUBLISHING_KEY_HERE&id=temp_test&value=");
client.print(celsius, 2);
client.print(" HTTP/1.1\r\n");
client.print("Host: partcl.com\r\n");
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);
NEW
Serial.println(celsius,2);
if (client.connect()) {
client.print("GET /publish?publish_key=ENTER_YOUR_PUBLISHING_KEY_HERE&id=temp_test&value=");
client.print(celsius, 2);
client.println(" HTTP/1.0");
client.println("Host: partcl.com");
client.println();
delay(300);
Mape98002 years ago
Is this tutorial still working? I have a arduino Ethernet board and Arduino IDE 1.0 installed. I have created the web page with the html code in the tutorial above. I have a Partcl account. I have entered the web key and the publishing key in both the arduino code and html code. My problem is that the web page is blank, no temperature appear on my site. Is there a problem with this tutorial or is it just me that is 'stupid'?
vespapierre2 years ago
Anyway I would like to use temp sensor what can be go above 85 Celsius..upper limit can be 120-125 Celsius. What can I use? TMP112 is not reachable here in Hungary umfortunately.
Does POE has a limit of the lenght of the CAT5 cable usage?
Many thanks!
vespapierre2 years ago
Hi,

Does the system still working fine? I would like to create this to monitor an air heating solar system. Should I start to order the parts?:):)
dbasmb2 years ago
Thanks apasiechnikov for the details!

You said: "If you have DHCP and can not specify a fixed IP address, you will need another library and slightly different code. I will be more then happy to provide any additional instructions if needed."

I do have DHCP and would like the details. I'm not up to speed on interfacing Arduino to the internet, so that would be quite helpful. Also, can you tell me if it's possible to add this data to my dyndns.org web page where I have my Foscam IP camera displayed or is that a totally different animal. If it's possible, I would appreciate it if you could point me in the right direction, so I can proceed to figure it out!

Thanks!
apasiechnikov (author)  dbasmb2 years ago
Hi there.
Sorry for the delay,
For the second question, yes it will work everywhare.
The first question:
below it is a "modern solution"
You have to upgrage your Arduino IDE to 1.0 and then the code should read:
(minor changes)
It will deal with DHCP


#include
#include
#include

// Enter a MAC address and IP address for your controller below.
byte mac[] = {0x??, 0x??, 0x??, 0x??, 0x??, 0x??}; //Mac Address of Arduino Ethernet Shield or Ethernet Board
char serverName[] = "www.partcl.com";

int tmp102Address = 0x48;

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):

EthernetClient client;

void setup() {

// start the serial library:
Serial.begin(9600);

SPI.begin();
Wire.begin();

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
while(true);
}
delay(1000);
Serial.println("connecting...");
}

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(serverName, 80)) {
client.print("GET
/publish?publish_key=ENTER_YOUR_PUBLISHING_KEY_HERE&id=temp_test&value=");
client.print(celsius, 2);
client.print(" HTTP/1.1\r\n");
client.print("Host: partcl.com\r\n");
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();
}
Thanks for the reply.

You said I would need another library, but the above code shows no library , only the #. Did you forget to add them?

Thanks

apasiechnikov (author)  dbasmb2 years ago

Sorry, I think it was some parsing trick here ))
in IDE 1.0 Ethernet library deals with DHCP
so oinclude the same libraries as in step 3
net00402 years ago
Good Jobs.

About Temperature sensor TMP102,Whether it can replace by DS18B20?
Thanks.

net0040@gmail.com
1.jpg
apasiechnikov (author)  net00402 years ago
Thank you. Sure it can be. Please refer to www.arduino.cc/playground/Learning/OneWire for hints.
Kind regards
LeskoIam2 years ago
I have a similar set-up, just that I use LM35 and python to update my page, you can see it here: http://ardmon.leskos.netne.net