Stephen GrantAlexander Johnson
Published

MEGR3171 Cigar Humidor Temp/Humidity Monitor

Humidity control is paramount in the preservation of quality cigars. This project provides constant humidor humidity and temperature data.

IntermediateFull instructions provided14 hours272
MEGR3171 Cigar Humidor Temp/Humidity Monitor

Things used in this project

Hardware components

DHT11 Humidity and Temperature Sensor
×1
Jumper Wires
×1
Argon
Particle Argon
×2
RGB Backlight LCD - 16x2
Adafruit RGB Backlight LCD - 16x2
A 10kΩ Potentiometer is included in purchase. Since no 16 pin displays were available online a 18 display was purchased with pins 16-18 used to change the screen color (red, green, or blue).
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

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

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Humidity Readings

Seen in the image are the humidity readings from the DHT-11 sensor. The sensor provided readings consistently at or very close to 69% humidity, which is exactly the ideal level for cigar storage. Ultimately this means our project was successful and our cigars are in optimal condition!

Temperature Readings

Seen in this figure are the temperature readings that the DHT-11 sensor provided in addition to the humidity readings. The readings were reasonably close to thermostat settings, especially considering the +/-~3 degree tolerance of the sensor.

LCD DISPLAY

DHT11 Temp and Humidity Sensor

Code

LCD DISPLAY

C/C++
#include <Adafruit_DHT.h>

#include "application.h"

#include "LiquidCrystal/LiquidCrystal.h"

// The info below shows the corresponding pinouts of the LCD Display and Argon used
// pinout on LCD [RS, EN, D4, D5, D6, D7];
// pin nums LCD  [ 4,  6, 11, 12, 13, 14];
// Shield Shield [RS, EN, D4, D5, D6, D7];
// Spark Core    [D3, D5, D2, D4, D7, D8];

#define DHTPIN D2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
LiquidCrystal lcd(D0, D1, D2, D3, D4, D5);
int 1;
void setup() {

  lcd.clear();
  lcd.begin(16, 2);
  lcd.setCursor(2,0);
  lcd.print("Temp");
  lcd.setCursor(0,1);
  lcd.print("Humidity");


  Particle.subscribe("Alex_Stephen_F", f,ALL_DEVICES);
  Particle.subscribe("Alex_Stephen_H", h,ALL_DEVICES);
  
}


    void f(const char *event, const char *data) {
    
    // Print the data over serial
    lcd.setCursor(10,0);
    lcd.print(data);
    lcd.setCursor(14,0);
    lcd.print("F     ");
    }
    
    void h(const char *event, const char *data) {
    
    lcd.setCursor(10,1);
    lcd.print(data);
    lcd.setCursor(14,1);
    lcd.print("%     ");
    Particle.publish("Alex_Stephen_Data",String(l), ALL_DEVICES);
    }

    

Temp and Humidity Sensor

C/C++
#include <ThingSpeak.h>

#include <Adafruit_DHT.h>


// This example assumes the sensor is plugged into pin CONN2
#define DHTPIN 2     // This is the pin we are connected to

// This Defines the type of sensor used
#define DHTTYPE DHT11   // DHT 11 Temp and Humidity Sensor

DHT dht(DHTPIN, DHTTYPE);

bool humid = false;

TCPClient client;


unsigned long myChannelNumber = 1241154;
const char * myWriteAPIKey = "PP3AMK7C0KV8JBBD";


void setup() {
    
    ThingSpeak.begin(client);
    
 pinMode(D2, OUTPUT);
 Serial.begin(9600); 
 dht.begin();
Particle.subscribe("Alex_Stephen_Data", (l), ALL_DEVICES);
}

void loop() {
    // A few second delay before the next reading
    delay(2000);

    // Sensor readings may also be up to 2 seconds 
    // The temperature is read in degrees Celcius
    float t = dht.getTempCelcius();
    // The temperature reading is converted into degrees Fahrenheit
    float f = dht.getTempFarenheit();
    // Reads Humidity in Percent
    float h = dht.getHumidity();


    Particle.publish("Alex_Stephen_F", String (f), ALL_DEVICES);
    Particle.publish("Alex_Stephen_H", String (h), ALL_DEVICES);
    
    
    ThingSpeak.setField(1,f);
    ThingSpeak.setField(2,h);
    
    Serial.print(dht.getTempFarenheit());
    Serial.println("f");
    Serial.print(dht.getHumidity());
    Serial.println("h");
    ThingSpeak.writeFields(myChannelNumber, myWriteAPIKey);  
    delay(60000); 

}

    void l(const char *event, const char *data) {
        
            digitalWrite(D2, HIGH);
            delay(2000);
            digitalWrite(D2, LOW);
            delay(1000);
       
    }

Credits

Stephen Grant

Stephen Grant

1 project • 0 followers
Alexander Johnson

Alexander Johnson

1 project • 0 followers

Comments

Add projectSign up / Login