anna hodgsonBellRacing51Austin Northcutt
Published © GPL3+

Hot and Steamy

This project uses an LCD screen and DHT22 to display temperature and humidity data, simultaneously collected from two different locations.

BeginnerFull instructions provided5 hours53
Hot and Steamy

Things used in this project

Hardware components

Argon
Particle Argon
×1
DHT22 Temperature and Humidity Sensor
DFRobot DHT22 Temperature and Humidity Sensor
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 10k ohm
Resistor 10k ohm
×1
Trimmer Potentiometer, 10 kohm
Trimmer Potentiometer, 10 kohm
×1
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
×1

Software apps and online services

ThingSpeak API
ThingSpeak API
Particle Build Web IDE
Particle Build Web IDE

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Mastech MS8217 Autorange Digital Multimeter
Digilent Mastech MS8217 Autorange Digital Multimeter

Story

Read more

Schematics

Argon Display Configuration

This is the wiring for the argon LCD display

Argon Sensor 1 Configuration

This is the wiring configuration of the first DHT22 sensor.

Argon Sensor 2 Configuration

This is the wiring configuration for the second DHT22 sensor (note that the purple BMP280 is not necessary).

Argon DHT22 Wiring Schematic

How to wire a DHT22 sensor into the particle argon.

Argon LCD 16x2 Wiring Schematic

How to wire a RGB Backlight LCD 16x2 display to a particle argon, using a 10K ohm potentiometer.

Project Video

Short Video explaining how the project works and how it can be applied to the real world.

Code

Argon Display Code

C/C++
This code was used to subscribe to the cloud to obtain data from the other two argons and display the data on an LCD screen.
// This #include statement was automatically added by the Particle IDE.
#include <Adafruit_DHT.h>

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


#define DHTPIN D2    


#define DHTTYPE DHT22        

DHT dht(DHTPIN, DHTTYPE);

LiquidCrystal lcd(0, 1, 2, 3, 4, 5);

void setup() {

  lcd.clear();
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
  lcd.print("T1");
  lcd.setCursor(8,0);
  lcd.print("H1");
  lcd.setCursor(0,1);
  lcd.print("T2");
  lcd.setCursor(8,1);
  lcd.print("H2");
  Particle.subscribe("AAJ_IOTf", f, ALL_DEVICES);
  Particle.subscribe("AAJ_IOTh", h, ALL_DEVICES);
  Particle.subscribe("AAJ_IOTf2", f2, ALL_DEVICES);
  Particle.subscribe("AAJ_IOTh2", h2, ALL_DEVICES);
  Serial.begin(19200); 
  Serial.println("DHT22 test!");

  dht.begin();
}
void loop() {
    delay(2000);
    Particle.publish("AAJ_IOT",PUBLIC);
}

    void f(const char *event, const char *data) {
    lcd.setCursor(3,0);
    lcd.print(data);
    lcd.setCursor(7,0);
    lcd.print("F ");
    }
    
    void h(const char *event, const char *data) {
    lcd.setCursor(8,0);
    lcd.print("H1 ");
    lcd.setCursor(11,0);
    lcd.print(data);
    lcd.setCursor(15,0);
    lcd.print("% ");
    }
        void f2(const char *event, const char *data) {
    lcd.setCursor(3,1);
    lcd.print(data);
    lcd.setCursor(7,1);
    lcd.print("F ");
     }
    
    void h2(const char *event, const char *data) {
    lcd.setCursor(8,1);
    lcd.print("H2 ");
    lcd.setCursor(11,1);
    lcd.print(data);
    lcd.setCursor(15,1);
    lcd.print("% ");
    }

Argon Sensor 1 Code

C/C++
This code was used to obtain data from the DHT22 sensor, deliver the data to ThingSpeak, and send the data to the cloud.
#include <ThingSpeak.h>
#include <Adafruit_DHT.h>
#define DHTPIN D2     
#define DHTTYPE DHT22        

DHT dht(DHTPIN, DHTTYPE);

bool humid = false;

TCPClient client;


unsigned long myChannelNumber = 916896;
const char * myWriteAPIKey = "YF9W3QWP9V0M6MJS";


void setup() {
    
    ThingSpeak.begin(client);
    
 pinMode(D7, OUTPUT);
 Serial.begin(19200); 
 dht.begin();

}

void loop() {
   
    delay(2000);
    
    float h = dht.getHumidity();
    float t = dht.getTempCelcius();
    float f = dht.getTempFarenheit();
    //float h2 = dht.getHumidity();
    //float t2 = dht.getTempCelcius();
    //float f2 = dht.getTempFarenheit();

    if (isnan(h) || isnan(t) || isnan(f)) {
        Serial.println("Failed to read from DHT sensor!");
        return;
    }
    // if (isnan(h2) || isnan(t2) || isnan(f2)) {
    //    Serial.println("Failed to read from DHT sensor!");
    //    return;
    //}
    
    Particle.publish("AAJ_IOTf", String (f), ALL_DEVICES);
    Particle.publish("AAJ_IOTh", String (h), ALL_DEVICES);
    //Particle.publish("AAJ_IOTt2", String (t2), ALL_DEVICES);
    //Particle.publish("AAJ_IOTh2", String (h2), ALL_DEVICES);

  ThingSpeak.setField(1,f);
  ThingSpeak.setField(2,h);
  //ThingSpeak.setField(3,t2);
  //ThingSpeak.setField(4,h2);
  
  Serial.print(dht.getHumidity());
  Serial.println("h");
  Serial.print(dht.getTempCelcius());
  Serial.println("f");
  //Serial.print(dht.getHumidity());
  //Serial.println("h2");
  //Serial.print(dht.getTempCelcius());
  //Serial.println("t2");

  
  ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);  

  delay(8000); // ThingSpeak will only accept updates every 15 seconds. 

}

Argon Sensor 2 Code

C/C++
This code was used to collect data from the second DHT22 sensor and send it to ThingSpeak and the cloud.
#include <ThingSpeak.h>
#include <Adafruit_DHT.h>
#define DHTPIN D2     
#define DHTTYPE DHT22        

DHT dht(DHTPIN, DHTTYPE);

bool humid = false;

TCPClient client;


unsigned long myChannelNumber = 916896;
const char * myWriteAPIKey = "YF9W3QWP9V0M6MJS";


void setup() {
    
    ThingSpeak.begin(client);
    
 pinMode(D7, OUTPUT);
 Serial.begin(19200); 
 dht.begin();

}

void loop() {
   
    delay(2000);
    

    float t2 = dht.getTempCelcius();
    float f2 = dht.getTempFarenheit();

 
     if (isnan(h2) || isnan(t2) || isnan(f2)) {
        Serial.println("Failed to read from DHT sensor!");
        return;
    }
    

    Particle.publish("AAJ_IOTf2", String (f2), ALL_DEVICES);
    Particle.publish("AAJ_IOTh2", String (h2), ALL_DEVICES);


  ThingSpeak.setField(3,f2);
  ThingSpeak.setField(4,h2);
  

  Serial.print(dht.getHumidity());
  Serial.println("h2");
  Serial.print(dht.getTempCelcius());
  Serial.println("f2");

  
  ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);  

  delay(7000); 

}

Credits

anna hodgson

anna hodgson

1 project • 0 followers
BellRacing51

BellRacing51

1 project • 0 followers
Austin Northcutt

Austin Northcutt

1 project • 0 followers

Comments

Add projectSign up / Login