Isaac H.
Published © GPL3+

Keep It Warm For Me: Argon Controlled Temperature Regulation

Using the DHT22 and Particle Argon, I'll turn on a small space heater when the temperature is too cold.

BeginnerFull instructions provided41
Keep It Warm For Me: Argon Controlled Temperature Regulation

Things used in this project

Hardware components

Argon
Particle Argon
×1
DHT22 Temperature Sensor
DHT22 Temperature Sensor
×1
Relay (generic)
×1
5 mm LED: Red
5 mm LED: Red
×1
Extension Lead, 4 Outlets
Extension Lead, 4 Outlets
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Space Heater
×1
Solderless Breadboard Half Size
Solderless Breadboard Half Size
×1

Software apps and online services

Particle Build Web IDE
Particle Build Web IDE

Story

Read more

Code

Particle Argon Source Code

C/C++
For use in Particle Argon build access.
#include "Adafruit_DHT.h"

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

DHT dht(DHTPIN, DHTTYPE);
int testLED = 4;
int relayPin = 7;

void setup() {
    pinMode(testLED, OUTPUT);
    pinMode(relayPin, OUTPUT);
	dht.begin();
}

void loop() {

    // Check the temperature.
	float f = dht.getTempFarenheit();
    
  if (f < 80) {
      digitalWrite(testLED, HIGH);
      digitalWrite(relayPin, HIGH);
  }
  
  else {
      digitalWrite(testLED, LOW);
      digitalWrite(relayPin, LOW);
      
  }
  
  // Wait a 3 minutes between measurements.
    delay(180000);

}

Credits

Isaac H.

Isaac H.

1 project • 0 followers

Comments

Add projectSign up / Login