Jan Zavaleta MolinaAustinHouser
Published

Temperature and Humidity Room Control

Temperature and Humidity Room Control

IntermediateFull instructions provided10 hours110
Temperature and Humidity Room Control

Things used in this project

Hardware components

DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Photon 2
Particle Photon 2
×2
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1
ELEGOO 37-in-1 Sensor Module Kit V1.0
ELEGOO 37-in-1 Sensor Module Kit V1.0
×1
Single Turn Potentiometer- 10k ohms
Single Turn Potentiometer- 10k ohms
×1
Resistor 220 ohm
Resistor 220 ohm
×1
USB-A to Micro-USB Cable
USB-A to Micro-USB Cable
×2

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE
ThingSpeak API
ThingSpeak API
Maker service
IFTTT Maker service

Hand tools and fabrication machines

Multitool, Screwdriver
Multitool, Screwdriver

Story

Read more

Schematics

Temp Circuit Schematic

DHT11 Circuit

LCD Circuit Schematic

Since the program didn't have a Particle Photon 2, we used the closest-looking item.

Built Circuit

DHT11 plus LCD Display

LCD Display

Due to the dim lighting, the phone wouldn't register, so I had to take the photo of the LCD at an angle.

IFTTT WEBHOOK TO GMAIL

Includes both webhooks for temperature and humidity

Humidity Email

Temp Email

ThingSpeak Humidity

Data came from outdoor humidity

ThingSpeak Temperature

Data came from outdoor temperature with a spike at the start of the data from powering on the device.

Code

Temperature and Humidity Code

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT_Particle.h>

// This #include sta// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT_Particle.h>
#define DHTPIN D7  
#define DHTTYPE DHT11		 

DHT dht(DHTPIN, DHTTYPE);
bool humid = false;

unsigned long myChannelNumber = 2341550;
const char * myWriteAPIKey = "YEN4QL8UCRVEP0IZ";


void setup() {
    
	Serial.begin(9600); 
	
    dht.begin();
 Particle.subscribe("tempandhumidity", handler);

}

void loop() {
    

	float h = dht.getHumidity();
	
	float f = dht.getTempFarenheit();

	if (isnan(h) || isnan(f)) {
	return;
	}

	Particle.publish("temp", String (f));
	Particle.publish("humidity", String (h));
	delay(9000);
	}
	
	 void handler(const char *event, const char *data) {
	   digitalWrite(D7, HIGH);
                delay(2500);
            digitalWrite(D7, LOW);
                delay(2500);
	 }
	 

LCD Display

C/C++
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT_Particle.h>
// This #include statement was automatically added by the Particle IDE.
#include <LiquidCrystal.h>



LiquidCrystal lcd(5, 4, 3, 2, 1, 0);
TCPClient client; 
int loopCount;


unsigned long myChannelNumber = 2341550;
const char * myWriteAPIKey = "YEN4QL8UCRVEP0IZ";


void setup() {
	lcd.clear();
	lcd.begin(16,2);
	
    

	lcd.setCursor(0,1);
    lcd.print("temp:");
    lcd.setCursor(0,0);
    lcd.print("humidity:");
    


    Particle.subscribe("temp", f, ALL_DEVICES);
    Particle.subscribe("humdity", h,  ALL_DEVICES);
   
}

void loop() {

	delay(15000);
	Particle.publish("tempandhumidity", PRIVATE);
}

void f(const char *event, const char *data) {
    
    lcd.setCursor(6,1);
    lcd.print(data);
    
    digitalWrite(D7, HIGH);
    delay(2500);
    digitalWrite(D7, LOW);
    delay(2500);
  }
    
    void h(const char *event, const char *data) {

   lcd.setCursor(9,0);
   lcd.print(data);
   
   digitalWrite(D7, HIGH);
   delay(2500);
   digitalWrite(D7, LOW);
   delay(2500);
  }
	

Credits

Jan Zavaleta Molina
1 project • 1 follower
Contact
AustinHouser
1 project • 1 follower
Contact

Comments

Please log in or sign up to comment.