Things used in this project

Hardware components:
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
×1
10167 01
DHT22 Temperature Sensor
×1
Photon new
Particle Photon
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
Hand tools and fabrication machines:
Lasercutter
Laser cutter (generic)

Code

code for taking temperature and humidityJava
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h>



#define DHTPIN 4            // what pin we're connected to
#define DHTTYPE DHT22       // DHT 22 (AM2302)

DHT dht(DHTPIN, DHTTYPE);

double hum;                 // current hum
double temp;                // current temp

void setup() {
    Serial.begin(9600);
    pinMode(DHTPIN, INPUT);
    
    Particle.variable("hum", hum);
    Particle.variable("temp", temp);
}

void loop() {    
    double checkHum = dht.getHumidity();
    double checkTemp = dht.getTempFarenheit();
    
    if (checkHum > 0 && checkHum < 100)
        hum = checkHum;
        
    if (checkTemp > 32 && checkTemp < 100)
        temp = checkTemp;
    
    Serial.println("Temp: " + String(checkTemp));
    Serial.println("Hum: " + String(checkHum));
        
    delay(3000);
}

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

Map Your Particles!
Easy
  • 499
  • 15

Protip

Locate your Particle Photons, P1s and Electrons on a map without needing extra hardware. Use Ubidots or an offline map alternative

Sending Photos and Video Over the Internet!
Easy
  • 1,964
  • 27

Full instructions

Record video, perform object and face recognition, take a time-lapse or whatever else with a Particle Photon and the 5-megapixel Arducam!

Text Machine, Get Gumball
Easy
  • 54
  • 1

This project describes how to build an Arduino-based, text-controlled gum dispenser

Power Supply Module 3.3V and 5V
Easy
  • 110
  • 0

Protip

First test of a separate Power Supply Module 3.3V and 5V

MyPIR-Sensor Informs Me Via IFTTT
Easy
  • 277
  • 1

Full instructions

Cheap & easy alarm-system.

Running Exercise Track
Easy
  • 79
  • 2

This is a device which can monitor running track via a GPS module and store data to a SD card. And then parse the data later from a app.

Add projectSign up / Login