Things used in this project

Hardware components:
Photon new
Particle Photon
Since we had three remote temperature monitoring setups, we have three times as many materials.
×3
10988 01
Temperature Sensor
We used the DS18B20 uncovered and covered temperature sensors to make this project.
×3
Mfr 25frf52 1k sml
Resistor 1k ohm
4.7K ohm resistors are an option as well, we just noticed more issues with receiving proper temperature measurements when using them.
×3
11026 02
Jumper wires (generic)
×12
Software apps and online services:
Ubidots
Ubidots

Code

DS18B20 Temperature Sensor to Ubidots codeC/C++
This is a basic code using the Particle.io build app. We include the HTTPClient, OneWire and Spark-dallas-temperature libraries to read our DS18B20 temperature sensor. In order to get data to Ubidots, you need to find and include the VARIABLE_ID and TOKEN and insert into the code on lines 19 and 20 respectively. The only problem we ran into was that the spark-dallas-temperature library included in particle build was not updated. Line 27 in the spark-dallas-temperature.h file was changed to #include <OneWire.h> and added next to our original code.
// This #include statement was automatically added by the Particle IDE.
#include "spark-dallas-temperature.h"

// This #include statement was automatically added by the Spark IDE.
#include "HttpClient/HttpClient.h"
 
// This #include statement was automatically added by the Spark IDE.
#include "OneWire.h"
 
 
#define ONE_WIRE_BUS D2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensor(&oneWire);
float temperaturef = 0.0; 
float temperature = 0.0;
char resultstr[64];
HttpClient http;
 
#define VARIABLE_ID "58ecf2787625422c3a418de6"
#define TOKEN "TASZcmIv4eg1oS180p4kKHs31Zy81q"
 
http_header_t headers[] = {
      { "Content-Type", "application/json" },
      { "X-Auth-Token" , TOKEN },
    { NULL, NULL } // NOTE: Always terminate headers will NULL
};
 
http_request_t request;
http_response_t response;
 
void setup() {
    request.port = 80;
    request.hostname = "things.ubidots.com";
    request.path = "/api/v1.6/variables/"VARIABLE_ID"/values";
    Serial.begin(9600);
    sensor.begin();
}
 
void loop() {
 sensor.requestTemperatures();
 temperature=sensor.getTempCByIndex( 0 );
 temperaturef=((1.81*temperature)+32);
 sprintf(resultstr, "{\"value\":%.4f}",temperaturef); 
 request.body = resultstr;//Sending presence to Ubidots
 http.post(request, response, headers);
 Serial.println(response.status); //For debug only
 Serial.println(response.body);
 delay(1000);
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Well House Temperature Manager
Easy
  • 283
  • 6

Full instructions

Monitors the temperature of the well house to prevent the well from freezing.

Drink Alert!!! (Beverage Can Monitor)
Easy
  • 343
  • 4

Full instructions

Tired of going to grab a soda only to find they're all gone!? Well now you have an alert system to let you know when you need to refill.

The Food Thief Catcher
Easy
  • 161
  • 4

Work in progress

Are you tired of all of your pesky roommates stealing your food? Me too, thats why we have the Food Thief Catcher!

Happy Wife =  Happy Life
Easy
  • 261
  • 3

Full instructions

Wife not a morning person? Improve your life by improving your wife's temperament in the morning. Fresh coffee makes wife happy!

Happy Wife = Happy Life

Team We Are Not Coders

Temperature Sensor
Easy
  • 401
  • 5

Full instructions

A photon that measures the temperature and humididty with a DHT 22 sensor and communicates the temperature data to another photon.

Motion Activated Room Light
Easy
  • 160
  • 4

Full instructions

With this project, you'll never have to search for the light switch in the dark again.

Add projectSign up / Login
Respect project