Things used in this project

Hardware components:
Photon new
Particle Photon
×1
Generic Wire
×1
DHT11
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
Software apps and online services:
Particle Build IDE
IFTTT

Schematics

Schematic
Schematic mdpijnu4cn

Code

CodeC/C++
#include <Adafruit_DHT.h>

#define DHTPIN 2
#define DHTTYPE DHT11

DHT dht(DHTPIN, DHTTYPE);

unsigned long last_time=0;
int how_often = 10000; //Take reading every 10 seconds
bool Celcius_or_Farenheit = true; //false for C, true for F

void setup() {
dht.begin();
}

void loop() {
if(millis()-last_time>how_often){
    String data = take_reading(Celcius_or_Farenheit);
    Particle.publish("Temp_Published", data);
    last_time = millis();
}
}

String take_reading(bool CorF){ //false for C, true for F
float t;
if(CorF){
    t = dht.getTempFarenheit();
}
else{
    float t = dht.getTempCelcius();
}
    return String(t);
}

Credits

Download
Arduino “having11” Guy
24 projects • 153 followers
I love creating cloud solutions that can interact with hardware along with using Arduino boards and Raspberry Pis to create new projects.
Contact

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

Sign up / LoginProjectsPlatformsTopicsContestsLiveAppsBetaBlog