Ivan Ramos
Published

Lane Tech HS Temperature Sensor W/ Email Alerts

A basic device that measures temperature and triggers emails under certain conditions

BeginnerFull instructions provided251
Lane Tech HS Temperature Sensor W/ Email Alerts

Things used in this project

Hardware components

Male/Male Jumper Wires
×3
Argon
Particle Argon
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
Maker service
IFTTT Maker service

Story

Read more

Schematics

Basic Temperature Sensor Scheme

A showing of the DHT pins and where they go on the Particle Argon

scheme 1

Code

Basic Temperature Sensor Code

C/C++
Done in Particle Web IDE
// This #include statement was automatically added by the Particle IDE.

#include <Adafruit_DHT.h>

#define DHTPIN 7

#define DHTTYPE DHT11   // DHT 11

DHT dht1(DHTPIN,DHTTYPE);

int check = 0;
int cycle = 60000;
int temperature = 0;
int store = 0;


void setup()
{
  Serial.begin(9600);
  Particle.variable("Temperature",store);
}

void loop()
{
    int temperature = int(dht1.getTempFarenheit());
    
    if (temperature < 100 && temperature > 20)
    {
        store = temperature;
    }
    
    //int temperature = int(dht1.getTempCelcius());
    
    //if (temperature < 38 && temperature > -7)
    //{
    //    store = temperature;
    //}
       
    if (millis() - check > cycle)
    {
        Particle.publish("Temperature",String(store));
        check = millis();
    }
    
    Serial.println(store);
    delay(100);
}

Credits

Ivan Ramos

Ivan Ramos

3 projects • 1 follower
Thanks to adafruit.

Comments

Add projectSign up / Login